Skip to content

Commit

Permalink
fix(avoidance): calculate distance between ego and goal pos properly (a…
Browse files Browse the repository at this point in the history
…utowarefoundation#4266)

Signed-off-by: satoshi-ota <[email protected]>
  • Loading branch information
satoshi-ota authored Jul 13, 2023
1 parent 14d2c8d commit b5e58f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions planning/behavior_path_planner/src/utils/avoidance/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,10 +792,10 @@ void filterTargetObjects(
const rclcpp::Time now = rclcpp::Clock(RCL_ROS_TIME).now();

// for goal
const auto dist_to_goal =
rh->isInGoalRouteSection(data.current_lanelets.back())
? calcSignedArcLength(path_points, ego_pos, rh->getGoalPose().position)
: std::numeric_limits<double>::max();
const auto ego_idx = planner_data->findEgoIndex(path_points);
const auto dist_to_goal = rh->isInGoalRouteSection(data.current_lanelets.back())
? calcSignedArcLength(path_points, ego_idx, path_points.size() - 1)
: std::numeric_limits<double>::max();

// extend lanelets if the reference path is cut for lane change.
const auto & ego_pose = planner_data->self_odometry->pose.pose;
Expand Down

0 comments on commit b5e58f6

Please sign in to comment.