Skip to content

Commit

Permalink
fix(lane_change): safety check not working when cancel disabled
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Zulfaqar <zulfaqar.azmi@tier4.jp>
  • Loading branch information
zulfaqar-azmi-t4 committed May 12, 2023
1 parent 789fee7 commit 198b2ee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class LaneChangeBase

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

bool isCancelEnabled() const { return lane_change_parameters_->enable_cancel_lane_change; }

std_msgs::msg::Header getRouteHeader() const
{
return planner_data_->route_handler->getRouteHeader();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "behavior_path_planner/scene_module/lane_change/interface.hpp"

#include "behavior_path_planner/module_status.hpp"
#include "behavior_path_planner/scene_module/scene_module_visitor.hpp"
#include "behavior_path_planner/utils/lane_change/utils.hpp"
#include "behavior_path_planner/utils/path_utils.hpp"
Expand Down Expand Up @@ -97,7 +98,8 @@ ModuleStatus LaneChangeInterface::updateState()
}

if (module_type_->isCancelConditionSatisfied()) {
current_state_ = ModuleStatus::FAILURE;
current_state_ =
module_type_->isCancelEnabled() ? ModuleStatus::FAILURE : ModuleStatus::RUNNING;
return current_state_;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,6 @@ bool NormalLaneChange::isCancelConditionSatisfied()
{
current_lane_change_state_ = LaneChangeStates::Normal;

if (!lane_change_parameters_->enable_cancel_lane_change) {
return false;
}

Pose ego_pose_before_collision;
const auto is_path_safe = isApprovedPathSafe(ego_pose_before_collision);

Expand Down

0 comments on commit 198b2ee

Please sign in to comment.