Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

tp.h

Go to the documentation of this file.
00001 #ifndef TP_H
00002 #define TP_H
00003 
00004 /*
00005    tp.h
00006 
00007    Trajectory planner based on TC elements
00008 
00009    Modification history:
00010 
00011    17-Aug-2001  FMP added aout,dout motion IO
00012    13-Mar-2000 WPS added unused attribute to tp_h to avoid 'defined but not used' compiler warning.
00013    8-Jun-1999  FMP added tpSetVlimit(), vLimit
00014    8-Mar-1999  FMP added tcSpace arg to tpCreate()
00015    18-Dec-1997  FMP took out C++ interface
00016    18-Dec-1997  FMP changed to PmPose
00017    18-Jul-1997  FMP added active depth
00018    16-Jul-1997  FMP added ids
00019    14-Jul-1997  FMP added C posemath changes (PM_POSE -> PmPose)
00020    24-Jun-1997  FMP added tpClear()
00021    13-Jun-1997  FMP added tpSetVscale(), tpIsPaused(), abort stuff
00022    16-Apr-1997  FMP created from C and C++ headers
00023 */
00024 
00025 #include "posemath.h"
00026 #include "tc.h"
00027 
00028 /* ident tag */
00029 #ifndef __GNUC__
00030 #ifndef __attribute__
00031 #define __attribute__(x)
00032 #endif
00033 #endif
00034 
00035 static char __attribute__((unused)) tp_h[] = "$Id: tp.h,v 1.4 2001/08/17 22:05:41 proctor Exp $";
00036 
00037 #define TP_DEFAULT_QUEUE_SIZE 32
00038 
00039 typedef struct
00040 {
00041   TC_QUEUE_STRUCT queue;
00042   int queueSize;
00043   double cycleTime;
00044   double vMax;                  /* vel for subsequent moves */
00045   double vScale, vRestore;
00046   double aMax;
00047   double vLimit;                /* absolute upper limit on all vels */
00048   double wMax;                  /* rotational velocity max  */
00049   double wDotMax;               /* rotational accelleration max */
00050   int nextId;
00051   int execId;
00052   int termCond;
00053   EmcPose currentPos;
00054   EmcPose goalPos;
00055   int done;
00056   int depth;                    /* number of total queued motions */
00057   int activeDepth;              /* number of motions blending */
00058   int aborting;
00059   int pausing;
00060   unsigned char douts;          /* mask for douts to set */
00061   unsigned char doutstart;      /* mask for dout start vals */
00062   unsigned char doutend;        /* mask for dout end vals */
00063 } TP_STRUCT;
00064 
00065 extern int tpCreate(TP_STRUCT *tp, int _queueSize, TC_STRUCT *tcSpace);
00066 extern int tpDelete(TP_STRUCT *tp);
00067 extern int tpClear(TP_STRUCT *tp);
00068 extern int tpInit(TP_STRUCT *tp);
00069 extern int tpSetCycleTime(TP_STRUCT *tp, double secs);
00070 extern int tpSetVmax(TP_STRUCT *tp, double vmax);
00071 extern int tpSetWmax(TP_STRUCT *tp, double vmax);
00072 extern int tpSetVlimit(TP_STRUCT *tp, double limit);
00073 extern int tpSetVscale(TP_STRUCT *tp, double scale); /* 0.0 .. large */
00074 extern int tpSetAmax(TP_STRUCT *tp, double amax);
00075 extern int tpSetWDotmax(TP_STRUCT *tp, double amax);
00076 extern int tpSetId(TP_STRUCT *tp, int id);
00077 extern int tpGetNextId(TP_STRUCT *tp);
00078 extern int tpGetExecId(TP_STRUCT *tp);
00079 extern int tpSetTermCond(TP_STRUCT *tp, int cond);
00080 extern int tpGetTermCond(TP_STRUCT *tp);
00081 extern int tpSetPos(TP_STRUCT *tp, EmcPose pos);
00082 extern int tpAddLine(TP_STRUCT *tp, EmcPose end);
00083 extern int tpAddCircle(TP_STRUCT *tp, EmcPose end,
00084                        PmCartesian center, PmCartesian normal, int turn);
00085 extern int tpRunCycle(TP_STRUCT *tp);
00086 extern int tpPause(TP_STRUCT *tp);
00087 extern int tpResume(TP_STRUCT *tp);
00088 extern int tpAbort(TP_STRUCT *tp);
00089 extern EmcPose tpGetPos(TP_STRUCT *tp);
00090 extern int tpIsDone(TP_STRUCT *tp);
00091 extern int tpIsPaused(TP_STRUCT *tp);
00092 extern int tpQueueDepth(TP_STRUCT *tp);
00093 extern int tpActiveDepth(TP_STRUCT *tp);
00094 extern void tpPrint(TP_STRUCT *tp);
00095 extern int tpSetAout(TP_STRUCT *tp, unsigned char index, double start, double end);
00096 extern int tpSetDout(TP_STRUCT *tp, unsigned char index, unsigned char start, unsigned char end);
00097 
00098 #endif /* TP_H */

Generated on Sun Dec 2 15:27:44 2001 for EMC by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001