Skip to content

Commit

Permalink
feat: componentize-mrm-handler (autowarefoundation#7018)
Browse files Browse the repository at this point in the history
Signed-off-by: TetsuKawa <[email protected]>
  • Loading branch information
TetsuKawa authored and karishma1911 committed Jun 3, 2024
1 parent 2e07ce2 commit f92ee8c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 37 deletions.
9 changes: 7 additions & 2 deletions system/mrm_handler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ project(mrm_handler)
find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_executable(mrm_handler
src/mrm_handler/mrm_handler_node.cpp
ament_auto_add_library(${PROJECT_NAME} SHARED
src/mrm_handler/mrm_handler_core.cpp
)

rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "MrmHandler"
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 @@ -60,7 +60,7 @@ struct Param
class MrmHandler : public rclcpp::Node
{
public:
MrmHandler();
explicit MrmHandler(const rclcpp::NodeOptions & options);

private:
// type
Expand Down
2 changes: 1 addition & 1 deletion system/mrm_handler/launch/mrm_handler.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<arg name="config_file" default="$(find-pkg-share mrm_handler)/config/mrm_handler.param.yaml"/>

<!-- mrm_handler -->
<node pkg="mrm_handler" exec="mrm_handler" name="mrm_handler" output="screen">
<node pkg="mrm_handler" exec="mrm_handler_node" name="mrm_handler" output="screen">
<remap from="~/input/operation_mode_availability" to="$(var input_operation_mode_availability)"/>
<remap from="~/input/odometry" to="$(var input_odometry)"/>
<remap from="~/input/control_mode" to="$(var input_control_mode)"/>
Expand Down
1 change: 1 addition & 0 deletions system/mrm_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
5 changes: 4 additions & 1 deletion system/mrm_handler/src/mrm_handler/mrm_handler_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <string>
#include <utility>

MrmHandler::MrmHandler() : Node("mrm_handler")
MrmHandler::MrmHandler(const rclcpp::NodeOptions & options) : Node("mrm_handler", options)
{
// Parameter
param_.update_rate = declare_parameter<int>("update_rate", 10);
Expand Down Expand Up @@ -597,3 +597,6 @@ bool MrmHandler::isArrivedAtGoal()

return operation_mode_state_->mode == OperationModeState::STOP;
}

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(MrmHandler)
32 changes: 0 additions & 32 deletions system/mrm_handler/src/mrm_handler/mrm_handler_node.cpp

This file was deleted.

0 comments on commit f92ee8c

Please sign in to comment.