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