完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
Launch文件:通过XML文件实现多节点的配置和启动(可自动启动ROS Master)
Launch文件语法 < l a u n c h > launch文件中的根元素采用< < < n o d e > pkg:节点所在的功能包名称 type:节点的可执行文件名称 name:节点运行时的名称 output, respawn, required, ns, args 参数设置 < p a r a m > / < r o s p a r a m > 设置ROS系统运行中的参数,存储在参数服务器中。 name:参数名 value:参数值 加载参数文件中的多个参数: < a r g > launch文件内部的局部变量,仅限于launch文件使用 name:参数名 value:参数值 调用: < r e m a p > 重映射ROS计算图资源的命名。 from:原命名 to:映射之后的命名 < i n c l u d e > 包含其他launch文件,类似C语言中的头文件包含。 file:包含的其他launch文件路径 更多标签可参见:http://wiki.ros.org/roslaunch/XML 实验 创建功能包 cd ~/catkin_workspace/src catkin_create_pkg learning_launch cd learning_launch mkdir launch 例子 simple.launch nano ~/catkin_workspace/src/learning_launch/launch/simple.launch 编译并运行 cd ~/catkin_workspace catkin_make # 新建一个终端 source ~/catkin_workspace/devel/setup.bash roslaunch learning_launch simple.launch turtlesim_parameter_config.launch nano ~/catkin_workspace/src/learning_launch/launch/turtlesim_parameter_config.launch mkdir ~/catkin_workspace/src/learning_launch/config nano ~/catkin_workspace/src/learning_launch/config/param.yaml A: 123 B: "hello" group: C: 456 D: "hello" 编译并运行 cd ~/catkin_workspace catkin_make # 新建一个终端 source ~/catkin_workspace/devel/setup.bash roslaunch learning_launch turtlesim_parameter_config.launch start_tf_demo_c++.launch nano ~/catkin_workspace/src/learning_launch/launch/start_tf_demo_c++.launch 编译并运行 cd ~/catkin_workspace catkin_make # 新建一个终端 source ~/catkin_workspace/devel/setup.bash roslaunch learning_launch start_tf_demo_c++.launch start_tf_demo_py.launch nano ~/catkin_workspace/src/learning_launch/launch/start_tf_demo_py.launch 编译并运行 cd ~/catkin_workspace catkin_make # 新建一个终端 source ~/catkin_workspace/devel/setup.bash roslaunch learning_launch start_tf_demo_py.launch turtlesim_remap.launch nano ~/catkin_workspace/src/learning_launch/launch/turtlesim_remap.launch 编译并运行 cd ~/catkin_workspace catkin_make # 新建一个终端 source ~/catkin_workspace/devel/setup.bash roslaunch learning_launch turtlesim_remap.launch # 新建一个终端 source ~/catkin_workspace/devel/setup.bash rqt_graph rostopic list rostopic pub /cmd_vel geometry_msgs/Twist "linear: x: 1.0 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.0" # 新建一个终端 source ~/catkin_workspace/devel/setup.bash rqt_graph |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
基于米尔瑞芯微RK3576核心板/开发板的人脸疲劳检测应用方案
1483 浏览 0 评论
1609 浏览 1 评论
1292 浏览 1 评论
2627 浏览 1 评论
3812 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-1-4 08:39 , Processed in 0.596633 second(s), Total 70, Slave 54 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (威廉希尔官方网站 图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号