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. pta-树种统计

    树种统计 (25 分) 随着卫星成像技术的应用,自然资源研究机构可以识别每一棵树的种类.请编写程序帮助研究人员统计每种树的数量,计算每种树占总数的百分比. 输入格式: 输入首先给出正整数N(≤10​5 ...

  2. Round #2

    题源:来自hzwer整理的题 2014-5-10 NOIP模拟赛 by coolyangzc Problem 1 机器人(robot.cpp/c/pas) [题目描述] 早苗入手了最新的Gundam模 ...

  3. 4.27Linux(5)

    2019-4-27 15:39:03 学了Linux好几天,发现Linux用着还是很爽 你一定要知道你要干啥!!!! 列一下参考博客: mysql博客地址:https://www.cnblogs.co ...

  4. ES6-个人学习大纲

    1,let   const学习补充 1.1,let的知识点: 01-作用域只限制在当前代码块内,代码块形式如下: { var str = '张三'; console.log(str); let str ...

  5. Java-JSON 解析

    JSON  JSON(JavaScript Object Notation, JS 对象简谱) 是一种轻量级的数据交换格式.它基于 ECMAScript (欧洲计算机协会制定的js规范)的一个子集,采 ...

  6. 接口自动化项目搭建(Java+testng+maven+git+springboot)

    自动化测试: https://www.bilibili.com/video/av31078661?from=search&seid=16551153777362561361 一工具准备 二 环 ...

  7. PHPWord导出word文档

    最近接了个把数据导出到word文档的需求,之前一直都是使用PHPExcel库导出excel的,还是头次接到导出到word文档的需求,我想既然有PHPExcel,那么肯定也会有PHPWord库吧,在网上 ...

  8. JAVA四类八种基本数据类型

    boolean类型 Boolean在内存中占用一个字节. 当java编译器把java源代码编译为字节码时,会用int或byte来表示boolean.在java虚拟机中,用整数零来表示false,用任意 ...

  9. Java开发快速上手

    Java开发快速上手 前言 1.我的大学 2.对初学者的建议 3.大牛的三大特点 4.与他人的差距 第一章 了解Java开发语言 前言 基础常识 1.1 什么是Java 1.1.1 跨平台性 1.2 ...

  10. [Swift]LeetCode466. 统计重复个数 | Count The Repetitions

    Define S = [s,n] as the string S which consists of n connected strings s. For example, ["abc&qu ...