blob: 7227dc256c489ec5384e00422ffd001f8de91c9e [file] [log] [blame]
milind-u086d7262022-01-19 20:44:18 -08001include "frc971/control_loops/profiled_subsystem.fbs";
2
3namespace y2022.control_loops.superstructure;
4
James Kuszmaul40526952022-03-13 15:56:38 -07005// Which intake to transfer to the turret from.
6enum RequestedIntake : ubyte {
7 kFront = 0,
8 kBack = 1,
9}
10
Austin Schuh39f26f62022-02-24 21:34:46 -080011table CatapultGoal {
Ravago Jones5da06352022-03-04 20:26:24 -080012 // Old fire flag, only kept for backwards-compatability with logs.
13 // Use the fire flag in the root Goal instead
14 fire:bool (id: 0, deprecated);
Austin Schuh39f26f62022-02-24 21:34:46 -080015
16 // The target shot position and velocity. If these are provided before fire
17 // is called, the optimizer can pre-compute the trajectory.
18 shot_position:double (id: 1);
19 shot_velocity:double (id: 2);
20
21 // The target position to return the catapult to when not shooting.
22 return_position:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 3);
23}
24
milind-u086d7262022-01-19 20:44:18 -080025table Goal {
Siddhant Kanwar0e37f592022-02-21 19:26:50 -080026 // Height of the climber above rest point
27 climber:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 0);
Henry Speiser55aa3ba2022-02-21 23:21:12 -080028
29 // Goal angles of intake joints.
30 // Positive is out, 0 is up.
31 intake_front:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 1);
32 intake_back:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 2);
33
34 // Positive is rollers intaking.
Milind Upadhyay918ecf02022-03-12 15:55:46 -080035 // When spinning the rollers, the turret will be moved to that side,
36 // so both shouldn't be positive at the same time.
Henry Speiser55aa3ba2022-02-21 23:21:12 -080037 roller_speed_front:double (id: 3);
38 roller_speed_back:double (id: 4);
Milind Upadhyay918ecf02022-03-12 15:55:46 -080039
Milind Upadhyayb1a74ea2022-03-09 20:34:35 -080040 transfer_roller_speed_front:double (id: 5);
41 transfer_roller_speed_back:double (id: 12);
Henry Speiser55aa3ba2022-02-21 23:21:12 -080042
43 // Factor to multiply robot velocity by and add to roller voltage.
44 roller_speed_compensation:double (id: 6);
45
46 turret:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 7);
Austin Schuh39f26f62022-02-24 21:34:46 -080047
48 // Catapult goal state.
49 catapult:CatapultGoal (id: 8);
Ravago Jones5da06352022-03-04 20:26:24 -080050
51 // If true, fire! The robot will only fire when ready.
52 fire:bool (id: 9);
53
54 // Aborts the shooting process if the ball has been loaded into the catapult
55 // and the superstructure is in the LOADED state.
56 cancel_shot:bool (id: 10);
James Kuszmaul84083f42022-02-27 17:24:38 -080057
58 // If true, auto-track the turret to point at the goal.
59 auto_aim:bool (id: 11);
Milind Upadhyay803bbf02022-03-11 17:56:26 -080060
61 // If true, we started with the ball loaded and should proceed to that state.
Milind Upadhyay3f082d72022-03-11 21:49:43 -080062 preloaded:bool (id: 13);
James Kuszmaul40526952022-03-13 15:56:38 -070063
64 // Specifies which intake the turret should move to to intake.
65 turret_intake:RequestedIntake (id: 14);
milind-u086d7262022-01-19 20:44:18 -080066}
67
Ravago Jones5da06352022-03-04 20:26:24 -080068
69
milind-u086d7262022-01-19 20:44:18 -080070root_type Goal;