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

/*----------McGill-Computer-Vision-and-Robotics-Laboratory--C-File-----------
 *
 * FILE NAME:	h/kine.h
 *
 * DESCRIPTION: defintions of structures to contain kinematic constants
 *		and terms. Also defined here are macros to update the
 *		jacobian related terms in the 'sncs_d' structure.
 *
 * AUTHOR:	Vincent Hayward, Purdue University, 1983.
 *		CVaRL installation and modification by John Lloyd.
 *
 * NOTES:
 *
 *-------------McGill-Computer-Vision-and-Robotics-Laboratory--------------*/

#ifndef KINEH
#define KINEH

#ifndef RCCLH
#include "rccl.h"
#endif

#define ALIGN_DEG       01              /* T6 in X Z Jt 1 plan          */
#define ELBOW_DEG       02              /* elbow degeneracy             */
#define WRIST_DEG       04              /* wrist degeneracy             */

/*
 * kinematic constants and gravity loading coefficients
 */

typedef struct kindyn {
	       float a2, d3, d4, d32, e42, e4ad;
	       float cp20, cp21, cp30, cp50;
} KINDYN, *KINDYN_PTR;

/*
 * sines and cosines of the joint angles, terms of the jacobian, a single
 * term 'h' of the jacobian, and the transform U5 mapping link 6 to link 4.
 *
 * The terms stored for the jacobian are as follows:
 *
 *		| d1x  d2x  d3x    .    .    .  |
 *		| d1y  d2y    .    .    .    .  |
 *	J  =	| d1z  d2z  d3z    .    .    .  |
 *		| r1x    .    .    .    .    .  |
 *		|   .    .    .    .    .    .  |
 *		| r1z    .    .    .    .    .  |
 *
 *  The terms h1, h2, and h3 are used in the inverse Jacobian calculations.
 */

typedef struct sincos {
	float c1, s1, c2, s2, c23, s23, c3, s3, c4, s4, c5, s5, c6, s6;
	float d1x, d1y, d1z, r1x, r1z, d2x, d2y, d2z, d3x, d3y, d3z;
	float h1, h2, h3;
	TRSF u5;
} SNCS, *SNCS_PTR;

extern  KINDYN  armk_c;                 /* arm kinematic and dynamic    */
					/* constants                    */
extern  JNTS    jready_c;               /* rest position joint range    */

extern  JNTS    jmin_c;                 /* angles range offset values   */

extern  JNTS    jrng_c;                 /* maximum joint range values   */

extern  JNTS    jmxv_c;                 /* max joint velocities */

#endif
