diff --git a/LibCarla/source/carla/trafficmanager/MotionPlanStage.cpp b/LibCarla/source/carla/trafficmanager/MotionPlanStage.cpp index 2a48bd2f4..6fbc2ed1a 100644 --- a/LibCarla/source/carla/trafficmanager/MotionPlanStage.cpp +++ b/LibCarla/source/carla/trafficmanager/MotionPlanStage.cpp @@ -329,10 +329,10 @@ std::pair MotionPlanStage::CollisionHandling(const CollisionHazardD } // If vehicle is approaching a lead vehicle and the lead vehicle is further // than CRITICAL_BRAKING_MARGIN but closer than FOLLOW_LEAD_DISTANCE. - else if (available_distance_margin > CRITICAL_BRAKING_MARGIN && other_velocity.Length() < 1.0f) { + else if (available_distance_margin > CRITICAL_BRAKING_MARGIN) { // Then follow the lead vehicle by acquiring it's speed along current heading. dynamic_target_velocity = std::max(other_speed_along_heading, RELATIVE_APPROACH_SPEED); - } else if (available_distance_margin < CRITICAL_BRAKING_MARGIN) { + } else { // If lead vehicle closer than CRITICAL_BRAKING_MARGIN, initiate emergency stop. collision_emergency_stop = true; }