Clone wiki

subt / tutorials / RvizVisualization

Back to Tutorials

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 the Virtual STIX environment

    ign launch -v 4 virtual_stix.ign robotName1:=X1 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.

    rviz_base_link.png

  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

  6. 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

Back to Tutorials

Updated