0
$\begingroup$

Rosanswers logo

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-dashing-diademata-released/9365.


Originally posted by msmcconnell on ROS Answers with karma: 268 on 2020-05-19

Post score: 3

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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).


Originally posted by stevemacenski with karma: 8272 on 2020-05-19

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by msmcconnell on 2020-05-19:
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/

Comment by stevemacenski on 2020-05-19:
Not sure on hand, my knowledge comes from the current status update from the ROSCon 2019 talk

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.