mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
Replaced floats with doubles (#355)
This makes our APIs more consistent. With optimizations enabled, doubles are just as efficient as floats on ARMv7, so we should take advantage of the extra precision.
This commit is contained in:
committed by
Peter Johnson
parent
7bcd243ec3
commit
69422dc063
@@ -32,9 +32,9 @@ class AnalogAccelerometer : public SensorBase,
|
||||
explicit AnalogAccelerometer(std::shared_ptr<AnalogInput> channel);
|
||||
virtual ~AnalogAccelerometer() = default;
|
||||
|
||||
float GetAcceleration() const;
|
||||
void SetSensitivity(float sensitivity);
|
||||
void SetZero(float zero);
|
||||
double GetAcceleration() const;
|
||||
void SetSensitivity(double sensitivity);
|
||||
void SetZero(double zero);
|
||||
double PIDGet() override;
|
||||
|
||||
void UpdateTable() override;
|
||||
@@ -48,8 +48,8 @@ class AnalogAccelerometer : public SensorBase,
|
||||
void InitAccelerometer();
|
||||
|
||||
std::shared_ptr<AnalogInput> m_analogInput;
|
||||
float m_voltsPerG = 1.0;
|
||||
float m_zeroGVoltage = 2.5;
|
||||
double m_voltsPerG = 1.0;
|
||||
double m_zeroGVoltage = 2.5;
|
||||
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user