\input manualMacros.tex
\manBegin
\manPageInfo{RCCL Reference Manual}{}{}
\manTitle{setForceLimit}{3}
\manSection{NAME}
{\rightskip=0ptplus1fil
{\tt \manName{setForceLimit}},
{\tt \manName{setDispLimit}}
-- set force and displacement limits on RCCL motions (bitmask specification).

}
\manSection{USAGE}
\cverbatim
#include <rccl.h>

setForceLimit (mnp, mask, force)
  MANIP *mnp;
  unsigned long mask;
  FORCE *force;

setDispLimit (mnp, mask, diff)
  MANIP *mnp;
  unsigned long mask;
  DIFF *diff;
@endcverbatim
\manSection{ARGUMENTS}
\manItem{{\tt mnp} --}
Manipulator reference structure.
\manItem{{\tt mask} --}
Bitmask specifing degrees of freedom along or about which limits
are to be applied.
\manItem{{\tt force} --}
Force/torque limit values (Newtons or Newton-meters).
\manItem{{\tt diff} --}
Displacement limit values (mm. or degrees).
\manSection{RESTRICTIONS}
These routines must be called from the planning level.
\manSection{DESCRIPTION}
These routines request limit
conditions for an RCCL motion. The same thing can be done
by the companion routine {\tt limit()} (q.v.), which uses a format-string,
var-args specification instead of a bitmask.

RCCL does not (at present) implement limit checking. These are
interfacing primitives only. These routines only set directives
which must be read by application monitor functions which implement the
limit checking using appropriate sensor inputs.
Some discussion of how this may
be done is given in the ``RCCL User's Guide''.

Limit specifications are valid for the next motion only.
Both routines indicate the axes along or about which limits are requested
with bits set in the {\tt mask} argument:
\cverbatim
        ALONG_X         /* force or motion along the X axis */
        ALONG_Y         /* force or motion along the Y axis */
        ALONG_Z         /* force or motion along the Z axis */
        ABOUT_X         /* torque or motion about the X axis */
        ABOUT_Y         /* torque or motion about the Y axis */
        ABOUT_Z         /* torque or motion about the Z axis */
@endcverbatim

{\tt setForceLimits()} requests the next motion to monitor
force limits along or about the degrees of freedom specified by
{\tt mask}. The limit values are specified in the corresponding fields in the
{\tt force} argument. If a force limit is detected while the
motion is in progress, it should be terminated.

{\tt setDispLimits()} instructs the next motion to monitor
differential displacement limits along or about the degrees of freedom
specified by 
{\tt mask}. The limit values are specified in the corresponding fields in the
{\tt diff} argument. If the motion deviates from its desired trajectory
by more than the indicated limit, it should be terminated.

An application monitor may read back the limit conditions
which are in effect for the current motion using {\tt getActiveForceLimit()}
and {\tt getActiveDispLimit()}.  
Since RCCL does not actually implement the limit checking, 
applications are free to interpret these limit specifications
in any way they like. For instance, the displacement limits can be
interpreted as velocity limits.
\manSection{DIAGNOSTICS}
These routines will abort the program if called from the control level.
\manSection{SEE ALSO}
\rightskip=0ptplus1fil
{\tt limit(3)}, {\tt getActiveForceLimit(3)}, {\tt getActiveDispLimit(3)}, 
{\tt move(3)}, {\tt rcclSetOptions(3)}.
\manEnd
\end
