Gazebo:Tutorials:pioneer2dx moving

From The Player Project

Jump to: navigation, search
m (Reverted edits by Kirkpatricky (talk) to last revision by Rmattes)
 
Line 64: Line 64:
If you want to see the output from the laser:
If you want to see the output from the laser:
# Select the '''Devices''' menu item, then '''Laser:0''', then '''Subscribe'''.
# 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