当前位置:网站首页>15、 Launch file label of ROS (I)
15、 Launch file label of ROS (I)
2022-07-28 14:53:00 【Rock magnon】
List of articles
1、launch File implementation steps
1. New function pack
- Be careful : Pay attention to joining launch The function package in the file depends on
2. Create... Under the function pack launch Folder
3. stay launch Create under folder launch file
<launch>
<node pkg="turtlesim" type="turtlesim_node" name="myturtle" output="screen" />
<node pkg="turtlesim" type="turtle_teleop_key" name="mykey" output="screen" />
</launch>
- pkg: Function pack
- type: The node name
- name: Self defined names
- output: Output location
4. call launch file
roslaunch Package name xxx.launch
- Be careful :roslaunch Command execution launch When you file , We will first judge whether it is started roscore, If it starts , Then the startup will not be repeated
2、launch Document labels
1.deprecated
- effect : Disclaimer , Tell the user that launch The file is out of date , And warn
- Be careful :launch It's a label , Other labels are launch Child labels of
- Code implementation :
<launch deprecated = " Disclaimer "> <!-- Disclaimer , Warnings will be given during operation --> <node pkg="turtlesim" type="turtlesim_node" name="myturtle" output="screen" /> <node pkg="turtlesim" type="turtle_teleop_key" name="mykey" output="screen" /> </launch> - Running results :
NODES / mykey (turtlesim/turtle_teleop_key) myturtle (turtlesim/turtlesim_node) WARNING: [/media/d102/EPAN/Desktop/code_study_ubuntu/rosdemo_05/src/launch_test_01/launch/turtle_start.launch] DEPRECATED: Disclaimer
2.node
- effect : Is used to specify the ROS node
- Be careful :roslaunch Commands do not guarantee that the corresponding nodes are started in the declared order , Because the startup of the node is multithreaded
- pkg=“ Package name ”
The package to which the node belongs - type=“nodeType”
Name of the node to start - name=“nodeName”
stay ROS The name of the node in the network topology - args=“xxx xxx xxx”( Optional )
Pass parameters to node , The parameters are separated by spaces - machine=“ machine name ”( Optional )
because ROS Distributed control ,machine Used to distinguish different machines - respawn=“true|false”( Optional )
If the node exits , Whether to restart automatically , When it comes to true when , It will restart automatically , Only kill the whole process (crtl+c), To exit the corresponding node - respawn_delay=“T”( Optional )
When respawn Set to true when , So delay T Restart in seconds - required=“true|false”( Optional )
Whether the node must , Set up as true, When the node exits , Will kill the whole launch - clear_params=“true|false”( Optional )
Before starting , Delete all parameters of the node's private space - output=“log|screen”( Optional )
Log sending destination , The default is log - ns=“xxx”( Optional )
Start the node in the specified namespace , Avoid duplicate names<launch deprecated = " Disclaimer "> <!-- Disclaimer , Warnings will be given during operation --> <node pkg="turtlesim" type="turtlesim_node" name="myturtle" output="screen" respawn="true" respawn_delay="10" ns="turtle"/> <node pkg="turtlesim" type="turtle_teleop_key" name="mykey" output="screen" /> </launch>
3.include
- effect : When completing a function , You may need to start many nodes , Some nodes may be associated , It needs to be started at the same time , At this time , You can quote what has been written launch file , Become functional package reuse
- Code implementation :
<launch> <include file="$(find launch_test_01)/launch/turtle_start.launch" /> <!-- Then add the nodes you need --> </launch>4.remap
- effect : Rename the topic name
- attribute :
- from=“xxx”: Original title
- to=“xxx”: Target topic name
- Example : adopt ROS Own keyboard node (/cmd_vel) Replace the keyboard control node of little turtle (/turtle1/cmd_vel) Control the movement of the little turtle
- Install the keyboard control package
sudo apt-get install ros-noetic-teleop-twist-keyboard- Start keyboard control node
rosrun teleop_twist_keyboard teleop_twist_keyboard.py- To write launch file
<launch deprecated = " Disclaimer "> <!-- Disclaimer , Warnings will be given during operation --> <node pkg="turtlesim" type="turtlesim_node" name="myturtle" output="screen" > <remap from="/turtle1/cmd_vel" to="/cmd_vel" /> </node> <node pkg="turtlesim" type="turtle_teleop_key" name="mykey" output="screen" /> </launch>- 4. start-up launch file
- Be careful : After starting , Little turtle's keyboard control node will no longer be available
边栏推荐
- Excel VBA password free view VBE encryption code
- The 35 required questions in MySQL interview are illustrated, which is too easy to understand
- SwiftUI 的动画机制
- BGP experiment
- It's so hot that solar power can't take off? Hello, head
- 基础架构之日志管理平台及钉钉&邮件告警通知
- Floating point data type in C language (did you learn to waste it)
- FormData对象的使用, var formdata=new FormData()
- Excel VBA 开发过程中遇到的一些问题,解决方案,持续更新
- Another way of understanding the essence of Hamming code
猜你喜欢

Cv:: mat conversion to qimage error

文件批量重命名工具Bulk Rename Utility

On July 29, apachecon | apachepulsar's exploration and practice in vivo will be broadcast soon

How to reduce the resolution of only 3D camera but not UI camera

Interviewer: what are the usage scenarios of ThreadLocal? How to avoid memory leakage?

SSH service

Raspberry pie foundation | summarize and record some operations in the learning process of raspberry pie

2022 melting welding and thermal cutting examination questions and online simulation examination

围绕新市民金融聚焦差异化产品设计、智能技术提效及素养教育
C# 读取ini文件、键值对操作
随机推荐
How to use the C language library function getchar ()
Multi merchant mall system function disassembly lecture 17 - platform side order list
How many ways can multithread run in sequence?
&0xffffffff(0x08)
The third pre class exercise
9、 Uni popup usage popup effect at the bottom of the drop-down box
Third class exercise
SwiftUI 布局 —— 尺寸( 上 )
Thoughts on the construction of some enterprise data platforms
2022 low voltage electrician examination questions and answers
How long can we "eat" the dividends of domestic databases?
[Tanabata] Tanabata lonely little frog research edition? The final chapter of Tanabata Festival!
unittest执行runTestCase提示<_io.TextIOWrapper name=‘<stderr>‘ mode=‘w‘ encoding=‘utf-8‘>解决方案
Product Manager
Log management platform of infrastructure and nail & email alarm notification
QT serialization qdatastream
8、 Picker usage drop-down box selection effect
SSH service
Penguin side: why not recommend using select *?
linux安装redis