blob: d96df453dcff032076f926a821097a9d15903f49 [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";
James Kuszmaul2549e752024-01-20 17:42:51 -08005include "frc971/control_loops/drivetrain/drivetrain_config.fbs";
Niko Sohmers3860f8a2024-01-12 21:05:19 -08006
7namespace y2024;
8
Jim Ostrowskicb8b4082024-01-21 02:23:46 -08009table CameraConfiguration {
10 calibration:frc971.vision.calibration.CameraCalibration (id: 0);
11}
12
Maxwell Henderson93f37f22024-01-19 17:08:23 -080013table ShotParams {
14 shot_velocity: double (id: 0);
Maxwell Hendersoned970292024-02-02 20:08:08 -080015
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 Henderson93f37f22024-01-19 17:08:23 -080024}
25
26table InterpolationTablePoint {
27 distance_from_goal: double (id: 0);
28 shot_params: ShotParams (id: 1);
29}
Niko Sohmers3860f8a2024-01-12 21:05:19 -080030
Niko Sohmersb21dbdc2024-01-20 20:06:59 -080031// Amount of voltage to give to the intake rollers when:
James Kuszmaul2549e752024-01-20 17:42:51 -080032// spitting, which represents voltage when IntakeRollerGoal is SPITTING
Niko Sohmersb21dbdc2024-01-20 20:06:59 -080033// and intaking, which represents voltage when IntakeRollerGoal is INTAKING
34table IntakeRollerVoltages {
35 spitting:double (id: 0);
36 intaking:double (id: 1);
37}
Niko Sohmers3860f8a2024-01-12 21:05:19 -080038
Niko Sohmersb21dbdc2024-01-20 20:06:59 -080039// 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
42table IntakePivotSetPoints {
43 extended:double (id: 0);
44 retracted:double (id: 1);
45}
46
Filip Kujawa37aa0bc2024-01-31 20:59:49 -080047// 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
51table ClimberSetPoints {
52 full_extend:double (id: 0);
53 half_extend:double (id: 1);
54 retract:double (id: 2);
55}
56
57table PotAndAbsEncoderConstants {
58 zeroing_constants:frc971.zeroing.PotAndAbsoluteEncoderZeroingConstants (id: 0);
Niko Sohmersb21dbdc2024-01-20 20:06:59 -080059 potentiometer_offset:double (id: 1);
60}
61
Niko Sohmers1259b2a2024-01-29 18:00:37 -080062// Stores current limits for motors
63table 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 Sohmersed7ffc42024-02-03 16:05:19 -080068 transfer_roller_supply_current_limit:double (id: 4);
69 transfer_roller_stator_current_limit:double (id: 5);
Maxwell Hendersonfb3bfea2024-02-03 19:24:46 -080070 drivetrain_supply_current_limit:double (id: 6);
71 drivetrain_stator_current_limit:double (id: 7);
Filip Kujawa749f2442024-02-04 01:12:35 -080072 climber_supply_current_limit:double (id: 8);
73 climber_stator_current_limit:double (id: 9);
Niko Sohmers1259b2a2024-01-29 18:00:37 -080074}
75
Nathan Leongb7a81bf2024-02-03 16:04:17 -080076table TransferRollerVoltages {
77 transfer_in:double (id: 0);
78 transfer_out:double (id: 1);
79}
80
Austin Schuh3db875a2024-02-18 20:02:40 -080081// Extend positions
82table ExtendSetPoints {
83 extended:double (id: 0);
84 retracted:double (id: 1);
85}
86
Niko Sohmersb21dbdc2024-01-20 20:06:59 -080087table RobotConstants {
Niko Sohmers74b0ad52024-02-03 18:00:31 -080088 intake_constants:frc971.zeroing.AbsoluteEncoderZeroingConstants (id: 0);
Filip Kujawa37aa0bc2024-01-31 20:59:49 -080089 climber_constants:PotAndAbsEncoderConstants (id: 1);
Niko Sohmers3bfe3d62024-02-18 16:09:49 -080090 catapult_constants:PotAndAbsEncoderConstants (id: 2);
91 altitude_constants:PotAndAbsEncoderConstants (id: 3);
92 turret_constants:PotAndAbsEncoderConstants (id: 4);
Austin Schuh3db875a2024-02-18 20:02:40 -080093 extend_constants:PotAndAbsEncoderConstants (id: 5);
Niko Sohmersb21dbdc2024-01-20 20:06:59 -080094}
95
96// Common table for constants unrelated to the robot
97table Common {
98 target_map:frc971.vision.TargetMap (id: 0);
99 shooter_interpolation_table: [InterpolationTablePoint] (id: 1);
100 intake_roller_voltages:IntakeRollerVoltages (id : 2);
101 intake_pivot_set_points:IntakePivotSetPoints (id: 3);
102 intake_pivot:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 4);
Niko Sohmers3bfe3d62024-02-18 16:09:49 -0800103
James Kuszmaul2549e752024-01-20 17:42:51 -0800104 drivetrain:frc971.control_loops.drivetrain.fbs.DrivetrainConfig (id: 5);
Niko Sohmers1259b2a2024-01-29 18:00:37 -0800105 current_limits:CurrentLimits (id: 6);
Nathan Leongb7a81bf2024-02-03 16:04:17 -0800106 transfer_roller_voltages:TransferRollerVoltages (id: 7);
Filip Kujawa37aa0bc2024-01-31 20:59:49 -0800107 climber:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 8);
108 climber_set_points:ClimberSetPoints (id: 9);
Maxwell Hendersoned970292024-02-02 20:08:08 -0800109 turret_loading_position: double (id: 10);
110 catapult_return_position: double (id: 11);
Niko Sohmers3bfe3d62024-02-18 16:09:49 -0800111 catapult:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 12);
112 altitude:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 13);
113 turret:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 14);
Austin Schuh3db875a2024-02-18 20:02:40 -0800114 extend:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemCommonParams (id: 15);
115 extend_setpoints:ExtendSetPoints (id: 16);
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800116}
117
118table Constants {
Niko Sohmersb21dbdc2024-01-20 20:06:59 -0800119 robot:RobotConstants (id: 0);
120 common:Common (id: 1);
Jim Ostrowskicb8b4082024-01-21 02:23:46 -0800121 cameras:[CameraConfiguration] (id: 2);
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800122}
123
James Kuszmaul2549e752024-01-20 17:42:51 -0800124root_type Constants;