Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rzblue committed Jan 30, 2025
1 parent 318163e commit d574a71
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
18 changes: 9 additions & 9 deletions wpilibc/src/main/native/include/frc/DutyCycleEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -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> dutyCycle, double fullRange,
double expectedZero);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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> digitalSource,
double fullRange, double expectedZero);
Expand Down Expand Up @@ -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;

Expand Down
6 changes: 4 additions & 2 deletions wpilibj/src/main/java/edu/wpi/first/wpilibj/DutyCycle.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ public void close() {
}

/**
* Get the frequency of the duty cycle signal. <b>Warning: This will return inaccurate values for
* up to 2 seconds after the duty cycle input is initialized.</b>
* Get the frequency of the duty cycle signal.
*
* <p><b>Warning: This will return inaccurate values for up to 2 seconds after the duty cycle
* input is initialized.</b>
*
* @return frequency in Hertz
*/
Expand Down
21 changes: 11 additions & 10 deletions wpilibj/src/main/java/edu/wpi/first/wpilibj/DutyCycleEncoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>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.
* <p><b>Warning: By default, position readings from {@link #get()} will be innacurate for up to 2
* seconds after this encoder is initialized.</b> 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;
Expand Down Expand Up @@ -142,11 +142,10 @@ private double mapSensorRange(double pos) {
}

/**
* Get the encoder value since the last reset. <b> Warning: This will return inaccurate values for
* up to 2 seconds after this encoder is initialized unless {@link #setAssumedFrequency(double)}
* is used.</b>
* Get the encoder value in rotations.
*
* <p>This is reported in rotations since the last reset.
* <p><b> Warning: This will return inaccurate values for up to 2 seconds after this encoder is
* initialized unless {@link #setAssumedFrequency(double)} is used.</b>
*
* @return the encoder value in rotations
*/
Expand Down Expand Up @@ -196,8 +195,10 @@ public void setDutyCycleRange(double min, double max) {
}

/**
* Get the frequency in Hz of the duty cycle signal from the encoder. <b>Warning: This will return
* inaccurate values for up to 2 seconds after this encoder is initialized.</b>
* Get the frequency in Hz of the duty cycle signal from the encoder.
*
* <p><b>Warning: This will return inaccurate values for up to 2 seconds after this encoder is
* initialized.</b>
*
* @return duty cycle frequency in Hz
*/
Expand Down

0 comments on commit d574a71

Please sign in to comment.