这一部分不断更新自己学到Ros中的一些知识
图片来源——古月居ROS
ros操作指令
需要开三个终端 每个终端运行一个指令
打开第四个终端输入rqt_graph(可视化工具用来显示节点之间的关系)
输入rosnode后使用回车
rosnode is a command-line tool for printing information about ROS Nodes.
Commands:
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
Type rosnode <command> -h for more detailed usage, e.g. 'rosnode ping -h'
每个指令的作用大家可以用英文来看
输入rostopic
rostopic is a command-line tool for printing information about ROS Topics.
Commands:
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
Type rostopic <command> -h for more detailed usage, e.g. 'rostopic echo -h'
每个指令的作用也是如上图
通过 rostopic pub 来移动小海龟
输入rostopic pub /turtle1/cmd_vel 用tab补全
得到
rostopic pub /turtle1/cmd_vel geometry_msgs/Twist "linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0"
可以通过控制线速度和角速度来达到控制小海龟的目的
如下图通过控制线速度使得小海龟向右平移
输入rosmsg
rosmsg is a command-line tool for displaying information about ROS Message types.
Commands:
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
Type rosmsg <command> -h for more detailed usage
输入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
Type rosservice <command> -h for more detailed usage, e.g. 'rosservice call -h'