Tutorials/drcsim/ros controlled robot


 * 1) Interfacing with a ROS Enabled Robot in Simulation via Dynamic Control


 * Prerequisites:** Building a Mobile Base

This tutorial describes the process of creating a simple Gazebo/ROS mechanism control interface plugin to control a ROS enabled robot.

The goal is to expose the identical ROS interface when switching between the simulation and the real hardware.


 * 1) Non-Simulation ROS Components

For this exercise, we will be using the following ROS components:

1. The PR2 Mechanism Stack This stack holds a simple mechanism interface model for real robots. In summary, - Detail robot kinematics and dynamics are described via URDF. - Transmission is described via transmission XML format. - This stack also contains a Controller Manger node for dynamically loading and unloading mechanism controllers.

1. The PR2 Controllers Stack This stack contains various mechanism controllers for real robots, from simple PID position controllers to specialized custom controllers.


 * 1) Installing ROS Components

1. Follow the | ROS install instructions. Make sure you have installed the required components above:

sudo apt-get install ros-fuerte-pr2-controllers ros-fuerte-pr2-mechanism


 * 1) Setting Up Your Work Environment

Create a directory for this exercise, let's call it `gazebo_ros_tutorials`:

mkdir ~/gazebo_ros_tutorials

Source scripts for setting environment variables for ROS:

source /opt/ros/fuerte/setup.bash

Source script for setting up environment variables for Gazebo:

source /usr/share/gazebo-1.2.0/setup.sh


 * 1) Create a Simple Robot Model

We'll create a simple robot model for testing our controller infrastructure here.

First, create a models directory here,

mkdir ~/gazebo_ros_tutorials/models mkdir ~/gazebo_ros_tutorials/models/simple_arm_gripper

For more information on creating models, you can consult Model Database page.

Create the model file `~/gazebo_ros_tutorials/models/simple_arm_gripper/model.sdf` so it contains both the `simple_arm` model and the `simple_gripper` model with a joint attaching the two models together:    model://simple_arm

model://simple_gripper 1.8 0 1 0 0 0



 simple_arm_gripper::simple_arm::arm_wrist_roll simple_arm_gripper::simple_gripper::riser 0          0         0 0 1

Create the corresponding model manifest `~/gazebo_ros_tutorials/models/simple_arm_gripper/manifest.xml` 

Simple Arm Gripper 1.0  model.sdf

John Hsu hsu@osrfoundation.org

model://simple_gripper 1.0

A simple arm and pinch gripper.

To test this model out, add your model path to `GAZEBO_MODEL_PATH`:

export GAZEBO_MODEL_PATH=~/gazebo_ros_tutorials/models:${GAZEBO_MODEL_PATH}

With the presence of a proper model file and model manifest, gazebo will find and list the model in the left hand panel under InsertModel.

Add a model plugin similar to the approach taken in the model plugin tutorial. But here, we'll have additional dependency on ROS in the plugin code: ...
 * 1) Controller Interface using Model Plugin


 * 1) Commanding the Controllers


 * 1) Commandline


 * 1) ROS Node