第六弹 ROS命令行工具
作者:互联网
1. 常用的命令
- rostopic
- rosservice
- rosnode
- rosprogram
- rosmsg
- rossrv
2.探索小海龟移动的秘密
2.1 运行小海龟
https://blog.csdn.net/qinqinxiansheng/article/details/106460180
建议手敲下面代码,不要直接复制
roscore
rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key
2.2 分析ROS原理
2.2.1 rqt_graph
rqt_graph:基于QT可视化,用来查看计算图。
2.2.2 rosnode 与 rostopic
rosnode 按下回车会提示后面可以接哪些东西
rosnode ping # test connectivity to node
rosnode list # list active nodes
rosnode info # print information about node
rosnode machine # list nodes running on a particular machine or list machines
rosnode kill # kill a running node
rosnode cleanup # purge registration information of unreachable nodes
rostopic
rostopic bw # display bandwidth used by topic
rostopic delay # display delay of topic from timestamp in header
rostopic echo # print messages to screen
rostopic find # find topics by type
rostopic hz # display publishing rate of topic
rostopic info # print information about active topic
rostopic list # list active topics
rostopic pub # publish data to topic
rostopic type # print topic or field type
用键盘控制海龟的移动
发布指令停止键: Ctrl + C
可以同时修改线速度和角速度。
2.2.3 rosmsg
rosmsg show Show message description
rosmsg info Alias for rosmsg show
rosmsg list List all messages
rosmsg md5 Display message md5sum
rosmsg package List messages in a package
rosmsg packages List packages that contain messages
2.2.4 rosservice
rosservice
Commands:
rosservice args print service arguments
rosservice call call the service with the provided args
rosservice find find services by service type
rosservice info print information about service
rosservice list list active services
rosservice type print service type
rosservice uri print service ROSRPC uri
2.2.5 话题记录与复现
rosbag record -a -O cmd_record #话题的记录
默认直接保存在终端所在的目录下:
用数据包来复现刚刚录制的指令:
重启小乌龟,三个终端那个。再开启一个终端:
rosbag play cmd_record.bag #复现保存的数据包
标签:rosnode,第六,list,rosservice,rostopic,命令行,print,ROS,rosmsg 来源: https://blog.csdn.net/txr152111/article/details/119110945