Skip to content

Commit ebe771f

Browse files
tkimura4mitsudome-rwep21nnmmesteve
authored
feat: add mission_planner package (autowarefoundation#40)
* release v0.4.0 * Fix routing from crosswalk (autowarefoundation#767) Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp> * remove ROS1 packages temporarily Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * Revert "remove ROS1 packages temporarily" This reverts commit 5eba353. Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * add COLCON_IGNORE to ros1 packages Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * Rename launch files to launch.xml (autowarefoundation#28) * port mission_planner to ROS2 (autowarefoundation#56) * port mission_planner to ROS2 Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * fix QoS for publishers Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * Add geometry2 to repos (autowarefoundation#76) * add geometry2 package temporarily until new release Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * trigger-ci Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * add tf2 dependency to the packages that use tf2_geometry_msgs Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * Revert "Add geometry2 to repos (autowarefoundation#76)" (autowarefoundation#96) * Revert "Add geometry2 to repos (autowarefoundation#76)" This reverts commit 61defd0. * Re-add tf2 dependencies * Revert "Re-add tf2 dependencies" This reverts commit e23b0c8b0826cf9518924d33349f9de34b4975df. * Debug CI pipeline * Revert "Debug CI pipeline" This reverts commit 58f1eba550360d82c08230552abfb64b33b23e0f. * Explicitly install known versions of the geometry packages * No need to skip tf2 packages anymore Co-authored-by: Esteve Fernandez <esteve@apache.org> * Rename h files to hpp (autowarefoundation#142) * Change includes * Rename files * Adjustments to make things compile * Other packages * Adjust copyright notice on 532 out of 699 source files (autowarefoundation#143) * Use quotes for includes where appropriate (autowarefoundation#144) * Use quotes for includes where appropriate * Fix lint tests * Make tests pass hopefully * Run uncrustify on the entire Pilot.Auto codebase (autowarefoundation#151) * Run uncrustify on the entire Pilot.Auto codebase * Exclude open PRs * fixing trasient_local in ROS2 packages (autowarefoundation#160) * Add linters to mission_planner (autowarefoundation#156) * Added linters to mission_planner * Removed duplicate dependencies * Only add the cppcheck linter * Added linters to CMake * Ros2 v0.8.0 mission planner (autowarefoundation#278) * add use_sim-time option (autowarefoundation#454) * Fix rolling build errors (autowarefoundation#1225) * Add missing include files Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Replace rclcpp::Duration Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Use reference for exceptions Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Use from_seconds Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Unify Apache-2.0 license name (autowarefoundation#1242) * Make planning modules components (autowarefoundation#1263) Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * Remove use_sim_time for set_parameter (autowarefoundation#1260) Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * Fix -Wunused-parameter (autowarefoundation#1836) * Fix -Wunused-parameter Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix mistake Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * fix spell * Fix lint issues Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Ignore flake8 warnings Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> Co-authored-by: Hiroki OTA <hiroki.ota@tier4.jp> * Fix compiler warnings (autowarefoundation#1837) * Fix -Wunused-private-field Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Wunused-variable Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Wformat-security Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Winvalid-constexpr Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Wdelete-non-abstract-non-virtual-dtor Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Wdelete-abstract-non-virtual-dtor Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Winconsistent-missing-override Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Wrange-loop-construct Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix "invalid application of 'sizeof' to an incomplete type" Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Ignore -Wgnu-anonymous-struct and -Wnested-anon-types Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix lint Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Ignore -Wno-deprecated-declarations in CUDA-related packages Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix mistake Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Wunused-parameter Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Docs/mission planner (autowarefoundation#1952) * add doc * update docs * Invoke code formatter at pre-commit (autowarefoundation#1935) * Run ament_uncrustify at pre-commit * Reformat existing files * Fix copyright and cpplint errors Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> Co-authored-by: Kenji Miyake <kenji.miyake@tier4.jp> * update mission planner doc (autowarefoundation#2044) * update mission planner doc * fix typo * Update planning/mission_planning/mission_planner/mission_planner-design.md Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com> Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com> * add sort-package-xml hook in pre-commit (autowarefoundation#1881) * add sort xml hook in pre-commit * change retval to exit_status * rename * add prettier plugin-xml * use early return * add license note * add tier4 license * restore prettier * change license order * move local hooks to public repo * move prettier-xml to pre-commit-hooks-ros * update version for bug-fix * apply pre-commit * add pull over/out module (autowarefoundation#2147) * Change formatter to clang-format and black (autowarefoundation#2332) * Revert "Temporarily comment out pre-commit hooks" This reverts commit 748e9cdb145ce12f8b520bcbd97f5ff899fc28a3. * Replace ament_lint_common with autoware_lint_common Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Remove ament_cmake_uncrustify and ament_clang_format Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Apply Black Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Apply clang-format Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix build errors Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix for cpplint * Fix include double quotes to angle brackets Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Apply clang-format Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix build errors Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Add COLCON_IGNORE (autowarefoundation#500) Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * rename to README.md (autowarefoundation#550) * rename to README.md * dealt with new auto_msgs format Co-authored-by: Takayuki Murooka <takayuki.murooka@tier4.jp> * port mission planner (autowarefoundation#538) * port lanelet2 msg Signed-off-by: Kosuke Murakami <kosuke.murakami@tier4.jp> * port route Signed-off-by: Kosuke Murakami <kosuke.murakami@tier4.jp> * fix precommit Signed-off-by: Kosuke Murakami <kosuke.murakami@tier4.jp> * Use route_handler package in mission_planner (autowarefoundation#579) * [autoware_vehicle_rviz_plugin/route_handler/simple_planning_simulator]fix some packages (autowarefoundation#606) * fix console meter * fix velocity_history * fix route handler * change topic name * Modify readme for mission planner (autowarefoundation#714) * modify readme for mission planner Signed-off-by: kosuke murakami <kosuke.murakami@tier4.jp> * fix document Signed-off-by: kosuke murakami <kosuke.murakami@tier4.jp> * fix readme Co-authored-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com> Co-authored-by: Nikolai Morin <nnmmgit@gmail.com> Co-authored-by: Ryohsuke Mitsudome <43976834+mitsudome-r@users.noreply.github.com> Co-authored-by: Esteve Fernandez <esteve@apache.org> Co-authored-by: nik-tier4 <71747268+nik-tier4@users.noreply.github.com> Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com> Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> Co-authored-by: Kazuki Miyahara <kmiya@outlook.com> Co-authored-by: Hiroki OTA <hiroki.ota@tier4.jp> Co-authored-by: Takayuki Murooka <takayuki5168@gmail.com> Co-authored-by: Takeshi Ishita <ishitah.takeshi@gmail.com> Co-authored-by: Kenji Miyake <kenji.miyake@tier4.jp> Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com> Co-authored-by: Keisuke Shima <19993104+KeisukeShima@users.noreply.github.com> Co-authored-by: kyoichi sugahara <81.s.kyo.19@gmail.com> Co-authored-by: Takayuki Murooka <takayuki.murooka@tier4.jp> Co-authored-by: Kosuke Murakami <kosuke.murakami@tier4.jp> Co-authored-by: Fumiya Watanabe <rej55.g@gmail.com> Co-authored-by: Takeshi Miura <57553950+1222-takeshi@users.noreply.github.com>
1 parent 4916f6b commit ebe771f

14 files changed

+1031
-0
lines changed
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
project(mission_planner)
3+
4+
### Compile options
5+
if(NOT CMAKE_CXX_STANDARD)
6+
set(CMAKE_CXX_STANDARD 14)
7+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
8+
set(CMAKE_CXX_EXTENSIONS OFF)
9+
endif()
10+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
11+
add_compile_options(-Wall -Wextra -Wpedantic)
12+
endif()
13+
14+
find_package(ament_cmake_auto REQUIRED)
15+
ament_auto_find_build_dependencies()
16+
17+
ament_auto_add_library(mission_planner_node SHARED
18+
lib/mission_planner_base.cpp
19+
src/mission_planner_lanelet2/mission_planner_lanelet2.cpp
20+
src/mission_planner_lanelet2/utility_functions.cpp
21+
)
22+
23+
rclcpp_components_register_node(mission_planner_node
24+
PLUGIN "mission_planner::MissionPlannerLanelet2"
25+
EXECUTABLE mission_planner
26+
)
27+
28+
ament_auto_add_library(goal_pose_visualizer_node SHARED
29+
src/goal_pose_visualizer/goal_pose_visualizer.cpp
30+
)
31+
32+
rclcpp_components_register_node(goal_pose_visualizer_node
33+
PLUGIN "mission_planner::GoalPoseVisualizer"
34+
EXECUTABLE goal_pose_visualizer
35+
)
36+
37+
if(BUILD_TESTING)
38+
find_package(ament_lint_auto REQUIRED)
39+
ament_lint_auto_find_test_dependencies()
40+
endif()
41+
42+
ament_auto_package(INSTALL_TO_SHARE
43+
launch
44+
)

planning/mission_planner/README.md

+149
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# Mission Planner
2+
3+
## Purpose
4+
5+
`Mission Planner` calculates a route that navigates from the current ego pose to the goal pose following the given check points.
6+
The route is made of a sequence of lanes on a static map.
7+
Dynamic objects (e.g. pedestrians and other vehicles) and dynamic map information (e.g. road construction which blocks some lanes) are not considered during route planning.
8+
Therefore, the output topic is only published when the goal pose or check points are given and will be latched until the new goal pose or check points are given.
9+
10+
The core implementation does not depend on a map format.
11+
In current Autoware.universe, only Lanelet2 map format is supported.
12+
13+
## Inputs / Outputs
14+
15+
### input
16+
17+
| Name | Type | Description |
18+
| -------------------- | ------------------------------------ | ------------------------------------------ |
19+
| `~input/vector_map` | autoware_auto_mapping_msgs/HADMapBin | vector map of Lanelet2 |
20+
| `~input/goal_pose` | geometry_msgs/PoseStamped | goal pose |
21+
| `~input/checkpoints` | geometry_msgs/PoseStamped | checkpoint to follow while heading to goal |
22+
23+
### output
24+
25+
| Name | Type | Description |
26+
| --------------- | --------------------------------------- | --------------------------- |
27+
| `~output/route` | autoware_auto_planning_msgs/HADMapRoute | route from ego pose to goal |
28+
29+
`autoware_planning_msgs/Route` consists of route sections and goal pose.
30+
31+
![route_sections](./media/route_sections.svg)
32+
33+
Route section, whose type is `autoware_auto_mapping_msgs/HADMapSegment`, is a "slice" of a road that bundles lane changeable lanes.
34+
Note that the most atomic unit of route is `autoware_auto_mapping_msgs/MapPrimitive`, which has the unique id of a lane in a vector map and its type.
35+
Therefore, route message does not contain geometric information about the lane since we did not want to have planning module’s message to have dependency on map data structure.
36+
37+
The ROS message of route section contains following three elements for each route section.
38+
39+
- `preferred_primitive_id`: Preferred lane to follow towards the goal.
40+
- `primitives`: All neighbor lanes in the same direction including the preferred lane.
41+
42+
## Implementation
43+
44+
### Mission Planner
45+
46+
Two callbacks (goal and check points) are a trigger for route planning.
47+
Routing graph, which plans route in Lanelet2, must be created before those callbacks, and this routing graph is created in vector map callback.
48+
49+
`plan route` is explained in detail in the following section.
50+
51+
```plantuml
52+
@startuml
53+
title goal callback
54+
start
55+
56+
:clear previously memorized check points;
57+
58+
:memorize ego and goal pose as check points;
59+
60+
if (routing graph is ready?) then (yes)
61+
else (no)
62+
stop
63+
endif
64+
65+
:plan route;
66+
67+
:publish route;
68+
69+
stop
70+
@enduml
71+
```
72+
73+
Note that during the goal callback, previously memorized check points are removed, and only current ego pose and goal pose are memorized as check points.
74+
75+
```plantuml
76+
@startuml
77+
title check point callback
78+
start
79+
80+
if (size of check points >= 2?) then (yes)
81+
else (no)
82+
stop
83+
endif
84+
85+
:memorize check point;
86+
87+
:plan route;
88+
89+
:publish route;
90+
91+
stop
92+
@enduml
93+
```
94+
95+
Note that at least two check points must be already memorized, which are start and goal pose, before the check point callback.
96+
97+
### Route Planner
98+
99+
`plan route` is executed with check points including current ego pose and goal pose.
100+
101+
```plantuml
102+
@startuml
103+
title plan route
104+
start
105+
106+
if (goal is valid?) then (yes)
107+
else (no)
108+
stop
109+
endif
110+
111+
:plan path between each check points;
112+
113+
:initialize route lanelets;
114+
115+
:get preferred lanelets;
116+
117+
:create route sections;
118+
119+
if (planed route is looped?) then (no)
120+
else (yes)
121+
:warn that looped route is not supported;
122+
endif
123+
124+
:return route;
125+
126+
stop
127+
@enduml
128+
```
129+
130+
`plan path between each check points` firstly calculates closest lanes to start and goal pose.
131+
Then routing graph of Lanelet2 plans the shortest path from start and goal pose.
132+
133+
`initialize route lanelets` initializes route handler, and calculates `route_lanelets`.
134+
`route_lanelets`, all of which will be registered in route sections, are lanelets next to the lanelets in the planned path, and used when planning lane change.
135+
To calculate `route_lanelets`,
136+
137+
1. All the neighbor (right and left) lanes for the planned path which is lane-changeable is memorized as `route_lanelets`.
138+
2. All the neighbor (right and left) lanes for the planned path which is not lane-changeable is memorized as `candidate_lanelets`.
139+
3. If the following and previous lanelets of each `candidate_lanelets` are `route_lanelets`, the `candidate_lanelet` is registered as `route_lanelets`
140+
- This is because even though `candidate_lanelet` (an adjacent lane) is not lane-changeable, we can pass the `candidate_lanelet` without lane change if the following and previous lanelets of the `candidate_lanelet` are `route_lanelets`
141+
142+
`get preferred lanelets` extracts `preferred_primitive_id` from `route_lanelets` with the route handler.
143+
144+
`create route sections` extracts `primitives` from `route_lanelets` for each route section with the route handler, and creates route sections.
145+
146+
## Limitations
147+
148+
- Dynamic objects (e.g. pedestrians and other vehicles) and dynamic map information (e.g. road construction which blocks some lanes) are not considered during route planning.
149+
- Looped route is not supported.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright 2020 Tier IV, Inc. All rights reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef MISSION_PLANNER__GOAL_POSE_VISUALIZER_HPP_
16+
#define MISSION_PLANNER__GOAL_POSE_VISUALIZER_HPP_
17+
18+
#include <rclcpp/rclcpp.hpp>
19+
20+
#include <autoware_auto_planning_msgs/msg/had_map_route.hpp>
21+
#include <geometry_msgs/msg/pose_stamped.hpp>
22+
23+
namespace mission_planner
24+
{
25+
class GoalPoseVisualizer : public rclcpp::Node
26+
{
27+
public:
28+
explicit GoalPoseVisualizer(const rclcpp::NodeOptions & node_options);
29+
30+
private:
31+
rclcpp::Subscription<autoware_auto_planning_msgs::msg::HADMapRoute>::SharedPtr sub_route_;
32+
rclcpp::Publisher<geometry_msgs::msg::PoseStamped>::SharedPtr pub_goal_pose_;
33+
34+
void echoBackRouteCallback(
35+
const autoware_auto_planning_msgs::msg::HADMapRoute::ConstSharedPtr msg);
36+
};
37+
38+
} // namespace mission_planner
39+
#endif // MISSION_PLANNER__GOAL_POSE_VISUALIZER_HPP_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Copyright 2019 Autoware Foundation
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef MISSION_PLANNER__LANELET2_IMPL__MISSION_PLANNER_LANELET2_HPP_
16+
#define MISSION_PLANNER__LANELET2_IMPL__MISSION_PLANNER_LANELET2_HPP_
17+
18+
#include <string>
19+
#include <vector>
20+
21+
// ROS
22+
#include <rclcpp/rclcpp.hpp>
23+
24+
#include <tf2_ros/buffer.h>
25+
#include <tf2_ros/transform_listener.h>
26+
27+
// Autoware
28+
#include "mission_planner/mission_planner_base.hpp"
29+
30+
#include <route_handler/route_handler.hpp>
31+
32+
#include <autoware_auto_mapping_msgs/msg/had_map_bin.hpp>
33+
#include <autoware_auto_planning_msgs/msg/had_map_route.hpp>
34+
35+
// lanelet
36+
#include <lanelet2_core/LaneletMap.h>
37+
#include <lanelet2_routing/RoutingGraph.h>
38+
#include <lanelet2_traffic_rules/TrafficRulesFactory.h>
39+
40+
namespace mission_planner
41+
{
42+
using RouteSections = std::vector<autoware_auto_mapping_msgs::msg::HADMapSegment>;
43+
class MissionPlannerLanelet2 : public MissionPlanner
44+
{
45+
public:
46+
explicit MissionPlannerLanelet2(const rclcpp::NodeOptions & node_options);
47+
48+
private:
49+
bool is_graph_ready_;
50+
lanelet::LaneletMapPtr lanelet_map_ptr_;
51+
lanelet::routing::RoutingGraphPtr routing_graph_ptr_;
52+
lanelet::traffic_rules::TrafficRulesPtr traffic_rules_ptr_;
53+
lanelet::ConstLanelets road_lanelets_;
54+
lanelet::ConstLanelets shoulder_lanelets_;
55+
route_handler::RouteHandler route_handler_;
56+
57+
rclcpp::Subscription<autoware_auto_mapping_msgs::msg::HADMapBin>::SharedPtr map_subscriber_;
58+
59+
void mapCallback(const autoware_auto_mapping_msgs::msg::HADMapBin::ConstSharedPtr msg);
60+
bool isGoalValid() const;
61+
62+
// virtual functions
63+
bool isRoutingGraphReady() const;
64+
autoware_auto_planning_msgs::msg::HADMapRoute planRoute();
65+
void visualizeRoute(const autoware_auto_planning_msgs::msg::HADMapRoute & route) const;
66+
};
67+
} // namespace mission_planner
68+
69+
#endif // MISSION_PLANNER__LANELET2_IMPL__MISSION_PLANNER_LANELET2_HPP_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright 2019 Autoware Foundation
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef MISSION_PLANNER__LANELET2_IMPL__UTILITY_FUNCTIONS_HPP_
16+
#define MISSION_PLANNER__LANELET2_IMPL__UTILITY_FUNCTIONS_HPP_
17+
#include <rclcpp/rclcpp.hpp>
18+
19+
#include <geometry_msgs/msg/pose.hpp>
20+
#include <std_msgs/msg/color_rgba.hpp>
21+
#include <visualization_msgs/msg/marker_array.hpp>
22+
23+
#include <lanelet2_core/LaneletMap.h>
24+
#include <lanelet2_core/primitives/LaneletSequence.h>
25+
26+
#include <string>
27+
#include <unordered_set>
28+
#include <vector>
29+
bool exists(const std::unordered_set<lanelet::Id> & set, const lanelet::Id & id);
30+
31+
template <typename T>
32+
bool exists(const std::vector<T> & vectors, const T & item)
33+
{
34+
for (const auto & i : vectors) {
35+
if (i == item) {
36+
return true;
37+
}
38+
}
39+
return false;
40+
}
41+
42+
void setColor(std_msgs::msg::ColorRGBA * cl, double r, double g, double b, double a);
43+
void insertMarkerArray(
44+
visualization_msgs::msg::MarkerArray * a1, const visualization_msgs::msg::MarkerArray & a2);
45+
std::string toString(const geometry_msgs::msg::Pose & pose);
46+
#endif // MISSION_PLANNER__LANELET2_IMPL__UTILITY_FUNCTIONS_HPP_

0 commit comments

Comments
 (0)