motionStatus(3)

NAME
motionStatus, motionStopCode, motionStartCode, motionScale, getActiveMotionId -- obtain status information for an RCCL motion request.

USAGE
motionStatus (mid)
  int mid;

motionStopCode (mid)
  int mid;

motionStartCode (mid)
  int mid;

float motionScale (mid)
  int mid;

getActiveMotionId (mnp)
  MANIP *mnp;

ARGUMENTS

mid --
    Motion ID. This is the number returned by a motion request (such as move() or stop()). This number is normally assigned automatically by the system, but can be specified explicitly using setMotionFlag().

mnp --
    Manipulator reference structure.

DESCRIPTION
These routines return information about a particular motion or stop request.

motionStatus() returns the status of the motion request. The status values, defined in <rccl.h>, include:

M_PENDING --
    Request is on the queue.

M_RUNNING --
    Request is being serviced.

M_PAUSED --
    Request has been paused.

M_FINISHED --
    Request has finished.

motionStopCode() returns the completion code that is set for the motion when it finishes. System supplied completion codes, defined in <rccl.h>, include:

ON_NORMAL --
    Normal completion.

ON_ABORT --
    Motion was aborted while it was still on the queue.

ON_FORCE --
    Motion was stopped by hitting a force limit (not currently used).

ON_DISP --
    Motion was stopped by hitting a displacement limit (not currently used).

UNDEF will be returned if the motion has not yet finished. Other codes can be specified if the motion is terminated by the application (such as with stopMotion()).

motionStartCode() returns the start code that is set when a motion begins executing. System supplied start codes, defined in <rccl.h>, include:

ON_NORMAL --
    Normal motion start.

UNDEF will be returned if the motion has not yet started. Other codes can be specified if the application uses startMotion().

motionScale() returns a scale parameter which varies linearly with time from 0.0 to 1.0 as the motion proceeds from start to completion. Because of the way RCCL blends together adjacent motions, the scale value will normally be slightly negative at the very beginning of the motion. This is because the trajectory generator begins to pre-evaluate the motion path before the nominal starting time.

getActiveMotionId() returns the ID of whatever motion is currently being executed on a particular manipulator, or UNDEF if the manipulator is not currently executing any motion.

The system has NUM_SYSMFLAGS motion flags available for automatic assignment to motion requests. When it runs out of flags, it reuses them, starting with the one least recently assigned. As an alternative to this, the program can explicitly specify a motion ID ahead of time using setMotionFlag().

DIAGNOSTICS
These routines return MSTAT_ERROR in the event of an error (which is converted to a float in the case of motionScale()). They will automatically abort the program if the option RCCL_ERROR_EXIT is set (see rcclSetOptions(3)). Error codes and messages are placed on the errorStack (q.v.). The following error codes may be set:

EDescriptor --
    A motion ID was specified that was either illegal or no longer valid.

SEE ALSO
move(3), stop(3), waitForStop(3), stopMotion(3), startMotion(3), setMotionFlag(3), rcclSetOptions(3), errorStack(3).