\input manualMacros.tex
\manBegin
\manPageInfo{RCCL Reference Manual}{}{}
\manTitle{movej}{3}
\manSection{NAME}
{\rightskip=0ptplus1fil
{\tt \manName{movej}}
-- RCCL joint level motion request primitive.

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

mid = movej (mnp, jnts)
  MANIP *mnp;
  JNTS *jnts;@endcverbatim
\manSection{ARGUMENTS}
\manItem{{\tt mnp} --}
Manipulator reference structure.
\manItem{{\tt jnts} --}
Joint values for the manipulator to move to.
\manItem{{\tt mid} --}
Motion ID. This is a non-negative number either assigned automatically
by the system or specified explicitly using {\tt setMotionFlag()}
before the call to {\tt movej()}.
\manSection{RESTRICTIONS}
This routine must be called from the planning level, and
does not work for virtual manipulators.
\manSection{DESCRIPTION}
The {\tt movej()} primitive
queues a request to move the indicated manipulator
to the location specified by the joint values {\tt jnts}.

Parameters controlling various aspects of
the motion (e.g., velocity or acceleration) are set {\it prior} to the call
using various 
{\it set} primitives. 
The requested motion will take place in 
joint mode, regardless of whatever interpolation mode has been 
established by {\tt setMod()}. 
Motion target offsets specified by {\tt distance()} or 
{\tt setDistance()} are ignored and cancelled.
{\tt movej()} also performs an implicit {\tt setConf()}, since the
joint values completely define the robot's configuration.
In other respects, {\tt movej()} behaves identically with the
{\tt move()} primitive. 

The returned motion ID value can be used to obtain status information
about the motion request (see {\tt motionStatus(3)}), cancel it
(see {\tt stopMotion(3)}), or wait for it to either begin executing
or finish
(see {\tt waitForStop(3)}). Motion IDs assigned by the system
are automatically invalidated and reused after {\tt NUM_SYSMFLAGS} subsequent
motion requests (on all manipulators). If this is undesirable,
a motion ID can be explicitly
set by the program with the primitive 
{\tt setMotionFlag()}.

\manSection{DIAGNOSTICS}
This routine returns {\tt -1} in the event of an error.
It will automatically abort the program if the option {\tt RCCL_ERROR_EXIT} is
set (see {\tt rcclSetOptions(3)}).
Error codes and messages are placed on the {\it errorStack} (q.v.). 
The following error codes may be set:

\manItem{{\tt ENoSpace} --}
The motion queue does not have enough space to store the requested motion
request packet.
\manItem{{\tt ELimit} --}
One or more of the requested joint values was out of range.
\manItem{{\tt ENotDefined} --}
An attempt was made apply {\tt movej()} on a virtual manipulator.
\manItem{{\tt EBadArg} --}
The pointer {\tt jnts} is {\tt NULL}.

The routine will abort the program if called from the control level.
\manSection{SEE ALSO}
\rightskip=0ptplus1fil
{\tt rcclCreate(3)}, {\tt move(3)},
{\tt waitForMotion(3)}, {\tt motionStatus(3)}, {\tt stopMotion(3)}, 
{\tt setMotionHold(3)},
{\tt distance(3)}, {\tt setConf(3)},
{\tt rcclSetOptions(3)}, {\tt errorStack(3)}.
\manEnd
\end

