diff --git a/wpilibc/src/main/native/include/frc/DutyCycleEncoder.h b/wpilibc/src/main/native/include/frc/DutyCycleEncoder.h index a5e6d625911..1055c8d8fa6 100644 --- a/wpilibc/src/main/native/include/frc/DutyCycleEncoder.h +++ b/wpilibc/src/main/native/include/frc/DutyCycleEncoder.h @@ -99,7 +99,7 @@ class DutyCycleEncoder : public wpi::Sendable, * * @param channel the channel to attach to * @param fullRange the value to report at maximum travel - * @param expectedZero the reading where you would expect a 0 from get() + * @param expectedZero the reading where you would expect a 0 from Get() */ DutyCycleEncoder(int channel, double fullRange, double expectedZero); @@ -108,7 +108,7 @@ class DutyCycleEncoder : public wpi::Sendable, * * @param dutyCycle the duty cycle to attach to * @param fullRange the value to report at maximum travel - * @param expectedZero the reading where you would expect a 0 from get() + * @param expectedZero the reading where you would expect a 0 from Get() */ DutyCycleEncoder(DutyCycle& dutyCycle, double fullRange, double expectedZero); @@ -117,7 +117,7 @@ class DutyCycleEncoder : public wpi::Sendable, * * @param dutyCycle the duty cycle to attach to * @param fullRange the value to report at maximum travel - * @param expectedZero the reading where you would expect a 0 from get() + * @param expectedZero the reading where you would expect a 0 from Get() */ DutyCycleEncoder(DutyCycle* dutyCycle, double fullRange, double expectedZero); @@ -126,7 +126,7 @@ class DutyCycleEncoder : public wpi::Sendable, * * @param dutyCycle the duty cycle to attach to * @param fullRange the value to report at maximum travel - * @param expectedZero the reading where you would expect a 0 from get() + * @param expectedZero the reading where you would expect a 0 from Get() */ DutyCycleEncoder(std::shared_ptr dutyCycle, double fullRange, double expectedZero); @@ -136,7 +136,7 @@ class DutyCycleEncoder : public wpi::Sendable, * * @param digitalSource the digital source to attach to * @param fullRange the value to report at maximum travel - * @param expectedZero the reading where you would expect a 0 from get() + * @param expectedZero the reading where you would expect a 0 from Get() */ DutyCycleEncoder(DigitalSource& digitalSource, double fullRange, double expectedZero); @@ -146,7 +146,7 @@ class DutyCycleEncoder : public wpi::Sendable, * * @param digitalSource the digital source to attach to * @param fullRange the value to report at maximum travel - * @param expectedZero the reading where you would expect a 0 from get() + * @param expectedZero the reading where you would expect a 0 from Get() */ DutyCycleEncoder(DigitalSource* digitalSource, double fullRange, double expectedZero); @@ -156,7 +156,7 @@ class DutyCycleEncoder : public wpi::Sendable, * * @param digitalSource the digital source to attach to * @param fullRange the value to report at maximum travel - * @param expectedZero the reading where you would expect a 0 from get() + * @param expectedZero the reading where you would expect a 0 from Get() */ DutyCycleEncoder(std::shared_ptr digitalSource, double fullRange, double expectedZero); @@ -199,12 +199,12 @@ class DutyCycleEncoder : public wpi::Sendable, void SetConnectedFrequencyThreshold(int frequency); /** - * Get the encoder value. + * Get the encoder value in rotations. * * @warning This will return inaccurate values for up to 2 seconds after this * encoder is initialized unless SetAssumedFrequency() is used. * - * @return the encoder value scaled by the full range input + * @return the encoder value in rotations */ double Get() const; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/DutyCycle.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/DutyCycle.java index 5e98b7f71f1..35d741acfe2 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/DutyCycle.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/DutyCycle.java @@ -54,8 +54,10 @@ public void close() { } /** - * Get the frequency of the duty cycle signal. Warning: This will return inaccurate values for - * up to 2 seconds after the duty cycle input is initialized. + * Get the frequency of the duty cycle signal. + * + *

Warning: This will return inaccurate values for up to 2 seconds after the duty cycle + * input is initialized. * * @return frequency in Hertz */ diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/DutyCycleEncoder.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/DutyCycleEncoder.java index c79afe6d950..dbb54cb7983 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/DutyCycleEncoder.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/DutyCycleEncoder.java @@ -16,10 +16,10 @@ * Class for supporting duty cycle/PWM encoders, such as the US Digital MA3 with PWM Output, the * CTRE Mag Encoder, the Rev Hex Encoder, and the AM Mag Encoder. * - *

Warning: By default, position readings from {@link #get()} will be innacurate for up to 2 - * seconds after this encoder is initialized. Setting the frequency of the encoder's output using - * {@link #setAssumedFrequency(double)} can be used to mitigate this, though users should verify the - * true frequency of the specific encoder in use as it can vary between devices. + *

Warning: By default, position readings from {@link #get()} will be innacurate for up to 2 + * seconds after this encoder is initialized. Setting the frequency of the encoder's output + * using {@link #setAssumedFrequency(double)} can be used to mitigate this, though users should + * verify the true frequency of the specific encoder in use as it can vary between devices. */ public class DutyCycleEncoder implements Sendable, AutoCloseable { private final DutyCycle m_dutyCycle; @@ -142,11 +142,10 @@ private double mapSensorRange(double pos) { } /** - * Get the encoder value since the last reset. Warning: This will return inaccurate values for - * up to 2 seconds after this encoder is initialized unless {@link #setAssumedFrequency(double)} - * is used. + * Get the encoder value in rotations. * - *

This is reported in rotations since the last reset. + *

Warning: This will return inaccurate values for up to 2 seconds after this encoder is + * initialized unless {@link #setAssumedFrequency(double)} is used. * * @return the encoder value in rotations */ @@ -196,8 +195,10 @@ public void setDutyCycleRange(double min, double max) { } /** - * Get the frequency in Hz of the duty cycle signal from the encoder. Warning: This will return - * inaccurate values for up to 2 seconds after this encoder is initialized. + * Get the frequency in Hz of the duty cycle signal from the encoder. + * + *

Warning: This will return inaccurate values for up to 2 seconds after this encoder is + * initialized. * * @return duty cycle frequency in Hz */