From 2cf3feea170e1c4798677e933d9b309c7de6c80b Mon Sep 17 00:00:00 2001 From: Makoto Kurihara Date: Wed, 10 Apr 2024 18:10:34 +0900 Subject: [PATCH] feat(mrm_handler): operate mrm only when autonomous operation mode Signed-off-by: Makoto Kurihara --- system/mrm_handler/src/mrm_handler/mrm_handler_core.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/system/mrm_handler/src/mrm_handler/mrm_handler_core.cpp b/system/mrm_handler/src/mrm_handler/mrm_handler_core.cpp index e8e692f755e2d..09376332656a4 100644 --- a/system/mrm_handler/src/mrm_handler/mrm_handler_core.cpp +++ b/system/mrm_handler/src/mrm_handler/mrm_handler_core.cpp @@ -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; }