setDistance(3)

NAME
setDistance -- offset the target position of an RCCL motion (transform specification).

USAGE
#include <rccl.h>

setDistance (mnp, tr)
  MANIP *mnp;
  TRSF *tr;

ARGUMENTS

mnp --
    Manipulator reference structure.

tr --
    Offset transformation.

RESTRICTIONS
This routine must be called from the planning level.

DESCRIPTION
This routine adds an offset to the target position of an RCCL motion (except for those initiated with movej() requests). It is useful for doing successive relative motions. Its companion routine, distance() (q.v.), does the same thing using a format-string, var-args specification.

The routine causes the target position of the next motion request to be offset by tr such that
                T6 TOOL = TARGET TR

The offset is valid for the next motion only. Relative motions can be achieved by using setDistance() in conjunction with the postion equation last, which is built into the MANIP structure. This equation describes the manipulator's location at the end of the previous motion, and has the form
                T6 = HERE .

HERE is the value of T6 at the end of the previous motion. To move by some relative displacement TR, then, we wish to satisfy the equation
                T6 = HERE TR

which can be done with the following construction:
        setDistance (mnp, tr);
        move (mnp, mnp->last);

setDistance() affects only move() requests; the specification is ignored by stop() requests and cancelled by movej() requests.

DIAGNOSTICS
The routine will abort the program if called from the control level.

SEE ALSO
distance(3), limit(3), move(3), rcclSetOptions(3).