Skip to content
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

feat(intersection): add param for stuck stopline overshoot margin #2756

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use_stuck_stopline: false # stopline generate before the intersection lanelet when is_stuck
assumed_front_car_decel: 1.0 # [m/ss] the expected deceleration of front car when front car as well as ego are turning
enable_front_car_decel_prediction: false # By default this feature is disabled
stop_overshoot_margin: 0.5 # [m] overshoot margin for stuck, collsion detection

merge_from_private_road:
stop_duration_sec: 1.0
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class IntersectionModule : public SceneModuleInterface
double
assumed_front_car_decel; //! the expected deceleration of front car when front car as well
bool enable_front_car_decel_prediction; //! flag for using above feature
double stop_overshoot_margin; //! overshoot margin for stuck, collsion detection
};

IntersectionModule(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ IntersectionModuleManager::IntersectionModuleManager(rclcpp::Node & node)
ip.assumed_front_car_decel = node.declare_parameter(ns + ".assumed_front_car_decel", 1.0);
ip.enable_front_car_decel_prediction =
node.declare_parameter(ns + ".enable_front_car_decel_prediction", false);
ip.stop_overshoot_margin = node.declare_parameter(ns + ".stop_overshoot_margin", 0.5);
}

MergeFromPrivateModuleManager::MergeFromPrivateModuleManager(rclcpp::Node & node)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,9 @@ bool IntersectionModule::modifyPathVelocity(PathWithLaneId * path, StopReason *
const double dist_stuck_stopline = motion_utils::calcSignedArcLength(
path->points, path->points.at(stuck_line_idx).point.pose.position,
path->points.at(closest_idx).point.pose.position);
const double eps = 1e-1; // NOTE: check if sufficiently over the stuck stopline
const bool is_over_stuck_stopline =
util::isOverTargetIndex(*path, closest_idx, current_pose, stuck_line_idx) &&
dist_stuck_stopline > eps;
dist_stuck_stopline > planner_param_.stop_overshoot_margin;
if (is_stuck && !is_over_stuck_stopline) {
stop_line_idx_final = stuck_line_idx;
pass_judge_line_idx_final = stuck_line_idx;
Expand Down