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:
@@ -16,35 +16,35 @@
|
||||
*/
|
||||
|
||||
namespace DriveConstants {
|
||||
constexpr int kLeftMotor1Port = 0;
|
||||
constexpr int kLeftMotor2Port = 1;
|
||||
constexpr int kRightMotor1Port = 2;
|
||||
constexpr int kRightMotor2Port = 3;
|
||||
inline constexpr int kLeftMotor1Port = 0;
|
||||
inline constexpr int kLeftMotor2Port = 1;
|
||||
inline constexpr int kRightMotor1Port = 2;
|
||||
inline constexpr int kRightMotor2Port = 3;
|
||||
|
||||
constexpr int kLeftEncoderPorts[]{0, 1};
|
||||
constexpr int kRightEncoderPorts[]{2, 3};
|
||||
constexpr bool kLeftEncoderReversed = false;
|
||||
constexpr bool kRightEncoderReversed = true;
|
||||
inline constexpr int kLeftEncoderPorts[]{0, 1};
|
||||
inline constexpr int kRightEncoderPorts[]{2, 3};
|
||||
inline constexpr bool kLeftEncoderReversed = false;
|
||||
inline constexpr bool kRightEncoderReversed = true;
|
||||
|
||||
constexpr int kEncoderCPR = 1024;
|
||||
constexpr double kWheelDiameterInches = 6;
|
||||
constexpr double kEncoderDistancePerPulse =
|
||||
inline constexpr int kEncoderCPR = 1024;
|
||||
inline constexpr double kWheelDiameterInches = 6;
|
||||
inline constexpr double kEncoderDistancePerPulse =
|
||||
// Assumes the encoders are directly mounted on the wheel shafts
|
||||
(kWheelDiameterInches * std::numbers::pi) /
|
||||
static_cast<double>(kEncoderCPR);
|
||||
} // namespace DriveConstants
|
||||
|
||||
namespace HatchConstants {
|
||||
constexpr int kHatchSolenoidModule = 0;
|
||||
constexpr int kHatchSolenoidPorts[]{0, 1};
|
||||
inline constexpr int kHatchSolenoidModule = 0;
|
||||
inline constexpr int kHatchSolenoidPorts[]{0, 1};
|
||||
} // namespace HatchConstants
|
||||
|
||||
namespace AutoConstants {
|
||||
constexpr double kAutoDriveDistanceInches = 60;
|
||||
constexpr double kAutoBackupDistanceInches = 20;
|
||||
constexpr double kAutoDriveSpeed = 0.5;
|
||||
inline constexpr double kAutoDriveDistanceInches = 60;
|
||||
inline constexpr double kAutoBackupDistanceInches = 20;
|
||||
inline constexpr double kAutoDriveSpeed = 0.5;
|
||||
} // namespace AutoConstants
|
||||
|
||||
namespace OIConstants {
|
||||
constexpr int kDriverControllerPort = 0;
|
||||
inline constexpr int kDriverControllerPort = 0;
|
||||
} // namespace OIConstants
|
||||
|
||||
Reference in New Issue
Block a user