94 AnalogEncoder(std::shared_ptr<AnalogInput> analogInput,
double fullRange,
136 void Init(
double fullRange,
double expectedZero);
137 double MapSensorRange(
double pos)
const;
139 std::shared_ptr<AnalogInput> m_analogInput;
141 double m_expectedZero;
142 double m_sensorMin{0.0};
143 double m_sensorMax{1.0};
144 bool m_isInverted{
false};
146 wpi::hal::SimDevice m_simDevice;
147 wpi::hal::SimDouble m_simPosition;
double Get() const
Get the encoder value.
int GetChannel() const
Get the channel number.
void InitSendable(wpi::util::SendableBuilder &builder) override
Initializes this Sendable object.
AnalogEncoder(int channel, double fullRange, double expectedZero)
Construct a new AnalogEncoder attached to a specific AnalogIn channel.
AnalogEncoder(std::shared_ptr< AnalogInput > analogInput, double fullRange, double expectedZero)
Construct a new AnalogEncoder attached to a specific AnalogInput.
AnalogEncoder(std::shared_ptr< AnalogInput > analogInput)
Construct a new AnalogEncoder attached to a specific AnalogInput.
void SetInverted(bool inverted)
Set if this encoder is inverted.
void SetVoltagePercentageRange(double min, double max)
Set the encoder voltage percentage range.
AnalogEncoder(int channel)
Construct a new AnalogEncoder attached to a specific AnalogIn channel.
~AnalogEncoder() override
AnalogEncoder(AnalogInput &analogInput)
Construct a new AnalogEncoder attached to a specific AnalogInput.
AnalogEncoder & operator=(AnalogEncoder &&)=default
AnalogEncoder(AnalogInput &analogInput, double fullRange, double expectedZero)
Construct a new AnalogEncoder attached to a specific AnalogInput.
AnalogEncoder(AnalogInput *analogInput)
Construct a new AnalogEncoder attached to a specific AnalogInput.
AnalogEncoder(AnalogEncoder &&)=default
AnalogEncoder(AnalogInput *analogInput, double fullRange, double expectedZero)
Construct a new AnalogEncoder attached to a specific AnalogInput.
Helper class for building Sendable dashboard representations.
Definition SendableBuilder.hpp:21
A helper class for use with objects that add themselves to SendableRegistry.
Definition SendableHelper.hpp:21
Interface for Sendable objects.
Definition Sendable.hpp:16
Definition CvSource.hpp:15