@@ -139,6 +139,7 @@ void StartPlannerModule::initVariables()
139
139
resetPathCandidate ();
140
140
resetPathReference ();
141
141
debug_marker_.markers .clear ();
142
+ info_marker_.markers .clear ();
142
143
initializeSafetyCheckParameters ();
143
144
initializeCollisionCheckDebugMap (debug_data_.collision_check );
144
145
updateDepartureCheckLanes ();
@@ -1456,25 +1457,35 @@ void StartPlannerModule::setDebugData()
1456
1457
const auto white_color = createMarkerColor (1.0 , 1.0 , 1.0 , 0.99 );
1457
1458
1458
1459
const auto life_time = rclcpp::Duration::from_seconds (1.5 );
1459
- auto add = [&](MarkerArray added) {
1460
+ auto add = [&](MarkerArray added, MarkerArray & target_marker_array ) {
1460
1461
for (auto & marker : added.markers ) {
1461
1462
marker.lifetime = life_time;
1462
1463
}
1463
- tier4_autoware_utils::appendMarkerArray (added, &debug_marker_ );
1464
+ tier4_autoware_utils::appendMarkerArray (added, &target_marker_array );
1464
1465
};
1465
1466
1466
1467
debug_marker_.markers .clear ();
1467
- add (createPoseMarkerArray (status_.pull_out_start_pose , " back_end_pose" , 0 , 0.9 , 0.3 , 0.3 ));
1468
- add (createPoseMarkerArray (status_.pull_out_path .start_pose , " start_pose" , 0 , 0.3 , 0.9 , 0.3 ));
1469
- add (createPoseMarkerArray (status_.pull_out_path .end_pose , " end_pose" , 0 , 0.9 , 0.9 , 0.3 ));
1470
- add (createFootprintMarkerArray (
1471
- debug_data_.refined_start_pose , vehicle_info_, " refined_start_pose" , 0 , 0.9 , 0.9 , 0.3 ));
1472
- add (createPathMarkerArray (getFullPath (), " full_path" , 0 , 0.0 , 0.5 , 0.9 ));
1473
- add (createPathMarkerArray (status_.backward_path , " backward_driving_path" , 0 , 0.0 , 0.9 , 0.0 ));
1468
+ info_marker_.markers .clear ();
1469
+ add (
1470
+ createPoseMarkerArray (status_.pull_out_start_pose , " back_end_pose" , 0 , 0.9 , 0.3 , 0.3 ),
1471
+ info_marker_);
1472
+ add (
1473
+ createPoseMarkerArray (status_.pull_out_path .start_pose , " start_pose" , 0 , 0.3 , 0.9 , 0.3 ),
1474
+ info_marker_);
1475
+ add (
1476
+ createPoseMarkerArray (status_.pull_out_path .end_pose , " end_pose" , 0 , 0.9 , 0.9 , 0.3 ),
1477
+ info_marker_);
1478
+ add (
1479
+ createFootprintMarkerArray (
1480
+ debug_data_.refined_start_pose , vehicle_info_, " refined_start_pose" , 0 , 0.9 , 0.9 , 0.3 ),
1481
+ debug_marker_);
1482
+ add (createPathMarkerArray (getFullPath (), " full_path" , 0 , 0.0 , 0.5 , 0.9 ), debug_marker_);
1483
+ add (
1484
+ createPathMarkerArray (status_.backward_path , " backward_driving_path" , 0 , 0.0 , 0.9 , 0.0 ),
1485
+ debug_marker_);
1474
1486
1475
1487
// visualize collision_check_end_pose and footprint
1476
1488
{
1477
- const auto local_footprint = vehicle_info_.createFootprint ();
1478
1489
std::map<PlannerType, double > collision_check_distances = {
1479
1490
{PlannerType::SHIFT, parameters_->shift_collision_check_distance_from_end },
1480
1491
{PlannerType::GEOMETRIC, parameters_->geometric_collision_check_distance_from_end }};
@@ -1484,24 +1495,16 @@ void StartPlannerModule::setDebugData()
1484
1495
getFullPath ().points , status_.pull_out_path .end_pose .position ,
1485
1496
collision_check_distance_from_end);
1486
1497
if (collision_check_end_pose) {
1487
- add (createPoseMarkerArray (
1488
- *collision_check_end_pose, " static_collision_check_end_pose" , 0 , 1.0 , 0.0 , 0.0 ));
1498
+ add (
1499
+ createPoseMarkerArray (
1500
+ *collision_check_end_pose, " static_collision_check_end_pose" , 0 , 1.0 , 0.0 , 0.0 ),
1501
+ info_marker_);
1489
1502
auto marker = createDefaultMarker (
1490
1503
" map" , rclcpp::Clock{RCL_ROS_TIME}.now (), " static_collision_check_end_polygon" , 0 ,
1491
- Marker::LINE_LIST, createMarkerScale (0.1 , 0.1 , 0.1 ), red_color);
1492
- const auto footprint = transformVector (
1493
- local_footprint, tier4_autoware_utils::pose2transform (*collision_check_end_pose));
1494
- const double ego_z = planner_data_->self_odometry ->pose .pose .position .z ;
1495
- for (size_t i = 0 ; i < footprint.size (); i++) {
1496
- const auto & current_point = footprint.at (i);
1497
- const auto & next_point = footprint.at ((i + 1 ) % footprint.size ());
1498
- marker.points .push_back (
1499
- tier4_autoware_utils::createPoint (current_point.x (), current_point.y (), ego_z));
1500
- marker.points .push_back (
1501
- tier4_autoware_utils::createPoint (next_point.x (), next_point.y (), ego_z));
1502
- }
1504
+ Marker::LINE_STRIP, createMarkerScale (0.1 , 0.1 , 0.1 ), red_color);
1505
+ addFootprintMarker (marker, *collision_check_end_pose, vehicle_info_);
1503
1506
marker.lifetime = life_time;
1504
- debug_marker_ .markers .push_back (marker);
1507
+ info_marker_ .markers .push_back (marker);
1505
1508
}
1506
1509
}
1507
1510
// start pose candidates
@@ -1528,8 +1531,8 @@ void StartPlannerModule::setDebugData()
1528
1531
start_pose_text_marker_array.markers .push_back (text_marker);
1529
1532
}
1530
1533
1531
- add (start_pose_footprint_marker_array);
1532
- add (start_pose_text_marker_array);
1534
+ add (start_pose_footprint_marker_array, debug_marker_ );
1535
+ add (start_pose_text_marker_array, debug_marker_ );
1533
1536
}
1534
1537
1535
1538
// visualize the footprint from pull_out_start pose to pull_out_end pose along the path
@@ -1561,26 +1564,32 @@ void StartPlannerModule::setDebugData()
1561
1564
pull_out_path_footprint_marker_array.markers .push_back (pull_out_path_footprint_marker);
1562
1565
}
1563
1566
1564
- add (pull_out_path_footprint_marker_array);
1567
+ add (pull_out_path_footprint_marker_array, debug_marker_ );
1565
1568
}
1566
1569
1567
1570
// safety check
1568
1571
if (parameters_->safety_check_params .enable_safety_check ) {
1569
1572
if (debug_data_.ego_predicted_path .size () > 0 ) {
1570
1573
const auto & ego_predicted_path = utils::path_safety_checker::convertToPredictedPath (
1571
1574
debug_data_.ego_predicted_path , ego_predicted_path_params_->time_resolution );
1572
- add (createPredictedPathMarkerArray (
1573
- ego_predicted_path, vehicle_info_, " ego_predicted_path_start_planner" , 0 , 0.0 , 0.5 , 0.9 ));
1575
+ add (
1576
+ createPredictedPathMarkerArray (
1577
+ ego_predicted_path, vehicle_info_, " ego_predicted_path_start_planner" , 0 , 0.0 , 0.5 , 0.9 ),
1578
+ debug_marker_);
1574
1579
}
1575
1580
1576
1581
if (debug_data_.filtered_objects .objects .size () > 0 ) {
1577
- add (createObjectsMarkerArray (
1578
- debug_data_.filtered_objects , " filtered_objects" , 0 , 0.0 , 0.5 , 0.9 ));
1582
+ add (
1583
+ createObjectsMarkerArray (
1584
+ debug_data_.filtered_objects , " filtered_objects" , 0 , 0.0 , 0.5 , 0.9 ),
1585
+ info_marker_);
1579
1586
}
1580
1587
1581
- add (showSafetyCheckInfo (debug_data_.collision_check , " object_debug_info" ));
1582
- add (showPredictedPath (debug_data_.collision_check , " ego_predicted_path" ));
1583
- add (showPolygon (debug_data_.collision_check , " ego_and_target_polygon_relation" ));
1588
+ add (showSafetyCheckInfo (debug_data_.collision_check , " object_debug_info" ), debug_marker_);
1589
+ add (
1590
+ showPredictedPath (debug_data_.collision_check , " predicted_path_for_safety_check" ),
1591
+ info_marker_);
1592
+ add (showPolygon (debug_data_.collision_check , " ego_and_target_polygon_relation" ), info_marker_);
1584
1593
1585
1594
// set objects of interest
1586
1595
for (const auto & [uuid, data] : debug_data_.collision_check ) {
@@ -1608,17 +1617,21 @@ void StartPlannerModule::setDebugData()
1608
1617
std::to_string (status_.pull_out_path .partial_paths .size () - 1 );
1609
1618
marker.lifetime = life_time;
1610
1619
planner_type_marker_array.markers .push_back (marker);
1611
- add (planner_type_marker_array);
1620
+ add (planner_type_marker_array, info_marker_ );
1612
1621
}
1613
1622
1614
- add (laneletsAsTriangleMarkerArray (
1615
- " departure_check_lanes_for_shift_pull_out_path" , debug_data_.departure_check_lanes ,
1616
- cyan_color));
1623
+ add (
1624
+ laneletsAsTriangleMarkerArray (
1625
+ " departure_check_lanes_for_shift_pull_out_path" , debug_data_.departure_check_lanes ,
1626
+ cyan_color),
1627
+ debug_marker_);
1617
1628
1618
1629
const auto pull_out_lanes = start_planner_utils::getPullOutLanes (
1619
1630
planner_data_, planner_data_->parameters .backward_path_length + parameters_->max_back_distance );
1620
- add (laneletsAsTriangleMarkerArray (
1621
- " pull_out_lanes_for_static_objects_collision_check" , pull_out_lanes, pink_color));
1631
+ add (
1632
+ laneletsAsTriangleMarkerArray (
1633
+ " pull_out_lanes_for_static_objects_collision_check" , pull_out_lanes, pink_color),
1634
+ debug_marker_);
1622
1635
}
1623
1636
1624
1637
void StartPlannerModule::logPullOutStatus (rclcpp::Logger::Level log_level) const
0 commit comments