Skip to content

Commit

Permalink
feat(mrm_handler): operate mrm only when autonomous operation mode
Browse files Browse the repository at this point in the history
Signed-off-by: Makoto Kurihara <[email protected]>
  • Loading branch information
mkuri committed Apr 10, 2024
1 parent 7503f42 commit 2cf3fee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions system/mrm_handler/src/mrm_handler/mrm_handler_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,12 +450,14 @@ void MrmHandler::updateMrmState()
const bool is_emergency = isEmergency();

// Get mode
const bool is_auto_mode = control_mode_->mode == ControlModeReport::AUTONOMOUS;
const bool is_vehicle_auto_mode = control_mode_->mode == ControlModeReport::AUTONOMOUS;
const bool is_operation_mode_auto_mode = operation_mode_state_->mode ==
autoware_adapi_v1_msgs::msg::OperationModeState::AUTONOMOUS;

// State Machine
if (mrm_state_.state == MrmState::NORMAL) {
// NORMAL
if (is_auto_mode && is_emergency) {
if (is_vehicle_auto_mode && is_operation_mode_auto_mode && is_emergency) {
transitionTo(MrmState::MRM_OPERATING);
return;
}
Expand Down

0 comments on commit 2cf3fee

Please sign in to comment.