19class DigitalGlitchFilter;
82 Encoder(
int aChannel,
int bChannel,
bool reverseDirection =
false,
137 Encoder(std::shared_ptr<DigitalSource> aSource,
138 std::shared_ptr<DigitalSource> bSource,
bool reverseDirection =
false,
177 [[deprecated(
"Use GetRate() in favor of this method")]]
196 "Use SetMinRate() in favor of this method. This takes unscaled periods "
197 "and SetMinRate() scales using value from SetDistancePerPulse().")]]
370 void InitEncoder(
bool reverseDirection,
EncodingType encodingType);
376 double DecodingScaleFactor()
const;
378 std::shared_ptr<DigitalSource> m_aSource;
379 std::shared_ptr<DigitalSource> m_bSource;
380 std::shared_ptr<DigitalSource> m_indexSource =
nullptr;
and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation source
Definition: ThirdPartyNotices.txt:111
Interface for counting the number of ticks on a digital input channel.
Definition: CounterBase.h:20
EncodingType
Definition: CounterBase.h:22
@ k4X
Definition: CounterBase.h:22
Class for configuring Direct Memory Access (DMA) of FPGA inputs.
Definition: DMA.h:23
DMA sample.
Definition: DMASample.h:23
Class to enable glitch filtering on a set of digital inputs.
Definition: DigitalGlitchFilter.h:30
DigitalSource Interface.
Definition: DigitalSource.h:22
Class to read quad encoders.
Definition: Encoder.h:40
int GetRaw() const
Gets the raw value from the encoder.
IndexingType
Encoder indexing types.
Definition: Encoder.h:48
@ kResetOnRisingEdge
Reset on rising edge of the signal.
Definition: Encoder.h:56
@ kResetOnFallingEdge
Reset on falling edge of the signal.
Definition: Encoder.h:54
@ kResetWhileLow
Reset while the signal is low.
Definition: Encoder.h:52
@ kResetWhileHigh
Reset while the signal is high.
Definition: Encoder.h:50
Encoder(int aChannel, int bChannel, bool reverseDirection=false, EncodingType encodingType=k4X)
Encoder constructor.
Encoder(DigitalSource *aSource, DigitalSource *bSource, bool reverseDirection=false, EncodingType encodingType=k4X)
Encoder constructor.
Encoder(std::shared_ptr< DigitalSource > aSource, std::shared_ptr< DigitalSource > bSource, bool reverseDirection=false, EncodingType encodingType=k4X)
void SetIndexSource(const DigitalSource &source, IndexingType type=kResetOnRisingEdge)
Set the index source for the encoder.
bool GetDirection() const override
The last direction the encoder value changed.
void SetMinRate(double minRate)
Set the minimum rate of the device before the hardware reports it stopped.
int Get() const override
Gets the current count.
void SetReverseDirection(bool reverseDirection)
Set the direction sensing for this encoder.
int GetEncodingScale() const
The encoding scale factor 1x, 2x, or 4x, per the requested encodingType.
void InitSendable(wpi::SendableBuilder &builder) override
Initializes this Sendable object.
void Reset() override
Reset the Encoder distance to zero.
double GetRate() const
Get the current rate of the encoder.
void SetSimDevice(HAL_SimDeviceHandle device)
Indicates this encoder is used by a simulated device.
void SetSamplesToAverage(int samplesToAverage)
Set the Samples to Average which specifies the number of samples of the timer to average when calcula...
int GetSamplesToAverage() const
Get the Samples to Average which specifies the number of samples of the timer to average when calcula...
void SetMaxPeriod(units::second_t maxPeriod) override
Sets the maximum period for stopped detection.
Encoder & operator=(Encoder &&)=default
void SetDistancePerPulse(double distancePerPulse)
Set the distance per pulse for this encoder.
void SetIndexSource(int channel, IndexingType type=kResetOnRisingEdge)
Set the index source for the encoder.
bool GetStopped() const override
Determine if the encoder is stopped.
Encoder(DigitalSource &aSource, DigitalSource &bSource, bool reverseDirection=false, EncodingType encodingType=k4X)
Encoder constructor.
double GetDistance() const
Get the distance the robot has driven since the last reset.
double GetDistancePerPulse() const
Get the distance per pulse for this encoder.
units::second_t GetPeriod() const override
Returns the period of the most recent pulse.
Encoder(Encoder &&)=default
Helper class for building Sendable dashboard representations.
Definition: SendableBuilder.h:21
A helper class for use with objects that add themselves to SendableRegistry.
Definition: SendableHelper.h:19
Interface for Sendable objects.
Definition: Sendable.h:16
HAL_Handle HAL_SimDeviceHandle
Definition: Types.h:53
type
Definition: core.h:556
Definition: AprilTagPoseEstimator.h:15