http://wiki.ros.org/ROS/Tutorials/UnderstandingTopics

  • rostopic
  • rqt_graph
  • rosmsg

rqt_graph

一个用于查看topic的sub/pub关系的node.

rostopic

获取与topic相关的信息

rostopic bw     display bandwidth used by topic
rostopic echo print messages to screen
rostopic hz display publishing rate of topic
rostopic list print information about active topics
rostopic pub publish data to topic
rostopic type print topic type

几种用法简介

rostopic echo [topic]
实际上就是subscribe了一个topic 当有向这个topic的消息发出时,打印出msg在屏幕上 rostopic list
输出当前的系统有哪些topic及publisher/sunscriber,如下
Published topics:
* /turtle1/color_sensor [turtlesim/Color] 1 publisher
* /turtle1/cmd_vel [geometry_msgs/Twist] 1 publisher
* /rosout [rosgraph_msgs/Log] 2 publishers
* /rosout_agg [rosgraph_msgs/Log] 1 publisher
* /turtle1/pose [turtlesim/Pose] 1 publisher Subscribed topics:
* /turtle1/cmd_vel [geometry_msgs/Twist] 1 subscriber
* /rosout [rosgraph_msgs/Log] 1 subscriber rostopic type [topic]
显示该topic的消息类型
rostopic type /turtle1/cmd_vel --> geometry_msgs/Twist rosmsg show [msgtype]
显示当前type的msg的具体信息
rosmsg show geometry_msgs/Twist,输出如下
geometry_msgs/Vector3 linear
float64 x
float64 y
float64 z
geometry_msgs/Vector3 angular
float64 x
float64 y
float64 z rostopic pub [topic] [msg_type] [args]
发送一个消息
rostopic pub -1 /turtle1/cmd_vel geometry_msgs/Twist -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, 1.8]'
-1代表发完就退出. --意思是其后面的内容不是option,不用解析.防止你的具体消息内容里带- rostopic pub /turtle1/cmd_vel geometry_msgs/Twist -r 1 -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, -1.8]'
-r 1的意思是每秒发1次 rostopic hz [topic]
查看某个topic的发送频率

rqt_plot

rqt_plot displays a scrolling time plot of the data published on topics. Here we'll use rqt_plot to plot the data being published on the /turtle1/pose topic.

ROS笔记 Topics的更多相关文章

  1. ROS 笔记

    ros的编程范式 - ros认为,linux平台下,机器人的软件由一个个小程序组成,这些小程序称为node,每个小程序负责一部分功能 - ros实现的框架就是,小程序的并发执行+相互通信,程序(进程) ...

  2. ROS笔记——创建简单的主题发布节点和主题订阅节点

    在安装好ROS后,接着学习如何创建节点和节点之间的通信方式,以一个简单的主题发布节点和主题订阅节点说明. 节点是连接ROS网络等可执行文件,是实现某些功能的软件包,也是一个主要计算执行的进程. 一.创 ...

  3. ROS笔记3 理解nodes

    http://wiki.ros.org/ROS/Tutorials/UnderstandingNodes 介绍几个命令行工具用法 roscore rosnode rosrun A node reall ...

  4. ROS笔记2 构建一个package

    构建package catkin_make 可以理解为一个集成了CMake和make的命令行工具 通常的cmake构建如下 # In a CMake project $ mkdir build $ c ...

  5. ROS笔记1 安装及创建一个ROS Package

    安装 跟着官方的安装指引来就行了.安装前要先确定自己的ros版本和ubuntu版本.这二者是一一对应的. http://wiki.ros.org/ROS/Installation 主要是package ...

  6. ROS 笔记 程序包/节点/topic

    官方教程: wiki.ros.org/cn/ROS/tutorials 程序包打创建于编译 创建程序包 在工作空间的src底下,输入如下命令: $ catkin_create_pkg 要创建的包名 依 ...

  7. ROS笔记一

    1.lwip:瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈.实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用. 2.RTOS:实时操作 ...

  8. ROS 101

    https://www.clearpathrobotics.com/blog/2014/01/how-to-guide-ros-101/ 什么是ROS ROS(robot operating syst ...

  9. Learning ROS for Robotics Programming Second Edition学习笔记(一) indigo v-rep

    中文译著已经出版,详情请参考:http://blog.csdn.net/ZhangRelay/article/category/6506865 Learning ROS for Robotics Pr ...

随机推荐

  1. php操作数组函数

    整理了一份PHP开发中数组操作大全,包含有数组操作的基本函数.数组的分段和填充.数组与栈.数组与列队.回调函数.排序.计算.其他的数组函数等. 一.数组操作的基本函数 数组的键名和值 array_va ...

  2. textarea--去掉空格的办法

    我在初次用到textarea多行文本框时,遇到的问题是:默认出现了两行空格,如图: 代码是(错误的写法): 最后才发现,原来是: textarea标签是需要写在同一行,不能换行,正确的写法:

  3. A_B_Good Bye 2018_cf

    A. New Year and the Christmas Ornament time limit per test 1 second memory limit per test 256 megaby ...

  4. linux学习:网络(防火墙)及系统安全相关命令学习

    指令: top.htop.free.pstree.lsof.ifconfig.w3m.tcpdump.netstat.nmap.ufw 网络: top    #查看内存,cpu,进程之间的状态.hto ...

  5. Java Fileupload

    fileupload FileUpload 是 Apache commons下面的一个子项目,用来实现Java环境下面的文件上传功能,与常见的SmartUpload齐名. 组件 1.FileUpLoa ...

  6. css与html基础收集

    1.css去掉iPhone.iPad默认按钮样式 nput[type="button"], input[type="submit"], input[type=& ...

  7. changXY

    changXY <!DOCTYPE html> <html> <head> <link rel="shortcut icon" href= ...

  8. js面向对象和php面向对象的区别

    ---恢复内容开始--- js的面向对象 1.类 具体相同的特征的一些对象的集合. 2.对象 具体到某一个失误了都可以叫做对象. 3.类  通过function 定义类  所以在js里类的本质是函数, ...

  9. linux 使用sh@d0ws0cks client

    Linux Centos7下安装使用Shadowsocks客户端,实现*** 准备 SS: 搭建一个可以连接外网的服务器 教程可见 自己动手搭梯子 服务器:本人用的腾讯云服务器,系统为Centos7 ...

  10. [Swift]LeetCode705. 设计哈希集合 | Design HashSet

    Design a HashSet without using any built-in hash table libraries. To be specific, your design should ...