Jim Ostrowski | cb8b408 | 2024-01-21 02:23:46 -0800 | [diff] [blame] | 1 | include "frc971/vision/calibration.fbs"; |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 2 | include "frc971/vision/target_map.fbs"; |
Niko Sohmers | b21dbdc | 2024-01-20 20:06:59 -0800 | [diff] [blame] | 3 | include "frc971/control_loops/profiled_subsystem.fbs"; |
| 4 | include "frc971/zeroing/constants.fbs"; |
James Kuszmaul | 2549e75 | 2024-01-20 17:42:51 -0800 | [diff] [blame] | 5 | include "frc971/control_loops/drivetrain/drivetrain_config.fbs"; |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 6 | |
| 7 | namespace y2024; |
| 8 | |
Jim Ostrowski | cb8b408 | 2024-01-21 02:23:46 -0800 | [diff] [blame] | 9 | table CameraConfiguration { |
| 10 | calibration:frc971.vision.calibration.CameraCalibration (id: 0); |
| 11 | } |
| 12 | |
Maxwell Henderson | 93f37f2 | 2024-01-19 17:08:23 -0800 | [diff] [blame] | 13 | table ShotParams { |
| 14 | shot_velocity: double (id: 0); |
Maxwell Henderson | ed97029 | 2024-02-02 20:08:08 -0800 | [diff] [blame] | 15 | |
| 16 | // Angle of the altitude |
| 17 | shot_altitude_angle: double (id: 1); |
| 18 | |
| 19 | // Angle of the catapult |
| 20 | shot_catapult_angle: double (id: 2); |
| 21 | |
| 22 | // Speed over ground to use for shooting on the fly |
| 23 | shot_speed_over_ground: double (id: 3); |
Maxwell Henderson | 93f37f2 | 2024-01-19 17:08:23 -0800 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | table InterpolationTablePoint { |
| 27 | distance_from_goal: double (id: 0); |
| 28 | shot_params: ShotParams (id: 1); |
| 29 | } |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 30 | |
Niko Sohmers | b21dbdc | 2024-01-20 20:06:59 -0800 | [diff] [blame] | 31 | // Amount of voltage to give to the intake rollers when: |
James Kuszmaul | 2549e75 | 2024-01-20 17:42:51 -0800 | [diff] [blame] | 32 | // spitting, which represents voltage when IntakeRollerGoal is SPITTING |
Niko Sohmers | b21dbdc | 2024-01-20 20:06:59 -0800 | [diff] [blame] | 33 | // and intaking, which represents voltage when IntakeRollerGoal is INTAKING |
| 34 | table IntakeRollerVoltages { |
| 35 | spitting:double (id: 0); |
| 36 | intaking:double (id: 1); |
| 37 | } |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 38 | |
Niko Sohmers | b21dbdc | 2024-01-20 20:06:59 -0800 | [diff] [blame] | 39 | // Set points for the pivot in radians when: |
| 40 | // extended, which represents radians for when IntakePivotGoal is EXTENDED |
| 41 | // and retracted, which represents radians for when IntakePivotGoal is RETRACTED or NONE |
| 42 | table IntakePivotSetPoints { |
| 43 | extended:double (id: 0); |
| 44 | retracted:double (id: 1); |
| 45 | } |
| 46 | |
Filip Kujawa | 37aa0bc | 2024-01-31 20:59:49 -0800 | [diff] [blame] | 47 | // Set points for the climber in meters when: |
| 48 | // fully extended, which represents meters for when ClimberGoal is FULL_EXTEND |
| 49 | // partially extended, which represents meters for when ClimberGoal is HALF_EXTEND |
| 50 | // and retracted, which represents meters for when ClimberGoal is RETRACT |
| 51 | table ClimberSetPoints { |
| 52 | full_extend:double (id: 0); |
| 53 | half_extend:double (id: 1); |
| 54 | retract:double (id: 2); |
| 55 | } |
| 56 | |
| 57 | table PotAndAbsEncoderConstants { |
| 58 | zeroing_constants:frc971.zeroing.PotAndAbsoluteEncoderZeroingConstants (id: 0); |
Niko Sohmers | b21dbdc | 2024-01-20 20:06:59 -0800 | [diff] [blame] | 59 | potentiometer_offset:double (id: 1); |
| 60 | } |
| 61 | |
Niko Sohmers | 1259b2a | 2024-01-29 18:00:37 -0800 | [diff] [blame] | 62 | // Stores current limits for motors |
| 63 | table CurrentLimits { |
| 64 | intake_pivot_supply_current_limit:double (id: 0); |
| 65 | intake_pivot_stator_current_limit:double (id: 1); |
| 66 | intake_roller_supply_current_limit:double (id: 2); |
| 67 | intake_roller_stator_current_limit:double (id: 3); |
Niko Sohmers | ed7ffc4 | 2024-02-03 16:05:19 -0800 | [diff] [blame] | 68 | transfer_roller_supply_current_limit:double (id: 4); |
| 69 | transfer_roller_stator_current_limit:double (id: 5); |
Maxwell Henderson | fb3bfea | 2024-02-03 19:24:46 -0800 | [diff] [blame] | 70 | drivetrain_supply_current_limit:double (id: 6); |
| 71 | drivetrain_stator_current_limit:double (id: 7); |
Filip Kujawa | 749f244 | 2024-02-04 01:12:35 -0800 | [diff] [blame] | 72 | climber_supply_current_limit:double (id: 8); |
| 73 | climber_stator_current_limit:double (id: 9); |
Filip Kujawa | d75252a | 2024-02-10 16:54:35 -0800 | [diff] [blame] | 74 | extend_supply_current_limit:double (id: 10); |
| 75 | extend_stator_current_limit:double (id: 11); |
| 76 | extend_roller_supply_current_limit:double (id: 12); |
| 77 | extend_roller_stator_current_limit:double (id: 13); |
Niko Sohmers | 1259b2a | 2024-01-29 18:00:37 -0800 | [diff] [blame] | 78 | } |
| 79 | |
Nathan Leong | b7a81bf | 2024-02-03 16:04:17 -0800 | [diff] [blame] | 80 | table TransferRollerVoltages { |
| 81 | transfer_in:double (id: 0); |
| 82 | transfer_out:double (id: 1); |
| 83 | } |
| 84 | |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 85 | table ExtendRollerVoltages { |
| 86 | scoring:double (id: 0); |
| 87 | reversing:double (id: 1); |
| 88 | } |
| 89 | |
Austin Schuh | 3db875a | 2024-02-18 20:02:40 -0800 | [diff] [blame] | 90 | // Extend positions |
| 91 | table ExtendSetPoints { |
| 92 | extended:double (id: 0); |
| 93 | retracted:double (id: 1); |
| 94 | } |
| 95 | |
Niko Sohmers | b21dbdc | 2024-01-20 20:06:59 -0800 | [diff] [blame] | 96 | table RobotConstants { |
Niko Sohmers | 74b0ad5 | 2024-02-03 18:00:31 -0800 | [diff] [blame] | 97 | intake_constants:frc971.zeroing.AbsoluteEncoderZeroingConstants (id: 0); |
Filip Kujawa | 37aa0bc | 2024-01-31 20:59:49 -0800 | [diff] [blame] | 98 | climber_constants:PotAndAbsEncoderConstants (id: 1); |
Niko Sohmers | 3bfe3d6 | 2024-02-18 16:09:49 -0800 | [diff] [blame] | 99 | catapult_constants:PotAndAbsEncoderConstants (id: 2); |
| 100 | altitude_constants:PotAndAbsEncoderConstants (id: 3); |
| 101 | turret_constants:PotAndAbsEncoderConstants (id: 4); |
Austin Schuh | 3db875a | 2024-02-18 20:02:40 -0800 | [diff] [blame] | 102 | extend_constants:PotAndAbsEncoderConstants (id: 5); |
Niko Sohmers | b21dbdc | 2024-01-20 20:06:59 -0800 | [diff] [blame] | 103 | } |
| 104 | |
| 105 | // Common table for constants unrelated to the robot |
| 106 | table Common { |
| 107 | target_map:frc971.vision.TargetMap (id: 0); |
| 108 | shooter_interpolation_table: [InterpolationTablePoint] (id: 1); |
| 109 | intake_roller_voltages:IntakeRollerVoltages (id : 2); |
| 110 | intake_pivot_set_points:IntakePivotSetPoints (id: 3); |
| 111 | intake_pivot:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 4); |
Niko Sohmers | 3bfe3d6 | 2024-02-18 16:09:49 -0800 | [diff] [blame] | 112 | |
James Kuszmaul | 2549e75 | 2024-01-20 17:42:51 -0800 | [diff] [blame] | 113 | drivetrain:frc971.control_loops.drivetrain.fbs.DrivetrainConfig (id: 5); |
Niko Sohmers | 1259b2a | 2024-01-29 18:00:37 -0800 | [diff] [blame] | 114 | current_limits:CurrentLimits (id: 6); |
Nathan Leong | b7a81bf | 2024-02-03 16:04:17 -0800 | [diff] [blame] | 115 | transfer_roller_voltages:TransferRollerVoltages (id: 7); |
Filip Kujawa | 37aa0bc | 2024-01-31 20:59:49 -0800 | [diff] [blame] | 116 | climber:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 8); |
| 117 | climber_set_points:ClimberSetPoints (id: 9); |
Maxwell Henderson | ed97029 | 2024-02-02 20:08:08 -0800 | [diff] [blame] | 118 | turret_loading_position: double (id: 10); |
| 119 | catapult_return_position: double (id: 11); |
Niko Sohmers | 3bfe3d6 | 2024-02-18 16:09:49 -0800 | [diff] [blame] | 120 | catapult:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 12); |
| 121 | altitude:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 13); |
| 122 | turret:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 14); |
Austin Schuh | 3db875a | 2024-02-18 20:02:40 -0800 | [diff] [blame] | 123 | extend:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 15); |
| 124 | extend_setpoints:ExtendSetPoints (id: 16); |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 125 | extend_roller_voltages:ExtendRollerVoltages (id: 17); |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | table Constants { |
Niko Sohmers | b21dbdc | 2024-01-20 20:06:59 -0800 | [diff] [blame] | 129 | robot:RobotConstants (id: 0); |
| 130 | common:Common (id: 1); |
Jim Ostrowski | cb8b408 | 2024-01-21 02:23:46 -0800 | [diff] [blame] | 131 | cameras:[CameraConfiguration] (id: 2); |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 132 | } |
| 133 | |
James Kuszmaul | 2549e75 | 2024-01-20 17:42:51 -0800 | [diff] [blame] | 134 | root_type Constants; |