blob: 0bb51e1aba6cab0294e2414d218083d9715e65ec [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 Upadhyay29dcc172022-04-02 19:21:30 -070040 // Positive is intaking front and spitting back, negative is the opposite
41 transfer_roller_speed:double (id: 5);
42 // Not used anymore - just one transfer roller speed to control both
43 transfer_roller_speed_back:double (id: 12, deprecated);
Henry Speiser55aa3ba2022-02-21 23:21:12 -080044
45 // Factor to multiply robot velocity by and add to roller voltage.
46 roller_speed_compensation:double (id: 6);
47
48 turret:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 7);
Austin Schuh39f26f62022-02-24 21:34:46 -080049
50 // Catapult goal state.
51 catapult:CatapultGoal (id: 8);
Ravago Jones5da06352022-03-04 20:26:24 -080052
53 // If true, fire! The robot will only fire when ready.
54 fire:bool (id: 9);
55
56 // Aborts the shooting process if the ball has been loaded into the catapult
57 // and the superstructure is in the LOADED state.
58 cancel_shot:bool (id: 10);
James Kuszmaul84083f42022-02-27 17:24:38 -080059
60 // If true, auto-track the turret to point at the goal.
61 auto_aim:bool (id: 11);
Milind Upadhyay803bbf02022-03-11 17:56:26 -080062
63 // If true, we started with the ball loaded and should proceed to that state.
Milind Upadhyay3f082d72022-03-11 21:49:43 -080064 preloaded:bool (id: 13);
James Kuszmaul40526952022-03-13 15:56:38 -070065
66 // Specifies which intake the turret should move to to intake.
67 turret_intake:RequestedIntake (id: 14);
milind-u086d7262022-01-19 20:44:18 -080068}
69
Ravago Jones5da06352022-03-04 20:26:24 -080070
71
milind-u086d7262022-01-19 20:44:18 -080072root_type Goal;