Note: This tutorial assumes that you have completed the previous tutorials: Qt Interactions.
(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Rviz Interactions

Description: Defining interactions for rviz configurations.

Keywords: rocon interactions

Tutorial Level: BEGINNER

Next Tutorial: Web App Interactions

Overview

This tutorial will guide you through the process of running and executing rviz configurations. This is really useful given the amount of time we had originally spent re-configuring rviz just to link to an image topic everytime we launched it for a particular robot.

Rviz Exports

Configuration

The first thing you need to do is to connect rviz to your system/robot and configure it exactly as you require. Then save that config (.rviz file) into a catkin package of your choosing. For this example we will make use of the already exported configuration in rocon_interactions/rviz/markers.rviz.

Launcher

Next we'll need a launcher to start rviz with this configuration. This will form the 'app' side of the interaction. Save this as rviz_markers.launch in foo.

   1 <launch>
   2   <node name="rviz" pkg="rviz" type="rviz" args="-d $(find rocon_interactions)/rviz/markers.rviz"/>
   3 </launch>

Interactions

Yaml

Save this as foo.interactions in foo.

   1 - name: foo/rviz_markers.launch
   2   role: 'PC'
   3   compatibility: rocon:/pc/*/hydro|indigo/*
   4   display_name: Rviz Markers (Launcher)
   5   description: Rviz with a view exactly configured for the rocon_interactions tutorial.
   6   max: -1
   7   icon:
   8     resource_name: rocon_bubble_icons/rviz.png

Launcher

Save this as foo.launch in foo.

   1 <launch>
   2   <param name="name" value="Rocon Interactions"/>
   3   <param name="description" value="A tutorial environment for interactions and remocons."/>
   4   <param name="icon" value="rocon_icons/cybernetic_pirate.png"/>
   5   <node pkg="rocon_master_info" type="master.py" name="master"/>
   6 
   7   <node pkg="rocon_interactions" type="interactions_manager.py" name="interactions">
   8     <rosparam param="interactions">[foo/foo]</rosparam>
   9   </node>
  10 
  11   <!-- publish some markers for viewing in an rviz interaction -->
  12   <node pkg="rocon_interactions" type="tutorial_markers.py" name="tutorial_markers"/>
  13 </launch>

Note that we've added a script from rocon_interactions which will publish some markers for our rviz configuration to pick up.

Interacting

# Dependencies
> sudo apt-get install ros-indigo-rviz ros-indigo-visualization-msgs
# In the first shell
> roslaunch foo foo.launch --screen
# In a second shell
> rocon_remocon

Add your ros master and rviz away.

Wiki: rocon_interactions/Tutorials/indigo/Rviz Interactions (last edited 2014-03-10 02:13:12 by DanielStonier)