rostopic 命令

NEW 1

$ roscore

NEW 2

$ rosrun turtlesim turtlesim_node

NEW 3

$ rosrun turtlesim turtle_teleop_key

 

NEW 4

$ sudo apt-get install ros-indigo-rqt  #安装rqt,这个貌似是一个节点管理器

$ sudo sudo apt-get install ros-indigo-rqt-common-plugins

$ rosrun rqt_graph rqt_graph  #节点工作示意图,一个工具

/teleop_turtle 控制节点

/turtlesim 显示节点

/turtle1/cmd_vel 话题

 

NEW 5

$ rostopic list -v  #显示所有在系统中活动的话题

$ rostopic  type /turtle1/cmd_vel  #话题的类型是由发布在它上面的消息类型决定的,rostopic可以查看消息类型

  geometry_msgs/Twist

$ rosmsg show geometry_msgs/Twist  #We can look at the details(或者说格式) of the message using rosmsg

  geometry_msgs/Vector3 linear

  float64 x

  float64 y

  float64 z

  geometry_msgs/Vector3 angular

  float64 x

  float64 y

  float64 z

$ rostopic  echo /turtle1/cmd_vel  #rostopic echo shows the data(或者说内容) published on a topic.

  linear:

  x: 2.0

  y: 0.0

  z: 0.0

  angular:

  x: 0.0

  y: 0.0

  z: 0.0

$ rostopic pub -1 /turtle1/cmd_vel geometry_msgs/Twist -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, 1.8]'  #发送一个Massage 到一个话题中,感觉像偷用,或者说中途截断

                        # -1 This option (dash-one) causes rostopic to only publish one message then exit

                        # -r 1 循环发送Massage

$ rostopic hz /turtle1/pose  #循环现实乌龟的位置信息,pose怎么来的?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值