-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
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
Sparkmax Failover will never happen #99
Comments
Actually apologies. I think absoluteEncoder could be null, but only if it wasn't connected originally. |
If the SparkMax has an absolute encoder attached to it, then it will return the value of the absolute encoder attached to it. However I do not remember if i made any checks to see if this fails. You may be correct. |
Currently with REV's API I do not know if there was an error raised because none is returned from the call. The closest I can get to it is |
The absolute encoder value wont change if it comes unplugged. Would that be something that could be used? |
I will not fix this until REV has an API in which I can utilize specifically to fix it. If this sits here by end of december and I am reminded of it I will implement a "hacky" fix. |
Ok Darn thank you |
Could you please tell me where in YAGSL does it make the change to the relative encoder, because seemingly no matter what I do it wont swap to the relative encoder? |
There should be no reason to get the relative encoder value since it is not used in a SparkMAX with attached absolute encoder. Here is the snippet that ensures that. |
What if it was used for failover? I feel like that is the main reason. |
It shouldnt be, since in theory the encoder is attached to the SparkMAX correctly and the response time is minimal + no magnets to worry about (unless using canandcoder). implementing a fail over would require resetting the feedback encoder to the relative encoder mid-operation which i have never seen in code before and have no idea if that may trigger some undefined behavior from REVLib. |
https://github.com/Trial-N-Terror-FRC-7900/YAGSL-Max-Swerve-Example/tree/SparkMaxFailover I have made some code that should work for failing over on the sparkmaxes. We will have to test it, but it is based on that we have noticed that the encoder value freezes after lost connection |
The getRelativeEncoderPosition method will always return the absolute encoder position as they are not separate in SparkmaxSwerve.java. Additionally absoluteEncoder will never equal null to swap over to the relative encoder.
So it wont fail over. And the Dashboard says they are always identical regardless if both work or not.
The text was updated successfully, but these errors were encountered: