diff --git a/LibCarla/source/carla/trafficmanager/CollisionStage.cpp b/LibCarla/source/carla/trafficmanager/CollisionStage.cpp index a20069ad0..29790a81c 100644 --- a/LibCarla/source/carla/trafficmanager/CollisionStage.cpp +++ b/LibCarla/source/carla/trafficmanager/CollisionStage.cpp @@ -202,7 +202,9 @@ namespace CollisionStageConstants { !(!reference_front_wp->CheckJunction() && cg::Math::Dot(reference_heading, reference_to_other) > 0 && - inter_vehicle_distance > minimum_inter_vehicle_distance)) { + inter_vehicle_distance > std::max(minimum_inter_vehicle_distance, + std::pow(parameters.GetDistanceToLeadingVehicle(reference_vehicle) + + inter_vehicle_length, 2.0f)))) { const Polygon reference_geodesic_polygon = GetPolygon(GetGeodesicBoundary(reference_vehicle, reference_location)); const Polygon other_geodesic_polygon = GetPolygon(GetGeodesicBoundary(other_vehicle, other_location)); diff --git a/LibCarla/source/carla/trafficmanager/Parameters.cpp b/LibCarla/source/carla/trafficmanager/Parameters.cpp index 48306fef7..b4e97995d 100644 --- a/LibCarla/source/carla/trafficmanager/Parameters.cpp +++ b/LibCarla/source/carla/trafficmanager/Parameters.cpp @@ -158,7 +158,7 @@ float Parameters::GetDistanceToLeadingVehicle(const ActorPtr &actor) { } else { specific_distance_margin = distance_margin; } - //std::cout <<"distance_margin :- "<< distance_margin <<" " <<"Value of Specific Distance Margin - " << specific_distance_margin << std::endl; + return specific_distance_margin; }