Gazebo:Tutorials:pioneer2dx moving

From The Player Project

Jump to: navigation, search
(Undo revision 4126 by Ybysavozy (Talk))
Line 1: Line 1:
-
----
 
-
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
-
----
 
-
=[http://uwujojedeh.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=
 
-
----
 
-
=[http://uwujojedeh.co.cc CLICK HERE]=
 
-
----
 
-
</div>
 
== Overview ==
== Overview ==
Line 18: Line 10:
First go to the location of all the default world files.
First go to the location of all the default world files.
-
  &lt;code&gt;
+
  <code>
  $ cd ~/local/share/gazebo/worlds
  $ cd ~/local/share/gazebo/worlds
-
  &lt;/code&gt;
+
  </code>
Now run gazebo with the pioneer2dx.world file
Now run gazebo with the pioneer2dx.world file
-
  &lt;code&gt;
+
  <code>
  $ gazebo pioneer2dx.world
  $ gazebo pioneer2dx.world
-
  &lt;/code&gt;
+
  </code>
At this point, a new window should appear that contains a Pioneer2dx sitting on a flat surface.
At this point, a new window should appear that contains a Pioneer2dx sitting on a flat surface.
Line 33: Line 25:
In a new terminal:
In a new terminal:
-
  &lt;code&gt;
+
  <code>
  $ cd ~/local/share/gazebo/player_cfgs
  $ cd ~/local/share/gazebo/player_cfgs
-
  &lt;/code&gt;
+
  </code>
Run player:
Run player:
-
  &lt;code&gt;
+
  <code>
  $ player gazebo.cfg
  $ player gazebo.cfg
-
  &lt;/code&gt;
+
  </code>
Not too much will happen here. Player should output something along the lines of:
Not too much will happen here. Player should output something along the lines of:
-
  &lt;code&gt;
+
  <code>
  Gazebo Plugin driver creating 1 device
  Gazebo Plugin driver creating 1 device
   6665.31.0 is  a simulation interface.
   6665.31.0 is  a simulation interface.
Line 52: Line 44:
  listening on 6665
  listening on 6665
  Listening on ports: 6665  
  Listening on ports: 6665  
-
  &lt;/code&gt;
+
  </code>
== Controlling the Robot ==
== Controlling the Robot ==
Line 58: Line 50:
In a new terminal:
In a new terminal:
-
  &lt;code&gt;
+
  <code>
  $ playerv -h localhost
  $ playerv -h localhost
-
  &lt;/code&gt;
+
  </code>
A window will pop-up that should a few menu items and a grid.
A window will pop-up that should a few menu items and a grid.
Line 78: Line 70:
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:
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:
-
  &lt;code&gt;
+
  <code>
-
  /tmp/gazebo-&lt;user_name&gt;-0/
+
  /tmp/gazebo-<user_name>-0/
-
  &lt;/code&gt;
+
  </code>
List the contents of that directory, and you'll see all the interfaces to entities in Gazebo. Note the Position2d and Laser interfaces.  
List the contents of that directory, and you'll see all the interfaces to entities in Gazebo. Note the Position2d and Laser interfaces.  
-
  &lt;code&gt;
+
  <code>
-
  $ ls /tmp/gazebo-&lt;user_name&gt;-0/
+
  $ ls /tmp/gazebo-<user_name>-0/
  ...
  ...
  position.pioneer2dx_model1::position_iface_0
  position.pioneer2dx_model1::position_iface_0
  laser.pioneer2dx_model1::laser_iface_0
  laser.pioneer2dx_model1::laser_iface_0
  ...
  ...
-
  &lt;/code&gt;
+
  </code>
-
Here is how the filenames break down: &lt;interface_type&gt;.&lt;gazebo_model&gt;.&lt;interface_name&gt;. 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'''.
+
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:
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:
-
  &lt;code&gt;
+
  <code>
  driver
  driver
  (
  (
-
   name &quot;gazebo&quot;
+
   name "gazebo"
-
   provides [&quot;position2d:0&quot;]
+
   provides ["position2d:0"]
-
   gz_id &quot;pioneer2dx_model1::position_iface_0&quot;
+
   gz_id "pioneer2dx_model1::position_iface_0"
  )
  )
-
  &lt;/code&gt;
+
  </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.
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.

Revision as of 03:10, 27 November 2010

Personal tools