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

ROS2 Python launch files

asked 2021-02-22 07:17:27 -0600

NotARobot gravatar image

updated 2021-02-22 07:18:26 -0600

Greetings. Since ROS2 allows for launch files written in Python I would like to ask if there is a usable/proper documentation available for such files (possible commands, their definition and so on)?

I am hard pressed to find even the syntax for more advanced use cases as the generic ones of the tutorials. Almost all examples are written in XML, however I imagine the things written in XML are also possible in Python.

Such as the usage of a launch file inside of another launch file, the search for ROS2 packages in the workspace, etc.

Unfortunately, the documentation on github is not really extensive enough to use the Python launch system properly. Is there maybe a comparison between the XML commands and the Python commands?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
4

answered 2021-02-22 10:14:55 -0600

vinny gravatar image

I agree, this was confusing for me when I made the transition previously.

I think the ros2_cookbook might help you in:

  • including other launch files
  • getting the share directory of the workspace

https://github.com/mikeferguson/ros2_...

edit flag offensive delete link more

Comments

Thank you! That is the information I was searching for.

NotARobot gravatar image NotARobot  ( 2021-02-23 02:11:58 -0600 )edit
2

answered 2022-01-19 07:01:50 -0600

Raza Rizvi gravatar image

The most extensive documentation can be found here

For a few examples, you can see:

Example with event handler Python launch node

Another example

Launch files for large projects

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2021-02-22 07:17:27 -0600

Seen: 623 times

Last updated: Jan 19 '22