ros2 基础学习16 - RQT:模块化可视化工具

RQT:模块化可视化工具

ROS中的Rviz功能已经很强大了,不过有些场景下,我们可能更需要一些简单的模块化的可视化工具,比如只显示一个摄像头的图像,使用Rviz的话,难免会觉得操作有点麻烦。

此时,我们就会用到ROS提供的另外一种模块化可视化工具——rqt。

rqt介绍

正如RQT的命名,它和Rviz一样,也是基于QT可视化工具开发而来,在使用前,我们需要通过这样一句指令进行安装,然后就可以通过rqt这个命令启动使用了。

安装
注意自己ros2 的版本,我的是humble

sudo apt install ros-humble-rqt

启动

rqt

启动成功后如图

在这里插入图片描述

里边可以加载很多小模块,每个模块都可以实现一个具体的小功能,一些常用的功能如下:

在这里插入图片描述

日志显示:

在这里插入图片描述
也可以通过命令行方式启动

ros2 run rqt_console rqt_console

从启动的界面可以看到有三个部分
Console:
The first section of the console is where log messages from your system will display.

Exclude Message:
In the middle you have the option to filter messages by excluding severity levels. You can also add more exclusion filters using the plus-sign button to the right.
用来过滤日志等级的
在这里插入图片描述

Hightlight Message…:
The bottom section is for highlighting messages that include a string you input. You can add more filters to this section as well.
自定义过滤

现在我们新开命令窗口,启动一个小乌龟节点
Now start turtlesim in a new terminal with the following command:

ros2 run turtlesim turtlesim_node

启动成功后我们会发现Console 栏中就会多两行数据,如下图所示:

在这里插入图片描述
双击某行日志可查看详情信息
在这里插入图片描述

测试定义一个不同级别日志的消息

To produce log messages for rqt_console to display, let’s have the turtle run into the wall. In a new terminal, enter the ros2 topic pub command (discussed in detail in the topics tutorial) below:

发布一条让小龟一直往前走的消息

ros2 topic pub -r 1 /turtle1/cmd_vel geometry_msgs/msg/Twist "{linear: {x: 2.0, y: 0.0, z: 0.0}, angular: {x: 0.0,y: 0.0,z: 0.0}}"

Since the above command is publishing the topic at a steady rate, the turtle is continuously running into the wall. In rqt_console you will see the same message with the Warn severity level displayed over and over, like so:

在这里插入图片描述

设置默认的日志等级
Set the default logger level

You can set the default logger level when you first run the /turtlesim node using remapping. Enter the following command in your terminal:

查看当前所有的topic 列表

在这里插入图片描述

发布话题数据/调用服务请求

在这里插入图片描述

数据包管理

在这里插入图片描述

节点可视化

Introspection / Node Graph

第一个是肯定是rqt_graph,插件名字叫做Node Graph,这个名字小鱼觉得更加的贴切,用rqt_graph更多的是为了延续ROS1中的用法,这个插件用于查看节点和节点之间的关系的。

在这里插入图片描述

查看节点和节点之间的关系

在这里插入图片描述

启动 Service 服务

从顶部的菜单栏中选择Plugins > Services > Service Caller
在这里插入图片描述

刷新服务列表

在这里插入图片描述

调整调用服务的参数

在这里插入图片描述

启动服务

在这里插入图片描述

查看设置节点服务的参数

在这里插入图片描述

在这里插入图片描述

RQT还有好些个插件的应用,后面会慢慢的补充

参考链接:
https://docs.ros.org/en/humble/Concepts/About-RQt.html
https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools/Using-Rqt-Console/Using-Rqt-Console.html

相关推荐

  1. 深度学习模型与神经网络工具

    2024-01-18 03:42:02       51 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-18 03:42:02       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-18 03:42:02       106 阅读
  3. 在Django里面运行非项目文件

    2024-01-18 03:42:02       87 阅读
  4. Python语言-面向对象

    2024-01-18 03:42:02       96 阅读

热门阅读

  1. Ubuntu 从零开始配置环境

    2024-01-18 03:42:02       51 阅读
  2. [网络安全]DHCP 部署与安全

    2024-01-18 03:42:02       47 阅读
  3. CSS 高频面试题

    2024-01-18 03:42:02       52 阅读
  4. MetaGPT-打卡day01

    2024-01-18 03:42:02       47 阅读
  5. redis内存淘汰机制

    2024-01-18 03:42:02       52 阅读
  6. LeetCode 36. 有效的数独

    2024-01-18 03:42:02       53 阅读
  7. pcie设备驱动无法工作排查

    2024-01-18 03:42:02       54 阅读
  8. 排序补充(C语言版)

    2024-01-18 03:42:02       38 阅读
  9. C++在结构(Struct)中使用队列(Queue)

    2024-01-18 03:42:02       55 阅读