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

'''Note:''' 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 and joints are on the robot, and where they connect)</div>

+

* 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 and joints are on the robot, and where they connect)

* 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/___’.

* 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/___’.

Overview

rviz (ROS visualization) is a 3D visualizer for displaying sensor data and state information from ROS. Using rviz, you can visualize Baxter's current configuration on a virtual model of the robot. You can also display live representations of sensor values coming over ROS Topics including camera data, infrared distance measurements, sonar data, and more.

Installation

$ sudoapt-get update$ sudoapt-get install ros-indigo-rviz

$ sudoapt-get update$ sudoapt-get install ros-hydro-rviz

$ sudoapt-get update$ sudoapt-get install ros-groovy-rviz

Usage

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.

Robot Visualization

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.

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

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 and joints are on the robot, and where they connect)

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

Adding a Simple Sensor

Add a Range Display for an IR sensor

Add a new ‘Range’ display type, by clicking the ‘Add’ button and finding it under the ‘Builtin’ types.

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.

Select the topic for the left IR sensor, which is under /robot/range/left_hand_range, and hit ‘OK’.

Baxter Sensors for Visualization

Cameras

Topic Name: /cameras/${side}_hand_camera/image

Left Hand: /cameras/left_hand_camera/image

Right Hand: /cameras/right_hand_camera/image

Display Type: Image

Joint States

via Robot Model

Topic Name: /robot/joint_states

Display Type: Robot Model

Recommended Options:

Robot Description: robot_description

via TF

Topic Name: /tf

Display Type: TF

Recommended Options:

Disable all links starting with prefix /reference/`

Sonar (Head)

Topic Name: /robot/head/sonar/sonar/state

Display Type: PointCloud

Recommended Options:

Color Transformer: Intensity

Channel Name: Distance

IR Range Sensors (Hands)

Topic Name: /robot/range/${side}_hand_range

Display Type: Range

Troubleshooting

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

rviz uses Display Types to visualize different types of ROS messages. This list shows available ROS topics and corresponding Display Types for sensors on Baxter.

Questions when using standard ROS tools are largely asked/responded to on ROS Answers

Segmentation Fault

Segmentation faults often point to incorrect graphics library configuration, or misconfigured rviz setups.

Flickering Flickering in rviz 3D and camera views

This can occur with some graphics drivers (depends on computer and monitor)

Solution: Unset the LIBGL_ALWAYS_INDIRECT environment variable.
Right before starting rviz (or any gui program), check if the environment variable LIBGL_ALWAYS_INDIRECT is set.

$ env|grep LIBGL_ALWAYS_INDIRECTLIBGL_ALWAYS_INDIRECT=1

If so, unset the variable, then you can run rviz normally.

$ unset LIBGL_ALWAYS_INDIRECT

Graphics context not supported (i.e. trying to run rviz in VM)

(Ogre can’t make GL context)

Global: Fixed Frame is broken on start (set to /map by default)

Global: Fixed Frame is empty, as is drop-down

Try putting in an intentionally bad frame for Fixed Frame, then look under .Global Status at the error for it. It will hopefully tell you that Fixed Frame is broken and your frame is bad, and then you will hopefully be able to click on the drop-down and see all the available frames.

When you try to Add >> Display Types, the list is empty

Delete rviz configuration,

$ rm ~/.rviz/*

When restarting, verify origin frame is set to /world

RViz in VMWare

after making sure that my VM was using hardware acceleration, had mesa-utils installed (wasn’t by default, then I could run glxinfo, and glxgears; important information is glxinfo | grep direct --> giving: “direct rendering: Yes”), then I had to change the RTT Preferred Mode from PBuffer to Copy, by instead running rviz like this: $ OGRE_RTT_MODE=”Copy” rosrun rviz rviz &

it would work intermittently (maybe not crash 1 out of 6 times)

Problem: The problem started with an error (when trying to run rviz) of:

trying to run glxinfo failed, because it wasn’t installed; told me to install mesa-utils

ran: $ sudo apt-get install mesa-utils

now glxinfo works, can run $ glxinfo | grep version to see version info:

can also run glxgears. (not sure if I may have been able to before too)

Problem: Still getting same error on rviz start though

Solution: Found out people get that error when LIBGL_ALWAYS_INDIRECT=”1” is set.

Also found that that is a compviz error! It is set when you open a terminal using Ctrl+Alt+T!!!

unset it, and the red exception error went away

Problem: rviz still won’t start up but crashes intermittently with either an X Error of ‘BadDrawable (invalid Pixmap or Window parameter)’, or just Seg Faults.

Solution: Found out this is a known intermittent problem by looking at the rviz troubleshooting page. By setting the OGRE_RTT_MODE environment variable from “PBuffer” to “Copy” or “FBO”, can get it to work intermittently.