[ROS 2] Components Launch file

asked 2019-08-15 12:31:43 -0600

zipp39 gravatar image

Platform: Windows 10 ROS 2 version: Dashing Patch release 1 Hi all, in the recent ROS 2 Dashing release it is mentioned that components are the proper way to write and handle ROS 2 nodes.

So following the minimal examples here launch

I wrote my launch file in the exact same way. However, I notice a lot of things I do not like about this launch file:

  1. Sometimes the component will freeze the terminal completely and will not allow me to exit out using 'ctrl + c'.
  2. Using ctrl + c to stop the component, it ignores it the first couple of times, and then finally exits with python scripting errors that I assume are a part of the ros2 launch code.

I was wondering if someone has found a better way to write component launch files, or maybe I am writing them wrong?

The goal is to be able to have a clean exit every time Ctrl + c or something like that is executed, similar to how ROS 1 worked.

Also I noticed that RCLCPP_INFO sometimes does not print to the terminal and only commands like std::flush(std::cout), or writing an std::cout printout will get them to appear. Sometimes the prints don't even show up if a bug occurs (which also causes a freezing state).

Please let me know if there are also any other references to documentation I can use to figure out ROS 2 components! It seems like nodes are a lot easier to write, even though Dashing prefers to use components.


edit retag flag offensive close merge delete


There were some issues with signal handling with launch, but I believe that they were resolved in https://github.com/ros2/launch/pull/294 as well as https://github.com/ros2/launch/pull/297. Those two PRs would be worth evaluating and determine if they resolve the ctrl-c issue.

mjcarroll gravatar image mjcarroll  ( 2019-08-29 10:04:24 -0600 )edit