blob: 4d4a81f6ad25da1706cfaeaf6c0b67cd3bce8404 [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
milind-u6e7d8d42022-04-06 18:30:43 -070029 // True if the servo should be released.
30 // Positive is moving it out
31 climber_servo:bool (id: 15);
32
Henry Speiser55aa3ba2022-02-21 23:21:12 -080033 // Goal angles of intake joints.
34 // Positive is out, 0 is up.
35 intake_front:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 1);
36 intake_back:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 2);
37
38 // Positive is rollers intaking.
Milind Upadhyay918ecf02022-03-12 15:55:46 -080039 // When spinning the rollers, the turret will be moved to that side,
40 // so both shouldn't be positive at the same time.
Henry Speiser55aa3ba2022-02-21 23:21:12 -080041 roller_speed_front:double (id: 3);
42 roller_speed_back:double (id: 4);
Milind Upadhyay918ecf02022-03-12 15:55:46 -080043
Milind Upadhyay29dcc172022-04-02 19:21:30 -070044 // Positive is intaking front and spitting back, negative is the opposite
45 transfer_roller_speed:double (id: 5);
46 // Not used anymore - just one transfer roller speed to control both
47 transfer_roller_speed_back:double (id: 12, deprecated);
Henry Speiser55aa3ba2022-02-21 23:21:12 -080048
49 // Factor to multiply robot velocity by and add to roller voltage.
50 roller_speed_compensation:double (id: 6);
51
52 turret:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 7);
Austin Schuh39f26f62022-02-24 21:34:46 -080053
54 // Catapult goal state.
55 catapult:CatapultGoal (id: 8);
Ravago Jones5da06352022-03-04 20:26:24 -080056
57 // If true, fire! The robot will only fire when ready.
58 fire:bool (id: 9);
59
60 // Aborts the shooting process if the ball has been loaded into the catapult
61 // and the superstructure is in the LOADED state.
62 cancel_shot:bool (id: 10);
James Kuszmaul84083f42022-02-27 17:24:38 -080063
64 // If true, auto-track the turret to point at the goal.
65 auto_aim:bool (id: 11);
Milind Upadhyay803bbf02022-03-11 17:56:26 -080066
67 // If true, we started with the ball loaded and should proceed to that state.
Milind Upadhyay3f082d72022-03-11 21:49:43 -080068 preloaded:bool (id: 13);
James Kuszmaul40526952022-03-13 15:56:38 -070069
70 // Specifies which intake the turret should move to to intake.
71 turret_intake:RequestedIntake (id: 14);
milind-u086d7262022-01-19 20:44:18 -080072}
73
Ravago Jones5da06352022-03-04 20:26:24 -080074
75
milind-u086d7262022-01-19 20:44:18 -080076root_type Goal;