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 SparkMaxRelativeEncoderSim.iterate( velocity, dt ) is setting Position value to match the Velocity value scaled to the dt.
To Reproduce Steps to reproduce the behavior:
import rev import wpilib import wpimath.units import wpimath.system.plant def __init__(self): self.controller = wpilib.XboxController(1) self.motor = rev.SparkMax( 1, rev.SparkMax.MotorType.kBrushless ) self.simMotor = rev.SparkMaxSim( self.motor, wpimath.system.plant.DCMotor.NEO(1) ) def periodic(self): self.motor.set( self.controller.getLeftX() ) def simulationPeriodic(self): maxRpm = wpimath.units.radiansToRotations( wpimath.system.plant.DCMotor.NEO(1).freespeed ) * wpimath.units.kSecondsPerMinute rpm = maxRpm * self.motor.get() self.simMotor.getRelativeEncoderSim().iterate( rpm, 0.02 ) print( self.simMotor.getRelativeEncoderSim().getPosition(), self.simMotor.getRelativeEncoderSim().getVelocity() )
Expected behavior Position should be increasing incrementally based on the velocity. Position = Position + ( Velocity / 60 * dt )
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information if applicable):
roboRIO (please complete the following information if applicable):
Additional context Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
This will be fixed along with #44 in the next release.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
SparkMaxRelativeEncoderSim.iterate( velocity, dt ) is setting Position value to match the Velocity value scaled to the dt.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Position should be increasing incrementally based on the velocity. Position = Position + ( Velocity / 60 * dt )
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information if applicable):
roboRIO (please complete the following information if applicable):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: