#ifndef _KYNMACROS_H_
#define _KYNMACROS_H_

/*-=-=-=-=-=-=-=-=-=-=-=- RCCL/RCI Notice of Copyright -=-=-=-=-=-=-=-=-=-=-*
 *									    *
 *	Copyright (C) 1991 by John E. Lloyd.				    *
 *									    *
 *	Information on copyright permissions, as well as a complete	    *
 *	disclaimer of warranty, is given in the file COPYRIGHT.		    *
 *									    *
 *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/

/*---------------------------------------------------------------------------
 *
 * DESCRIPTION:	Wrapper macros for the kinematic functions.
 * 
 * AUTHOR/DATE:	John Lloyd, Fall 1988
 *
 * MODIFICATION HISTORY:
 *
 *--------------------------------------------------------------------------*/

#include "../h/robot_kynvar.h"

/* these macros present wrappers around the existing kinematic functions
   so that the data structures are hidden.

   Some of this interface ultimately needs to be cleaned up -- i.e.,
   the function defs should be made robot independant. That can be
   done as soon as we have a better idea of exactly what kinematic
   routines we need.

   These macros also make explicit use of a variable 'rbt'.
*/

#define FWD_KINEMATICS(t,c,j,v)	\
	fwdKinematics ((t), (c), (j), rbt->kyn,(void*)(v))

#define INV_KINEMATICS(j,t,c,r,v) \
 invKinematics ((j),(t),(c),(r),rbt->kyn,rbt->jls,(void*)(v))

#define RANGE_ANGLES(jo,ji,jr) \
	rangeAngles ((jo),(ji),(jr),rbt->kyn,rbt->jls)

#define FWD_JACOB(x,y) \
	fwdJacobVar ((DIFF*)(x), (float*)(y), rbt->var, rbt->kyn)

#define FWD_JACOBT(x,y)	\
	fwdJacobTVar ((float*)(x), (FORCE*)(y), rbt->var, rbt->kyn)

#define INV_JACOB(x,y,e) \
	invJacobVar ((float*)(x), (DIFF*)(y), rbt->var, rbt->kyn, (e))

#define INV_JACOBT(x,y,e) \
	invJacobTVar ((FORCE*)(x), (float*)(y), rbt->var, rbt->kyn, (e))

#endif
