Skip to content

Commit

Permalink
fix(lane_change): correct computation of maximum lane changing length…
Browse files Browse the repository at this point in the history
… threshold (autowarefoundation#9279)

fix computation of maximum lane changing length threshold

Signed-off-by: mohammad alqudah <alqudah.mohammad@tier4.jp>
  • Loading branch information
mkquda authored and shmpwk committed Dec 25, 2024
1 parent c76a8c2 commit 0b18e63
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,6 @@ std::vector<LaneChangePhaseMetrics> NormalLaneChange::get_lane_changing_metrics(
const double shift_length, const double dist_to_reg_element) const
{
const auto & route_handler = getRouteHandler();
const auto & target_lanes = common_data_ptr_->lanes_ptr->target;
const auto & transient_data = common_data_ptr_->transient_data;
const auto dist_lc_start_to_end_of_lanes = calculation::calc_dist_from_pose_to_terminal_end(
common_data_ptr_, common_data_ptr_->lanes_ptr->target_neighbor,
Expand All @@ -1426,12 +1425,8 @@ std::vector<LaneChangePhaseMetrics> NormalLaneChange::get_lane_changing_metrics(
transient_data.is_ego_near_current_terminal_start
? transient_data.dist_to_terminal_end - prep_metric.length
: std::min(transient_data.dist_to_terminal_end, dist_to_reg_element) - prep_metric.length;
auto target_lane_buffer = lane_change_parameters_->lane_change_finish_judge_buffer +
transient_data.next_dist_buffer.min;
if (std::abs(route_handler->getNumLaneToPreferredLane(target_lanes.back(), direction_)) > 0) {
target_lane_buffer += lane_change_parameters_->backward_length_buffer_for_end_of_lane;
}
max_length = std::min(max_length, dist_lc_start_to_end_of_lanes - target_lane_buffer);
max_length =
std::min(max_length, dist_lc_start_to_end_of_lanes - transient_data.next_dist_buffer.min);
return max_length;
});

Expand Down

0 comments on commit 0b18e63

Please sign in to comment.