Skip to content

Commit

Permalink
fix(autonomous_emergency_braking): solve issue with arc length (autow…
Browse files Browse the repository at this point in the history
…arefoundation#9247) (#1627)

* solve issue with arc length



* fix problem with points one vehicle apart from path



---------

Signed-off-by: Daniel Sanchez <[email protected]>
  • Loading branch information
danielsanchezaran authored Nov 7, 2024
1 parent 0797900 commit 7d609fa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion control/autoware_autonomous_emergency_braking/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,11 +900,15 @@ void AEB::getClosestObjectsOnPath(
return autoware::universe_utils::createPoint(p.x, p.y, p.z);
}();

const auto path_length = autoware::motion_utils::calcArcLength(ego_path);
for (const auto & p : *points_belonging_to_cluster_hulls) {
const auto obj_position = autoware::universe_utils::createPoint(p.x, p.y, p.z);
const double obj_arc_length =
autoware::motion_utils::calcSignedArcLength(ego_path, current_p, obj_position);
if (std::isnan(obj_arc_length)) continue;
if (
std::isnan(obj_arc_length) ||
obj_arc_length > path_length + vehicle_info_.max_longitudinal_offset_m)
continue;

// calculate the lateral offset between the ego vehicle and the object
const double lateral_offset =
Expand Down

0 comments on commit 7d609fa

Please sign in to comment.