Skip to content

Commit 2712884

Browse files
authored
refactor(mission_planner): prepare to support ad api (autowarefoundation#1561)
* 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>
1 parent a690660 commit 2712884

13 files changed

+31
-104
lines changed

launch/tier4_planning_launch/launch/mission_planning/mission_planning.launch.py

-73
This file was deleted.

launch/tier4_planning_launch/launch/planning.launch.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<!-- mission planning module -->
1616
<group>
1717
<push-ros-namespace namespace="mission_planning"/>
18-
<include file="$(find-pkg-share tier4_planning_launch)/launch/mission_planning/mission_planning.launch.py"/>
18+
<include file="$(find-pkg-share tier4_planning_launch)/launch/mission_planning/mission_planning.launch.xml"/>
1919
</group>
2020

2121
<!-- scenario planning module -->

planning/mission_planner/CMakeLists.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ project(mission_planner)
44
find_package(autoware_cmake REQUIRED)
55
autoware_package()
66

7-
ament_auto_add_library(mission_planner_node SHARED
8-
lib/mission_planner_base.cpp
7+
ament_auto_add_library(${PROJECT_NAME}_component SHARED
8+
src/mission_planner/mission_planner.cpp
99
src/mission_planner_lanelet2/mission_planner_lanelet2.cpp
1010
src/mission_planner_lanelet2/utility_functions.cpp
1111
)
1212

13-
rclcpp_components_register_node(mission_planner_node
13+
rclcpp_components_register_node(${PROJECT_NAME}_component
1414
PLUGIN "mission_planner::MissionPlannerLanelet2"
15-
EXECUTABLE mission_planner
15+
EXECUTABLE ${PROJECT_NAME}
1616
)
1717

18-
ament_auto_add_library(goal_pose_visualizer_node SHARED
18+
ament_auto_add_library(goal_pose_visualizer_component SHARED
1919
src/goal_pose_visualizer/goal_pose_visualizer.cpp
2020
)
2121

22-
rclcpp_components_register_node(goal_pose_visualizer_node
22+
rclcpp_components_register_node(goal_pose_visualizer_component
2323
PLUGIN "mission_planner::GoalPoseVisualizer"
2424
EXECUTABLE goal_pose_visualizer
2525
)
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<launch>
2-
<arg name="rout_topic_name" default="/planning/mission_planning/route"/>
2+
<arg name="route_topic_name" default="/planning/mission_planning/route"/>
33
<arg name="echo_back_goal_pose_topic_name" default="/planning/mission_planning/echo_back_goal_pose"/>
44

55
<node pkg="mission_planner" exec="goal_pose_visualizer" name="goal_pose_visualizer" output="screen">
6-
<remap from="input/route" to="$(var rout_topic_name)"/>
6+
<remap from="input/route" to="$(var route_topic_name)"/>
77
<remap from="output/goal_pose" to="$(var echo_back_goal_pose_topic_name)"/>
88
</node>
99
</launch>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<launch>
22
<arg name="goal_topic_name" default="/planning/mission_planning/goal"/>
33
<arg name="checkpoint_topic_name" default="/planning/mission_planning/checkpoint"/>
4-
<arg name="rout_topic_name" default="/planning/mission_planning/route"/>
4+
<arg name="route_topic_name" default="/planning/mission_planning/route"/>
55
<arg name="map_topic_name" default="/map/vector_map"/>
66
<arg name="visualization_topic_name" default="/planning/mission_planning/route_marker"/>
77

@@ -11,7 +11,7 @@
1111
<remap from="input/vector_map" to="$(var map_topic_name)"/>
1212
<remap from="input/goal_pose" to="$(var goal_topic_name)"/>
1313
<remap from="input/checkpoint" to="$(var checkpoint_topic_name)"/>
14-
<remap from="output/route" to="$(var rout_topic_name)"/>
14+
<remap from="output/route" to="$(var route_topic_name)"/>
1515
<remap from="debug/route_marker" to="$(var visualization_topic_name)"/>
1616
</node>
1717
</launch>

planning/mission_planner/src/goal_pose_visualizer/goal_pose_visualizer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "mission_planner/goal_pose_visualizer.hpp"
15+
#include "goal_pose_visualizer.hpp"
1616

1717
namespace mission_planner
1818
{
1919
GoalPoseVisualizer::GoalPoseVisualizer(const rclcpp::NodeOptions & node_options)
20-
: Node("goal_pose_visualizer_node", node_options)
20+
: Node("goal_pose_visualizer", node_options)
2121
{
2222
sub_route_ = create_subscription<autoware_auto_planning_msgs::msg::HADMapRoute>(
2323
"input/route", rclcpp::QoS{1}.transient_local(),

planning/mission_planner/include/mission_planner/goal_pose_visualizer.hpp planning/mission_planner/src/goal_pose_visualizer/goal_pose_visualizer.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MISSION_PLANNER__GOAL_POSE_VISUALIZER_HPP_
16-
#define MISSION_PLANNER__GOAL_POSE_VISUALIZER_HPP_
15+
#ifndef GOAL_POSE_VISUALIZER__GOAL_POSE_VISUALIZER_HPP_
16+
#define GOAL_POSE_VISUALIZER__GOAL_POSE_VISUALIZER_HPP_
1717

1818
#include <rclcpp/rclcpp.hpp>
1919

@@ -36,4 +36,4 @@ class GoalPoseVisualizer : public rclcpp::Node
3636
};
3737

3838
} // namespace mission_planner
39-
#endif // MISSION_PLANNER__GOAL_POSE_VISUALIZER_HPP_
39+
#endif // GOAL_POSE_VISUALIZER__GOAL_POSE_VISUALIZER_HPP_

planning/mission_planner/lib/mission_planner_base.cpp planning/mission_planner/src/mission_planner/mission_planner.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "mission_planner/mission_planner_base.hpp"
15+
#include "mission_planner.hpp"
1616

1717
#include <lanelet2_extension/utility/message_conversion.hpp>
1818
#include <lanelet2_extension/utility/query.hpp>

planning/mission_planner/include/mission_planner/mission_planner_base.hpp planning/mission_planner/src/mission_planner/mission_planner.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MISSION_PLANNER__MISSION_PLANNER_BASE_HPP_
16-
#define MISSION_PLANNER__MISSION_PLANNER_BASE_HPP_
15+
#ifndef MISSION_PLANNER__MISSION_PLANNER_HPP_
16+
#define MISSION_PLANNER__MISSION_PLANNER_HPP_
1717

1818
#include <string>
1919
#include <vector>
@@ -70,4 +70,4 @@ class MissionPlanner : public rclcpp::Node
7070
};
7171

7272
} // namespace mission_planner
73-
#endif // MISSION_PLANNER__MISSION_PLANNER_BASE_HPP_
73+
#endif // MISSION_PLANNER__MISSION_PLANNER_HPP_

planning/mission_planner/src/mission_planner_lanelet2/mission_planner_lanelet2.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "mission_planner/lanelet2_impl/mission_planner_lanelet2.hpp"
15+
#include "mission_planner_lanelet2.hpp"
1616

17-
#include "mission_planner/lanelet2_impl/utility_functions.hpp"
17+
#include "utility_functions.hpp"
1818

1919
#include <lanelet2_extension/utility/message_conversion.hpp>
2020
#include <lanelet2_extension/utility/query.hpp>
@@ -136,7 +136,7 @@ double projectGoalToMap(
136136
namespace mission_planner
137137
{
138138
MissionPlannerLanelet2::MissionPlannerLanelet2(const rclcpp::NodeOptions & node_options)
139-
: MissionPlanner("mission_planner_node", node_options), is_graph_ready_(false)
139+
: MissionPlanner("mission_planner", node_options), is_graph_ready_(false)
140140
{
141141
using std::placeholders::_1;
142142
map_subscriber_ = create_subscription<autoware_auto_mapping_msgs::msg::HADMapBin>(

planning/mission_planner/include/mission_planner/lanelet2_impl/mission_planner_lanelet2.hpp planning/mission_planner/src/mission_planner_lanelet2/mission_planner_lanelet2.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MISSION_PLANNER__LANELET2_IMPL__MISSION_PLANNER_LANELET2_HPP_
16-
#define MISSION_PLANNER__LANELET2_IMPL__MISSION_PLANNER_LANELET2_HPP_
15+
#ifndef MISSION_PLANNER_LANELET2__MISSION_PLANNER_LANELET2_HPP_
16+
#define MISSION_PLANNER_LANELET2__MISSION_PLANNER_LANELET2_HPP_
1717

1818
#include <string>
1919
#include <vector>
@@ -25,7 +25,7 @@
2525
#include <tf2_ros/transform_listener.h>
2626

2727
// Autoware
28-
#include "mission_planner/mission_planner_base.hpp"
28+
#include "../mission_planner/mission_planner.hpp"
2929

3030
#include <route_handler/route_handler.hpp>
3131

@@ -67,4 +67,4 @@ class MissionPlannerLanelet2 : public MissionPlanner
6767
};
6868
} // namespace mission_planner
6969

70-
#endif // MISSION_PLANNER__LANELET2_IMPL__MISSION_PLANNER_LANELET2_HPP_
70+
#endif // MISSION_PLANNER_LANELET2__MISSION_PLANNER_LANELET2_HPP_

planning/mission_planner/src/mission_planner_lanelet2/utility_functions.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "mission_planner/lanelet2_impl/utility_functions.hpp"
15+
#include "utility_functions.hpp"
1616

1717
#include <rclcpp/rclcpp.hpp>
1818

planning/mission_planner/include/mission_planner/lanelet2_impl/utility_functions.hpp planning/mission_planner/src/mission_planner_lanelet2/utility_functions.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MISSION_PLANNER__LANELET2_IMPL__UTILITY_FUNCTIONS_HPP_
16-
#define MISSION_PLANNER__LANELET2_IMPL__UTILITY_FUNCTIONS_HPP_
15+
#ifndef MISSION_PLANNER_LANELET2__UTILITY_FUNCTIONS_HPP_
16+
#define MISSION_PLANNER_LANELET2__UTILITY_FUNCTIONS_HPP_
1717
#include <rclcpp/rclcpp.hpp>
1818

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

0 commit comments

Comments
 (0)