We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug dutyCycleEncoderSim.setDistance(distance) does not set the distance but rather rotations.
To Reproduce Steps to reproduce the behavior: Here is a JUnit 5 unit test that fails
/** * Consolidated duty cycle encoder test. */ @Test public void testDutyCycleEncoder() { int channel = 15; DutyCycleEncoder dceEncoder = new DutyCycleEncoder(channel); DutyCycleEncoderSim dceSim = new DutyCycleEncoderSim(dceEncoder); // "2023.4.2" System.out.println(WPILibVersion.Version); double gain = 3.0; dceEncoder.setDistancePerRotation(gain); double rotations = 1.0; System.out.println("dceSim.set() works"); dceSim.set(rotations); // 1.0 System.out.printf(" dceEncoder.get() = %8f\n", dceEncoder.get()); // 3.0 System.out.printf(" dceEncoder.getDistance() = %8f\n", dceEncoder.getDistance()); assertEquals(rotations, dceEncoder.get(), 0.001); assertEquals(rotations * gain, dceEncoder.getDistance(), 0.001); System.out.println("dceSim.setDistance() fails"); dceSim.setDistance(rotations * gain); // 3.0 System.out.printf(" dceEncoder.get() = %8f\n", dceEncoder.get()); // 9.0 System.out.printf(" dceEncoder.getDistance() = %8f\n", dceEncoder.getDistance()); assertEquals(rotations, dceEncoder.get(), 0.001); assertEquals(rotations * gain, dceEncoder.getDistance(), 0.001); dceEncoder.close(); }
Expected behavior A clear and concise description of what you expected to happen.
If I set the distance with dceEncoderSim.setDistance(3.0)
then I expect dceEncoder.getDistance() to return 3; instead it returns 9.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
This was fixed in #5147, will be included in the latest release soon.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
dutyCycleEncoderSim.setDistance(distance) does not set the distance but rather rotations.
To Reproduce
Steps to reproduce the behavior:
Here is a JUnit 5 unit test that fails
Expected behavior
A clear and concise description of what you expected to happen.
If I set the distance with
dceEncoderSim.setDistance(3.0)
then I expect
dceEncoder.getDistance() to return 3; instead it returns 9.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: