@@ -615,16 +615,25 @@ std::optional<geometry_msgs::msg::Pose> RunOutModule::calcStopPoint(
615
615
// vehicle have to decelerate if there is not enough distance with deceleration_jerk
616
616
const bool deceleration_needed =
617
617
*stop_dist > dist_to_collision - planner_param_.run_out .stop_margin ;
618
- // avoid acceleration when ego is decelerating
619
- // TODO(Tomohito Ando): replace with more appropriate method
620
- constexpr float epsilon = 1.0e-2 ;
621
- constexpr float stopping_vel_mps = 2.5 / 3.6 ;
622
- const bool is_stopping = current_vel < stopping_vel_mps && current_acc < epsilon;
623
- if (!deceleration_needed && !is_stopping) {
618
+ const auto & detection_method = planner_param_.run_out .detection_method ;
619
+
620
+ if (!deceleration_needed && detection_method == " Object" ) {
624
621
debug_ptr_->setAccelReason (RunOutDebug::AccelReason::LOW_JERK);
625
622
return {};
626
623
}
627
624
625
+ // If the detection method assumes running out, avoid acceleration when the ego is decelerating.
626
+ // TODO(Tomohito Ando): replace with more appropriate way
627
+ if (!deceleration_needed && detection_method != " Object" ) {
628
+ constexpr float epsilon = 1.0e-2 ;
629
+ constexpr float stopping_vel_mps = 2.5 / 3.6 ;
630
+ const bool is_stopping = current_vel < stopping_vel_mps && current_acc < epsilon;
631
+ if (!is_stopping) {
632
+ debug_ptr_->setAccelReason (RunOutDebug::AccelReason::LOW_JERK);
633
+ return {};
634
+ }
635
+ }
636
+
628
637
// calculate the stop point for base link
629
638
const float base_to_collision_point =
630
639
planner_param_.run_out .stop_margin + planner_param_.vehicle_param .base_to_front ;
0 commit comments