Examples with Player

From MCS Wiki
Jump to: navigation, search

Basic Setup:

1. Connect a computer (PC, laptop, cluster, etc) and the gumstix to a wireless 802.11 network

2. SSH into the gumstix and start the Player server (previously installed on gumstix using the buildroot)

The following drive file for the Create is also placed on the gumstix: named create.cfg in our case:

   name "create"
   provides ["position2d:0" "power:0" "bumper:0" "ir:0" "opaque:0"]
   port "/dev/ttyS2"
   safe 1

The second line lists a series of device interfaces that are provided by the driver.

 * position2d - returns odometry data and accepts velocity commands
 * power - returns battery levels
 * bumper - returns bumper data
 * opaque - supports programming songs, playing songs, setting the LEDs, and running demo scripts

The third line lists the serial port over which we are currently communicating with the actual robot. The fourth line keeps the robot in safe mode so that its activities are interrupted by wheel-drop and cliff sensor events.

 type: # player create.cfg  

3. Run the control code on a remote machine.

 * Gumstix are not particularly powerful or user friendly
 * Very powerful remote machine can treat the robots as an arm of itself
 * Can control multiple robots at once (cooperative behavior)

The Control Code using the Player API is much more user-friendly and readable:

 * example.cc [1]
 * Player Manual: Position2dProxy Class Reference [2]

Modified Example for Wall-following:

 * example1.cc [3]

Multiple Robot Scouting:

 * example2.cc [4]

Compile with same command as before:

 $ g++ -o [executable name] `pkg-config --cflags playerc++` [filename].cc `pkg-config --libs playerc++`
Personal tools