Looking for swerve code with Neos and Thrifty Bot encoders

We are having problems with our swerve code and are looking for functioning code with Neos and the TB encoders to see if it might be some hardware problem we can’t find. We were thinking if we knew the code was good we could get an answer as to whether our problem is code or hardware. We’ve spent 10 days troubleshooting and have run out of ideas.

1 Like

If you are looking to contribute you could try making a absolute encoder module for YAGSL by extending SwerveAbsoluteEncoder and adding it where necessary. The code works very well with Neo’s and CANCoders right now so if you can make that drop in replacement it should work just fine.

(Full disclosure I am the developer of it and have been wanting to support this configuration but don’t have the hardware)

1 Like

What problems are you seeing? I don’t have thrifty encoder code to supply, but with a description of the problem (and preferably access to your code) I or someone else here can probably get you back on track.

Here’s the Max Swerve example that uses neos and TB encoder GitHub - REVrobotics/MAXSwerve-Java-Template

1 Like

Perhaps this will help, we have code that currently uses Neos and TTB encoders on our practice bot. Our code is written to be able to handle different setups (not as nice as YAGSL), so here are links to the relevant files.

Generic Swerve Module handles the basic module algorithms

Mk4SwerveModules extends GenericSwerve Module and sets itself up with TTBs

This class implements interfacing with the TTB encoder

This class ties it all together, pretty standard stuff.

3 Likes

I am not a coder and don’t really understand the specific problem. What I see is that when they run the code, the wheels either don’t align or continuously rotate back and forth. They have thought it was just a matter of tuning the PID but have spent 2 weeks trying every combination they can think of without success. Not sure if that helps but thank you.

Based off of your code I just updated YAGSL-Example to support Thrifty encoders. Thank you!

Glad we could contribute, even if indirectly, lol. When the season is over, I was going to add YAGSL to our code base, but too busy now.

1 Like

I designed it to be very easy to extend abstracted swerve classes in YAGSL the more difficult part is updating device creation because that is a simple switch case in DeviceJson.java. If you have anything else that you think would be useful to add I am all ears!

As for @FredK you should be able to use GitHub - BroncBotz3481/YAGSL-Example: Yet Another General Swerve Library Example Project to setup and run your swerve drive. The thrifty encoders should be attached to the roborio if you aren’t attaching them to the REV data port (The encoder type is thrifty for rio, and attached if connected to the sparkmax). Documentation is on the github wiki page for the JSON files and a lazy configurator is here YAGSL Tuning Webpage Let me know if you have any questions!

Just a FYI, I update every other library nightly and the thrifty change was made this morning so it doesn’t exist in the YAGSL or YAGSL-Lib repo yet.

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.