How to write Launch file in ROS

Start node writing

<launch>
        <node pkg="learning" name="talker" type="talker" output="screen" respawn="true"/>
         <node pkg="learning" name="listener" type="listener" output="screen" respawn="true"/>
</launch>
  • Label usenode
  • The name of the function package where the node is locatedpkg ="learning"
  • The name of the node isname="talker"
  • I didn’t understand the type of node. The content is the same as the node name.type="talker"
  • Output to the screen, that is, print to the terminal where launch is currently runningoutput="screen"
  • If the process does not exist, start the processrespawn="true"

Start other luanch file writing

<launch>
        <include  file="$(find learning)/launch/learning.launch"/>
</launch>
  • Label asinclude
  • Find the function package where other launch files are located$(find learning)
  • The path of other launch files under the function package/launch/learning.launch

Guess you like

Origin blog.csdn.net/weixin_50303783/article/details/113887717