Skip to content

Commit

Permalink
Merge branch 'beta/v0.7.0' into feat/pullover_hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
tkimura4 authored Jan 17, 2023
2 parents e4678d9 + b9fce1f commit 557270f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class LaneChangeModule : public SceneModuleInterface
void updateSteeringFactorPtr(
const CandidateOutput & output, const LaneChangePath & selected_path) const;
bool isSafe() const;
bool isValidPath() const;
bool isValidPath(const PathWithLaneId & path) const;
bool isNearEndOfLane() const;
bool isCurrentSpeedLow() const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ struct LaneChangeStatus
std::vector<uint64_t> lane_follow_lane_ids;
std::vector<uint64_t> lane_change_lane_ids;
bool is_safe;
bool is_valid_path = true;
double start_distance;
};
} // namespace behavior_path_planner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ BehaviorModuleOutput LaneChangeModule::run()
is_activated_ = isActivated();
auto output = plan();

if (!isSafe()) {
if (!isValidPath()) {
current_state_ = BT::NodeStatus::SUCCESS; // for breaking loop
return output;
}
Expand Down Expand Up @@ -118,7 +118,7 @@ bool LaneChangeModule::isExecutionReady() const
BT::NodeStatus LaneChangeModule::updateState()
{
RCLCPP_DEBUG(getLogger(), "LANE_CHANGE updateState");
if (!isSafe()) {
if (!isValidPath()) {
current_state_ = BT::NodeStatus::SUCCESS;
return current_state_;
}
Expand Down Expand Up @@ -148,8 +148,10 @@ BehaviorModuleOutput LaneChangeModule::plan()
auto path = status_.lane_change_path.path;

if (!isValidPath(path)) {
status_.is_safe = false;
status_.is_valid_path = false;
return BehaviorModuleOutput{};
} else {
status_.is_valid_path = true;
}
generateExtendedDrivableArea(path);

Expand Down Expand Up @@ -374,6 +376,8 @@ std::pair<bool, bool> LaneChangeModule::getSafePath(

bool LaneChangeModule::isSafe() const { return status_.is_safe; }

bool LaneChangeModule::isValidPath() const { return status_.is_valid_path; }

bool LaneChangeModule::isValidPath(const PathWithLaneId & path) const
{
const auto & route_handler = planner_data_->route_handler;
Expand Down

0 comments on commit 557270f

Please sign in to comment.