当前位置:网站首页>ROS Basics - use the launch file (I) - start multiple ROS nodes in batch
ROS Basics - use the launch file (I) - start multiple ROS nodes in batch
2022-06-11 03:02:00 【NiuniuAndAdu】
ROS Basics - Use launch file ( One ) - Batch launch multiple ROS node
This paper mainly introduces launch Basic use of documents , The details of the launch Document format description and Pass on ROS Parameters param Methods , See : https://aduandniuniu.blog.csdn.net/article/details/125181523?spm=1001.2014.3001.5502
roslaunch The command can be used to start the definition in launch( start-up ) Nodes in the file .
roslaunch The order in which nodes start is not guaranteed , Because it is impossible to know from the outside when to initialize the node completely , Therefore, all the startup code must be able to start in any order ..
Command format :
roslaunch [package] [filename.launch]
1、 newly build ROS engineering
$ mkdir -p ~/launchExample/src
$ cd ~/launchExample/src
$ catkin_init_workspace // Initialize workspace
$ catkin_create_pkg launchTest1 roscpp // establish ROS Project package (pachage)
$ catkin_create_pkg launchTest2 roscpp // establish ROS Project package (pachage)
$ mkdir launch // establish .launch File storage directory
$ cd ~/launchExample/
$ catkin_make
2、 newly build test.launch file
newly build ~/launchExample/launch/test.launch file , The contents are as follows :
<launch>
<node pkg="launchTest1" type="launchTest1_node" name="launchTest1_node" output="screen" args="" />
<node pkg="launchTest2" type="launchTest1_node" name="launchTest2_node" output="screen" args="" />
</launch>
Be careful : Among them type Field , To match the , CMakelist.txt in add_executable designated ROS The procedure is consistent .
3 Write test code
3.1 newly build launchTest1 The test program
newly build ~/launchExample/launchTest1/main.cpp file , The contents are as follows :
void main()
{
printf(“Hello LaunchTest1”);
}
3.2 newly build launchTest2 The test program
newly build ~/launchExample/launchTest2/main.cpp file , The contents are as follows :
void main()
{
printf(“Hello LaunchTest2”);
}
$ cd ~/launchExample/
$ catkin_make
$ source devel/setup.bash // Set up the operating environment
4、roslaunch Command to start ROS node
4.1 Starting method 1
roslaunch test.launch // Don't specify ROS Package path
4.2 Starting method 2
catkin_create_pkg launchStart roscpp // establish ROS Project package (pachage)
cp ~/launchExample/launch/test.launch ~/launchExample/launchStart/
roslaunch launchStart test.launch // Appoint ROS Package path
5 launch File format - Example 1
<launch>
<node pkg="turtlesim" name="sim1" type="turtlesim_node"/>
<node pkg="turtlesim" name="sim2" type="turtlesim_node"/>
</launch>
<launch>
<group ns="turtlesim1">
<node pkg="turtlesim" name="sim" type="turtlesim_node"/>
</group>
<group ns="turtlesim2">
<node pkg="turtlesim" name="sim" type="turtlesim_node"/>
</group>
<node pkg="turtlesim" name="mimic" type="mimic">
<remap from="input" to="turtlesim1/turtle1"/>
<remap from="output" to="turtlesim2/turtle1"/>
</node>
</launch>
边栏推荐
- List filtering, sorting, verification and other processing methods
- How to handle error code 30204-44 when installing office 2016 in win10?
- 近期学习和更新计划
- [resolved] how to fix another update in progress WordPress upgrade error
- 第七章 常用的协议简介(1)
- Three special data types, day3 and redis (geographic location, cardinality statistics and bitmap scene usage)
- Prophet
- Recent learning and update plan
- Go语言之Go 快速入门篇(一):第一个 Go 程序
- 20220610 Friday
猜你喜欢

Application of the remote acquisition IOT gateway of the Bashir trough flowmeter in open channel flow monitoring

If you understand the logic of mining and carbon neutrality, you will understand the 100 billion market of driverless mining areas

Can Xiaoxiang life become the "Yonghui" in the discount industry after the completion of the round a financing of tens of millions of yuan?

JS memory leak

HUST软件工程(实验2)--TDD测试驱动开发实验。

巴歇尔槽流量计远程采集物联网关在明渠流量监测的应用

CocosCreator原生二次开发的正确姿势

Log4j:error category option "1" not a decimal integer

B_QuRT_User_Guide(17)

怎样简洁明了地说清楚产品需求?
随机推荐
DNS Optimization Practice of APP network optimization
Shell 按行读取文件
CPT 102_ LEC 16
【长时间序列预测】Aotoformer 代码详解之[3]模型整体架构分析
The two request sessionids of the same user are inconsistent ----- record the problem
File file = new File(“test.txt“)文件路径
最长递增子序列
Problems with JDBC tool classes
[new open source project] dynamic configuration task scheduling framework gobrs async joins the dromara open source community
Helm deploy traifik ingress
Flink开发环境搭建及WordCount
GraphAcademy 課程講解:《Neo4j 圖數據科學基礎》
怎样确保消息的可靠性投递?
Wechat template message errCode ": 40165," errmsg ":" invalid web pagepath
How to fix syntax errors in WordPress websites
Go language advantages and learning Roadmap
HUST软件工程(实验2)--TDD测试驱动开发实验。
AOSP - Developer mode is enabled by default
巴歇尔槽流量计远程采集物联网关在明渠流量监测的应用
基于互联网架构演进, 构建秒杀系统