Skip to content

Commit

Permalink
use only check ego in current lane
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp>
  • Loading branch information
zulfaqar-azmi-t4 committed Nov 28, 2022
1 parent 0eb354f commit 4f97408
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ BehaviorModuleOutput LaneChangeModule::plan()
path = util::resamplePathWithSpline(selected_path, resample_interval);
generateExtendedDrivableArea(path);
prev_approved_path_ = path;
if(is_abort_condition_satisfied_){
if (is_abort_condition_satisfied_ && (isNearEndOfLane() && isCurrentSpeedLow())) {
const auto stop_point = util::insertStopPoint(0.1, &path);
}
} else {
Expand Down Expand Up @@ -489,26 +489,27 @@ bool LaneChangeModule::isAbortConditionSatisfied()

current_lane_change_state_ = LaneChangeStates::Cancel;

const bool is_velocity_low =
util::l2Norm(current_twist.linear) < parameters_->abort_lane_change_velocity_thresh;
// const bool is_velocity_low =
// util::l2Norm(current_twist.linear) < parameters_->abort_lane_change_velocity_thresh;

const bool is_within_original_lane =
lane_change_utils::isEgoWithinOriginalLane(current_lanes, current_pose, common_parameters);

if (is_velocity_low && is_within_original_lane) {
if (is_within_original_lane) {
return true;
}

const bool is_distance_small =
lane_change_utils::isEgoDistanceNearToCenterline(closest_lanelet, current_pose, *parameters_);
// const bool is_distance_small =
// lane_change_utils::isEgoDistanceNearToCenterline(closest_lanelet, current_pose,
// *parameters_);

// check angle thresh from original lane
const bool is_angle_diff_small = lane_change_utils::isEgoHeadingAngleLessThanThreshold(
closest_lanelet, current_pose, *parameters_);
// const bool is_angle_diff_small = lane_change_utils::isEgoHeadingAngleLessThanThreshold(
// closest_lanelet, current_pose, *parameters_);

if (is_distance_small && is_angle_diff_small) {
return true;
}
// if (is_angle_diff_small) {
// return true;
// }

if (!parameters_->enable_abort_lane_change) {
return true;
Expand Down

0 comments on commit 4f97408

Please sign in to comment.