Difference between revisions of "Rviz"

From sdk-wiki
Jump to: navigation, search
m (Protected "Rviz" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) [cascading])
Line 1: Line 1:
= Visualize Baxter with rviz =
+
 
 +
 
 
== Summary ==
 
== Summary ==
 
Use rviz to visualize Baxter's joints and sensor data.
 
Use rviz to visualize Baxter's joints and sensor data.
  
[[File:rviz.png]]
+
[[File:rviz_2014.png]]
 +
 
 +
===== Prerequisites =====
 +
# User has completed the [[Setup Guide|RSDK Setup Guide]] setup, at least up through [[Installing the Research SDK]] and all prerequisites.
 +
# User has an rviz compatible system and environment setup (see: [[rviz - Troubleshooting|rviz Troubleshooting/Setting up rviz]]).
  
 
== Overview ==
 
== Overview ==
Line 15: Line 20:
 
Use a 'Fixed Frame' of <code>/world</code>, and Add a <code>Robot Model</code> Display Type.  Reference the list below (Baxter Display Types) for more sensors.
 
Use a 'Fixed Frame' of <code>/world</code>, and Add a <code>Robot Model</code> Display Type.  Reference the list below (Baxter Display Types) for more sensors.
  
== Documentation ==
+
== I. Start rviz ==
+ [[rviz - Basic Use Case|Basic Use Case]]
+
=== Setup rviz ===
* [[rviz - Basic Use Case#ii-adding-displays|Adding a Sensor Display]]
+
1. Make sure rviz is installed (and all dependencies):
+ [[rviz - Baxter Sensor Displays|Baxter Sensor Display Types]]
+
<source lang="bash">
 +
    $ sudo apt-get install ros-groovy-visualization
 +
</source>
 +
2. Initialize your environment:
 +
<source lang="bash">
 +
    $ cd ~/ros_ws
 +
    $ ./baxter.sh <baxter_hostname>
 +
</source>
 +
3. Run rviz:
 +
<source lang="bash">
 +
    $ rosrun rviz rviz
 +
</source>
 +
 
 +
=== Configure rviz ===
 +
 
 +
* Set the Fixed Frame:
 +
*. Set your ‘Fixed Frame’, under ‘.Global Options’ on the left, to the reference tf frame ‘/world’
 +
*. <Insert Images>
 +
''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. 
 +
&nbsp;
 +
 
 +
* (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. 
 +
*. Click the ‘Add’ button, at the bottom of the Displays sidebar, to open the New Display window.
 +
*. 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 ==
 +
# Add a Robot Model Display:
 +
#* Select the ‘Add’ button under the Displays sidebar.
 +
#* 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:
 +
## Robot Description:  <code>robot_description</code>
 +
##* <code>robot_description</code> 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)</div>
 +
## 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/___’.
 +
## Links: 
 +
##* The links show the current transform of the robot’s links (i.e. where each link is actually positioned right now).   
 +
# (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 <code>/robot/range/left_hand_range</code>, and hit ‘OK’.
 +
 
 +
 
  
 
== Troubleshooting ==
 
== Troubleshooting ==

Revision as of 21:19, 18 May 2014


Summary

Use rviz to visualize Baxter's joints and sensor data.

Rviz 2014.png

Prerequisites
  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).

Overview

rviz is a 3D visualizer for displaying sensor data and state information from ROS. With rviz, you can visualize Baxter's current pose on a virtual model of the robot. You can also display live representations of sensor values coming over ROS Topics.

Usage

Start rviz from an RSDK terminal session using:

   $ rosrun rviz rviz &

Use a 'Fixed Frame' of /world, and Add a Robot Model Display Type. Reference the list below (Baxter Display Types) for more sensors.

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:
  • . Set your ‘Fixed Frame’, under ‘.Global Options’ on the left, to the reference tf frame ‘/world’
  • . <Insert Images>

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.

  • . Click the ‘Add’ button, at the bottom of the Displays sidebar, to open the New Display window.
  • . 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:
    • Select the ‘Add’ button under the Displays sidebar.
    • 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)</div>
    2. 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/___’.
    3. Links:
      • The links show the current transform of the robot’s links (i.e. where each link is actually positioned right now).
  2. (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’.


Troubleshooting

For common issues specific to using rviz with Baxter, check out the Troubleshooting page.

For more information about rviz, see the original documentation for the tool at the ROS wiki: