mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Fix all the samples to build with the C++11/14 language features (constexpr)
This commit is contained in:
@@ -12,8 +12,8 @@ private:
|
||||
double driveForwardSpeed;
|
||||
double distance;
|
||||
double error;
|
||||
static const double TOLERANCE = .1;
|
||||
static const double KP = -1.0 / 5.0;
|
||||
static constexpr double TOLERANCE = .1;
|
||||
static constexpr double KP = -1.0 / 5.0;
|
||||
void init(double dist, double maxSpeed);
|
||||
public:
|
||||
DriveForward();
|
||||
|
||||
@@ -13,9 +13,9 @@ class Collector: public Subsystem
|
||||
{
|
||||
public:
|
||||
// Constants for some useful speeds
|
||||
static const double FORWARD = 1;
|
||||
static const double STOP = 0;
|
||||
static const double REVERSE = -1;
|
||||
static constexpr double FORWARD = 1;
|
||||
static constexpr double STOP = 0;
|
||||
static constexpr double REVERSE = -1;
|
||||
|
||||
private:
|
||||
// Subsystem devices
|
||||
|
||||
@@ -12,10 +12,10 @@ class Pivot: public PIDSubsystem
|
||||
{
|
||||
public:
|
||||
// Constants for some useful angles
|
||||
static const double COLLECT = 105;
|
||||
static const double LOW_GOAL = 90;
|
||||
static const double SHOOT = 45;
|
||||
static const double SHOOT_NEAR = 30;
|
||||
static constexpr double COLLECT = 105;
|
||||
static constexpr double LOW_GOAL = 90;
|
||||
static constexpr double SHOOT = 45;
|
||||
static constexpr double SHOOT_NEAR = 30;
|
||||
|
||||
private:
|
||||
// Subsystem devices
|
||||
|
||||
@@ -17,7 +17,7 @@ private:
|
||||
Compressor* compressor;
|
||||
#endif
|
||||
|
||||
static const double MAX_PRESSURE = 2.55;
|
||||
static constexpr double MAX_PRESSURE = 2.55;
|
||||
|
||||
public:
|
||||
Pneumatics();
|
||||
|
||||
Reference in New Issue
Block a user