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 the Virtual STIX environment
ign launch -v 4 virtual_stix.ign robotName1:=X1 robotConfig1:=X1_SENSOR_CONFIG_1
Open another terminal and run
rosrun rviz rviz
rviz, find the
Displayspanel and set the
X1/base_link. If the
Displayspanel is not visible, enable it from the
Panelsmenu. It is important to set the appropriate fixed frame because
rvizneeds 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 the
Image Topicparameter to
/X1/front/image_raw. You can also select this from the dropdown menu.
Finally, add a
LaserScandisplay and set the
/X1/front_scan. If the scan lines aren't visible, adjust the
Sizeparameter 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 in