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

#ifndef _SCARA_KYN_H_
#define _SCARA_KYN_H_

#include "../h/robotTypes.h"
#include "../h/robot_kynvar.h"
#include "../h/scara_jls.h"

#define SCARA_ELBOW_DEG  0x0200   /* elbow is flat out			*/
#define SCARA_WRIST_DEG  KYN_WRIST_SING

#define SCARA_RIGHT_CONF 0x0001	 /* right-handed configuration 		*/
#define SCARA_FLIP_CONF	 0x0002	 /* wrist-flip configuration		*/

typedef struct {

	float	cp30;		/* joint 3 gravity load coefficient	*/
	float	cp50;		/* joint 5 gravity load coefficient	*/

} SCARA_KYN;

typedef struct {
	float	c[SCARAJ];	/* sines of the joint angles 		*/
	float	s[SCARAJ];	/* coines of the joint angles 		*/
	float	c12, s12;	/* sine/cosine of ang1 + ang2		*/

	TRSF	u4;		/* transform from link 3 to link 6	*/
} SCARA_VAR;

extern scaraFwdKinematics PROTO((FWDKINEMATICS_PROTO));
extern scaraInvKinematics PROTO((INVKINEMATICS_PROTO));
extern scaraRangeAngles PROTO((RANGEANGLES_PROTO));
extern scaraSolveConf PROTO((SOLVECONF_PROTO));
extern scaraStrToConfig PROTO((STRTOCONFIG_PROTO));
extern scaraConfigToStr PROTO((CONFIGTOSTR_PROTO));
extern scaraFwdJacob PROTO((FWDJACOB_PROTO));
extern scaraInvJacob PROTO((INVJACOB_PROTO));
extern scaraFwdJacobT PROTO((FWDJACOBT_PROTO));
extern scaraInvJacobT PROTO((INVJACOBT_PROTO));
extern scaraGravload PROTO((GRAVLOAD_PROTO));
extern scaraUpdateVar PROTO((UPDATEVAR_PROTO));
extern scaraUpdateVarXsincos PROTO((UPDATEVARXSINCOS_PROTO));
extern scaraFwdJacobVar PROTO((FWDJACOBVAR_PROTO));
extern scaraInvJacobVar PROTO((INVJACOBVAR_PROTO));
extern scaraFwdJacobTVar PROTO((FWDJACOBTVAR_PROTO));
extern scaraInvJacobTVar PROTO((INVJACOBTVAR_PROTO));
extern scaraGravloadVar PROTO((GRAVLOADVAR_PROTO));

#endif
