While migrating a large project from Noetic, I struggled with debugging the converted launch files. The many config files and nested included launch files made it difficult to debug when things didn’t work. The interleaved output did not help in tracking down problems.
It seems like the ROS 2 launch introspection support is not fully fleshed out yet so the -p option to ros2 launch for printing out the launch description wasn’t very helpful in my case. My search for tools like rosmon for ROS 2 didn’t produce much which left me little choice but to put together some tools so I could better understand what was happening while launching my system.
The result is this package that adds a gui option to the ros2 launch command.
By cloning the package into your workspace and building it, you’ll gain a -g option to ros2 launch that will display the launch description as a tree and show the output of each process in a separate tab in a window.
It’s still a proof of concept since it hasn’t been tested much, but I hope this can become the start of a nice optional tool to help understand what’s happening with the launch process.
Many features are missing and I initially started with tk thinking that it would reduce the amount of dependencies. On second thought, I probably should have used QT to allows an rqt plugin to be easily developed from this. I did design the core to be agnostic to the UI framework choice.
On the topic of alternative UI choices, I am thinking of a web based option for running on a robot without a display. Pointing a browser at the robot could be a useful launch debugging tool.
Other ideas I have are to replicate the rosmon abilities of stopping and restarting processes. Also having lifecycle management tools could be useful I think.
I think it would be useful to know what you expected to get out of the ros2 launch --print option, what you actually got, and what’s missing or incomplete. This could be done in a new issue on ros2/launch.
Yes, I should open an issue with more details, but to summarize, when launching a top level launch file with includes, only the structure of top level file is displayed without the full description that would result from an actual launch.
Also, most of the entities are displayed using the default python object representation <type object at 0x1234567> instead of a more useful representation.
It does look like the code has stubs for better describing the launch description, but that part might still be a work in progress. When I first started looking into the launch source, I wasn’t sure how it was all meant to work so I didn’t try to fix the launch code directly yet. I instead started writing this package to to help me accomplish multiple goals, one being a better descriptions while introspecting.
Once I’m more comfortable with how the launch system all works, I would like to move the describe code I have here into launch and launch_ros to keep this package leaner.
Did you source the workspace’s setup file after building? It’s the only thing I can think of at the moment. Also, which ROS 2 version are you using? I have only tested with Jazzy and Rolling.
Edit: On second thought, I see that it’s looking for the package so the ros2 launch cli seems to know about it. I’ll investigate in a clean workspace in case it’s something that didn’t make it to the repo.
I just pushed an update where I updated some init.py files. This might solve @thejeeb’s issue, but I can’t reproduce the problem so this is only a guess. I wonder if it’s a python version issue. I’m on Ubuntu 24.04 running python 3.12.3.
Also, I had pushed a new version the other day with a qt based interface, which is what I’ll use moving forward.
Hi, I am using Humble and had a similar problem with another module, error message is: “Failed to load entry point ‘gui’: No module named ‘launch.some_entities_type’”.
So I guess this module is new for Jazzy.