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>
  • Loading branch information
rej55 committed Feb 9, 2024
1 parent 5a31585 commit acf436f
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 @@ -141,7 +141,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 @@ -66,15 +66,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 @@ -225,7 +225,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 @@ -183,7 +183,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 @@ -431,7 +431,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 @@ -1447,7 +1447,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 acf436f

Please sign in to comment.