From 8af2ec5736a3422cca03b3a8e16db512fe03e7d2 Mon Sep 17 00:00:00 2001 From: TetsuKawa Date: Sun, 19 Jan 2025 11:17:44 +0900 Subject: [PATCH 1/2] feat: add election status msg Signed-off-by: TetsuKawa --- tier4_system_msgs/CMakeLists.txt | 1 + tier4_system_msgs/msg/ElectionStatus.msg | 26 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 tier4_system_msgs/msg/ElectionStatus.msg diff --git a/tier4_system_msgs/CMakeLists.txt b/tier4_system_msgs/CMakeLists.txt index 9cce43e..2017a87 100644 --- a/tier4_system_msgs/CMakeLists.txt +++ b/tier4_system_msgs/CMakeLists.txt @@ -28,6 +28,7 @@ rosidl_generate_interfaces(${PROJECT_NAME} "msg/DiagLinkStruct.msg" "msg/DiagLinkStatus.msg" "msg/OperationModeAvailability.msg" + "msg/ElectionStatus.msg" "msg/EmergencyGoalsClearCommand.msg" "msg/EmergencyGoalsStamped.msg" "msg/EmergencyHoldingState.msg" diff --git a/tier4_system_msgs/msg/ElectionStatus.msg b/tier4_system_msgs/msg/ElectionStatus.msg new file mode 100644 index 0000000..037f296 --- /dev/null +++ b/tier4_system_msgs/msg/ElectionStatus.msg @@ -0,0 +1,26 @@ +# leader_id +uint8 MAIN_ECU = 0 +uint8 SUB_ECU = 1 +uint8 MAIN_VCU = 2 +uint8 SUB_VCU = 3 + +# path_info +# The path_info is a 4-bit data which represents the selected path, +# The bits represent the state of the Main ECU, Sub ECU, Main VCU, and Sub VCU in order from the leading bit. +# For example: +# If path_info=0x1010, +# the path selects the Main ECU and Main VCU. + +builtin_interfaces/Time stamp +uint8 leader_id # leader of all nodes +uint8 path_info # The path used for driving +tier4_system_msgs/MrmState mrm_state # The mrm behavior determined for the entire system and its state +uint8 election_start_count # means the number of times a failure has occurred. +bool in_election # whether an election is in progress +bool has_received_availability # If false, it means that the Availability UDP packet from Autoware has not been received or has timed out. +bool has_received_mrm_state # If false, it means that the MrmState UDP packet from Autoware has not been received or has timed out. +bool is_autoware_emergency # whether Autoware is in a normal state +bool is_main_ecu_connected # whether this node is able to communicate properly with the Main ECU +bool is_sub_ecu_connected # whether this node is able to communicate properly with the Sub ECU +bool is_main_vcu_connected # whether this node is able to communicate properly with the Main VCU +bool is_sub_vcu_connected # whether this node is able to communicate properly with the Sub VCU From 4e0feb1a8227b9050edb244dc63e400c5e57a00e Mon Sep 17 00:00:00 2001 From: TetsuKawa Date: Sun, 19 Jan 2025 13:47:45 +0900 Subject: [PATCH 2/2] feat: change msg type to autoware_adapi_v1_msgs Signed-off-by: TetsuKawa --- tier4_system_msgs/CMakeLists.txt | 1 + tier4_system_msgs/msg/ElectionStatus.msg | 2 +- tier4_system_msgs/package.xml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tier4_system_msgs/CMakeLists.txt b/tier4_system_msgs/CMakeLists.txt index 2017a87..722d591 100644 --- a/tier4_system_msgs/CMakeLists.txt +++ b/tier4_system_msgs/CMakeLists.txt @@ -43,6 +43,7 @@ rosidl_generate_interfaces(${PROJECT_NAME} "srv/ChangeOperationMode.srv" "srv/ChangeAutowareControl.srv" DEPENDENCIES + autoware_adapi_v1_msgs autoware_common_msgs builtin_interfaces diagnostic_msgs diff --git a/tier4_system_msgs/msg/ElectionStatus.msg b/tier4_system_msgs/msg/ElectionStatus.msg index 037f296..5a7d93b 100644 --- a/tier4_system_msgs/msg/ElectionStatus.msg +++ b/tier4_system_msgs/msg/ElectionStatus.msg @@ -14,7 +14,7 @@ uint8 SUB_VCU = 3 builtin_interfaces/Time stamp uint8 leader_id # leader of all nodes uint8 path_info # The path used for driving -tier4_system_msgs/MrmState mrm_state # The mrm behavior determined for the entire system and its state +autoware_adapi_v1_msgs/MrmState mrm_state # The mrm behavior determined for the entire system and its state uint8 election_start_count # means the number of times a failure has occurred. bool in_election # whether an election is in progress bool has_received_availability # If false, it means that the Availability UDP packet from Autoware has not been received or has timed out. diff --git a/tier4_system_msgs/package.xml b/tier4_system_msgs/package.xml index b8bffca..dc7d74b 100644 --- a/tier4_system_msgs/package.xml +++ b/tier4_system_msgs/package.xml @@ -11,6 +11,7 @@ rosidl_default_generators + autoware_adapi_v1_msgs autoware_common_msgs builtin_interfaces diagnostic_msgs