Brief introduction and use of rviz2

Rviz2 is a visualization tool for displaying messages in the robot environment, providing a 3D perspective to view the robot's status and activities. It can help developers better understand the current status and activities of the robot, as well as other visual messages. Rviz2 provides a series of visualization tools that can help developers better understand the status and activities of robots, such as visual coordinate systems, laser scanning messages, point cloud messages, robot models, etc. Using Rviz2, robotic systems can be easily viewed and debugged to better achieve robotic goals.

1 Introduction to the installation and interface of rviz2

The successful installation of ros2 indicates that rviz2 has also been installed successfully, because the installation of ros2 includes rviz2.

Open a console terminal (shortcut key Ctrl+Alt+T) and enter the command to open rviz2:

ros2 run rviz2 rviz2
# or
rviz2

Open rviz2 and the following interface is displayed:

1.1 Introduction to each region

  • On the left is the display list, a display is the thing that draws something in the 3D world and may have some options available in the display list. Including functions such as adding, deleting, copying, renaming plug-ins, displaying plug-ins, and setting plug-in properties.
  • Above is the toolbar, which allows users to use various function keys to select tools with multiple functions.
  • The middle part is the 3D view: It is the main screen where various data can be viewed in three dimensions. The background color, fixed frame, grid, etc. of the 3D view can be set in detail in the Global Options and Grid items displayed on the left.
  • Below is the time display area, including system time and ROS time, etc.
  • The right side is the observation angle setting area, where different observation angles can be set.

We only give a rough introduction in this part. If you want to know more details, you can go to the User Guide to check it out.

2 Simple to use

Launch via launch.py file

This example is based on the fact that you have completed [Environment Building] (11.2.1-EnvironmentBuilding.md) and successfully copied the company's code from GitHub.

Open a console terminal (shortcut keys Ctrl+Alt+T) and enter the following commands to configure ROS2 environment.

cd ~/colcon_ws/
colcon build --symlink-install
source install/setup.bash

Then enter:

ros2 launch mycobot_630 test.launch.py

Open rviz and get the following results:

If you want to know more about rviz, you can go to Official Documents to check it out


← Previous page | Next page →

results matching ""

    No results matching ""