当前位置:网站首页>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
边栏推荐
- Redis-Redis在Jedis中的使用
- When Xcode writes swiftui code, it is a small trap that compiles successfully but causes the preview to crash
- 九、uni-popup用法 下拉框底部弹窗效果
- OKR and grad
- How to make the characters in the photos laugh? HMS core video editing service one click smile function makes people smile more naturally
- Multi merchant mall system function disassembly lecture 17 - platform side order list
- Installing MySQL on Linux
- 多商户商城系统功能拆解17讲-平台端订单列表
- Swiftui layout - size (bottom)
- [thread safety] what risks may multithreading bring?
猜你喜欢

企鹅一面:为什么不建议使用SELECT * ?

ScottPlot入门教程:获取和显示鼠标处的数值

如何让照片中的人物笑起来?HMS Core视频编辑服务一键微笑功能,让人物笑容更自然

C语言实现简单学生成绩管理系统的方法

2022 safety officer-a certificate operation certificate examination question bank simulated examination platform operation

Introduction to MITK
C# 获取当前路径7种方法

Cv:: mat conversion to qimage error

C语言库函数getchar()怎么使用

复制excel行到指定行
随机推荐
十、时间戳
Namespace conflict problem
为自定义属性包装类型添加类 @Published 的能力
Swiftui layout - size (top)
如何让照片中的人物笑起来?HMS Core视频编辑服务一键微笑功能,让人物笑容更自然
SwiftUI 布局 —— 尺寸( 下 )
Digital transformation security issues occur frequently, and Shanshi Netcom helps build a digital government
Redis-Redis在Jedis中的使用
SwiftUI 的动画机制
Four basic data types
BGP experiment
When Xcode writes swiftui code, it is a small trap that compiles successfully but causes the preview to crash
树莓派基础 | 总结记录树莓派学习过程中的一些操作
Excel VBA 免密查看VBE加密代码
@Solution to DS ('slave') multi data source compatible transaction problem
(function(global,factory){
多商户商城系统功能拆解17讲-平台端订单列表
C language program: judging triangles
Why can the anonymous functions of JQ access the methods inside
Added the ability of class @published for @cloudstorage