stopCurrentMotion(3)

NAME
stopCurrentMotion, flushMotionQueue -- cancel current RCCL motions.

USAGE
stopCurrentMotion(mnp, stopCode)
  MANIP *mnp;
  int stopCode;

flushMotionQueue(mnp);
  MANIP *mnp;

ARGUMENTS

mnp --
    Manipulator reference structure.

stopCode --
    Termination code. This can be used to indicate why the motion was terminated. The value is considered to be undefined if negative.

DESCRIPTION
These routines allow cancellation of any currently executing RCCL motions.

stopCurrentMotion() cancels any RCCL motion presently being executed (unless the current motion has been paused). The stop status associated with the motion is set to either stopCode, if that value is non-negative, or ON_ABORT otherwise.

flushMotionQueue() flushes all the pending motion requests on the motion queue for the indicated manipulator, and sets their stop statuses to ON_ABORT. It does not cancel the current motion request.

Typically, one wishes to both stop the current motion and flush the motion queue. When doing this, the motion queue should be flushed first, as in
        flushMotionQueue(mnp);
        stopCurrentMotion(mnp, 0);

Otherwise, the trajectory generator may remove another motion from the queue and start executing it after the current motion has been terminated but before the queue has been flushed.

DIAGNOSTICS
No errors are currently implemented.

SEE ALSO
stopMotion(3), pauseCurrentMotion(3), rcclSetOptions(3), errorStack(3).