We’ve been working on implementing our swerve drive with YAGSL and nearly have it worked out, but are having a few issues and we are starting to run out of ideas so I’m here looking for some direction.
We are at the point where our robot can translate and rotate relative to the field and robot, but whenever we power cycle or upload new code we need to realign the wheels. We are using CANcoders and currently they are setup with the “old” Phoenix Tuner (and firmware) because it appears that YAGSL needs the encoder in degrees and Tuner X only provides it as a 0-1 value. Is there something I’m missing which could A) cause us to need to realign the wheels and B) not allow us to use the latest firmware/Phoenix Tuner X?
Not too familiar with YAGSL, but is there any reason you can’t convert the 0-1 output value from Tuner X to degrees? Should be a simple 1:1 conversion factor, multiply the value by 360 and offset if necessary.
Look at shuffleboard network tables and you woll see an Raw Absolute Encoder value that you plug into module absolute encoder offsets to get the persistence you’re looking for. You also don’t have your absolute encoders configured correctly by the sounds of it.
Do we need to add anything to our code to be able to see the encoder offsets in shuffleboard? When we open it up we see lots of stuff, but not that. I saw in the setup guide something about importing telemetry libraries, does that need to be done?
which is certainly not installing another telemetry library.
It should show up in Shuffleboard network tables widget. If not you may have other issues. To see a more indepth guide on how to read it look at this page.
OK, it looks like I was somehow missing the imports for the Swervelib.telemetry and once those were in I was able to see the encoder offsets in Shuffleboard. After setting the correct offset values we are now able to preserve alignment between power cycles. Thank you for responding back to my inquiry, I’m sure you are a very busy person and it’s cool that the author is able to connect with us directly to help solve what I’m sure are “small potatoes” type questions!