|
12 | 12 | // See the License for the specific language governing permissions and
|
13 | 13 | // limitations under the License.
|
14 | 14 |
|
15 |
| -#include "autoware/behavior_velocity_planner_common/utilization/util.hpp" |
16 | 15 | #include "autoware/motion_utils/marker/virtual_wall_marker_creator.hpp"
|
17 | 16 | #include "autoware/universe_utils/geometry/geometry.hpp"
|
18 |
| -#include "autoware/universe_utils/ros/marker_helper.hpp" |
19 | 17 | #include "scene.hpp"
|
20 | 18 |
|
21 |
| -#ifdef ROS_DISTRO_GALACTIC |
22 |
| -#include <tf2_geometry_msgs/tf2_geometry_msgs.h> |
23 |
| -#else |
24 |
| -#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp> |
25 |
| -#endif |
26 |
| - |
27 | 19 | namespace autoware::behavior_velocity_planner
|
28 | 20 | {
|
29 |
| -using autoware::universe_utils::appendMarkerArray; |
30 |
| -using autoware::universe_utils::createMarkerColor; |
31 |
| -using autoware::universe_utils::createMarkerScale; |
32 |
| - |
33 |
| -namespace |
34 |
| -{ |
35 |
| -using DebugData = StopLineModule::DebugData; |
36 |
| - |
37 |
| -visualization_msgs::msg::MarkerArray createStopLineCollisionCheck( |
38 |
| - const DebugData & debug_data, const int64_t module_id) |
39 |
| -{ |
40 |
| - visualization_msgs::msg::MarkerArray msg; |
41 |
| - |
42 |
| - // Search Segments |
43 |
| - { |
44 |
| - visualization_msgs::msg::Marker marker; |
45 |
| - marker.header.frame_id = "map"; |
46 |
| - marker.ns = "search_segments"; |
47 |
| - marker.id = module_id; |
48 |
| - marker.lifetime = rclcpp::Duration::from_seconds(0.5); |
49 |
| - marker.type = visualization_msgs::msg::Marker::SPHERE_LIST; |
50 |
| - marker.action = visualization_msgs::msg::Marker::ADD; |
51 |
| - for (const auto & e : debug_data.search_segments) { |
52 |
| - marker.points.push_back( |
53 |
| - geometry_msgs::build<geometry_msgs::msg::Point>().x(e.at(0).x()).y(e.at(0).y()).z(0.0)); |
54 |
| - marker.points.push_back( |
55 |
| - geometry_msgs::build<geometry_msgs::msg::Point>().x(e.at(1).x()).y(e.at(1).y()).z(0.0)); |
56 |
| - } |
57 |
| - marker.scale = createMarkerScale(0.1, 0.1, 0.1); |
58 |
| - marker.color = createMarkerColor(0.0, 0.0, 1.0, 0.999); |
59 |
| - msg.markers.push_back(marker); |
60 |
| - } |
61 |
| - |
62 |
| - // Search stopline |
63 |
| - { |
64 |
| - visualization_msgs::msg::Marker marker; |
65 |
| - marker.header.frame_id = "map"; |
66 |
| - marker.ns = "search_stopline"; |
67 |
| - marker.id = module_id; |
68 |
| - marker.lifetime = rclcpp::Duration::from_seconds(0.5); |
69 |
| - marker.type = visualization_msgs::msg::Marker::LINE_STRIP; |
70 |
| - marker.action = visualization_msgs::msg::Marker::ADD; |
71 |
| - const auto p0 = debug_data.search_stopline.at(0); |
72 |
| - marker.points.push_back( |
73 |
| - geometry_msgs::build<geometry_msgs::msg::Point>().x(p0.x()).y(p0.y()).z(0.0)); |
74 |
| - const auto p1 = debug_data.search_stopline.at(1); |
75 |
| - marker.points.push_back( |
76 |
| - geometry_msgs::build<geometry_msgs::msg::Point>().x(p1.x()).y(p1.y()).z(0.0)); |
77 |
| - |
78 |
| - marker.scale = createMarkerScale(0.1, 0.1, 0.1); |
79 |
| - marker.color = createMarkerColor(1.0, 0.0, 0.0, 0.999); |
80 |
| - msg.markers.push_back(marker); |
81 |
| - } |
82 |
| - |
83 |
| - return msg; |
84 |
| -} |
85 |
| - |
86 |
| -} // namespace |
87 |
| - |
88 |
| -visualization_msgs::msg::MarkerArray StopLineModule::createDebugMarkerArray() |
89 |
| -{ |
90 |
| - visualization_msgs::msg::MarkerArray debug_marker_array; |
91 |
| - if (planner_param_.show_stop_line_collision_check) { |
92 |
| - appendMarkerArray( |
93 |
| - createStopLineCollisionCheck(debug_data_, module_id_), &debug_marker_array, |
94 |
| - this->clock_->now()); |
95 |
| - } |
96 |
| - return debug_marker_array; |
97 |
| -} |
98 | 21 |
|
99 | 22 | autoware::motion_utils::VirtualWalls StopLineModule::createVirtualWalls()
|
100 | 23 | {
|
|
0 commit comments