@@ -257,26 +257,27 @@ std::vector<CruiseObstacle> ObstacleCruiseModule::filter_cruise_obstacle_for_pre
257
257
cruise_obstacles.push_back (*cruise_obstacle);
258
258
continue ;
259
259
}
260
+ }
260
261
261
- // 3. precise filtering for yield cruise
262
- if (obstacle_filtering_param_.enable_yield ) {
263
- const auto yield_obstacles = find_yield_cruise_obstacles (
264
- odometry, objects, predicted_objects_stamp, traj_points, vehicle_info);
265
- if (yield_obstacles) {
266
- for (const auto & y : yield_obstacles.value ()) {
267
- // Check if there is no member with the same UUID in cruise_obstacles
268
- auto it = std::find_if (
269
- cruise_obstacles.begin (), cruise_obstacles.end (),
270
- [&y](const auto & c) { return y.uuid == c.uuid ; });
271
-
272
- // If no matching UUID found, insert yield obstacle into cruise_obstacles
273
- if (it == cruise_obstacles.end ()) {
274
- cruise_obstacles.push_back (y);
275
- }
262
+ // 3. precise filtering for yield cruise
263
+ if (obstacle_filtering_param_.enable_yield ) {
264
+ const auto yield_obstacles = find_yield_cruise_obstacles (
265
+ odometry, objects, predicted_objects_stamp, traj_points, vehicle_info);
266
+ if (yield_obstacles) {
267
+ for (const auto & y : yield_obstacles.value ()) {
268
+ // Check if there is no member with the same UUID in cruise_obstacles
269
+ auto it = std::find_if (
270
+ cruise_obstacles.begin (), cruise_obstacles.end (),
271
+ [&y](const auto & c) { return y.uuid == c.uuid ; });
272
+
273
+ // If no matching UUID found, insert yield obstacle into cruise_obstacles
274
+ if (it == cruise_obstacles.end ()) {
275
+ cruise_obstacles.push_back (y);
276
276
}
277
277
}
278
278
}
279
279
}
280
+
280
281
prev_cruise_object_obstacles_ = cruise_obstacles;
281
282
282
283
return cruise_obstacles;
@@ -461,14 +462,14 @@ std::optional<std::vector<CruiseObstacle>> ObstacleCruiseModule::find_yield_crui
461
462
obstacle_filtering_param_.stopped_obstacle_velocity_threshold ;
462
463
if (is_moving) {
463
464
const bool is_within_lat_dist_threshold =
464
- o->get_dist_to_traj_lateral (traj_points) <
465
+ std::abs ( o->get_dist_to_traj_lateral (traj_points) ) <
465
466
obstacle_filtering_param_.yield_lat_distance_threshold ;
466
467
if (is_within_lat_dist_threshold) moving_objects.push_back (o);
467
468
return ;
468
469
}
469
470
// lat threshold is larger for stopped obstacles
470
471
const bool is_within_lat_dist_threshold =
471
- o->get_dist_to_traj_lateral (traj_points) <
472
+ std::abs ( o->get_dist_to_traj_lateral (traj_points) ) <
472
473
obstacle_filtering_param_.yield_lat_distance_threshold +
473
474
obstacle_filtering_param_.max_lat_dist_between_obstacles ;
474
475
if (is_within_lat_dist_threshold) stopped_objects.push_back (o);
0 commit comments