Writing a launch file to publish TFs and visualize the robot
The my_robot_description
package is finished, but we will add a launch file so we can start all the nodes and parameters that we discovered at the beginning of this chapter. This way, we can publish TFs and visualize the robot in RViz. This will also be a good practice exercise on launch files, and we will reuse part of the code in the next chapter when we build the Gazebo simulation for the robot.
Note
Usually, we add all launch files inside a _bringup
package (dedicated package used for launch and configuration files). Here, we make an exception, because this launch file will be used only for visualization and development. Any other launch file that we write for this application will be placed inside the my_robot_bringup
package (which we will create in the next chapter).
We will write the launch file first with XML, and then with Python. This will be another example of how XML launch files can be easier to write...