Merge remote-tracking branch 'origin/fix/USBSerial-breaks-if-host-doesnt-assert-DTR...
[clinton/Smoothieware.git] / src / modules / robot / arm_solutions / RostockSolution.h
1 #ifndef ROSTOCKSOLUTION_H
2 #define ROSTOCKSOLUTION_H
3 #include "libs/Module.h"
4 #include "libs/Kernel.h"
5 #include "BaseSolution.h"
6 #include "libs/nuts_bolts.h"
7
8 #include "libs/Config.h"
9
10 #define alpha_steps_per_mm_checksum CHECKSUM("alpha_steps_per_mm")
11 #define beta_steps_per_mm_checksum CHECKSUM("beta_steps_per_mm")
12 #define gamma_steps_per_mm_checksum CHECKSUM("gamma_steps_per_mm")
13
14 #define arm_length_checksum CHECKSUM("arm_length")
15 #define arm_radius_checksum CHECKSUM("arm_radius")
16
17 #define alpha_angle_checksum CHECKSUM("alpha_angle")
18 #define beta_relative_angle_checksum CHECKSUM("beta_relative_angle")
19 #define gamma_relative_angle_checksum CHECKSUM("gamma_relative_angle")
20
21 class RostockSolution : public BaseSolution {
22 public:
23 RostockSolution(Config* passed_config);
24 void millimeters_to_steps( double millimeters[], int steps[] );
25 void steps_to_millimeters( int steps[], double millimeters[] );
26
27 void set_steps_per_millimeter( double steps[] );
28 void get_steps_per_millimeter( double steps[] );
29
30 float solve_arm( float millimeters[] );
31 void rotate( float in[], float out[], float sin, float cos );
32
33 Config* config;
34 float alpha_steps_per_mm;
35 float beta_steps_per_mm;
36 float gamma_steps_per_mm;
37
38 float arm_length;
39 float arm_radius;
40 float arm_length_squared;
41
42 float sin_alpha;
43 float cos_alpha;
44 float sin_beta;
45 float cos_beta;
46 float sin_gamma;
47 float cos_gamma;
48 };
49
50
51
52
53
54
55 #endif // ROSTOCKSOLUTION_H