| Essential Concepts | Index |
Here are the essential concepts you need to have in mind when working with the Garcia API and robot. All the documentation is written in terms of these concepts so make sure they are second nature prior to moving on.
Properties
Properties are attributes of objects in the Garcia API. A property is identified by a name or index. A value of a supported type is associated with each property. These values may be retrieved or set by the user.
Primitives
Primitives are the lowest level building blocks of the Garcia API. In computer graphics, rendering images boils down to the primitive of setting pixel colors. In much the same way, the Garcia primitives are the basic pieces of motion and action from which all high-level operations can be constructed. In the Garcia API, these primitives are implemented as plug-in modules. This allows easy changes, and introduction of new primitives within a consistent structure. Some example primitives might be saying a phrase on the text-to-speech synthesizer, moving straight forward, or following a wall on the left hand side of the robot. Each primitive has a set of properties that control its operation. Once a primitive is associated with specific values for its properties, it becomes a behavior.
Behaviors
A behavior is a primitive and set of properties that have been assigned specific values in order to perform a task. For example, a user might create a behavior called "foo" using a "move" primitive whose "distance" property is set to a value of "1.0" meters. When a behavior is performed, it passes these property values to the underlying primitive as parameters for execution. Behaviors can be combined into sequences in order to perform more complicated functions, like docking the robot at a charging station or navigating a pre-defined path.
Monitor
As behaviors are performed, a monitor program is always running within the robot itself. The monitor watches for error, end, or success conditions. The underlying primitives that comprise the behaviors manipulate the functioning of the monitor to suppress or enable various types of monitoring based on the needs of a particular primitive. For instance, a primitive that moves the robot forward may disable the rear rangers (for power conservation) and enable front sensors (to avoid obstacles). The monitor can stop the current primitive if conditions exist that prohibit the primitive from succeeding. An example of such a condition would be a stall of the motors when trying to move forward.
Geometry
When doing geometry with a Garcia robot, it is convenient to work in terms of a wheel axis, middle axis, and midpoint. The wheel axis passes through the center of the two drive wheels. When viewed from the top, the midpoint of the robot is the center point between the two wheel axes. The middle axis is perpendicular to the wheel axis and passes through the midpoint.
In the API, range values are always specified with respect to the wheel axis, middle axis, or the midpoint. A range value from a rear ranger is the distance between an object and the wheel axis. A range value from a side ranger is the distance between an object and the middle axis. A range value from a front ranger is the distance between an object and the midpoint.
