blob: 8a6784925d8098ceafd328674bbcd250bc54d562 [file] [log] [blame]
Alex Perrycb7da4b2019-08-28 19:35:56 -07001include "frc971/control_loops/control_loops.fbs";
2
3namespace frc971.control_loops.drivetrain;
4
5enum ControllerType : byte {
6 POLYDRIVE,
7 MOTION_PROFILE,
8 SPLINE_FOLLOWER,
9 LINE_FOLLOWER,
10}
11
12table SplineGoal {
13 // index of the spline. Zero indicates the spline should not be computed.
14 spline_idx:int;
15
16 // Acutal spline.
17 spline:frc971.MultiSpline;
18
19 // Whether to follow the spline driving forwards or backwards.
20 drive_spline_backwards:bool;
21}
22
23table Goal {
24 // Position of the steering wheel (positive = turning left when going
25 // forwards).
26 wheel:float;
27 wheel_velocity:float;
28 wheel_torque:float;
29
30 // Position of the throttle (positive forwards).
31 throttle:float;
32 throttle_velocity:float;
33 throttle_torque:float;
34
35 // True to shift into high, false to shift into low.
36 highgear:bool;
37
38 // True to activate quickturn.
39 quickturn:bool;
40
41 // Type of controller in charge of the drivetrain.
42 controller_type:ControllerType;
43
44 // Position goals for each drivetrain side (in meters) when the
45 // closed-loop controller is active.
46 left_goal:double;
47 right_goal:double;
48
49 max_ss_voltage:float;
50
51 // Motion profile parameters.
52 // The control loop will profile if these are all non-zero.
53 linear:ProfileParameters;
54 angular:ProfileParameters;
55
56 // Parameters for a spline to follow. This just contains info on a spline to
57 // compute. Each time this is sent, spline drivetrain will compute a new
58 // spline.
59 spline:SplineGoal;
60
61 // Which spline to follow.
62 spline_handle:int;
63}
64
65root_type Goal;