-
Notifications
You must be signed in to change notification settings - Fork 12
/
DeltaKinematics.h
49 lines (34 loc) · 1009 Bytes
/
DeltaKinematics.h
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
#ifndef DeltaKinematics_h
#define DeltaKinematics_h
#define sqrt3 1.7320508075688772935274463415059
#define pi 3.1415926535897932384626433832795 // PI
#define sin120 sqrt3/2.0
#define cos120 -0.5
#define tan60 sqrt3
#define sin30 0.5
#define tan30 1.0/sqrt3
#define non_existing_povar_error -2
#define no_error 1
class DeltaKinematics
{
public:
// SETUP
DeltaKinematics(double _ArmLength,double _RodLength,double _BassTri,double _PlatformTri);
int forward();
int forward(double thetaA, double thetaB, double thetaC);
int inverse();
int inverse(double x0, double y0, double z0);
double x;
double y;
double z;
double a;
double b;
double c;
private:
int delta_calcAngleYZ(double *Angle, double x0, double y0, double z0);
double ArmLength;
double RodLength;
double BassTri;
double PlatformTri;
};
#endif