blob: d2e4ede45d83c0ff65fd236144a06d15146c25d6 [file] [log] [blame]
Jim Ostrowskicb8b4082024-01-21 02:23:46 -08001include "frc971/vision/calibration.fbs";
Niko Sohmers3860f8a2024-01-12 21:05:19 -08002include "frc971/vision/target_map.fbs";
Niko Sohmersb21dbdc2024-01-20 20:06:59 -08003include "frc971/control_loops/profiled_subsystem.fbs";
4include "frc971/zeroing/constants.fbs";
Niko Sohmersc4d2c502024-02-19 19:35:35 -08005include "frc971/math/matrix.fbs";
James Kuszmaul2549e752024-01-20 17:42:51 -08006include "frc971/control_loops/drivetrain/drivetrain_config.fbs";
Niko Sohmers3860f8a2024-01-12 21:05:19 -08007
8namespace y2024;
9
Jim Ostrowskicb8b4082024-01-21 02:23:46 -080010table CameraConfiguration {
11 calibration:frc971.vision.calibration.CameraCalibration (id: 0);
12}
13
Maxwell Henderson93f37f22024-01-19 17:08:23 -080014table ShotParams {
15 shot_velocity: double (id: 0);
Maxwell Hendersoned970292024-02-02 20:08:08 -080016
17 // Angle of the altitude
18 shot_altitude_angle: double (id: 1);
19
20 // Angle of the catapult
21 shot_catapult_angle: double (id: 2);
22
23 // Speed over ground to use for shooting on the fly
24 shot_speed_over_ground: double (id: 3);
Maxwell Henderson93f37f22024-01-19 17:08:23 -080025}
26
27table InterpolationTablePoint {
28 distance_from_goal: double (id: 0);
29 shot_params: ShotParams (id: 1);
30}
Niko Sohmers3860f8a2024-01-12 21:05:19 -080031
Niko Sohmersb21dbdc2024-01-20 20:06:59 -080032// Amount of voltage to give to the intake rollers when:
James Kuszmaul2549e752024-01-20 17:42:51 -080033// spitting, which represents voltage when IntakeRollerGoal is SPITTING
Niko Sohmersb21dbdc2024-01-20 20:06:59 -080034// and intaking, which represents voltage when IntakeRollerGoal is INTAKING
35table IntakeRollerVoltages {
36 spitting:double (id: 0);
37 intaking:double (id: 1);
38}
Niko Sohmers3860f8a2024-01-12 21:05:19 -080039
Niko Sohmersb21dbdc2024-01-20 20:06:59 -080040// Set points for the pivot in radians when:
41// extended, which represents radians for when IntakePivotGoal is EXTENDED
42// and retracted, which represents radians for when IntakePivotGoal is RETRACTED or NONE
43table IntakePivotSetPoints {
44 extended:double (id: 0);
45 retracted:double (id: 1);
46}
47
Filip Kujawa37aa0bc2024-01-31 20:59:49 -080048// Set points for the climber in meters when:
49// fully extended, which represents meters for when ClimberGoal is FULL_EXTEND
50// partially extended, which represents meters for when ClimberGoal is HALF_EXTEND
51// and retracted, which represents meters for when ClimberGoal is RETRACT
52table ClimberSetPoints {
53 full_extend:double (id: 0);
Maxwell Henderson7db29782024-02-24 20:10:26 -080054 stowed:double (id: 1);
Filip Kujawa37aa0bc2024-01-31 20:59:49 -080055 retract:double (id: 2);
56}
57
58table PotAndAbsEncoderConstants {
59 zeroing_constants:frc971.zeroing.PotAndAbsoluteEncoderZeroingConstants (id: 0);
Niko Sohmersb21dbdc2024-01-20 20:06:59 -080060 potentiometer_offset:double (id: 1);
61}
62
Niko Sohmers1259b2a2024-01-29 18:00:37 -080063// Stores current limits for motors
64table CurrentLimits {
65 intake_pivot_supply_current_limit:double (id: 0);
66 intake_pivot_stator_current_limit:double (id: 1);
67 intake_roller_supply_current_limit:double (id: 2);
68 intake_roller_stator_current_limit:double (id: 3);
Niko Sohmersed7ffc42024-02-03 16:05:19 -080069 transfer_roller_supply_current_limit:double (id: 4);
70 transfer_roller_stator_current_limit:double (id: 5);
Maxwell Hendersonfb3bfea2024-02-03 19:24:46 -080071 drivetrain_supply_current_limit:double (id: 6);
72 drivetrain_stator_current_limit:double (id: 7);
Filip Kujawa749f2442024-02-04 01:12:35 -080073 climber_supply_current_limit:double (id: 8);
74 climber_stator_current_limit:double (id: 9);
Filip Kujawad75252a2024-02-10 16:54:35 -080075 extend_supply_current_limit:double (id: 10);
76 extend_stator_current_limit:double (id: 11);
77 extend_roller_supply_current_limit:double (id: 12);
78 extend_roller_stator_current_limit:double (id: 13);
Niko Sohmers27d92c62024-02-19 14:15:07 -080079 turret_supply_current_limit:double (id: 14);
80 turret_stator_current_limit:double (id: 15);
81 altitude_supply_current_limit:double (id: 16);
82 altitude_stator_current_limit:double (id: 17);
Maxwell Henderson862fc2c2024-02-23 16:04:37 -080083 retention_roller_supply_current_limit:double (id: 18);
84 retention_roller_stator_current_limit:double (id: 19);
Maxwell Hendersond5bf47a2024-02-23 17:16:48 -080085 slower_retention_roller_stator_current_limit:double (id: 20);
Maxwell Henderson3d68e142024-02-25 09:58:11 -080086 catapult_supply_current_limit:double (id: 21);
87 catapult_stator_current_limit:double (id: 22);
Niko Sohmers1259b2a2024-01-29 18:00:37 -080088}
89
Nathan Leongb7a81bf2024-02-03 16:04:17 -080090table TransferRollerVoltages {
91 transfer_in:double (id: 0);
92 transfer_out:double (id: 1);
93}
94
Filip Kujawa102a9b22024-02-18 09:40:23 -080095table ExtendRollerVoltages {
96 scoring:double (id: 0);
97 reversing:double (id: 1);
98}
99
Austin Schuh3db875a2024-02-18 20:02:40 -0800100// Extend positions
101table ExtendSetPoints {
Filip Kujawa7a799602024-02-23 12:27:47 -0800102 // The position which lets us score on the trap.
103 trap:double (id: 0);
104 // The position which lets us score on the amp.
105 amp:double (id: 1);
106 // The position which lets us transfer into the catapult.
107 catapult:double (id: 2);
108 // The position near 0 where we are ready to intake a note.
109 retracted:double (id: 3);
Austin Schuh3db875a2024-02-18 20:02:40 -0800110}
111
Niko Sohmersb21dbdc2024-01-20 20:06:59 -0800112table RobotConstants {
Niko Sohmers74b0ad52024-02-03 18:00:31 -0800113 intake_constants:frc971.zeroing.AbsoluteEncoderZeroingConstants (id: 0);
Filip Kujawa37aa0bc2024-01-31 20:59:49 -0800114 climber_constants:PotAndAbsEncoderConstants (id: 1);
Niko Sohmers3bfe3d62024-02-18 16:09:49 -0800115 catapult_constants:PotAndAbsEncoderConstants (id: 2);
116 altitude_constants:PotAndAbsEncoderConstants (id: 3);
117 turret_constants:PotAndAbsEncoderConstants (id: 4);
Austin Schuh3db875a2024-02-18 20:02:40 -0800118 extend_constants:PotAndAbsEncoderConstants (id: 5);
Niko Sohmersb21dbdc2024-01-20 20:06:59 -0800119}
120
Filip Kujawa45d72cd2024-02-24 18:29:15 -0800121table ShooterSetPoint {
122 turret_position: double (id: 0);
123 altitude_position: double (id: 1);
124 shot_velocity:double (id: 2);
125}
126
Niko Sohmersc4d2c502024-02-19 19:35:35 -0800127table Pose {
128 // Pos is a 3x1 matrix which contains the (x, y, z) component of the Pose.
129 pos: frc971.fbs.Matrix (id: 0);
130 theta: double (id: 1);
131}
132
133table ShooterTargets {
134 // The Pose of the red and blue alliance speakers we are aiming at.
135 red_alliance: Pose (id: 0);
136 blue_alliance: Pose (id: 1);
137}
138
139table RetentionRollerVoltages {
140 retaining:double (id: 0);
141 spitting:double (id: 1);
142}
143
Niko Sohmersb21dbdc2024-01-20 20:06:59 -0800144// Common table for constants unrelated to the robot
145table Common {
146 target_map:frc971.vision.TargetMap (id: 0);
147 shooter_interpolation_table: [InterpolationTablePoint] (id: 1);
148 intake_roller_voltages:IntakeRollerVoltages (id : 2);
149 intake_pivot_set_points:IntakePivotSetPoints (id: 3);
150 intake_pivot:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 4);
James Kuszmaul2549e752024-01-20 17:42:51 -0800151 drivetrain:frc971.control_loops.drivetrain.fbs.DrivetrainConfig (id: 5);
Niko Sohmers1259b2a2024-01-29 18:00:37 -0800152 current_limits:CurrentLimits (id: 6);
Nathan Leongb7a81bf2024-02-03 16:04:17 -0800153 transfer_roller_voltages:TransferRollerVoltages (id: 7);
Filip Kujawa37aa0bc2024-01-31 20:59:49 -0800154 climber:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 8);
155 climber_set_points:ClimberSetPoints (id: 9);
Maxwell Hendersoned970292024-02-02 20:08:08 -0800156 turret_loading_position: double (id: 10);
157 catapult_return_position: double (id: 11);
Niko Sohmers3bfe3d62024-02-18 16:09:49 -0800158 catapult:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 12);
159 altitude:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 13);
160 turret:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 14);
Austin Schuh3db875a2024-02-18 20:02:40 -0800161 extend:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 15);
Filip Kujawa45d72cd2024-02-24 18:29:15 -0800162 extend_roller_voltages:ExtendRollerVoltages (id: 16);
163 shooter_targets:ShooterTargets (id: 17);
164 altitude_loading_position: double (id: 18);
165 retention_roller_voltages:RetentionRollerVoltages (id: 19);
166 min_altitude_shooting_angle: double (id: 20);
Maxwell Henderson3d68e142024-02-25 09:58:11 -0800167 max_altitude_shooting_angle: double (id: 25);
Filip Kujawa45d72cd2024-02-24 18:29:15 -0800168 shooter_speaker_set_point: ShooterSetPoint (id: 21);
169 shooter_podium_set_point: ShooterSetPoint (id: 22);
170 extend_set_points:ExtendSetPoints (id: 23);
Filip Kujawa7a799602024-02-23 12:27:47 -0800171 // The position to move the turret to when avoiding collision
172 // with the extend when the extend is moving to amp/trap position.
Filip Kujawa45d72cd2024-02-24 18:29:15 -0800173 turret_avoid_extend_collision_position: double (id: 24);
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800174}
175
176table Constants {
Niko Sohmersc4d2c502024-02-19 19:35:35 -0800177 cameras:[CameraConfiguration] (id: 0);
178 robot:RobotConstants (id: 1);
179 common:Common (id: 2);
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800180}
181
James Kuszmaul2549e752024-01-20 17:42:51 -0800182root_type Constants;