From 32465c3ba8e2a800595fac1de06e8d08e52d5da1 Mon Sep 17 00:00:00 2001 From: Jacopo Bartiromo Date: Mon, 2 Aug 2021 13:11:19 +0200 Subject: [PATCH] Revert broken MP stage change --- LibCarla/source/carla/trafficmanager/MotionPlanStage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }