James Kuszmaul | 75a18c5 | 2021-03-10 22:02:07 -0800 | [diff] [blame] | 1 | include "frc971/control_loops/control_loops.fbs"; |
| 2 | |
| 3 | namespace frc971.control_loops.drivetrain.fb; |
| 4 | |
| 5 | enum SegmentConstraint : byte { |
| 6 | VELOCITY_LIMITED, |
| 7 | CURVATURE_LIMITED, |
| 8 | ACCELERATION_LIMITED, |
| 9 | DECELERATION_LIMITED, |
| 10 | VOLTAGE_LIMITED, |
| 11 | } |
| 12 | |
| 13 | table PlanPoint { |
| 14 | // Distance along the path of this point. |
| 15 | distance: float (id: 0); |
| 16 | velocity: float (id: 1); |
| 17 | segment_constraint: SegmentConstraint (id: 2); |
| 18 | } |
| 19 | |
| 20 | table GainPoint { |
| 21 | distance: float (id: 0); |
| 22 | // Column-major matrix (should be 2 rows x 5 columns). |
| 23 | gains: [float] (id: 1); |
| 24 | } |
| 25 | |
| 26 | table DistanceSpline { |
| 27 | spline:frc971.MultiSpline (id: 0); |
| 28 | distances:[float] (id: 1); |
| 29 | } |
| 30 | |
| 31 | table Trajectory { |
| 32 | // Unique ID of the trajectory, same as that defined in the SplineGoal. |
| 33 | handle:int (id: 0); |
| 34 | // Spline plan, indexed on distance. |
| 35 | distance_based_plan : [PlanPoint] (id : 1); |
| 36 | // Gains, indexed on time. |
| 37 | gains: [GainPoint] (id: 2); |
| 38 | spline:DistanceSpline (id: 3); |
| 39 | |
| 40 | // Whether to follow the spline driving forwards or backwards. |
| 41 | drive_spline_backwards:bool (id: 4); |
| 42 | } |
| 43 | |
| 44 | root_type Trajectory; |