Use of ROS rviz tool

rviz is a graphical tool that comes with ros, which can conveniently perform graphical operations on the ros program. The overall interface is shown in the figure below:

../../_images/lin_Rv1.jpg

The interface is mainly divided into a display setting area on the left, a large display area in the middle, and a viewing angle setting area on the right. At the top are several tools related to navigation. The bottom is the display of some data related to ros status.

rviz preparation before use

  1. Open ROS environment:

    Roscore&
    
  2. Enter the folder where ros package is located to initialize the environment variables:

    source ./devel/setup.bash
    
  3. Run the launch file:

    roslaunch dmcam_ros start.launch
    

rviz display depth image

  1. Open a terminal and run rviz:

    rviz
    
  2. Select add, select Image under image_dist in the By topic, and finally confirm the addition, as shown in the figure below::

    ../../_images/lin_Rv2.jpg
  3. The display effect is shown in the following figure:

    ../../_images/lin_Rv3.jpg

rviz display pointcloud image

  1. Open a terminal and run rviz:

    rviz
    
  2. Select add, select PointCloud2 under pointcloud in byTopic, and finally confirm the addition.

    ../../_images/lin_Rv4.jpg
  3. In the displays area in the upper left corner of rviz, modify the value of the FixedFrame variable under GlobalOptions to dmcam_ros. The point cloud is displayed as shown below.

    ../../_images/lin_Rv5.jpg