milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 1 | include "frc971/control_loops/profiled_subsystem.fbs"; |
| 2 | |
| 3 | namespace y2022.control_loops.superstructure; |
| 4 | |
James Kuszmaul | 4052695 | 2022-03-13 15:56:38 -0700 | [diff] [blame^] | 5 | // Which intake to transfer to the turret from. |
| 6 | enum RequestedIntake : ubyte { |
| 7 | kFront = 0, |
| 8 | kBack = 1, |
| 9 | } |
| 10 | |
Austin Schuh | 39f26f6 | 2022-02-24 21:34:46 -0800 | [diff] [blame] | 11 | table CatapultGoal { |
Ravago Jones | 5da0635 | 2022-03-04 20:26:24 -0800 | [diff] [blame] | 12 | // 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 Schuh | 39f26f6 | 2022-02-24 21:34:46 -0800 | [diff] [blame] | 15 | |
| 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-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 25 | table Goal { |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 26 | // Height of the climber above rest point |
| 27 | climber:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 0); |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 28 | |
| 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 Upadhyay | 918ecf0 | 2022-03-12 15:55:46 -0800 | [diff] [blame] | 35 | // When spinning the rollers, the turret will be moved to that side, |
| 36 | // so both shouldn't be positive at the same time. |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 37 | roller_speed_front:double (id: 3); |
| 38 | roller_speed_back:double (id: 4); |
Milind Upadhyay | 918ecf0 | 2022-03-12 15:55:46 -0800 | [diff] [blame] | 39 | |
Milind Upadhyay | b1a74ea | 2022-03-09 20:34:35 -0800 | [diff] [blame] | 40 | transfer_roller_speed_front:double (id: 5); |
| 41 | transfer_roller_speed_back:double (id: 12); |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 42 | |
| 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 Schuh | 39f26f6 | 2022-02-24 21:34:46 -0800 | [diff] [blame] | 47 | |
| 48 | // Catapult goal state. |
| 49 | catapult:CatapultGoal (id: 8); |
Ravago Jones | 5da0635 | 2022-03-04 20:26:24 -0800 | [diff] [blame] | 50 | |
| 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 Kuszmaul | 84083f4 | 2022-02-27 17:24:38 -0800 | [diff] [blame] | 57 | |
| 58 | // If true, auto-track the turret to point at the goal. |
| 59 | auto_aim:bool (id: 11); |
Milind Upadhyay | 803bbf0 | 2022-03-11 17:56:26 -0800 | [diff] [blame] | 60 | |
| 61 | // If true, we started with the ball loaded and should proceed to that state. |
Milind Upadhyay | 3f082d7 | 2022-03-11 21:49:43 -0800 | [diff] [blame] | 62 | preloaded:bool (id: 13); |
James Kuszmaul | 4052695 | 2022-03-13 15:56:38 -0700 | [diff] [blame^] | 63 | |
| 64 | // Specifies which intake the turret should move to to intake. |
| 65 | turret_intake:RequestedIntake (id: 14); |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 66 | } |
| 67 | |
Ravago Jones | 5da0635 | 2022-03-04 20:26:24 -0800 | [diff] [blame] | 68 | |
| 69 | |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 70 | root_type Goal; |