blob: 7816563ee0c8eb4b414558ac4e324b2d0be8f2fa [file] [log] [blame]
milind-u086d7262022-01-19 20:44:18 -08001include "frc971/control_loops/profiled_subsystem.fbs";
2
3namespace y2022.control_loops.superstructure;
4
Austin Schuh39f26f62022-02-24 21:34:46 -08005table CatapultGoal {
Ravago Jones5da06352022-03-04 20:26:24 -08006 // Old fire flag, only kept for backwards-compatability with logs.
7 // Use the fire flag in the root Goal instead
8 fire:bool (id: 0, deprecated);
Austin Schuh39f26f62022-02-24 21:34:46 -08009
10 // The target shot position and velocity. If these are provided before fire
11 // is called, the optimizer can pre-compute the trajectory.
12 shot_position:double (id: 1);
13 shot_velocity:double (id: 2);
14
15 // The target position to return the catapult to when not shooting.
16 return_position:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 3);
17}
18
milind-u086d7262022-01-19 20:44:18 -080019table Goal {
Siddhant Kanwar0e37f592022-02-21 19:26:50 -080020 // Height of the climber above rest point
21 climber:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 0);
Henry Speiser55aa3ba2022-02-21 23:21:12 -080022
23 // Goal angles of intake joints.
24 // Positive is out, 0 is up.
25 intake_front:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 1);
26 intake_back:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 2);
27
28 // Positive is rollers intaking.
Milind Upadhyay918ecf02022-03-12 15:55:46 -080029 // When spinning the rollers, the turret will be moved to that side,
30 // so both shouldn't be positive at the same time.
Henry Speiser55aa3ba2022-02-21 23:21:12 -080031 roller_speed_front:double (id: 3);
32 roller_speed_back:double (id: 4);
Milind Upadhyay918ecf02022-03-12 15:55:46 -080033
Milind Upadhyayb1a74ea2022-03-09 20:34:35 -080034 transfer_roller_speed_front:double (id: 5);
35 transfer_roller_speed_back:double (id: 12);
Henry Speiser55aa3ba2022-02-21 23:21:12 -080036
37 // Factor to multiply robot velocity by and add to roller voltage.
38 roller_speed_compensation:double (id: 6);
39
40 turret:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 7);
Austin Schuh39f26f62022-02-24 21:34:46 -080041
42 // Catapult goal state.
43 catapult:CatapultGoal (id: 8);
Ravago Jones5da06352022-03-04 20:26:24 -080044
45 // If true, fire! The robot will only fire when ready.
46 fire:bool (id: 9);
47
48 // Aborts the shooting process if the ball has been loaded into the catapult
49 // and the superstructure is in the LOADED state.
50 cancel_shot:bool (id: 10);
James Kuszmaul84083f42022-02-27 17:24:38 -080051
52 // If true, auto-track the turret to point at the goal.
53 auto_aim:bool (id: 11);
Milind Upadhyay803bbf02022-03-11 17:56:26 -080054
55 // If true, we started with the ball loaded and should proceed to that state.
Milind Upadhyay3f082d72022-03-11 21:49:43 -080056 preloaded:bool (id: 13);
milind-u086d7262022-01-19 20:44:18 -080057}
58
Ravago Jones5da06352022-03-04 20:26:24 -080059
60
milind-u086d7262022-01-19 20:44:18 -080061root_type Goal;