Fix all the samples to build with the C++11/14 language features (constexpr)

This commit is contained in:
Brad Miller
2014-11-11 09:15:46 -05:00
parent 68ba9bfeae
commit 1d0a6b8ace
7 changed files with 13 additions and 12 deletions

View File

@@ -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();

View File

@@ -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

View File

@@ -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

View File

@@ -17,7 +17,7 @@ private:
Compressor* compressor;
#endif
static const double MAX_PRESSURE = 2.55;
static constexpr double MAX_PRESSURE = 2.55;
public:
Pneumatics();