Hello. We are working on our first swerve drive. MK4is, neos with spark max. NavX. Cancoders. Two questions: 1) Does anyone know of sample code (java) that will get the chassis driving? 2) Do we need a canivore? Thanks. Appreciate it.
I will say that Spark Max motor controllers are not compatible with the CANivore, so no you don’t need one.
Someone else can chime in with a code example for your SDS setup.
I highly recommend YAGSL GitHub - BroncBotz3481/YAGSL-Example: Yet Another General Swerve Library Example Project
There’s currently issues with using the NavX but we have that fixed in our code. More documented in the readme GitHub - Trial-N-Terror-FRC-7900/YAGSL-Max-Swerve-Example We aren’t using CanCoders or SDS but swapping over to them with YAGSL should be a snap
We have ported the MAXSwerve template to support four MK4i Swerve Modules (each configured with two SPARKS MAX, a NEO as the driving motor, a NEO as the turning motor, and a Thrifty encoder as the absolute turning encoder) and a NavX as the IMU.
So very much in line as what you are aiming at, except for the absolute encoders.
Hello. That’s super. Thanks. We updated the code for our sparkmax and encoder bus addresses. But when we deploy it then enable the drive station, it comes up as “No Code” “Usually due to code error” on the drive station. Any thoughts would be appreciated. Thanks again for your help.
Are you sure that the deployment was successful? Are your Rio firmware and image up to date? Also, if you branched out from our branch, make sure you change the team number in .wpilib/wpilib_preferences.json
If the deployment is successful, what do you see in the console? Any exception?
Did you replace the code related to Thrifty encoders by code for Cancoders encoder? Could you somehow have ended up trying to access null pointers in the process?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.