-
Notifications
You must be signed in to change notification settings - Fork 104
RViz
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.
-
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 -
Open another terminal and run
rvizrosrun rviz rviz -
Inside
rviz, find theDisplayspanel and set theFixed FrametoX1/base_link. If theDisplayspanel is not visible, enable it from thePanelsmenu. It is important to set the appropriate fixed frame becauservizneeds 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. -
We will now add a camera view by adding an
Imagedisplay. Again, expand the added item and set theImage Topicparameter to/X1/front/image_raw. You can also select this from the dropdown menu. -
Finally, add a
LaserScandisplay and set theTopicparameter to/X1/front_scan. If the scan lines aren't visible, adjust theSizeparameter to 0.03 as shown below.

- You can then save your
rvizsetting to a file and load it inside a launch file. A launch file that loads this example can be found insubt_examples/launch/x1_rviz.launch