Simple Controller in Player

From MurrayWiki
Revision as of 19:59, 18 January 2007 by Thorsley (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Documentation for the Client Libraries can be found at [1]

For C++, the first few lines of a controller (in a .cc file) will look something like:

    using namespace PlayerCc;

    // Connect to Player server
    robot = new PlayerClient(gHostname, gPort);

    // Request sensor data
    pp = new Position2dProxy(robot, gIndex);
    sp = new SonarProxy(robot, gIndex);

This code creates a PlayerClient, the connection between your controller and your robot. In this case, the robot supplies 2d position data (x,y, and theta) and sonar data to the controller.