ARMS  3.1.1
Documentation for ARMS movement library
pid.h
1 #ifndef _ARMS_PID_H_
2 #define _ARMS_PID_H_
3 
4 #include <array>
5 
6 namespace arms::pid {
7 
8 // pid mode enums
9 extern int mode;
10 #define DISABLE 0
11 #define TRANSLATIONAL 1
12 #define ANGULAR 2
13 
14 // pid constants
15 extern double linearKP;
16 extern double linearKI;
17 extern double linearKD;
18 extern double angularKP;
19 extern double angularKI;
20 extern double angularKD;
21 extern double trackingKP;
22 extern double minError;
23 
24 // integral
25 extern double in_lin;
26 extern double in_ang;
27 
28 // targets
29 extern double angularTarget;
30 extern Point pointTarget;
31 
32 // flags
33 extern bool thru;
34 extern bool reverse;
35 
36 extern bool canReverse;
37 
38 // pid functions
39 std::array<double, 2> translational();
40 std::array<double, 2> angular();
41 
42 // initializer
43 
50 void init(double linearKP, double linearKI, double linearKD, double angularKP,
51  double angularKI, double angularKD, double trackingKP, double minError, double leadPct);
52 
53 } // namespace arms::pid
54 
55 #endif
void init()
Initialize ARMS using the user defined constants Example 1:
Definition: config.h:566