Skip to content

Commit

Permalink
fix(autoware_motion_velocity_planner_common_universe): check optional…
Browse files Browse the repository at this point in the history
… before accessing (autowarefoundation#10183)

* Update polygon_utils.cpp

fix bug-prone code

Signed-off-by: Y.Hisaki <yhisaki31@gmail.com>

* Update polygon_utils.cpp

---------

Signed-off-by: Y.Hisaki <yhisaki31@gmail.com>
  • Loading branch information
yhisaki authored Feb 26, 2025
1 parent 4c462de commit 3677bda
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ std::optional<std::pair<geometry_msgs::msg::Point, double>> get_collision_point(
max_collision_point = poly_vertex.point;
}
}
if (!max_collision_point.has_value() || !max_collision_length.has_value()) return std::nullopt;
return std::make_pair(
*max_collision_point,
autoware::motion_utils::calcSignedArcLength(traj_points, 0, collision_info.first) -
Expand Down

0 comments on commit 3677bda

Please sign in to comment.