Simple Controller in Player

From Murray Wiki
Revision as of 16:58, 19 January 2007 by Thorsley (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to 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.