mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpilibcExamples] Add inline specifier to constexpr constants (#6049)
This commit is contained in:
@@ -25,33 +25,33 @@
|
||||
|
||||
namespace Constants {
|
||||
|
||||
static constexpr int kMotorPort = 0;
|
||||
static constexpr int kEncoderAChannel = 0;
|
||||
static constexpr int kEncoderBChannel = 1;
|
||||
static constexpr int kJoystickPort = 0;
|
||||
inline constexpr int kMotorPort = 0;
|
||||
inline constexpr int kEncoderAChannel = 0;
|
||||
inline constexpr int kEncoderBChannel = 1;
|
||||
inline constexpr int kJoystickPort = 0;
|
||||
|
||||
static constexpr double kElevatorKp = 0.75;
|
||||
static constexpr double kElevatorKi = 0.0;
|
||||
static constexpr double kElevatorKd = 0.0;
|
||||
inline constexpr double kElevatorKp = 0.75;
|
||||
inline constexpr double kElevatorKi = 0.0;
|
||||
inline constexpr double kElevatorKd = 0.0;
|
||||
|
||||
static constexpr units::volt_t kElevatorMaxV = 10_V;
|
||||
static constexpr units::volt_t kElevatorkS = 0.0_V;
|
||||
static constexpr units::volt_t kElevatorkG = 0.62_V;
|
||||
static constexpr auto kElevatorkV = 3.9_V / 1_mps;
|
||||
static constexpr auto kElevatorkA = 0.06_V / 1_mps_sq;
|
||||
inline constexpr units::volt_t kElevatorMaxV = 10_V;
|
||||
inline constexpr units::volt_t kElevatorkS = 0.0_V;
|
||||
inline constexpr units::volt_t kElevatorkG = 0.62_V;
|
||||
inline constexpr auto kElevatorkV = 3.9_V / 1_mps;
|
||||
inline constexpr auto kElevatorkA = 0.06_V / 1_mps_sq;
|
||||
|
||||
static constexpr double kElevatorGearing = 5.0;
|
||||
static constexpr units::meter_t kElevatorDrumRadius = 1_in;
|
||||
static constexpr units::kilogram_t kCarriageMass = 12_lb;
|
||||
inline constexpr double kElevatorGearing = 5.0;
|
||||
inline constexpr units::meter_t kElevatorDrumRadius = 1_in;
|
||||
inline constexpr units::kilogram_t kCarriageMass = 12_lb;
|
||||
|
||||
static constexpr units::meter_t kSetpoint = 42.875_in;
|
||||
static constexpr units::meter_t kLowerSetpoint = 15_in;
|
||||
static constexpr units::meter_t kMinElevatorHeight = 0_cm;
|
||||
static constexpr units::meter_t kMaxElevatorHeight = 50_in;
|
||||
inline constexpr units::meter_t kSetpoint = 42.875_in;
|
||||
inline constexpr units::meter_t kLowerSetpoint = 15_in;
|
||||
inline constexpr units::meter_t kMinElevatorHeight = 0_cm;
|
||||
inline constexpr units::meter_t kMaxElevatorHeight = 50_in;
|
||||
|
||||
// distance per pulse = (distance per revolution) / (pulses per revolution)
|
||||
// = (Pi * D) / ppr
|
||||
static constexpr double kArmEncoderDistPerPulse =
|
||||
inline constexpr double kArmEncoderDistPerPulse =
|
||||
2.0 * std::numbers::pi * kElevatorDrumRadius.value() / 4096.0;
|
||||
|
||||
} // namespace Constants
|
||||
|
||||
Reference in New Issue
Block a user