blob: ab14238a472c5c3e2d52f76fc902658ec582cc7d [file] [log] [blame]
James Kuszmaul75a18c52021-03-10 22:02:07 -08001include "frc971/control_loops/control_loops.fbs";
2
3namespace frc971.control_loops.drivetrain.fb;
4
5enum SegmentConstraint : byte {
6 VELOCITY_LIMITED,
7 CURVATURE_LIMITED,
8 ACCELERATION_LIMITED,
9 DECELERATION_LIMITED,
10 VOLTAGE_LIMITED,
11}
12
13table 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
20table GainPoint {
21 distance: float (id: 0);
22 // Column-major matrix (should be 2 rows x 5 columns).
23 gains: [float] (id: 1);
24}
25
26table DistanceSpline {
27 spline:frc971.MultiSpline (id: 0);
28 distances:[float] (id: 1);
29}
30
31table 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
44root_type Trajectory;