@@ -271,12 +271,6 @@ void AvoidanceModule::fillFundamentalData(AvoidancePlanningData & data, DebugDat
271
271
data.reference_path , 0 , data.reference_path .points .size (),
272
272
motion_utils::calcSignedArcLength (data.reference_path .points , getEgoPosition (), 0 ));
273
273
274
- data.to_return_point = utils::avoidance::calcDistanceToReturnDeadLine (
275
- data.current_lanelets , data.reference_path_rough , planner_data_, parameters_);
276
-
277
- data.to_start_point = utils::avoidance::calcDistanceToAvoidStartLine (
278
- data.current_lanelets , data.reference_path_rough , planner_data_, parameters_);
279
-
280
274
// target objects for avoidance
281
275
fillAvoidanceTargetObjects (data, debug);
282
276
@@ -290,6 +284,17 @@ void AvoidanceModule::fillFundamentalData(AvoidancePlanningData & data, DebugDat
290
284
return a.longitudinal < b.longitudinal ;
291
285
});
292
286
287
+ std::sort (data.other_objects .begin (), data.other_objects .end (), [](auto a, auto b) {
288
+ return a.longitudinal < b.longitudinal ;
289
+ });
290
+
291
+ data.to_return_point = utils::avoidance::calcDistanceToReturnDeadLine (
292
+ data.current_lanelets , data.reference_path_rough , data.other_objects , planner_data_,
293
+ parameters_);
294
+
295
+ data.to_start_point = utils::avoidance::calcDistanceToAvoidStartLine (
296
+ data.current_lanelets , data.reference_path_rough , planner_data_, parameters_);
297
+
293
298
// set base path
294
299
path_shifter_.setPath (data.reference_path );
295
300
}
0 commit comments