Skip to content

Commit

Permalink
fix(bpp): update collided polygon pose only once (#9338)
Browse files Browse the repository at this point in the history
* fix(bpp): update collided polygon pose only once

Signed-off-by: Zulfaqar Azmi <[email protected]>

* add expected pose

Signed-off-by: Zulfaqar Azmi <[email protected]>

---------

Signed-off-by: Zulfaqar Azmi <[email protected]>
  • Loading branch information
zulfaqar-azmi-t4 authored Nov 15, 2024
1 parent d819a66 commit 8dfc04a
Showing 1 changed file with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -622,13 +622,15 @@ std::vector<Polygon2d> get_collided_polygons(

// check intersects
if (boost::geometry::intersects(ego_polygon, obj_polygon)) {
debug.unsafe_reason = "overlap_polygon";
if (collided_polygons.empty()) {
debug.unsafe_reason = "overlap_polygon";
debug.expected_ego_pose = ego_pose;
debug.expected_obj_pose = obj_pose;
debug.extended_ego_polygon = ego_polygon;
debug.extended_obj_polygon = obj_polygon;
}
collided_polygons.push_back(obj_polygon);

debug.expected_ego_pose = ego_pose;
debug.expected_obj_pose = obj_pose;
debug.extended_ego_polygon = ego_polygon;
debug.extended_obj_polygon = obj_polygon;
continue;
}

Expand Down Expand Up @@ -676,14 +678,17 @@ std::vector<Polygon2d> get_collided_polygons(

// check intersects with extended polygon
if (boost::geometry::intersects(extended_ego_polygon, extended_obj_polygon)) {
debug.unsafe_reason = "overlap_extended_polygon";
if (collided_polygons.empty()) {
debug.unsafe_reason = "overlap_extended_polygon";
debug.rss_longitudinal = rss_dist;
debug.inter_vehicle_distance = min_lon_length;
debug.expected_ego_pose = ego_pose;
debug.expected_obj_pose = obj_pose;
debug.extended_ego_polygon = extended_ego_polygon;
debug.extended_obj_polygon = extended_obj_polygon;
debug.is_front = is_object_front;
}
collided_polygons.push_back(obj_polygon);

debug.rss_longitudinal = rss_dist;
debug.inter_vehicle_distance = min_lon_length;
debug.extended_ego_polygon = extended_ego_polygon;
debug.extended_obj_polygon = extended_obj_polygon;
debug.is_front = is_object_front;
}
}

Expand Down

0 comments on commit 8dfc04a

Please sign in to comment.