mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Fix all the samples to build with the C++11/14 language features (constexpr)
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
<option id="gnu.cpp.compiler.option.debugging.level.969129918" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
|
||||
<option id="gnu.cpp.compiler.option.include.paths.394786621" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${WPILIB}/cpp/current/include""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src}""/>
|
||||
</option>
|
||||
<option id="gnu.cpp.compiler.option.dialect.std.1060340803" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.c++1y" valueType="enumerated"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1033680971" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
|
||||
|
||||
@@ -13,7 +13,7 @@ private:
|
||||
SpeedController* motor;
|
||||
Potentiometer* pot;
|
||||
|
||||
static const double kP_real = 4, kI_real = 0.07,
|
||||
static constexpr double kP_real = 4, kI_real = 0.07,
|
||||
kP_simulation = 18, kI_simulation = 0.2;
|
||||
|
||||
public:
|
||||
|
||||
@@ -13,7 +13,7 @@ private:
|
||||
SpeedController* motor;
|
||||
Potentiometer* pot; // TODO: Make Potentiometer
|
||||
|
||||
static const double kP_real = 1, kP_simulation = 0.05;
|
||||
static constexpr double kP_real = 1, kP_simulation = 0.05;
|
||||
|
||||
public:
|
||||
Wrist();
|
||||
|
||||
@@ -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