Skip to content

rviz Basic Use Case

rethink-bbenoit edited this page Nov 15, 2013 · 4 revisions

Visualize Robot with rviz

This use case covers using the visualization tool rviz to view a 3D model of Baxter and visualize sensor data. Basic start-up and adding a display for a simple sensor will be demonstrated.

Preconditions:
  1. User has completed the RSDK Setup Guide setup, at least up through Installing the Research SDK and all prerequisites.
  2. User has an rviz compatible system and environment setup (see: rviz Troubleshooting/Setting up rviz).
Postconditions:
  1. User is able to run rviz and visualize Baxter’s state, including viewing the real-time 3D robot model and displaying a range sensor.

I. Start rviz

Setup rviz

  1. Make sure rviz is installed (and all dependencies):
    $ sudo apt-get install ros-groovy-visualization
  2. Initialize your environment:
    $ cd ~/ros_ws
    $ ./baxter.sh <baxter_hostname>
  3. Run rviz:
    $ rosrun rviz rviz

Configure rviz

  • Set the Fixed Frame:

    1. Set your ‘Fixed Frame’, under ‘.Global Options’ on the left, to the reference tf frame ‘/world’

    Info: The ‘Fixed Frame’ provides a static, base reference for your visualization. Any sensor data that comes in to rviz will be transformed into that reference frame so it can be properly displayed in the virtual world.
     

  • (Optional) Display a virtual grid
    Info: It is hard to tell with nothing there, but the blank area in the middle of the window is the 3D view. We can display simple grid lines in our virtual world to help us visualize the space.

    1. Click the ‘Add’ button, at the bottom of the Displays sidebar, to open the New Display window.
    2. Select the ‘Grid’ Display Type, under the ‘Builtin’ category, then hit ‘OK’ to add the display to our visualization. You should now be able to distinguish our (empty) virtual world.

II. Adding Displays

  1. Add a Robot Model Display:
  2. Select the ‘Add’ button under the Displays sidebar.
  3. In the Dialog that pops up, scroll to ‘Robot Model’ (under the ‘Builtin’ category), and then hit ‘OK’ to add a visual representation of the robot’s current pose.

By default, all the parameters should be set correctly but just in case check the following:

  1. Robot Description:  `robot_description`  
    `robot_description` is the name of the ros parameter where the URDF is stored on parameter server.  (this stores the description of what links are on the robot, and where they connect)
  1. TF Prefix:  (blank)  
    Change this if you have a tf tree under a different namespace.  For example, if you are publishing the robot’s intended pose under the  ‘/reference/____’ prefix; or if you have multiple robots, each with their own trees: ‘/baxter1/___’ , ‘/baxter2/___’.
  
  1. Links:  
    The links show the current transform of the robot’s links (i.e. where each link is actually positioned right now).
  1. (Optional) Test movement to see the virtual Baxter update

III. Add a Simple Sensor

Add a Range Display for an IR sensor

  1. Add a new ‘Range’ display type, by clicking the ‘Add’ button and finding it under the ‘Builtin’ types.
  2. Find the ‘Topic’ field under your new Range display, and use the ‘...’ button to open a new window with available Range topics currently being published.
  3. Select the topic for the left IR sensor, which is under /robot/range/left_hand_range, and hit ‘OK’.
Clone this wiki locally