-
Notifications
You must be signed in to change notification settings - Fork 744
feat(behavior_velocity_run_out_module): exclude obstacle crossing ego back line #6680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
8a2ed10
4c56d2e
15323ed
9db1a4b
97fef69
6750f64
099a2c7
214dc90
0ea38b3
be22578
ee30dd4
8da6110
e202b55
306a050
24ff740
19fb4e6
b678057
006a24b
9b9efe8
63f02b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -102,9 +102,18 @@ bool RunOutModule::modifyPathVelocity( | |||||||||||||||||||||||||
const auto dynamic_obstacles = dynamic_obstacle_creator_->createDynamicObstacles(); | ||||||||||||||||||||||||||
debug_ptr_->setDebugValues(DebugValues::TYPE::NUM_OBSTACLES, dynamic_obstacles.size()); | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
// extract obstacles using lanelet information | ||||||||||||||||||||||||||
const auto partition_excluded_obstacles = | ||||||||||||||||||||||||||
excludeObstaclesOutSideOfPartition(dynamic_obstacles, extended_smoothed_path, current_pose); | ||||||||||||||||||||||||||
const auto filtered_obstacles = std::invoke([&]() { | ||||||||||||||||||||||||||
// extract obstacles using lanelet information | ||||||||||||||||||||||||||
const auto partition_excluded_obstacles = | ||||||||||||||||||||||||||
excludeObstaclesOutSideOfPartition(dynamic_obstacles, extended_smoothed_path, current_pose); | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
// extract obstacles that cross the ego's back lane | ||||||||||||||||||||||||||
if (!planner_param_.run_out.use_ego_cut_line) return partition_excluded_obstacles; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
const auto ego_back_line_excluded_obstacles = | ||||||||||||||||||||||||||
excludeObstaclesCrossingEgoBackLine(partition_excluded_obstacles, current_pose); | ||||||||||||||||||||||||||
return ego_back_line_excluded_obstacles; | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the comment place is better like this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done, thanks for the suggestion! @kosuke55 |
||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
// record time for obstacle creation | ||||||||||||||||||||||||||
const auto t_obstacle_creation = std::chrono::system_clock::now(); | ||||||||||||||||||||||||||
|
@@ -122,7 +131,7 @@ bool RunOutModule::modifyPathVelocity( | |||||||||||||||||||||||||
planner_data_->route_handler_->getOverallGraphPtr()) | ||||||||||||||||||||||||||
: std::vector<std::pair<int64_t, lanelet::ConstLanelet>>(); | ||||||||||||||||||||||||||
const auto dynamic_obstacle = | ||||||||||||||||||||||||||
detectCollision(partition_excluded_obstacles, extended_smoothed_path, crosswalk_lanelets); | ||||||||||||||||||||||||||
detectCollision(filtered_obstacles, extended_smoothed_path, crosswalk_lanelets); | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
// record time for collision check | ||||||||||||||||||||||||||
const auto t_collision_check = std::chrono::system_clock::now(); | ||||||||||||||||||||||||||
|
@@ -147,8 +156,7 @@ bool RunOutModule::modifyPathVelocity( | |||||||||||||||||||||||||
applyMaxJerkLimit(current_pose, current_vel, current_acc, *path); | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
publishDebugValue( | ||||||||||||||||||||||||||
extended_smoothed_path, partition_excluded_obstacles, dynamic_obstacle, current_pose); | ||||||||||||||||||||||||||
publishDebugValue(extended_smoothed_path, filtered_obstacles, dynamic_obstacle, current_pose); | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
// record time for collision check | ||||||||||||||||||||||||||
const auto t_path_planning = std::chrono::system_clock::now(); | ||||||||||||||||||||||||||
|
@@ -810,6 +818,24 @@ void RunOutModule::applyMaxJerkLimit( | |||||||||||||||||||||||||
run_out_utils::insertPathVelocityFromIndex(stop_point_idx.value(), jerk_limited_vel, path.points); | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
std::vector<DynamicObstacle> RunOutModule::excludeObstaclesCrossingEgoBackLine( | ||||||||||||||||||||||||||
const std::vector<DynamicObstacle> & dynamic_obstacles, | ||||||||||||||||||||||||||
const geometry_msgs::msg::Pose & current_pose) const | ||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||
std::vector<DynamicObstacle> extracted_obstacles; | ||||||||||||||||||||||||||
std::vector<geometry_msgs::msg::Point> ego_cut_lane; | ||||||||||||||||||||||||||
const double ego_cut_lane_half_width = planner_param_.run_out.egos_cut_line_length / 2.0; | ||||||||||||||||||||||||||
std::for_each(dynamic_obstacles.begin(), dynamic_obstacles.end(), [&](const auto & o) { | ||||||||||||||||||||||||||
const auto predicted_path = run_out_utils::getHighestConfidencePath(o.predicted_paths); | ||||||||||||||||||||||||||
if (!run_out_utils::pathIntersectsEgoCutLine( | ||||||||||||||||||||||||||
predicted_path, current_pose, ego_cut_lane_half_width, ego_cut_lane)) { | ||||||||||||||||||||||||||
extracted_obstacles.push_back(o); | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||
debug_ptr_->pushEgoCutLane(ego_cut_lane); | ||||||||||||||||||||||||||
return extracted_obstacles; | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
std::vector<DynamicObstacle> RunOutModule::excludeObstaclesOutSideOfPartition( | ||||||||||||||||||||||||||
const std::vector<DynamicObstacle> & dynamic_obstacles, const PathWithLaneId & path, | ||||||||||||||||||||||||||
const geometry_msgs::msg::Pose & current_pose) const | ||||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.