Skip to content

Commit

Permalink
bug: do error handling
Browse files Browse the repository at this point in the history
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
  • Loading branch information
sasakisasaki committed Mar 6, 2025
1 parent 2e286d9 commit 8093a99
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions planning/autoware_path_generator/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,13 @@ std::optional<PathWithLaneId> PathGenerator::generate_path(
const lanelet::LaneletSequence & lanelet_sequence, const double s_start, const double s_end,
const Params & params) const
{

// Sanity check
if (s_start > s_end) {
RCLCPP_ERROR(get_logger(), "s_start must not be greater than s_end: Provided s_start = %f, s_end = %f. Skipping path generation.", s_start, s_end);
return std::nullopt;
}

std::vector<PathPointWithLaneId> path_points_with_lane_id{};

const auto add_path_point = [&](const auto & path_point, const lanelet::ConstLanelet & lanelet) {
Expand Down

0 comments on commit 8093a99

Please sign in to comment.