Hi everyone this is my second year programming for FRC, but my first attempting swerve. We are using the REV Swerve modules with NEOs and 550s. We have everything connected including the encoders, we have gone through the absolute zero process as described by REV, and have taken the REV template and modified it to address our Spark Max’s, Motors, etc… We are using a standard USB-C XBox game controller. Everything builds correctly, but when we enable the robot both of the XBox joy sticks control the primary NEOs and not the steering that should be happening from the 550s. Does anyone have any advice?
Code for the robot: GitHub - PlusUltra7413/Swerve_2024: PlusUltra7413 robot2024 code
The first thing I can recommend is to embrase logging, please record (you can print or use WPILib’s data logging) each module’s recived target state, and motor duty cycle outputs. Data is key to debugging.
1 Like
When asking for help, it’s important to include your code, which you did. That’s definitely helpful, but you included just the individual files instead of the actual project. In java, the folder structure is important as it relates to the java package structure. Additionally, it’s possible (though not necessarily in this case) that the other files (i.e. build.gradle or the json files in vendordeps directory) might be helpful. Also, nobody will be able to build/test your project in its current state.
Finally, while not technically a requirement, knowledge of and proper usage of git is an invaluable skill for nearly every professional software job you may get. Proper source-control practices may also save you or someone else on your team if you accidentally delete something or otherwise need to go back to a previously working version of something.
Okay okay, I’ll get off my soapbox…
1 Like
Our team uses the same swerve setup. I looked at your code. The rate-limit stuff looks hairy. What happens if you turn it off?
And your CANids don’t seem to be in a logical arrangement. You may want to reset those so that they’re (1,2) (3,4) (5,6) (7,8) for fl, fr, bl, br. Or something regular like that. So that they look orderly in Constants. Disorder risks confusion.
@RomanTechPlus - Thanks for your recommendation. Is this what you are talking about → On-Robot Telemetry Recording Into Data Logs — FIRST Robotics Competition documentation
@Fletch1373 - Any feedback is super useful since Software is one of the more challenging areas for our team. I believe I have re-uploaded the full project to my repository I linked to before for teams to be able to view. Any other Git advice would be helpful.
@jientho I’ve renamed and re-organized the code so the CANids are in the arrangement you mentioned above. (1,2) being front left (NEO, 550), (3,4) being front right (NEO, 550), (5,6) being black left (NEO, 550), (7,8) being back right (NEO, 550). Also I tested turning the rate-limit to FALSE. It didn’t fix my issue, instead it just allowed the wheel to increase to max speed quicker.
Hello, our team is having the same exact problem, was wondering if you have found any solutions? Hope everything is well.