Erratic Swerve Drive Behavior #186
Unanswered
willitcode
asked this question in
Q&A
Replies: 1 comment 2 replies
-
If the NaN is in YAGSL i will be very surprised but this is likely your issue. Let me know where in YAGSL it is and I will either make an update or accept your PR. thank you for finding this! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all!
We are having an issue with our swerve drive. When we are driving, our drivetrain occasionally starts driving and will not stop, no matter how we command it with the stick. I've attached a video below to illustrate this:
Untitled.mov
When the problem occurs, it appears that it continuously tries to drive in one direction, almost no matter what we do. It persists between enable-disable cycles, but rebooting robot code or the RoboRIO appears to erase this state.
Here is a video just showing AdvantageScope when the problem occurs:
VID_20240306_101615.mp4
The code running on the bot can be found here.
I can upload the Driver Station logs if that would be helpful as well. I don't have them handy at the moment; just let me know if you need them.
I believe that I have found a potential solution to this problem. It appears that the series of methods that gets and scales the controller axes for us is occasionally returning NaN (see log images below). I can see why this might cause an issue. I am planning on working on tracking down where exactly the NaN is produced and fixing the error later today, but I don't have access to the robot or even a controller to test in simulation with, so I can't troubleshoot right this second.
If it turns out that this NaN is causing the error, I would be more than happy to find a place to add a safeguard in YAGSL for it and submit a PR. (Further discussion of that potential change can likely happen in its own issue).
Any help or feedback would be much appreciated! I believe I am very close to solving this problem, but if I'm on the wrong track, I would appreciate if someone could let me know.
Beta Was this translation helpful? Give feedback.
All reactions