ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

Which ROS2 launch is preferable python or xml?

asked 2020-05-19 12:39:47 -0600

msmcconnell gravatar image

updated 2020-05-21 12:18:35 -0600

As of ROS2 Eloquent we can use xml or yaml for writing launch files. Previous versions of ROS2 used python with the roslaunch API. So my question is which of these methods is currently recommended or considered best practice?

I will be converting an existing ROS1 package to ROS2 Foxy and I need to decide how to update the launch structure. I'm leaning toward XML since that will make the conversion more straightforward, but if python files are now considered best practice I will follow the community standards.

Update from Answer: After reviewing the documentation based on the concerns with XML functionality pointed out by @stevemacenski, I have decided to stick with python until XML adds support for components as they are the recommended way to design nodes https://discourse.ros.org/t/ros-2-das....

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2020-05-19 12:47:09 -0600

On personal recommendations: Use the Python3 API. If you want to use lifecycle or components, the XML/YAML doesn't yet support them. It will only work for standard nodes and parameters.

Long term, I'd like to move to XML once those are complete with lifecycle / component nodes (if I don't get used to the python API before then). There are some nice things about the python3 API (e.g. its in _python_ which you can do whatever you want with before launching some set of things).

edit flag offensive delete link more

Comments

Do you happen to know where I can find the feature set of the XML vs Python? I don't see it explicitly defined in the feature set page https://index.ros.org/doc/ros2/Features/

msmcconnell gravatar image msmcconnell  ( 2020-05-19 13:19:43 -0600 )edit

Not sure on hand, my knowledge comes from the current status update from the ROSCon 2019 talk

stevemacenski gravatar image stevemacenski  ( 2020-05-19 14:35:48 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2020-05-19 12:39:47 -0600

Seen: 1,078 times

Last updated: May 21 '20