Brief introduction and use of rviz2

Rviz is a 3D visualization platform in ROS. On the one hand, it can realize the graphical display of external information, and on the other hand, it can release control information to objects through rviz, so as to realize the monitoring and control of robots.

1 Brief Introduction of rviz2

The successful installation of ros2 indicates that the installation of rviz2 is also successful, because the installation of ros2 includes rviz2.

Open a new terminal(shotcutCtrl+Alt+T) enter the command to open rviz2

rviz2

Open rviz2, and the following interface is displayed:

2 Introduction to each region

  • On the left is the list of displays, which are used to draw some content in the 3D world, and may have some available options in the display list.
  • Above is the toolbar, which allows users to select a variety of tools with various function keys
  • The middle part is a 3D view: it is the main screen that can view various data in 3D. 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.
  • The lower part is the time display area, including system time and ROS time.
  • The right side is the viewing angle setting area, where different viewing angles can be set.

In this part, we will only give a brief introduction,If you want to know more details, you can go to User Guide

3 Simple Use

Start with the launch.py file

This example is based on the fact that you have completed Environment Building,And successfully copied the company's code from Git Hub

Open a console terminal(shoycutCtrl+Alt+T) Enter the following command to configure the ROS2 environment

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

And enter:

ros2 launch ultraarm test.launch.py

Open rviz2 and get the following results:

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

4 Control of mechanical arm

4.1 Operating Environment

Environment building is required before use. For details, see Environment Building section

4.2 Slider Control

Open a command line and run:

# The default serial port name of ultraArm is"/dev/ttyUSB0",baud rate is 115200.
ros2 launch ultraarm slider_control.launch.py

It will open rviz2 and a slider component, and you will see the following picture:

Then you can control the model movement in rviz2 by dragging the slider. The real ultraArm will move with it.

Please note: since the mechanical arm will move to the current position of the model when the command is entered, please ensure that the model in rviz is not penetrated before you use the command

Do not drag the slider quickly after connecting the mechanical arm to prevent damage to the mechanical arm

results matching ""

    No results matching ""