As it stands, ros2_serial_bridge_main.cpp does way too much work. This means that the node is not composable with other nodes. What we should probably do here is:
Remove the signal_handler and the running variable; I don't think they serve a purpose anymore.
Move the get_parameter for write_sleep_ms into the constructor (or get rid of it completely).
Think about how to get rid of the rate loop; if we code it properly, we should just be able to call rclcpp::spin on the constructed node.
Add a dependency on rclcpp_components to the package.xml and CMakeLists.txt.
Add the RCLCPP_COMPONENTS_REGISTER_NODE macro to the end of ros2_to_serial_bridge.cpp.
Add launch files showing how to launch the node in both composable and non-composable modes.
As it stands, ros2_serial_bridge_main.cpp does way too much work. This means that the node is not composable with other nodes. What we should probably do here is:
signal_handler
and therunning
variable; I don't think they serve a purpose anymore.get_parameter
forwrite_sleep_ms
into the constructor (or get rid of it completely).rclcpp::spin
on the constructed node.rclcpp_components
to the package.xml and CMakeLists.txt.RCLCPP_COMPONENTS_REGISTER_NODE
macro to the end ofros2_to_serial_bridge.cpp
.