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 | |
Austin Schuh | 39f26f6 | 2022-02-24 21:34:46 -0800 | [diff] [blame] | 5 | table CatapultGoal { |
Ravago Jones | 5da0635 | 2022-03-04 20:26:24 -0800 | [diff] [blame] | 6 | // 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 Schuh | 39f26f6 | 2022-02-24 21:34:46 -0800 | [diff] [blame] | 9 | |
| 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-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 19 | table Goal { |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 20 | // Height of the climber above rest point |
| 21 | climber:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 0); |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 22 | |
| 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. |
| 29 | roller_speed_front:double (id: 3); |
| 30 | roller_speed_back:double (id: 4); |
| 31 | // One transfer motor for both sides |
| 32 | transfer_roller_speed:double (id: 5); |
| 33 | |
| 34 | // Factor to multiply robot velocity by and add to roller voltage. |
| 35 | roller_speed_compensation:double (id: 6); |
| 36 | |
| 37 | turret:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 7); |
Austin Schuh | 39f26f6 | 2022-02-24 21:34:46 -0800 | [diff] [blame] | 38 | |
| 39 | // Catapult goal state. |
| 40 | catapult:CatapultGoal (id: 8); |
Ravago Jones | 5da0635 | 2022-03-04 20:26:24 -0800 | [diff] [blame] | 41 | |
| 42 | // If true, fire! The robot will only fire when ready. |
| 43 | fire:bool (id: 9); |
| 44 | |
| 45 | // Aborts the shooting process if the ball has been loaded into the catapult |
| 46 | // and the superstructure is in the LOADED state. |
| 47 | cancel_shot:bool (id: 10); |
James Kuszmaul | 84083f4 | 2022-02-27 17:24:38 -0800 | [diff] [blame] | 48 | |
| 49 | // If true, auto-track the turret to point at the goal. |
| 50 | auto_aim:bool (id: 11); |
Milind Upadhyay | 803bbf0 | 2022-03-11 17:56:26 -0800 | [diff] [blame^] | 51 | |
| 52 | // If true, we started with the ball loaded and should proceed to that state. |
| 53 | preloaded:bool (id: 12); |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 54 | } |
| 55 | |
Ravago Jones | 5da0635 | 2022-03-04 20:26:24 -0800 | [diff] [blame] | 56 | |
| 57 | |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 58 | root_type Goal; |