Skip to content

Commit

Permalink
feat: componentize-emergency-handler (#7017)
Browse files Browse the repository at this point in the history
* feat: componentize-emergency-handler

Signed-off-by: TetsuKawa <[email protected]>

* style(pre-commit): autofix

* feat: add an arg to the constructor

Signed-off-by: TetsuKawa <[email protected]>

* style(pre-commit): autofix

---------

Signed-off-by: TetsuKawa <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
TetsuKawa and pre-commit-ci[bot] authored May 17, 2024
1 parent 7da5afd commit db0017b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 37 deletions.
9 changes: 7 additions & 2 deletions system/emergency_handler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ project(emergency_handler)
find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_executable(emergency_handler
src/emergency_handler/emergency_handler_node.cpp
ament_auto_add_library(${PROJECT_NAME} SHARED
src/emergency_handler/emergency_handler_core.cpp
)

rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "EmergencyHandler"
EXECUTABLE ${PROJECT_NAME}_node
EXECUTOR MultiThreadedExecutor
)

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

private:
// Subscribers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<arg name="config_file" default="$(find-pkg-share emergency_handler)/config/emergency_handler.param.yaml"/>

<!-- emergency_handler -->
<node pkg="emergency_handler" exec="emergency_handler" name="emergency_handler" output="screen">
<node pkg="emergency_handler" exec="emergency_handler_node" name="emergency_handler" output="screen">
<remap from="~/input/hazard_status" to="$(var input_hazard_status)"/>
<remap from="~/input/prev_control_command" to="$(var input_prev_control_command)"/>
<remap from="~/input/odometry" to="$(var input_odometry)"/>
Expand Down
1 change: 1 addition & 0 deletions system/emergency_handler/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<depend>autoware_auto_vehicle_msgs</depend>
<depend>nav_msgs</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>std_msgs</depend>
<depend>std_srvs</depend>
<depend>tier4_system_msgs</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
#include <string>
#include <utility>

EmergencyHandler::EmergencyHandler() : Node("emergency_handler")
EmergencyHandler::EmergencyHandler(const rclcpp::NodeOptions & options)
: Node("emergency_handler", options)
{
// Parameter
param_.update_rate = declare_parameter<int>("update_rate");
Expand Down Expand Up @@ -459,3 +460,6 @@ bool EmergencyHandler::isStopped()

return false;
}

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(EmergencyHandler)

This file was deleted.

0 comments on commit db0017b

Please sign in to comment.