Writing configuration files

From The Player Project

Jump to: navigation, search
(Driver-independent options)
Line 1: Line 1:
==Overview==
==Overview==
-
Player needs to know which drivers to instantiate and to which device addresses each should be bound. This information is usually specified in a Player configuration file (it can also be done directly from code by calling into [http://playerstage.sourceforge.net/doc/Player-cvs/player/group__libplayercore.html libplayercore]).
+
Player needs to know which drivers to instantiate and to which device addresses each should be bound. This information is usually specified in a Player configuration file (it can also be done directly from code by calling into [http://playerstage.sourceforge.net/doc/Player-svn/player/group__libplayercore.html libplayercore]).
A Player configuration file is a text file that, by convention, has the extension .cfg. The file is composed of one or more driver sections, each of which instantiates and configures a single driver. Consider an example:
A Player configuration file is a text file that, by convention, has the extension .cfg. The file is composed of one or more driver sections, each of which instantiates and configures a single driver. Consider an example:
Line 12: Line 12:
</pre>
</pre>
-
This block instantiates the [http://playerstage.sourceforge.net/doc/Player-cvs/player/group__driver__sicklms200.html sicklms200] driver. The provides keyword is used to specify the device address to which the driver will be bound. Using this configuration, an instance of the [http://playerstage.sourceforge.net/doc/Player-cvs/player/group__driver__sicklms200.html sicklms200] driver will be available as laser :0.
+
This block instantiates the [http://playerstage.sourceforge.net/doc/Player-svn/player/group__driver__sicklms200.html sicklms200] driver. The provides keyword is used to specify the device address to which the driver will be bound. Using this configuration, an instance of the [http://playerstage.sourceforge.net/doc/Player-svn/player/group__driver__sicklms200.html sicklms200] driver will be available as laser :0.
==Basic syntax==
==Basic syntax==
Line 41: Line 41:
===provides===
===provides===
-
Most drivers (e.g., [http://playerstage.sourceforge.net/doc/Player-cvs/player/group__driver__sicklms200.html sicklms200]) support a single interface. Thus their provides value is a tuple containing a single string.
+
Most drivers (e.g., [http://playerstage.sourceforge.net/doc/Player-svn/player/group__driver__sicklms200.html sicklms200]) support a single interface. Thus their provides value is a tuple containing a single string.
-
Some drivers support multiple interfaces. For example, the [http://playerstage.sourceforge.net/doc/Player-cvs/player/group__driver__amcl.html amcl] driver supports the [http://playerstage.sourceforge.net/doc/Player-cvs/player/group__interface__localize.html localize] and the [http://playerstage.sourceforge.net/doc/Player-cvs/player/group__interface__position2d.html position2d] interfaces, so its provides line might look like this:
+
Some drivers support multiple interfaces. For example, the [http://playerstage.sourceforge.net/doc/Player-svn/player/group__driver__amcl.html amcl] driver supports the [http://playerstage.sourceforge.net/doc/Player-svn/player/group__interface__localize.html localize] and the [http://playerstage.sourceforge.net/doc/Player-svn/player/group__interface__position2d.html position2d] interfaces, so its provides line might look like this:
<pre>
<pre>
provides ["localize:0" "position2d:0"]
provides ["localize:0" "position2d:0"]
Line 53: Line 53:
Most drivers (e.g., sicklms200) don't need any other devices to do their work. Thus no requires option is given.
Most drivers (e.g., sicklms200) don't need any other devices to do their work. Thus no requires option is given.
-
Some drivers require other devices. For example, the [http://playerstage.sourceforge.net/doc/Player-cvs/player/group__driver__vfh.html vfh] driver, a local navigation / obstacle-avoidance algorithm, needs two devices: a [http://playerstage.sourceforge.net/doc/Player-cvs/player/group__interface__position2d.html position2d] device to command and a laser device from which to read laser scans. This driver in turn provides a [http://playerstage.sourceforge.net/doc/Player-cvs/player/group__interface__position2d.html position2d] device to which target poses can be sent. So the vfh driver might be configured like so:
+
Some drivers require other devices. For example, the [http://playerstage.sourceforge.net/doc/Player-svn/player/group__driver__vfh.html vfh] driver, a local navigation / obstacle-avoidance algorithm, needs two devices: a [http://playerstage.sourceforge.net/doc/Player-svn/player/group__interface__position2d.html position2d] device to command and a laser device from which to read laser scans. This driver in turn provides a [http://playerstage.sourceforge.net/doc/Player-svn/player/group__interface__position2d.html position2d] device to which target poses can be sent. So the vfh driver might be configured like so:
<pre>
<pre>
driver
driver

Revision as of 16:52, 31 January 2011

Personal tools