blob: f0cbacbe26fc76c69fd249fa18bf08353482ffe6 [file] [log] [blame]
Ravago Jones486de802021-05-19 20:47:55 -07001#ifndef Y2021_BOT3_CONSTANTS_H_
2#define Y2021_BOT3_CONSTANTS_H_
3
Ravago Jones486de802021-05-19 20:47:55 -07004#include <array>
Tyler Chatowbf0609c2021-07-31 16:13:27 -07005#include <cmath>
6#include <cstdint>
Ravago Jones486de802021-05-19 20:47:55 -07007
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
13namespace y2021_bot3 {
14namespace constants {
15
16struct Values {
17 static const int kZeroingSampleSize = 200;
18
19 static constexpr double kDrivetrainCyclesPerRevolution() { return 512.0; }
20 static constexpr double kDrivetrainEncoderCountsPerRevolution() {
21 return kDrivetrainCyclesPerRevolution() * 4;
22 }
23 static constexpr double kDrivetrainEncoderRatio() { return (24.0 / 52.0); }
24 static constexpr double kMaxDrivetrainEncoderPulsesPerSecond() {
25 return control_loops::drivetrain::kFreeSpeed / (2.0 * M_PI) *
26 control_loops::drivetrain::kHighOutputRatio /
27 constants::Values::kDrivetrainEncoderRatio() *
28 kDrivetrainEncoderCountsPerRevolution();
29 }
Vinay Siva62e3d322021-08-14 17:37:51 -070030 static constexpr double kRollerSupplyCurrentLimit() { return 30.0; }
31 static constexpr double kRollerStatorCurrentLimit() { return 40.0; }
Vinay Siva7cea8a82021-09-25 15:06:28 -070032
33 // Climber
34 static constexpr double kClimberSupplyCurrentLimit() { return 60.0; }
Ravago Jones486de802021-05-19 20:47:55 -070035};
36
37// Creates (once) a Values instance for ::aos::network::GetTeamNumber() and
38// returns a reference to it.
39const Values &GetValues();
40
41// Creates Values instances for each team number it is called with and returns
42// them.
43const Values &GetValuesForTeam(uint16_t team_number);
44
45} // namespace constants
46} // namespace y2021_bot3
47
48#endif // Y2021_BOT3_CONSTANTS_H_