Gazebo:Tutorials:pioneer2dx moving

From The Player Project

Jump to: navigation, search
(New page: == Overview == We assume that you have installed both Gazebo and Player locally (in your home directory). This tutorial demonstrates how to move a robot around in Gazebo using a graphica...)
m (Reverted edits by Kirkpatricky (talk) to last revision by Rmattes)
 
Line 59: Line 59:
# Select the '''Devices''' menu item, then '''Position2d:0''', then '''Enable'''.
# Select the '''Devices''' menu item, then '''Position2d:0''', then '''Enable'''.
# Select the '''Devices''' menu item, then '''Position2d:0''', then '''Command'''.
# Select the '''Devices''' menu item, then '''Position2d:0''', then '''Command'''.
 +
 +
At this point a red box and cross-hair should be visible in playerv. Left-click on the cross hair and drag it around. Once you do this, the robot in Gazebo should move.
 +
 +
If you want to see the output from the laser:
 +
# Select the '''Devices''' menu item, then '''Laser:0''', then '''Subscribe'''.
 +
 +
== Behind the Scenes ==
 +
 +
Here is a little insight into what's going on.
 +
 +
Gazebo uses a shared memory interface to communicate with the other programs. The shared memory files are created once Gazebo is started, and are found in:
 +
<code>
 +
/tmp/gazebo-<user_name>-0/
 +
</code>
 +
 +
List the contents of that directory, and you'll see all the interfaces to entities in Gazebo. Note the Position2d and Laser interfaces.
 +
<code>
 +
$ ls /tmp/gazebo-<user_name>-0/
 +
...
 +
position.pioneer2dx_model1::position_iface_0
 +
laser.pioneer2dx_model1::laser_iface_0
 +
...
 +
</code>
 +
 +
Here is how the filenames break down: <interface_type>.<gazebo_model>.<interface_name>. For the position2d interface, the type is '''position''', the model which contains the interface (or your can think of this as the model that is controlled by the interface) is the '''pioneer2dx_model1''', and the name of the interface itself is '''position_iface_0'''.
 +
 +
This information is used in the Player configuration file. Take a look at the gazebo.cfg file used previously in this tutorial. Look at this section:
 +
<code>
 +
driver
 +
(
 +
  name "gazebo"
 +
  provides ["position2d:0"]
 +
  gz_id "pioneer2dx_model1::position_iface_0"
 +
)
 +
</code>
 +
The '''provides''' tag tells this driver what type of interface this driver uses, and the gz_id tells the driver where to find the matching Gazebo interface. This name must match a name in the Gazebo shared memory interfaces.
 +
 +
[[Category:Gazebo]]
 +
[[Category:Documentation]]]
 +
[[Category:Tutorials]]

Latest revision as of 15:58, 23 August 2011

Personal tools