\input manualMacros.tex
\manBegin
\manPageInfo{RCI Reference Manual}{}{}
\manTitle{fwdJacobVar}{3}
\manSection{NAME}
{\rightskip=0ptplus1fil
{\tt \manName{fwdJacobVar}},
{\tt \manName{invJacobVar}},
{\tt \manName{fwdJacobTVar}},
{\tt \manName{invJacobTVar}}
-- RCI routines to do Jacobian computations using the robot 
{\tt VAR} structure.

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

fwdJacobVar(dc, dj, var, kyn)
   DIFF *dc;
   float *dj;
   void *var;
   KYN *kyn;

fwdJacobTVar(t, f, var, kyn)
   float *t;
   FORCE *f;
   void *var;
   KYN *kyn;

invJacobVar(dj, dc, var, kyn, epsilon)
   float *dj;
   DIFF *dc;
   void *var;
   KYN *kyn;
   float epsilon;

invJacobTVar(f, t, var, kyn, epsilon)
   FORCE *f;
   float *t;
   void *var;
   KYN *kyn;
   float epsilon;
@endcverbatim
\manSection{ARGUMENTS}
\manItem{{\tt dc} --}
Differential coordinate changes in Cartesian space.
\manItem{{\tt dj} --}
Differential coordinate changes in joint space.
\manItem{{\tt t} --}
(Nominally) forces in joint space.
\manItem{{\tt f} --}
(Nominally) forces in Cartesian space.
\manItem{{\tt kyn} --}
Robot's {\tt KYN} structure.
\manItem{{\tt var} --}
Robot's {\tt VAR} structure (see below).
\manItem{{\tt espilon} --}
Specifies, in radians, how close inverse computations are allowed to
get to a singularity before the result is ``fudged''.
\manSection{DESCRIPTION}
These routines perform the same Jacobian computations
as {\tt fwdJacob()}, {\tt fwdJacobT()}, {\tt invJacob()}, and
{\tt invJacobT()}. They differ from the latter routines only
in that they take a pointer to the robot's {\tt VAR} structure in
place of a set of joint values.

A {\tt VAR} structure is used to store certain kinematic terms that are
functions of the joint position, such as the sines and cosines of the 
joint angles, or some Jacobian terms. Storing these quantities in a separate
structure allows them to be reused by different routines without having to be
recomputed. 

For more details on the {\tt VAR} structure and how to create and update it,
see the manual page {\tt VAR(3)}.

Before being called with any of these functions, the {\tt VAR} structure must
be updated for the current robot position, and it must be reupdated 
for every new robot position. 
Below is a complete example of allocating a {\tt VAR} structure and using
it to call {\tt fwdJacobVar()} and {\tt fwdJacobTVar()}, for a 6 DOF robot
named {\tt "Zeus"}:
\cverbatim
        float ang[6];      /* robot joint positions */
        DIFF dc;           /* Cartesian displacement */
        FORCE f;           /* Cartesian force */
        float t[6], dj[6]; /* joint torque and displacement */ 
        void *var;
        KYN *kyn;

        /* ... update ang, dj, and f ... */

        kyn = getKyn("Zeus", (int*)0);
        var = malloc(getVarSize("Zeus"));

        updateVar (kyn, ang, kyn);   /* update VAR structure */
        fwdJacob (&dc, dj, var, kyn);
        fwdJacobT (t, &f, var, kyn);
@endcverbatim
\manInset{{\bf NOTE:} To make this example work at the RCI control level, the
call to {\tt malloc()} should be replaced with {\tt rciMalloc()}, and
the call to {\tt getKyn()} should be replaced with {\tt rciGetKyn()}.}
\manSection{DIAGNOSTICS}
Same as for the functions {\tt fwdJacob()}, etc.
\manSection{SEE ALSO}
\rightskip=0ptplus1fil
{\tt fwdJacob(3)}, {\tt KYN(3)}, {\tt VAR(3)}, {\tt getKyn(3)}, 
{\tt updateVar(3)}.

\manEnd
\end
