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. TS+React+Redux 使用之搭建环境

    使用 create-react-app 构建 1.全局安装create-react-app npm install -g create-react-app 2.创建一个项目 create-react- ...

  2. ES6的Module 的用法

    在vue-cli中遇到的模糊参考 https://www.cnblogs.com/ppJuan/p/7151000.html 解决问题: 在 ES6 之前,社区制定了一些模块加载方案,最主要的有 Co ...

  3. windows 10 64位机器上 安装部署

    mi这个博客写的不错 https://www.cnblogs.com/dingguofeng/p/8709476.html 安装redis 可视化工具后 ,新建连接 名称随意,注意端口号是否有误默认6 ...

  4. firefox中遇到的offsetX的问题

    项目中遇到一个问题,滚轮缩放或鼠标移动svg的时候,当鼠标放置在svg元素上时,firefox浏览器中的offsetX和offsetY是不准确的,导致缩放和移动会产生便宜,其实问题不是firefox计 ...

  5. [Swift]LeetCode37. 解数独 | Sudoku Solver

    Write a program to solve a Sudoku puzzle by filling the empty cells. A sudoku solution must satisfy  ...

  6. [Swift]LeetCode267.回文全排列 II $ Palindrome Permutation II

    Given a string s, return all the palindromic permutations (without duplicates) of it. Return an empt ...

  7. [Swift]LeetCode277. 寻找名人 $ Find the Celebrity

    Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there may exist o ...

  8. [Swift]LeetCode546. 移除盒子 | Remove Boxes

    Given several boxes with different colors represented by different positive numbers. You may experie ...

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

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

  10. PHP的Memcached简单实现

    Memcached 是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载.它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提高动态.数据库驱动网站的速度.也可动态缓存一些实 ...