@@ -655,7 +655,7 @@ std::vector<double> NormalLaneChange::sampleLongitudinalAccValues(
655
655
}
656
656
657
657
// If the ego is in stuck, sampling all possible accelerations to find avoiding path.
658
- if (isVehicleStuckByObstacle (current_lanes, max_lane_change_length )) {
658
+ if (isVehicleStuckByObstacle (current_lanes)) {
659
659
auto clock = rclcpp::Clock (RCL_ROS_TIME);
660
660
RCLCPP_INFO_THROTTLE (
661
661
logger_, clock , 1000 , " Vehicle is stuck. sample all longitudinal acceleration." );
@@ -1668,7 +1668,21 @@ bool NormalLaneChange::isVehicleStuckByObstacle(const lanelet::ConstLanelets & c
1668
1668
1669
1669
const auto [min_acc, max_acc] = calcCurrentMinMaxAcceleration ();
1670
1670
const auto max_lane_change_length = calcMaximumLaneChangeLength (current_lanes.back (), max_acc);
1671
- return isVehicleStuckByObstacle (current_lanes, max_lane_change_length);
1671
+ const auto rss_dist = calcRssDistance (
1672
+ 0.0 , planner_data_->parameters .minimum_lane_changing_velocity ,
1673
+ lane_change_parameters_->rss_params );
1674
+
1675
+ // It is difficult to define the detection range. If it is too short, the stuck will not be
1676
+ // determined, even though you are stuck by an obstacle. If it is too long,
1677
+ // the ego will be judged to be stuck by a distant vehicle, even though the ego is only
1678
+ // stopped at a traffic light. Essentially, the calculation should be based on the information of
1679
+ // the stop reason, but this is outside the scope of one module. I keep it as a TODO.
1680
+ constexpr double DETECTION_DISTANCE_MARGIN = 10.0 ;
1681
+ const auto detection_distance = max_lane_change_length + rss_dist +
1682
+ getCommonParam ().base_link2front + DETECTION_DISTANCE_MARGIN;
1683
+ RCLCPP_INFO (logger_, " max_lane_change_length: %f, max_acc: %f" , max_lane_change_length, max_acc);
1684
+
1685
+ return isVehicleStuckByObstacle (current_lanes, detection_distance);
1672
1686
}
1673
1687
1674
1688
void NormalLaneChange::setStopPose (const Pose & stop_pose)
0 commit comments