Skip to content
Nate Koenig edited this page Jan 20, 2021 · 2 revisions

This tutorial will walk you through launching RViz and configuring it to visualize a robot's sensor data. As an example, we will visualize the camera and laser sensors in the X1 robot.

The tutorial assumes you have installed SubT according to the instructions in Installation tutorials.

  1. Open a terminal and launch a Cave environment

     ign launch -v 4 competition.ign worldName:=simple_cave_01 circuit:=cave robotName1:=X1_C1 robotConfig1:=X1_SENSOR_CONFIG_1
    
  2. Open another terminal and run rviz

     rosrun rviz rviz
    
  3. Inside rviz, find the Displays panel and set the Fixed Frame to X1/base_link. If the Displays panel is not visible, enable it from the Panels menu. It is important to set the appropriate fixed frame because rviz needs to know how to transform the sensor data, which is usually available in the robot's local frame. For this simple example, we will use the robot's base as the fixed frame.

  4. We will now add a camera view by adding an Image display. Again, expand the added item and set the Image Topic parameter to /X1/front/image_raw. You can also select this from the dropdown menu.

  5. Finally, add a LaserScan display and set the Topic parameter to /X1/front_scan. If the scan lines aren't visible, adjust the Size parameter to 0.03 as shown below.

rviz_image_topic.png

  1. You can then save your rviz setting to a file and load it inside a launch file. A launch file that loads this example can be found in subt_examples/launch/x1_rviz.launch