robotMacros(3)

NAME
ROBOT_DEV, ROBOT_WAKEUP, ROBOT_READY -- RCI robot support macros.

USAGE
#include <rci.h>

IO_DEVICE *ROBOT_DEV(rbt)
  RCI_RBT *rbt;

ROBOT_WAKEUP(rbt)
  RCI_RBT *rbt;

ROBOT_READY(rbt)
  RCI_RBT *rbt;

ARGUMENTS

rbt --
    Pointer to robot data structure.

DESCRIPTION
These macros provide a few "housekeeping" functions for robots which are attached to RCI tasks (see rciAttachRobot(3)); they may be called from any part of an RCI program.

ROBOT_DEV() returns a pointer to the I/O device associated with a robot. This is only valid if called from the control task to which the robot is attached.

ROBOT_WAKEUP() executes a function to "wake up" a robot for the next control cycle. The macro uses the "wakeup" and "wakeupArg" fields in the "rbt" structure; since these are usually instantiated by the robot interface startup function, this macro will not function properly until the startup function has been called (which is usually done inside the control task's startup function).

ROBOT_READY() tests to see if a robot is "ready"; that is, the feedback data for the next control cycle has been collected and is ready for reading by the control task. This macro is typically used inside a robot control task's "wakeup" function.

SEE ALSO
rciAttachRobot(3), rciWakeupOn(3), robotComfxns(7), controlFxns(7).