Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 1 | #ifndef Y2021_BOT3_CONSTANTS_H_ |
| 2 | #define Y2021_BOT3_CONSTANTS_H_ |
| 3 | |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 4 | #include <array> |
Tyler Chatow | bf0609c | 2021-07-31 16:13:27 -0700 | [diff] [blame] | 5 | #include <cmath> |
| 6 | #include <cstdint> |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 7 | |
| 8 | #include "frc971/constants.h" |
| 9 | #include "frc971/control_loops/pose.h" |
| 10 | #include "frc971/control_loops/static_zeroing_single_dof_profiled_subsystem.h" |
| 11 | #include "y2021_bot3/control_loops/drivetrain/drivetrain_dog_motor_plant.h" |
| 12 | |
Stephan Pleines | d99b1ee | 2024-02-02 20:56:44 -0800 | [diff] [blame] | 13 | namespace y2021_bot3::constants { |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 14 | |
| 15 | struct Values { |
| 16 | static const int kZeroingSampleSize = 200; |
| 17 | |
| 18 | static constexpr double kDrivetrainCyclesPerRevolution() { return 512.0; } |
| 19 | static constexpr double kDrivetrainEncoderCountsPerRevolution() { |
| 20 | return kDrivetrainCyclesPerRevolution() * 4; |
| 21 | } |
| 22 | static constexpr double kDrivetrainEncoderRatio() { return (24.0 / 52.0); } |
| 23 | static constexpr double kMaxDrivetrainEncoderPulsesPerSecond() { |
| 24 | return control_loops::drivetrain::kFreeSpeed / (2.0 * M_PI) * |
| 25 | control_loops::drivetrain::kHighOutputRatio / |
| 26 | constants::Values::kDrivetrainEncoderRatio() * |
| 27 | kDrivetrainEncoderCountsPerRevolution(); |
| 28 | } |
Vinay Siva | 62e3d32 | 2021-08-14 17:37:51 -0700 | [diff] [blame] | 29 | static constexpr double kRollerSupplyCurrentLimit() { return 30.0; } |
| 30 | static constexpr double kRollerStatorCurrentLimit() { return 40.0; } |
Vinay Siva | 7cea8a8 | 2021-09-25 15:06:28 -0700 | [diff] [blame] | 31 | |
| 32 | // Climber |
| 33 | static constexpr double kClimberSupplyCurrentLimit() { return 60.0; } |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | // Creates (once) a Values instance for ::aos::network::GetTeamNumber() and |
| 37 | // returns a reference to it. |
| 38 | const Values &GetValues(); |
| 39 | |
| 40 | // Creates Values instances for each team number it is called with and returns |
| 41 | // them. |
| 42 | const Values &GetValuesForTeam(uint16_t team_number); |
| 43 | |
Stephan Pleines | d99b1ee | 2024-02-02 20:56:44 -0800 | [diff] [blame] | 44 | } // namespace y2021_bot3::constants |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 45 | |
| 46 | #endif // Y2021_BOT3_CONSTANTS_H_ |