tc.h
1 /******************************************************************** 2 * Description: tc.h 3 * Discriminate-based trajectory planning 4 * 5 * Derived from a work by Fred Proctor & Will Shackleford 6 * 7 * Author: 8 * License: GPL Version 2 9 * System: Linux 10 * 11 * Copyright (c) 2004 All rights reserved. 12 * 13 * Last change: 14 ********************************************************************/ 15 #ifndef TC_H 16 #define TC_H 17 18 #include "spherical_arc.h" 19 #include "posemath.h" 20 #include "emcpos.h" 21 #include "emcmotcfg.h" 22 #include "tc_types.h" 23 #include "tp_types.h" 24 25 double tcGetMaxTargetVel(TC_STRUCT const * const tc, 26 double max_scale); 27 28 double tcGetOverallMaxAccel(TC_STRUCT const * tc); 29 double tcGetTangentialMaxAccel(TC_STRUCT const * const tc); 30 31 int tcSetKinkProperties(TC_STRUCT *prev_tc, TC_STRUCT *tc, double kink_vel, double accel_reduction); 32 int tcInitKinkProperties(TC_STRUCT *tc); 33 int tcRemoveKinkProperties(TC_STRUCT *prev_tc, TC_STRUCT *tc); 34 int tcGetEndpoint(TC_STRUCT const * const tc, EmcPose * const out); 35 int tcGetStartpoint(TC_STRUCT const * const tc, EmcPose * const out); 36 int tcGetPos(TC_STRUCT const * const tc, EmcPose * const out); 37 int tcGetPosReal(TC_STRUCT const * const tc, int of_endpoint, EmcPose * const out); 38 int tcGetEndAccelUnitVector(TC_STRUCT const * const tc, PmCartesian * const out); 39 int tcGetStartAccelUnitVector(TC_STRUCT const * const tc, PmCartesian * const out); 40 int tcGetEndTangentUnitVector(TC_STRUCT const * const tc, PmCartesian * const out); 41 int tcGetStartTangentUnitVector(TC_STRUCT const * const tc, PmCartesian * const out); 42 43 double tcGetDistanceToGo(TC_STRUCT const * const tc, int direction); 44 double tcGetTarget(TC_STRUCT const * const tc, int direction); 45 46 int tcGetIntersectionPoint(TC_STRUCT const * const prev_tc, 47 TC_STRUCT const * const tc, PmCartesian * const point); 48 49 int tcCanConsume(TC_STRUCT const * const tc); 50 51 int tcSetTermCond(TC_STRUCT * prev_tc, TC_STRUCT * tc, int term_cond); 52 53 int tcConnectBlendArc(TC_STRUCT * const prev_tc, TC_STRUCT * const tc, 54 PmCartesian const * const circ_start, 55 PmCartesian const * const circ_end); 56 57 int tcIsBlending(TC_STRUCT * const tc); 58 59 60 int tcFindBlendTolerance(TC_STRUCT const * const prev_tc, 61 TC_STRUCT const * const tc, double * const T_blend, double * const nominal_tolerance); 62 63 int pmCircleTangentVector(PmCircle const * const circle, 64 double angle_in, PmCartesian * const out); 65 66 int tcFlagEarlyStop(TC_STRUCT * const tc, 67 TC_STRUCT * const nexttc); 68 69 double pmLine9Target(PmLine9 * const line9); 70 71 int pmLine9Init(PmLine9 * const line9, 72 EmcPose const * const start, 73 EmcPose const * const end); 74 75 double pmCircle9Target(PmCircle9 const * const circ9); 76 77 int pmCircle9Init(PmCircle9 * const circ9, 78 EmcPose const * const start, 79 EmcPose const * const end, 80 PmCartesian const * const center, 81 PmCartesian const * const normal, 82 int turn); 83 84 int pmRigidTapInit(PmRigidTap * const tap, 85 EmcPose const * const start, 86 EmcPose const * const end, 87 double reversal_scale); 88 89 double pmRigidTapTarget(PmRigidTap * const tap, double uu_per_rev); 90 91 int tcInit(TC_STRUCT * const tc, 92 int motion_type, 93 int canon_motion_type, 94 double cycle_time, 95 unsigned char enables, 96 char atspeed); 97 98 int tcSetupFromTP(TC_STRUCT * const tc, TP_STRUCT const * const tp); 99 100 int tcSetupMotion(TC_STRUCT * const tc, 101 double vel, 102 double ini_maxvel, 103 double acc); 104 105 int tcSetupState(TC_STRUCT * const tc, TP_STRUCT const * const tp); 106 107 int tcUpdateCircleAccRatio(TC_STRUCT * tc); 108 109 int tcFinalizeLength(TC_STRUCT * const tc); 110 111 int tcClampVelocityByLength(TC_STRUCT * const tc); 112 113 int tcPureRotaryCheck(TC_STRUCT const * const tc); 114 115 int tcSetCircleXYZ(TC_STRUCT * const tc, PmCircle const * const circ); 116 117 int tcClearFlags(TC_STRUCT * const tc); 118 #endif /* TC_H */