-
Notifications
You must be signed in to change notification settings - Fork 98
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
rviz
rosrun rviz rviz
-
Inside
rviz
, find theDisplays
panel and set theFixed Frame
toX1/base_link
. If theDisplays
panel is not visible, enable it from thePanels
menu. It is important to set the appropriate fixed frame becauserviz
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. -
We will now add a camera view by adding an
Image
display. Again, expand the added item and set theImage Topic
parameter to/X1/front/image_raw
. You can also select this from the dropdown menu. -
Finally, add a
LaserScan
display and set theTopic
parameter to/X1/front_scan
. If the scan lines aren't visible, adjust theSize
parameter to 0.03 as shown below.
- 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 insubt_examples/launch/x1_rviz.launch