-
Notifications
You must be signed in to change notification settings - Fork 166
Open
Description
I have wrapper classes for SRX & FX encoders. Cloned the FX encoder class to create to wrapper for CANCoder. The code that drives the sim updates:
` public void setSimValues(double position, double velocity)
{
simCollection.setRawPosition(metersToTicks(position));
simCollection.setVelocity(velocityToTicks(velocity));
}
'
Reset is done with:
` public void reset()
{
ErrorCode errorCode;
errorCode = encoder.setPosition(0);
if (errorCode != ErrorCode.OK)
Util.consoleLog("encoder reset failed (%d) %s", errorCode.value, errorCode.name());
}
`
Running under sim, the absolute position works fine but the encoder count returned by get() is way out of whack. Start sim do no driving, just call for reset of encoder, the next (and all subsequent) get() returns a huge negative number. Then driving some does not change that value returned by get(). Note that I get this error on the reset() call:
encoder reset failed (-3) CAN_MSG_NOT_FOUND
Metadata
Metadata
Assignees
Labels
No labels