Skip to content

Commit

Permalink
fix(behavior_path_planner): fix pull out length to lane end (#2692)
Browse files Browse the repository at this point in the history
Signed-off-by: kosuke55 <[email protected]>

Signed-off-by: kosuke55 <[email protected]>
  • Loading branch information
kosuke55 authored Jan 19, 2023
1 parent 9e3e3a0 commit fcacc80
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,10 @@ std::vector<Pose> PullOutModule::searchBackedPoses()
// check the back pose is near the lane end
const double length_to_backed_pose =
lanelet::utils::getArcCoordinates(status_.pull_out_lanes, *backed_pose).length;
const double length_to_lane_end =
lanelet::utils::getLaneletLength2d(status_.pull_out_lanes.back());
double length_to_lane_end = 0.0;
for (const auto & lane : status_.pull_out_lanes) {
length_to_lane_end += lanelet::utils::getLaneletLength2d(lane);
}
const double distance_from_lane_end = length_to_lane_end - length_to_backed_pose;
if (distance_from_lane_end < parameters_.ignore_distance_from_lane_end) {
RCLCPP_WARN_THROTTLE(
Expand Down

0 comments on commit fcacc80

Please sign in to comment.