So my team decided to pursue swerve drive over the summer and we are just now entering the testing phase. However, we have encountered a few debilitating issues, first among which is the fact that the robot does not respond to any controller inputs we give, instead the modules all start turning rapidly and uniformly as soon as the robot is enabled. We have poured over our code again and again without progress. Any wisdom as to why this might be happening / how to fix this would be beyond appreciated.
Thank you for pointing out the misconfig of our gear ratio, that definitely explains why we were getting NaN for our velocity. The lack of a dead zone is mostly because in our experience it generally doesn’t drift enough to Warrent that, but you are right that it is probably best to include it regardless. Using the dashboard for debugging is actually a great suggestion though that ill implement post haste, so thank you!
From the control perspective, if everything else is configured correctly, small joystick values are unlikely to cause the robot to move. Nevertheless, it’s not good practice to keep motors at stall indefinitely, even at low currents. Also, it prevents the motors from entering idle brake mode, which might affect you against defence or on a ramp.
For things powered by joysticks where the joystick value directly relates to speed. No deadband may be fine since it won’t have enough power to actually move the motor but it does mean the motor may always be running at some amount of power just not enough to be noticeable.
For something like swerve it’s even more important since the steering is just turning to the right angle as fast as it can rather then being proportional. This means if the joystick is wondering close to 0 but not right on 0, your modules will constantly be rotating to the angle it thinks you are trying to drive even though you are not touching the controller.
It appears that you actually do have a dead zone in your process flow. The TalonFX has a neutralDeadband = 0.04007820136852395 as a default, if you don’t configure the dead zone which you didn’t. Four percent may or may not cover any joystick centering problem.
The issue we are having occurs even without a controller so I don’t think the deadband is our main problem (plus we just added a dedicated deadband to our controller anyways)
We’ve been prepping for chezy champs while training new members we just got last week so have had very little time to work on swerve recently. I’ll post an update as soon as I can get dedicated time to run tests on the swervebot but I’m not likely to get a window like that until the week or weekend after chezy. Although I could get a window next week, we’ll see I suppose.