summaryrefslogtreecommitdiff
path: root/src/emc/tp/tp.h
blob: 301e4ac5c182427ba9d16a6a073a9873ee9d4435 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/********************************************************************
* Description: tp.h
*   Trajectory planner based on TC elements
*
*   Derived from a work by Fred Proctor & Will Shackleford
*
* Author:
* License: GPL Version 2
* System: Linux
*    
* Copyright (c) 2004 All rights reserved.
*
********************************************************************/
#ifndef TP_H
#define TP_H

#include "posemath.h"
#include "tc_types.h"
#include "tp_types.h"
#include "tcq.h"

int tpCreate(TP_STRUCT * const tp, int _queueSize, TC_STRUCT * const tcSpace);
int tpClear(TP_STRUCT * const tp);
int tpInit(TP_STRUCT * const tp);
int tpClearDIOs(TP_STRUCT * const tp);
int tpSetCycleTime(TP_STRUCT * const tp, double secs);
int tpSetVmax(TP_STRUCT * const tp, double vmax, double ini_maxvel);
int tpSetVlimit(TP_STRUCT * const tp, double vLimit);
int tpSetAmax(TP_STRUCT * const tp, double aMax);
int tpSetId(TP_STRUCT * const tp, int id);
int tpGetExecId(TP_STRUCT * const tp);
int tpSetTermCond(TP_STRUCT * const tp, int cond, double tolerance);
int tpSetPos(TP_STRUCT * const tp, EmcPose const * const pos);
int tpAddCurrentPos(TP_STRUCT * const tp, EmcPose const * const disp);
int tpSetCurrentPos(TP_STRUCT * const tp, EmcPose const * const pos);
int tpAddRigidTap(TP_STRUCT * const tp, EmcPose end, double vel, double
        ini_maxvel, double acc, unsigned char enables);
int tpAddLine(TP_STRUCT * const tp, EmcPose end, int canon_motion_type, double vel, double
                     ini_maxvel, double acc, unsigned char enables, char atspeed, int indexrotary);
int tpAddCircle(TP_STRUCT * const tp, EmcPose end, PmCartesian center,
        PmCartesian normal, int turn, int canon_motion_type, double vel, double ini_maxvel,
                       double acc, unsigned char enables, char atspeed);
int tpRunCycle(TP_STRUCT * const tp, long period);
int tpPause(TP_STRUCT * const tp);
int tpResume(TP_STRUCT * const tp);
int tpAbort(TP_STRUCT * const tp);
int tpGetPos(TP_STRUCT const  * const tp, EmcPose * const pos);
int tpIsDone(TP_STRUCT * const tp);
int tpQueueDepth(TP_STRUCT * const tp);
int tpActiveDepth(TP_STRUCT * const tp);
int tpGetMotionType(TP_STRUCT * const tp);
int tpSetSpindleSync(TP_STRUCT * const tp, double sync, int wait);
void tpToggleDIOs(TC_STRUCT * const tc); //gets called when a new tc is taken from the queue. it checks and toggles all needed DIO's

int tpSetAout(TP_STRUCT * const tp, unsigned char index, double start, double end);
int tpSetDout(TP_STRUCT * const tp, int index, unsigned char start, unsigned char end); //gets called to place DIO toggles on the TC queue

#endif				/* TP_H */