ROS study notes (seven): QT tools and rviz visualization platform

QT tools

In order to facilitate visual debugging and display, ROS provides a QT architecture background graphics toolkit - rqt_common_plugins, which includes rqt_console, rqt_graph, rqt_plot, rqt_reconfigure and other practical tools.
If the ROS you installed is not the desktop version, you may need the following command to install the QT toolbox:

# Ubuntu 16.04
sudo apt-get install ros-kinetic-rqt
sudo apt-get install ros-kinetic-rqt-common-plugins
# Ubuntu 18.04
sudo apt-get install ros-melodic-rqt
sudo apt-get install ros-melodic-rqt-common-plugins
# Ubuntu 20.04
sudo apt-get install ros-noetic-rqt
sudo apt-get install ros-noetic-rqt-common-plugins

Log output tool (rqt_console)

The rqt_console tool is used to graphically display and filter all log messages in the running status of the ROS system, including logs of info, warn, and error levels. The tool can be started with the following command:

rqt_console

Computational graph visualization tool (rqt_graph)

The rqt_graph tool can graphically display the calculation graph in the current ROS system. While the system is running, use the following command to start the tool:

rqt_graph

Data plotting tool (rqt_plot)

rqt_plot is a two-dimensional numerical curve drawing tool, which can draw the data to be displayed using a curve in the xy coordinate system. The tool can be started with the following command:

rqt_plot

Enter the topic message to be displayed in the Topic input box at the top of the interface, and the data changes can be displayed.

Parameter dynamic configuration tool (rqt_reconfigure)

The rqt_reconfigure tool can dynamically configure the parameters in the ROS system without restarting the system, but the use of this function requires setting the relevant attributes of the parameters in the code to support dynamic configuration. The tool can be started with the following command:

rosrun rqt_reconfigure rqt_reconfigure

The interface after startup will display all dynamically configurable parameters in the current system, and the dynamic configuration of parameters can be realized by setting the input box, slide bar or drop-down box in the interface.

rviz visualization platform

There are a lot of multidimensional and multivariate data in the robot system, which need to be displayed visually. ROS provides users with a 3D visualization platform for displaying various data—rviz. It has been integrated in the full desktop version of ROS. If the full version of the desktop has been successfully installed, you don’t need to install rivz, otherwise you need to use the following command to install:

# Ubuntu 16.04
sudo apt-get install ros-kinetic-rviz
# Ubuntu 18.04
sudo apt-get install ros-melodic-rviz
# Ubuntu 20.04
sudo apt-get install ros-noetic-rviz

After the installation is complete, run the following commands in the terminal to start rviz:

roscore
rviz

rviz provides a user-friendly graphical user interface (GUI). Assuming that the data needs to be visualized and the corresponding message type is published, we use the corresponding plug-in in rviz to subscribe to the message to realize the display, so that the user can display in a visual scene View the robot and its surroundings. It supports many different types of sensor data, such as laser scanners, depth cameras, IMUs, and GPS, among others. Using rviz, you can visualize this sensor data as point clouds, 2D/3D maps, images and other forms of data.

rviz also supports motion planning and control of robots. It can display the robot's trajectory, joint status, pose and other information. These capabilities allow robot developers to easily test their motion control algorithms and visualize their performance and results.

Another important feature is the extensibility of rviz. It allows users to write their own visualization plugins to meet specific needs. This feature makes rviz a very flexible and adaptable tool that can be adapted to various types of robot projects and tasks, and even create a human-computer interaction software based on rviz.

Guess you like

Origin blog.csdn.net/weixin_43603658/article/details/129809017