1. Establish connection ...is accomplished with PlayerClient robot(gHostname,gPort). PlayerClient establishes a connection to the Player server on the local machine by constructing a client object usually called robot with a host and and a port number | 2.Subscribe device(s) ...is accomplished by proxies such as Position2dProxy pp(&robot,gIndex and ore SonarProxy(&robot, gIndex). The object, robot, is used to as an argument to the constructor proxies for controlling mobile robot movement in the dimension space. | 3. Read Sensory Data ... initializes proxies to NULL and then creates the necessary proxies such as, SonarProxy. Once established proxy objects, provide a continuous stream of buffered readings to the robots' control program. The Player client continuously updates and processes the reading by the robots' device proxy objects. |
Summary These five steps summarize the basic flow of robot control and have been used to describe the program randomwalk.cc which, attempts to avoid obstacles by setting parameter: speed to 0 and yawing either -40 or 40 degrees. When an obstacle is not in the robot path, the robot moves forward at speed .200 and yaws randomly between -20 and 20 degree every 3 seconds. Laserobstacleavoid and sonarobstacleavoid work similarly. |