Skip to content

Instantly share code, notes, and snippets.

@peci1
Last active June 16, 2025 15:30
Show Gist options
  • Save peci1/52aea17faf5f7e33c8096b75dc9bcd2f to your computer and use it in GitHub Desktop.
Save peci1/52aea17faf5f7e33c8096b75dc9bcd2f to your computer and use it in GitHub Desktop.
ROS 2 migration pain points

Launch

  • Where the hell do I find complete docs for XML launch files?
  • use_sim_time hell (i.e. no support for global parameters)
  • $(dirname) is broken and unreliable (ros2/launch#618)
  • ugly testing for nonempty XML launch args ($(eval 'bool(\'$(var var_name)\')'))
  • in Python launch, launch_arguments of IncludeLaunchDescription ingest booleans as 'true'/'false', i.e. strings!
    • launch_arguments=[('use_sim_time', 'true'),]
    • and the error you get if you pass an actual boolean is super cumbersome
  • cannot use parameters which are lists of dicts or other non-trivial types (ros2/ros2#1380)
    • the error you get is difficult to understand
  • I haven't found any docs on writing custom launch actions (and it took me quite some time to get a little into it)
    • what's missing at minimum is a doc that would tell what are all the steps needed to register the action
      • setup.cfg, make and install as a Python package even if it's a C++ one otherwise, add the decorator...
  • No XSD schema for launch_ros with all its actions, only for launch base:
  • Setting <arg value> in an <include> will also overwrite the arg in the rest of the launch file (ros2/launch#620 (comment))
    • Workaround: wrap each <include> within its own <group>.
    • It is described in the migration guide, but its meaning is not really obvious to people who want to dive into ROS 2 without prior knowledge:
      • Available in ROS 1, included content was scoped. In ROS 2, itโ€™s not. Nest includes in group tags to scope them.

    • <param> doesn't support if="" (ros2/launch_ros#323)

rclpy

QoS

  • I haven't found any complete documentation about qos_overrides parameter. There are some bits and pieces, but e.g. no docs page explains to you that deadline is in nanoseconds.

CLI tools

  • ros2 topic hz is unusable because it is in Python and it deserializes all messages (https://discourse.ros.org/t/rmw-zenoh-binaries-for-rolling-jazzy-and-humble/41395/18)
  • tab completion of ros2 topic is much worse than ROS 1. Also, the pregenerated message content is incorrect and cannot be used as is
  • CLI tools silently ignore RMW_IMPLEMENTATION variable and only talk to the running daemon. So if you first launch something with one RMW and then want to run something else with another RMW, all CLI tools still silently use the first RMW. To solve that, call ros2 daemon stop.

package types

ros_gz

  • server can be launched as a composable node, but the client can't (need to use Executable)
  • topic bridges cannot be launched as composable nodes with the bridge specification passed as arg/parameter (only through YAML config)
    • there is no way how the YAML config of a bridge could be parametrized by world and robot name, which makes these configs practically useless (gazebosim/ros_gz#717)
  • topic bridges do not allow easy setting of QoS profiles (but that can be overcome by setting qos_overrides manually)
    • quite important for /clock bridge!
  • it is quite difficult to understand how changing a sensor frame_id works, because you have to use gz_frame_id, but that is an undocumented SDF element.
  • <export>ing Gazebo resource paths in package.xml no longer works

Components

  • component_container is single-threaded (it even runs its own load/unload callbacks on the single thread)! Use component_container_mt or component_container_isolated.
  • When component manager dies and respawns, no components are reloaded into it!!! ros2/launch_ros#361

Colcon

micro-ROS

bag files

rviz

@christophebedard
Copy link

christophebedard commented Apr 21, 2025

package types

  • what is a preferred package type for message-only packages? do they need to use ament_cmake? this is a quite common task, so it'd be great to have this documented

They do have to be CMake packages (and thus use ament_cmake). It's mentioned here: https://docs.ros.org/en/rolling/Tutorials/Beginner-Client-Libraries/Custom-ROS2-Interfaces.html#create-a-new-package

Note that it is, and can only be, a CMake package, but this doesnโ€™t restrict in which type of packages you can use your messages and services. You can create your own custom interfaces in a CMake package, and then use it in a C++ or Python node, which will be covered in the last section.

This might not be visible enough, though. Maybe we can make it a reST note.

@fujitatomoya
Copy link

component_container is single-threaded (it even rins its own load/unload callbacks on the single thread)! Use component_container_mt.

or component_container_isolated with single or multi threads?

@emersonknapp
Copy link

Great list!

Re: launch. I've been eyeing picking up ros2/launch#392 for the launch schema. Right now the design doc is close to the real thing but it's not actually a schema used by anything and may be out of date. We absolutely want a usable schema just like for package.xml that could be automatically validated against. Including a launch_ros extension. With that, we could autogenerate human-readable documentation - because as you said it's not very ergonomic to read XSD directly.

@fujitatomoya
Copy link

ros2 topic hz is unusable because it is in Python and it deserializes all messages (https://discourse.ros.org/t/rmw-zenoh-binaries-for-rolling-jazzy-and-humble/41395/18)

ros2/ros2cli#1005 addressed this already ๐Ÿ˜ƒ i am not sure how much it helps though... ๐Ÿ˜“

@Ryanf55
Copy link

Ryanf55 commented Apr 23, 2025

The biggest one was the switch from TCPROS to ROS 2 FastDDS on Jazzy has been extremely difficult to get performing well at the same system CPU load we had in ROS 1. SHM does not work out of the box.
ros2/ros2#1289

@peci1
Copy link
Author

peci1 commented Apr 25, 2025

package types

  • what is a preferred package type for message-only packages? do they need to use ament_cmake? this is a quite common task, so it'd be great to have this documented
    This might not be visible enough, though. Maybe we can make it a reST note.

@christophebedard Thanks for the link. Somehow I missed it. I think the current docs are okay. The only thing that might be missing is --message and --service arguments to ros2 pkg create. These might even check that the package type is ament_cmake.

or component_container_isolated with single or multi threads?

@fujitatomoya Thanks, I've added it as another option. It might actually be a better default because it doesn't need to specify the number of threads (in single-threaded mode). However, for things like Gazebo+bridge, _mt might be better to limit the number of threads to a reasonable number.

Re: launch. I've been eyeing picking up ros2/launch#392 for the launch schema.

@emersonknapp I'm 100% for this. That would be great.

ros2/ros2cli#1005 addressed this already ๐Ÿ˜ƒ i am not sure how much it helps though... ๐Ÿ˜“

@fujitatomoya Great, right on time :) Let's see how it performs in reality. We need to wait for the next sync...

The biggest one was the switch from TCPROS to ROS 2 FastDDS on Jazzy

@Ryanf55 Yes, we go right away with Zenoh to minimize the DDS hassle. I wouldn't mind if Zenoh became the default because it is literally the least-hassle option. Production environments can then be switched to a DDS of their liking tuned to the specific use-case.

@MoffKalast
Copy link

MoffKalast commented Apr 29, 2025

I'm not sure if one can make a PR for a gist, but I've compiled some additions if you would like to include any of them: https://gist.github.com/MoffKalast/8141e90841d57174571e6f4902b67378/revisions

@christophebedard
Copy link

@peci1 would you be willing to move this list into a high-level issue on https://github.com/ros2/ros2? It would be a bit easier to add items to the list. Then we can discuss there, create concrete issues, and link them back to the high-level issue.

@peci1
Copy link
Author

peci1 commented May 2, 2025

Thanks for the comments, @MoffKalast and @christophebedard .

The main purpose of this list is to put together issues our lab has faced during the migration. Other labs can create their own lists.

If ROS 2 maintainers want to create a meta bug for migration issues, I'd certainly put some of these issues there. But I'll leave creation of such issue to the maintainers.

@christophebedard
Copy link

If ROS 2 maintainers want to create a meta bug for migration issues, I'd certainly put some of these issues there. But I'll leave creation of such issue to the maintainers.

OK, sounds good. I think I'll create it and collect things from lists such as yours and then create concrete issues in the relevant repos from there.

@nbbrooks
Copy link

nbbrooks commented May 21, 2025

@christophebedard just a heads up that Martin filed an issue for

CLI tools silently ignore RMW_IMPLEMENTATION variable and only talk to the running daemon. So if you first launch something with one RMW and then want to run something else with another RMW, all CLI tools still silently use the first RMW. To solve that, call ros2 daemon stop.

here ros2/ros2cli#1009

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment