mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +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
@@ -69,10 +69,10 @@ class Encoder : public SensorBase,
|
||||
bool GetStopped() const override;
|
||||
bool GetDirection() const override;
|
||||
|
||||
float GetDistance() const;
|
||||
float GetRate() const;
|
||||
void SetMinRate(float minRate);
|
||||
void SetDistancePerPulse(float distancePerPulse);
|
||||
double GetDistance() const;
|
||||
double GetRate() const;
|
||||
void SetMinRate(double minRate);
|
||||
void SetDistancePerPulse(double distancePerPulse);
|
||||
void SetReverseDirection(bool reverseDirection);
|
||||
void SetSamplesToAverage(int samplesToAverage);
|
||||
int GetSamplesToAverage() const;
|
||||
@@ -97,7 +97,7 @@ class Encoder : public SensorBase,
|
||||
private:
|
||||
void InitEncoder(bool reverseDirection, EncodingType encodingType);
|
||||
|
||||
float DecodingScaleFactor() const;
|
||||
double DecodingScaleFactor() const;
|
||||
|
||||
std::shared_ptr<DigitalSource> m_aSource; // the A phase of the quad encoder
|
||||
std::shared_ptr<DigitalSource> m_bSource; // the B phase of the quad encoder
|
||||
|
||||
Reference in New Issue
Block a user