Welcome to MicroROS V2 Robot Car repository
17.ROS2 rviz2 use
17. Using ROS2 Rviz2
1. Introduction to Rviz2
During robot development, various functions require analysis at the data level, making it difficult to quickly understand their impact. For example, for robot models, we need to understand the design's appearance and the positions of the model's numerous internal coordinate systems during motion.
For robotic arm motion planning and mobile robot autonomous navigation, we need to visualize the robot's surrounding environment, the planned path, and, of course, sensor information, such as cameras, 3D cameras, and lidar. Data is used for calculations, while visualization is for human viewing.
Therefore, data visualization can greatly improve development efficiency. Rviz2 is such a data visualization software for robot development. It can handle everything from robot models, sensor information, and environmental information.
2. Preparation
- If you have a physical robot, you can launch Rviz on the robot controller to practice this lesson. If you don't have a physical robot, you can use Gazebo to simulate a TurtleBot3 robot to simulate the lidar, camera, and other components, facilitating subsequent data visualization.
Note: The following installation steps are optional. If you have a physical robot and have set up multi-machine communication, you can directly use the actual robot's radar information. You can choose to use the actual radar or a simulated robot. The following information is for users without a physical robot.
- This lesson uses a simulated robot as an example to teach you the visualization capabilities of Rviz2. The operation process is the same for both real and simulated robots.
- Install the TutleBot3 simulator package
xxxxxxxxxxsudo apt install ros-${ROS_DISTRO}-turtlebot3*- Install the ROS and Gazebo bridge tool
xxxxxxxxxxsudo apt install ros-${ROS_DISTRO}-ros-gz- Set the TurtleBot3 robot type environment variable