Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: componentize-system_error_monitor #7009

Merged
merged 6 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions system/system_error_monitor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ project(system_error_monitor)
find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_executable(${PROJECT_NAME}
src/system_error_monitor_node.cpp
ament_auto_add_library(${PROJECT_NAME} SHARED
src/system_error_monitor_core.cpp
)

rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "AutowareErrorMonitor"
EXECUTABLE ${PROJECT_NAME}_node)

ament_auto_package(INSTALL_TO_SHARE
launch
config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct KeyName
class AutowareErrorMonitor : public rclcpp::Node
{
public:
AutowareErrorMonitor();
explicit AutowareErrorMonitor(const rclcpp::NodeOptions & options);

private:
// Parameter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<arg name="emergency_hazard_level" default="2" description="1: Safe Fault, 2: Latent Fault, 3: Single Point Fault"/>

<node pkg="system_error_monitor" exec="system_error_monitor" name="system_error_monitor" output="screen">
<node pkg="system_error_monitor" exec="system_error_monitor_node" name="system_error_monitor" output="screen">
<remap from="input/diag_array" to="/diagnostics_agg"/>
<remap from="~/input/autoware_state" to="/autoware/state"/>
<remap from="~/input/current_gate_mode" to="/control/current_gate_mode"/>
Expand Down
1 change: 1 addition & 0 deletions system/system_error_monitor/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<depend>diagnostic_msgs</depend>
<depend>fmt</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>std_srvs</depend>
<depend>tier4_autoware_utils</depend>
<depend>tier4_control_msgs</depend>
Expand Down
7 changes: 5 additions & 2 deletions system/system_error_monitor/src/system_error_monitor_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ int isInNoFaultCondition(
}
} // namespace

AutowareErrorMonitor::AutowareErrorMonitor()
AutowareErrorMonitor::AutowareErrorMonitor(const rclcpp::NodeOptions & options)
: Node(
"system_error_monitor",
rclcpp::NodeOptions().automatically_declare_parameters_from_overrides(true)),
rclcpp::NodeOptions(options).automatically_declare_parameters_from_overrides(true)),
diag_array_stamp_(0, 0, this->get_clock()->get_clock_type()),
autoware_state_stamp_(0, 0, this->get_clock()->get_clock_type()),
current_gate_mode_stamp_(0, 0, this->get_clock()->get_clock_type()),
Expand Down Expand Up @@ -720,3 +720,6 @@ void AutowareErrorMonitor::loggingErrors(
logger_name, get_clock(), 5000, "[Single Point Fault]: " + hazard_diag.message);
}
}

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(AutowareErrorMonitor)
27 changes: 0 additions & 27 deletions system/system_error_monitor/src/system_error_monitor_node.cpp

This file was deleted.

Loading