From 73cb81184072fca443e2838d3765dad6e2918068 Mon Sep 17 00:00:00 2001 From: Akihisa Nagata <54956813+asa-naki@users.noreply.github.com> Date: Thu, 28 Sep 2023 11:25:45 +0900 Subject: [PATCH] feat(system_error_monitor): manual modules (#793) * feat(rviz_plugin): console meter is too large on the Rviz with FHD display, isn't it? (#587) * feat(tier4_planning/vehicle_plugin): make plugins size scalable Signed-off-by: Takamasa Horibe * remove space Signed-off-by: Takamasa Horibe * scaling Signed-off-by: Takamasa Horibe * change diag message Signed-off-by: asa-naki * fix module name Signed-off-by: asa-naki * add manual module and ignoring modules Signed-off-by: asa-naki * Revert "feat(rviz_plugin): console meter is too large on the Rviz with FHD display, isn't it? (#587)" This reverts commit f96169c31cb6183d06797df86873f2d8d66c752a. * Revert "change diag message" This reverts commit dff01ce8dd3bee99db49c6972f766d6425e153c2. * ci(pre-commit): autofix * fix spell check Signed-off-by: asa-naki * Revert "fix spell check" This reverts commit 208aa1eb880e3ab4b3dab9a1584f3193b1fb3cca. * Revert "fix module name" This reverts commit cec76535bcbc51466236493d0dcfece424f2d169. * revert ignore module Signed-off-by: asa-naki * current_mode check update Signed-off-by: asa-naki * ci(pre-commit): autofix * delete margin Signed-off-by: asa-naki --------- Signed-off-by: Takamasa Horibe Signed-off-by: asa-naki Co-authored-by: Takamasa Horibe Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .../config/system_error_monitor.param.yaml | 9 +++++++++ ...system_error_monitor.planning_simulation.param.yaml | 10 ++++++++++ .../system_error_monitor/system_error_monitor_core.hpp | 1 + .../src/system_error_monitor_core.cpp | 6 ++++++ 4 files changed, 26 insertions(+) diff --git a/system/system_error_monitor/config/system_error_monitor.param.yaml b/system/system_error_monitor/config/system_error_monitor.param.yaml index 282c3b919867b..722eb943bc7d1 100644 --- a/system/system_error_monitor/config/system_error_monitor.param.yaml +++ b/system/system_error_monitor/config/system_error_monitor.param.yaml @@ -41,6 +41,15 @@ /autoware/vehicle/node_alive_monitoring: default + manual_control: + /autoware/control/control_command_gate/node_alive_monitoring: default + /autoware/control/autonomous_emergency_braking/performance_monitoring/emergency_stop: { sf_at: "none", lf_at: "warn", spf_at: "error", auto_recovery: "false"} + + /autoware/system/node_alive_monitoring: default + /autoware/system/emergency_stop_operation: default + + /autoware/vehicle/node_alive_monitoring: default + external_control: /autoware/control/control_command_gate/node_alive_monitoring: default /autoware/control/autonomous_emergency_braking/performance_monitoring/emergency_stop: { sf_at: "none", lf_at: "warn", spf_at: "error", auto_recovery: "false"} diff --git a/system/system_error_monitor/config/system_error_monitor.planning_simulation.param.yaml b/system/system_error_monitor/config/system_error_monitor.planning_simulation.param.yaml index 271555d1d1dc8..db71ffe5c0c90 100644 --- a/system/system_error_monitor/config/system_error_monitor.planning_simulation.param.yaml +++ b/system/system_error_monitor/config/system_error_monitor.planning_simulation.param.yaml @@ -41,6 +41,16 @@ /autoware/vehicle/node_alive_monitoring: default + manual_control: + /autoware/control/control_command_gate/node_alive_monitoring: default + /autoware/control/autonomous_emergency_braking/performance_monitoring/emergency_stop: { sf_at: "none", lf_at: "warn", spf_at: "error", auto_recovery: "false"} + /autoware/control/external_control/external_command_selector/node_alive_monitoring: default + + /autoware/system/node_alive_monitoring: default + /autoware/system/emergency_stop_operation: default + + /autoware/vehicle/node_alive_monitoring: default + external_control: /autoware/control/control_command_gate/node_alive_monitoring: default /autoware/control/autonomous_emergency_braking/performance_monitoring/emergency_stop: { sf_at: "none", lf_at: "warn", spf_at: "error", auto_recovery: "false"} diff --git a/system/system_error_monitor/include/system_error_monitor/system_error_monitor_core.hpp b/system/system_error_monitor/include/system_error_monitor/system_error_monitor_core.hpp index dc54b25d8e54b..a77462f9c8a30 100644 --- a/system/system_error_monitor/include/system_error_monitor/system_error_monitor_core.hpp +++ b/system/system_error_monitor/include/system_error_monitor/system_error_monitor_core.hpp @@ -56,6 +56,7 @@ struct KeyName { static constexpr const char * autonomous_driving = "autonomous_driving"; static constexpr const char * external_control = "external_control"; + static constexpr const char * manual_control = "manual_control"; }; class AutowareErrorMonitor : public rclcpp::Node diff --git a/system/system_error_monitor/src/system_error_monitor_core.cpp b/system/system_error_monitor/src/system_error_monitor_core.cpp index d6cc771e5dbd2..8db37d6d62488 100644 --- a/system/system_error_monitor/src/system_error_monitor_core.cpp +++ b/system/system_error_monitor/src/system_error_monitor_core.cpp @@ -232,6 +232,7 @@ AutowareErrorMonitor::AutowareErrorMonitor() loadRequiredModules(KeyName::autonomous_driving); loadRequiredModules(KeyName::external_control); + loadRequiredModules(KeyName::manual_control); using std::placeholders::_1; using std::placeholders::_2; @@ -460,6 +461,11 @@ void AutowareErrorMonitor::onTimer() current_mode_ = current_gate_mode_->data == tier4_control_msgs::msg::GateMode::AUTO ? KeyName::autonomous_driving : KeyName::external_control; + if ( + current_gate_mode_->data == tier4_control_msgs::msg::GateMode::AUTO && + control_mode_->mode == autoware_auto_vehicle_msgs::msg::ControlModeReport::MANUAL) { + current_mode_ = KeyName::manual_control; + } updateHazardStatus(); publishHazardStatus(hazard_status_);