Skip to content

Commit

Permalink
fix docstring and remove redundant argument
Browse files Browse the repository at this point in the history
Signed-off-by: Zulfaqar Azmi <[email protected]>
  • Loading branch information
zulfaqar-azmi-t4 committed Dec 19, 2024
1 parent cd8e625 commit cf4a8af
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using behavior_path_planner::lane_change::CommonDataPtr;
*
* This function generates the "prepare segment" of the path by trimming it to the specified length,
* adjusting longitudinal velocity for acceleration or deceleration, and ensuring the starting point
* meets necessary constraints for a lane change. the ego vehicle for a lane change. It adjusts the
* meets necessary constraints for a lane change.
*
* @param common_data_ptr Shared pointer to CommonData containing current and target lane
* information, vehicle parameters, and ego state.
Expand Down Expand Up @@ -75,8 +75,7 @@ bool get_prepare_segment(
LaneChangePath get_candidate_path(
const CommonDataPtr & common_data_ptr, const LaneChangePhaseMetrics & prep_metric,
const LaneChangePhaseMetrics & lc_metric, const PathWithLaneId & prep_segment,
const std::vector<std::vector<int64_t>> & sorted_lane_ids, const Pose & lc_start_pose,
const double shift_length);
const std::vector<std::vector<int64_t>> & sorted_lane_ids, const double shift_length);

/**
* @brief Constructs a candidate path for a lane change maneuver.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1160,8 +1160,7 @@ bool NormalLaneChange::get_lane_change_paths(LaneChangePaths & candidate_paths)
LaneChangePath candidate_path;
try {
candidate_path = utils::lane_change::get_candidate_path(
common_data_ptr_, prep_metric, lc_metric, prepare_segment, sorted_lane_ids,
lane_changing_start_pose, shift_length);
common_data_ptr_, prep_metric, lc_metric, prepare_segment, sorted_lane_ids, shift_length);
} catch (const std::exception & e) {
debug_print_lat(std::string("Reject: ") + e.what());
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,23 @@ bool get_prepare_segment(
LaneChangePath get_candidate_path(
const CommonDataPtr & common_data_ptr, const LaneChangePhaseMetrics & prep_metric,
const LaneChangePhaseMetrics & lc_metric, const PathWithLaneId & prep_segment,
const std::vector<std::vector<int64_t>> & sorted_lane_ids, const Pose & lc_start_pose,
const double shift_length)
const std::vector<std::vector<int64_t>> & sorted_lane_ids, const double shift_length)
{
const auto & route_handler = *common_data_ptr->route_handler_ptr;
const auto & target_lanes = common_data_ptr->lanes_ptr->target;

const auto resample_interval = calc_resample_interval(lc_metric.length, prep_metric.velocity);

if (prep_segment.points.empty()) {
throw std::logic_error("Empty prepare segment!");
}

const auto & lc_start_pose = prep_segment.points.back().point.pose;
const auto target_lane_reference_path = get_reference_path_from_target_Lane(
common_data_ptr, lc_start_pose, lc_metric.length, resample_interval);

if (target_lane_reference_path.points.empty()) {
throw std::logic_error("target_lane_reference_path is empty!");
throw std::logic_error("Empty target reference!");
}

const auto lc_end_pose = std::invoke([&]() {
Expand Down

0 comments on commit cf4a8af

Please sign in to comment.