I am getting the robots shouldn’t quit but yours did error and I do not know why. I was trying to diagnose the issue and it leads to my manual drive method.
Please post the full stack trace (and read it, too, as it will likely solve your problem).
Unfortunately, I cannot get to my shop until tomorrow afternoon. The only error it gave was the manualDrive method. That is the issue but I’m not sure what’s wrong with it. It points to the arcade drive.
It looks like you’re instantiating your drivetrain subsystem twice. Once in Robot.java
on Line 39 and once in RobotContainer
on Line 38.
However, your issue might not be related to this (although this is certainly a problem), and we cannot know for sure until you provide the entire stack trace.
That could be it however the only thing the stacktrace pointed to was the Arcade drive in the Subsystem. I can post a full stacktrace tomorrow morning as I was rushed out of the shop today. Also are you not supposed to instantiate the Subsystem in Robot.java anymore or just in RobotContainer?
Your initialization is wrong. The speed controller groups reference the WPI_TalonSRX instances before they’re instantiated, causing null pointers when they get used.
A more basic problem with the code is that you’re mixing static and instance fields, as well as initializing some fields at the declaration and some in the constructor/init method. Initializing everything where they’re declared and using only instance (nonstatic) fields can clear it up. Alternatively, you could instantiate everything in the constructor, but you will need to be mindful of initialization order if you do so.
Ok, thanks! When I get to my desktop I’ll fix the problems!
Deployed the code to the robot this morning and it all works! Thanks for your help! If you see anything else that is wrong be sure to let me know!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.