Skip to content

Commit

Permalink
refactor(lane_change): add const to lane change functions (autowarefo…
Browse files Browse the repository at this point in the history
…undation#6175)

Signed-off-by: Fumiya Watanabe <rej55.g@gmail.com>
Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp>
  • Loading branch information
zulfaqar-azmi-t4 authored and satoshi-ota committed Feb 23, 2024
1 parent 0bd8954 commit c92aa75
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class NormalLaneChange : public LaneChangeBase

BehaviorModuleOutput generateOutput() override;

void extendOutputDrivableArea(BehaviorModuleOutput & output) override;
void extendOutputDrivableArea(BehaviorModuleOutput & output) const override;

void insertStopPoint(const lanelet::ConstLanelets & lanelets, PathWithLaneId & path) override;

Expand All @@ -65,7 +65,7 @@ class NormalLaneChange : public LaneChangeBase

void resetParameters() override;

TurnSignalInfo updateOutputTurnSignal() override;
TurnSignalInfo updateOutputTurnSignal() const override;

bool calcAbortPath() override;

Expand Down Expand Up @@ -148,7 +148,7 @@ class NormalLaneChange : public LaneChangeBase
const utils::path_safety_checker::RSSparams rss_params, const bool is_stuck,
const bool check_safety = true) const override;

TurnSignalInfo calcTurnSignalInfo() override;
TurnSignalInfo calcTurnSignalInfo() const override;

bool isValidPath(const PathWithLaneId & path) const override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ class LaneChangeBase

virtual BehaviorModuleOutput generateOutput() = 0;

virtual void extendOutputDrivableArea(BehaviorModuleOutput & output) = 0;
virtual void extendOutputDrivableArea(BehaviorModuleOutput & output) const = 0;

virtual PathWithLaneId getReferencePath() const = 0;

virtual std::optional<PathWithLaneId> extendPath() = 0;

virtual void resetParameters() = 0;

virtual TurnSignalInfo updateOutputTurnSignal() = 0;
virtual TurnSignalInfo updateOutputTurnSignal() const = 0;

virtual bool hasFinishedLaneChange() const = 0;

Expand Down Expand Up @@ -224,7 +224,7 @@ class LaneChangeBase
LaneChangePaths * candidate_paths, const utils::path_safety_checker::RSSparams rss_params,
const bool is_stuck, const bool check_safety) const = 0;

virtual TurnSignalInfo calcTurnSignalInfo() = 0;
virtual TurnSignalInfo calcTurnSignalInfo() const = 0;

virtual bool isValidPath(const PathWithLaneId & path) const = 0;

Expand Down
6 changes: 3 additions & 3 deletions planning/behavior_path_lane_change_module/src/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ BehaviorModuleOutput NormalLaneChange::generateOutput()
return output;
}

void NormalLaneChange::extendOutputDrivableArea(BehaviorModuleOutput & output)
void NormalLaneChange::extendOutputDrivableArea(BehaviorModuleOutput & output) const
{
const auto & dp = planner_data_->drivable_area_expansion_parameters;

Expand Down Expand Up @@ -471,7 +471,7 @@ void NormalLaneChange::resetParameters()
RCLCPP_DEBUG(logger_, "reset all flags and debug information.");
}

TurnSignalInfo NormalLaneChange::updateOutputTurnSignal()
TurnSignalInfo NormalLaneChange::updateOutputTurnSignal() const
{
TurnSignalInfo turn_signal_info = calcTurnSignalInfo();
const auto [turn_signal_command, distance_to_vehicle_front] = utils::getPathTurnSignal(
Expand Down Expand Up @@ -1527,7 +1527,7 @@ PathSafetyStatus NormalLaneChange::isApprovedPathSafe() const
return safety_status;
}

TurnSignalInfo NormalLaneChange::calcTurnSignalInfo()
TurnSignalInfo NormalLaneChange::calcTurnSignalInfo() const
{
const auto get_blinker_pose = [](const PathWithLaneId & path, const double length) {
double accumulated_length = 0.0;
Expand Down

0 comments on commit c92aa75

Please sign in to comment.