Skip to content

Commit

Permalink
refactor(mission_planner): prepare to support ad api (tier4#1561)
Browse files Browse the repository at this point in the history
* refactor(mission_planner): prepare to support ad api

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix node name

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
  • Loading branch information
isamu-takagi authored and boyali committed Sep 28, 2022
1 parent 383618a commit 5acadd7
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 104 deletions.

This file was deleted.

2 changes: 1 addition & 1 deletion launch/tier4_planning_launch/launch/planning.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!-- mission planning module -->
<group>
<push-ros-namespace namespace="mission_planning"/>
<include file="$(find-pkg-share tier4_planning_launch)/launch/mission_planning/mission_planning.launch.py"/>
<include file="$(find-pkg-share tier4_planning_launch)/launch/mission_planning/mission_planning.launch.xml"/>
</group>

<!-- scenario planning module -->
Expand Down
12 changes: 6 additions & 6 deletions planning/mission_planner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ project(mission_planner)
find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_library(mission_planner_node SHARED
lib/mission_planner_base.cpp
ament_auto_add_library(${PROJECT_NAME}_component SHARED
src/mission_planner/mission_planner.cpp
src/mission_planner_lanelet2/mission_planner_lanelet2.cpp
src/mission_planner_lanelet2/utility_functions.cpp
)

rclcpp_components_register_node(mission_planner_node
rclcpp_components_register_node(${PROJECT_NAME}_component
PLUGIN "mission_planner::MissionPlannerLanelet2"
EXECUTABLE mission_planner
EXECUTABLE ${PROJECT_NAME}
)

ament_auto_add_library(goal_pose_visualizer_node SHARED
ament_auto_add_library(goal_pose_visualizer_component SHARED
src/goal_pose_visualizer/goal_pose_visualizer.cpp
)

rclcpp_components_register_node(goal_pose_visualizer_node
rclcpp_components_register_node(goal_pose_visualizer_component
PLUGIN "mission_planner::GoalPoseVisualizer"
EXECUTABLE goal_pose_visualizer
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<launch>
<arg name="rout_topic_name" default="/planning/mission_planning/route"/>
<arg name="route_topic_name" default="/planning/mission_planning/route"/>
<arg name="echo_back_goal_pose_topic_name" default="/planning/mission_planning/echo_back_goal_pose"/>

<node pkg="mission_planner" exec="goal_pose_visualizer" name="goal_pose_visualizer" output="screen">
<remap from="input/route" to="$(var rout_topic_name)"/>
<remap from="input/route" to="$(var route_topic_name)"/>
<remap from="output/goal_pose" to="$(var echo_back_goal_pose_topic_name)"/>
</node>
</launch>
4 changes: 2 additions & 2 deletions planning/mission_planner/launch/mission_planner.launch.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<launch>
<arg name="goal_topic_name" default="/planning/mission_planning/goal"/>
<arg name="checkpoint_topic_name" default="/planning/mission_planning/checkpoint"/>
<arg name="rout_topic_name" default="/planning/mission_planning/route"/>
<arg name="route_topic_name" default="/planning/mission_planning/route"/>
<arg name="map_topic_name" default="/map/vector_map"/>
<arg name="visualization_topic_name" default="/planning/mission_planning/route_marker"/>

Expand All @@ -11,7 +11,7 @@
<remap from="input/vector_map" to="$(var map_topic_name)"/>
<remap from="input/goal_pose" to="$(var goal_topic_name)"/>
<remap from="input/checkpoint" to="$(var checkpoint_topic_name)"/>
<remap from="output/route" to="$(var rout_topic_name)"/>
<remap from="output/route" to="$(var route_topic_name)"/>
<remap from="debug/route_marker" to="$(var visualization_topic_name)"/>
</node>
</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "mission_planner/goal_pose_visualizer.hpp"
#include "goal_pose_visualizer.hpp"

namespace mission_planner
{
GoalPoseVisualizer::GoalPoseVisualizer(const rclcpp::NodeOptions & node_options)
: Node("goal_pose_visualizer_node", node_options)
: Node("goal_pose_visualizer", node_options)
{
sub_route_ = create_subscription<autoware_auto_planning_msgs::msg::HADMapRoute>(
"input/route", rclcpp::QoS{1}.transient_local(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef MISSION_PLANNER__GOAL_POSE_VISUALIZER_HPP_
#define MISSION_PLANNER__GOAL_POSE_VISUALIZER_HPP_
#ifndef GOAL_POSE_VISUALIZER__GOAL_POSE_VISUALIZER_HPP_
#define GOAL_POSE_VISUALIZER__GOAL_POSE_VISUALIZER_HPP_

#include <rclcpp/rclcpp.hpp>

Expand All @@ -36,4 +36,4 @@ class GoalPoseVisualizer : public rclcpp::Node
};

} // namespace mission_planner
#endif // MISSION_PLANNER__GOAL_POSE_VISUALIZER_HPP_
#endif // GOAL_POSE_VISUALIZER__GOAL_POSE_VISUALIZER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "mission_planner/mission_planner_base.hpp"
#include "mission_planner.hpp"

#include <lanelet2_extension/utility/message_conversion.hpp>
#include <lanelet2_extension/utility/query.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef MISSION_PLANNER__MISSION_PLANNER_BASE_HPP_
#define MISSION_PLANNER__MISSION_PLANNER_BASE_HPP_
#ifndef MISSION_PLANNER__MISSION_PLANNER_HPP_
#define MISSION_PLANNER__MISSION_PLANNER_HPP_

#include <string>
#include <vector>
Expand Down Expand Up @@ -70,4 +70,4 @@ class MissionPlanner : public rclcpp::Node
};

} // namespace mission_planner
#endif // MISSION_PLANNER__MISSION_PLANNER_BASE_HPP_
#endif // MISSION_PLANNER__MISSION_PLANNER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "mission_planner/lanelet2_impl/mission_planner_lanelet2.hpp"
#include "mission_planner_lanelet2.hpp"

#include "mission_planner/lanelet2_impl/utility_functions.hpp"
#include "utility_functions.hpp"

#include <lanelet2_extension/utility/message_conversion.hpp>
#include <lanelet2_extension/utility/query.hpp>
Expand Down Expand Up @@ -136,7 +136,7 @@ double projectGoalToMap(
namespace mission_planner
{
MissionPlannerLanelet2::MissionPlannerLanelet2(const rclcpp::NodeOptions & node_options)
: MissionPlanner("mission_planner_node", node_options), is_graph_ready_(false)
: MissionPlanner("mission_planner", node_options), is_graph_ready_(false)
{
using std::placeholders::_1;
map_subscriber_ = create_subscription<autoware_auto_mapping_msgs::msg::HADMapBin>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef MISSION_PLANNER__LANELET2_IMPL__MISSION_PLANNER_LANELET2_HPP_
#define MISSION_PLANNER__LANELET2_IMPL__MISSION_PLANNER_LANELET2_HPP_
#ifndef MISSION_PLANNER_LANELET2__MISSION_PLANNER_LANELET2_HPP_
#define MISSION_PLANNER_LANELET2__MISSION_PLANNER_LANELET2_HPP_

#include <string>
#include <vector>
Expand All @@ -25,7 +25,7 @@
#include <tf2_ros/transform_listener.h>

// Autoware
#include "mission_planner/mission_planner_base.hpp"
#include "../mission_planner/mission_planner.hpp"

#include <route_handler/route_handler.hpp>

Expand Down Expand Up @@ -67,4 +67,4 @@ class MissionPlannerLanelet2 : public MissionPlanner
};
} // namespace mission_planner

#endif // MISSION_PLANNER__LANELET2_IMPL__MISSION_PLANNER_LANELET2_HPP_
#endif // MISSION_PLANNER_LANELET2__MISSION_PLANNER_LANELET2_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "mission_planner/lanelet2_impl/utility_functions.hpp"
#include "utility_functions.hpp"

#include <rclcpp/rclcpp.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef MISSION_PLANNER__LANELET2_IMPL__UTILITY_FUNCTIONS_HPP_
#define MISSION_PLANNER__LANELET2_IMPL__UTILITY_FUNCTIONS_HPP_
#ifndef MISSION_PLANNER_LANELET2__UTILITY_FUNCTIONS_HPP_
#define MISSION_PLANNER_LANELET2__UTILITY_FUNCTIONS_HPP_
#include <rclcpp/rclcpp.hpp>

#include <geometry_msgs/msg/pose.hpp>
Expand Down Expand Up @@ -43,4 +43,4 @@ void setColor(std_msgs::msg::ColorRGBA * cl, double r, double g, double b, doubl
void insertMarkerArray(
visualization_msgs::msg::MarkerArray * a1, const visualization_msgs::msg::MarkerArray & a2);
std::string toString(const geometry_msgs::msg::Pose & pose);
#endif // MISSION_PLANNER__LANELET2_IMPL__UTILITY_FUNCTIONS_HPP_
#endif // MISSION_PLANNER_LANELET2__UTILITY_FUNCTIONS_HPP_

0 comments on commit 5acadd7

Please sign in to comment.