Skip to content

Commit 97ed099

Browse files
Update shift pull out behavior and add debug data
Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
1 parent 2e181d1 commit 97ed099

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

planning/behavior_path_start_planner_module/config/start_planner.param.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
center_line_path_interval: 1.0
1414
# shift pull out
1515
enable_shift_pull_out: true
16-
check_shift_path_lane_departure: false
16+
check_shift_path_lane_departure: true
1717
minimum_shift_pull_out_distance: 0.0
1818
deceleration_interval: 15.0
1919
lateral_jerk: 0.5

planning/behavior_path_start_planner_module/include/behavior_path_start_planner_module/data_structs.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ struct StartPlannerDebugData
4646
std::vector<PoseWithVelocityStamped> ego_predicted_path;
4747
// collision check debug map
4848
CollisionCheckDebugMap collision_check;
49+
lanelet::ConstLanelets drivable_lanes;
4950

5051
Pose refined_start_pose;
5152
std::vector<Pose> start_pose_candidates;

planning/behavior_path_start_planner_module/src/shift_pull_out.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ std::optional<PullOutPath> ShiftPullOut::plan(const Pose & start_pose, const Pos
102102
// check lane departure
103103
if (
104104
parameters_.check_shift_path_lane_departure &&
105-
lane_departure_checker_->checkPathWillLeaveLane(drivable_lanes_, path_start_to_end)) {
105+
lane_departure_checker_->checkPathWillLeaveLane(drivable_lanes_, path_shift_start_to_end)) {
106106
continue;
107107
}
108108

planning/behavior_path_start_planner_module/src/start_planner_module.cpp

+20-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include <lanelet2_extension/utility/query.hpp>
2525
#include <lanelet2_extension/utility/utilities.hpp>
26+
#include <lanelet2_extension/visualization/visualization.hpp>
2627
#include <magic_enum.hpp>
2728
#include <rclcpp/rclcpp.hpp>
2829

@@ -1199,8 +1200,12 @@ bool StartPlannerModule::isSafePath() const
11991200
const double hysteresis_factor =
12001201
status_.is_safe_dynamic_objects ? 1.0 : safety_check_params_->hysteresis_factor_expand_rate;
12011202

1202-
behavior_path_planner::updateSafetyCheckDebugData(
1203-
debug_data_, filtered_objects, target_objects_on_lane, ego_predicted_path);
1203+
// debug
1204+
{
1205+
debug_data_.filtered_objects = filtered_objects;
1206+
debug_data_.target_objects_on_lane = target_objects_on_lane;
1207+
debug_data_.ego_predicted_path = ego_predicted_path;
1208+
}
12041209

12051210
return behavior_path_planner::utils::path_safety_checker::checkSafetyWithRSS(
12061211
pull_out_path, ego_predicted_path, target_objects_on_lane.on_current_lane,
@@ -1337,6 +1342,10 @@ void StartPlannerModule::updateDrivableLanes()
13371342
shift_pull_out->setDrivableLanes(drivable_lanes);
13381343
}
13391344
}
1345+
// debug
1346+
{
1347+
debug_data_.drivable_lanes = drivable_lanes;
1348+
}
13401349
}
13411350

13421351
lanelet::ConstLanelets StartPlannerModule::createDrivableLanes() const
@@ -1365,6 +1374,7 @@ lanelet::ConstLanelets StartPlannerModule::createDrivableLanes() const
13651374

13661375
void StartPlannerModule::setDebugData()
13671376
{
1377+
using lanelet::visualization::laneletsAsTriangleMarkerArray;
13681378
using marker_utils::addFootprintMarker;
13691379
using marker_utils::createFootprintMarkerArray;
13701380
using marker_utils::createObjectsMarkerArray;
@@ -1483,6 +1493,10 @@ void StartPlannerModule::setDebugData()
14831493
}
14841494

14851495
add(pull_out_path_footprint_marker_array);
1496+
std::cerr << "path_shift_start_to_end is outside of drivable lanes: "
1497+
<< lane_departure_checker_->checkPathWillLeaveLane(
1498+
debug_data_.drivable_lanes, path_shift_start_to_end)
1499+
<< std::endl;
14861500
}
14871501

14881502
// safety check
@@ -1532,6 +1546,10 @@ void StartPlannerModule::setDebugData()
15321546
planner_type_marker_array.markers.push_back(marker);
15331547
add(planner_type_marker_array);
15341548
}
1549+
1550+
add(laneletsAsTriangleMarkerArray(
1551+
"drivable_lanes_for_shift_pull_out_path", debug_data_.drivable_lanes,
1552+
createMarkerColor(0.16, 1.0, 0.69, 0.2)));
15351553
}
15361554

15371555
void StartPlannerModule::logPullOutStatus(rclcpp::Logger::Level log_level) const

0 commit comments

Comments
 (0)