ROS node management: launch file operation process

launch file (ros node management)

The launch file is in xml format, and multiple functional nodes can be launched at one time.

Take the keyboard to control the movement of the little turtle as an example to explain the implementation steps in detail:

(1) Create a new function package in the src file, name it launch01, and add dependencies turtlesim rospy roscpp std_msgs

(2) Create a new file in the function package, generally named launch

(3) Create a new file with the suffix .launch in the launch folder, here named startturtle.launch

(4) Edit the content of the .launch file: the root tag <launch>, and the child tags are the node names that need to be started together

insert image description here

(5) source to refresh the environment variables, use the command: roslaunch function package name.launch file name to execute the file

  The launch file packs the turtle gui interface node and the turtle keyboard control node. After running, the turtle can be directly controlled by the keyboard to move

Guess you like

Origin blog.csdn.net/weixin_45205599/article/details/129164921
Recommended