Skip to content

Commit

Permalink
fix(path_optimizer): fix possible zero division (#10022)
Browse files Browse the repository at this point in the history
Signed-off-by: Mamoru Sobue <[email protected]>
  • Loading branch information
soblin authored Jan 29, 2025
1 parent fcd1c7b commit a6baa18
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ geometry_msgs::msg::Point getStartPoint(
{
const size_t segment_idx = autoware::motion_utils::findNearestSegmentIndex(bound, point);
const auto & curr_seg_point = bound.at(segment_idx);
const auto & next_seg_point = bound.at(segment_idx);
const auto & next_seg_point = bound.at(segment_idx + 1);
const Eigen::Vector2d first_to_target{point.x - curr_seg_point.x, point.y - curr_seg_point.y};
const Eigen::Vector2d first_to_second{
next_seg_point.x - curr_seg_point.x, next_seg_point.y - curr_seg_point.y};
Expand Down

0 comments on commit a6baa18

Please sign in to comment.