Skip to content

Commit

Permalink
fix: path distance calculator (#975)
Browse files Browse the repository at this point in the history
Signed-off-by: tomoya.kimura <[email protected]>
  • Loading branch information
tkimura4 committed May 26, 2022
1 parent 1d5a7b3 commit b76b6e1
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ PathDistanceCalculator::PathDistanceCalculator(const rclcpp::NodeOptions & optio
RCLCPP_WARN_THROTTLE(get_logger(), *get_clock(), 5000, "path empty");
}

if (path->points.size() == 1) {
RCLCPP_WARN_THROTTLE(get_logger(), *get_clock(), 5000, "too short path");
}

const double distance = tier4_autoware_utils::calcSignedArcLength(
path->points, pose->pose.position, path->points.size() - 1);

Expand Down

0 comments on commit b76b6e1

Please sign in to comment.