Adding a driver to Player

From The Player Project

(Difference between revisions)
Jump to: navigation, search

Revision as of 23:35, 30 January 2011

These are rough directions for adding a new driver to the CVS source-tree for Player/Stage.

Other HowTos/Tutorials explaining other aspects of writing and building a Player 2.0 driver:

Player and Automake

Migrating from Player 1.6 to Player 2.0

How to write a player plugin driver

Very good tutorial that describes in detail how to write a new driver

Although this example is for a "roboteq" driver it should work for other drivers.

"..." in a code block means lines were omitted for clarity.

o.k., I have created a patch file for the changes made to the Player source tree in order to add my new Roboteq driver. Only glitch is that the patch does not include the two new files or the new directory:



here is the process:

1. cvs checkout of Player source (a cvs checkout and build is its own process; check Player FAQs for more info)

2. drop the directory for the new driver ("roboteq" -- position2d) in "player/server/drivers/position/" with its appropriately edited (removed the extern "C" Extra stuff for building a shared object, otherwise same as the plugin driver).

3. add a new entry in "player/":

dnl Create the following Makefiles (from the Makefile.ams)

4. add a new entry in "player/server/drivers/position/":

SUBDIRS = isense microstrain vfh ascension bumpersafe lasersafe nav200 nd roboteq

5. add new entries in "player/server/libplayerdrivers/":

void roboteq_Register (DriverTable* table);

6. add new entry in "player/acinclude.m4":


7. create "player/server/drivers/position/roboteq/":

AM_CPPFLAGS = -Wall -I$(top_srcdir)
libroboteq_la_SOURCES =

8. run the usual

./make && make install

if you want to make sure this worked

9. from the top-level source directory (player/)

cvs diff -u > registernewdriver.patch

to make a patch file of any existing files that have changed. Check out the patch file to see if its in good shape. Mine had a bunch of ? marks at the top, listing new files cvs did not know about because they had not been added, so I cleaned it up a bit. Otherwise it should show the changes in all the files that were modified (above).

10. cvs did not allow me to add any files to the repository without having write-privileges:

$ cvs add roboteq
cvs [server aborted]: "add" requires write access to the repository

so I just uploaded a tar.gz of the new directory with the patch file to patch tracker - don't know if there is a better way.

Personal tools