Garcia C++ OverviewIndex

One of the main API interfaces for Garcia is implemented in C++.  The C++ implementation allows the creation of one main class, the acpGarcia class.  This class manages the link communication with the robot using a seperate thread internally.  The object can be used to retrieve information from the robot in the form of named properties.  For example, to get the battery voltage, you would get the floating point property "battery-voltage".  Similarly, all the properties of the acpGarcia object can be either set, retreived, or both.

The acpGarcia object also allows you to create behaviors based on built-in primitives.  These behaviors have properties as well.  An example would be a behavior created with the wall-hugging primitive .  This behaviors has properties that allows you to set which wall (right or left), the distance from the wall to follow, etc.  You can think of a behavior as a parametrized primitive.

Once created and parametrized, the behavior can be handed to the Garcia object for queuing on the behavior list.  As behaviors are completed, the next behavior in the list is executed, provided there were no errors in the previous behavior.  In this way, the user can queue up a series of primitives to complete a complex action and then move on in the code to perform other tasks while the behaviors are launched and monitored in the background.

Each behavior has callbacks that allow the user to learn of when they launch, when they complete, and potentially other conditions.  This allows the user to perform other tasks out-of-band based on where in the behavior list the robot currently is.  For instance, when the robot starts following a wall to the left, the user may want to query the right side rangers to verify the passing of an expected object on the right.  The left-wall-following routine would not continue as parametrized without knowing of the additional sensor query.

The Garcia object can also accept and execute an XML script that defines a series of parameterized behaviors.  The garcia object then processes the script and returns and overall error of whether the script had the expected results along the way at each distince behavior.  These scripts are easily edited outside your compiled code to effect changes in the behaviors and lists of actions.


version: 1.0, build 81007
© Copyright 1994-2008 Acroname, Inc., Boulder, Colorado.  All rights reserved.