Hey CD, I have a little bit of a problem.
We have just finished doing most of our code (excluding extra things and autonomous (we haven’t finished building so we can’t test)) and we are getting an error when running our program on the robot. First of all, our disabled method DOES work. We have it println “disabled”. So we know for a fact that it compiles somewhat correctly.
What we do not know is what is actually going wrong. It returns this error message :
java.lang.NullPointerException
[cRIO] at edu.wpi.first.wpilibj.templates.OperatorControl.driving(OperatorControl.java:15)
[cRIO] at edu.wpi.first.wpilibj.templates.MainRobotFunctions.operatorControl(MainRobotFunctions.java:138)
[cRIO] at edu.wpi.first.wpilibj.SimpleRobot.startCompetition(SimpleRobot.java:118)
[cRIO] at edu.wpi.first.wpilibj.RobotBase.startApp(RobotBase.java:156)
[cRIO] in virtual method #10 of javax.microedition.midlet.MIDlet(bci=17)
[cRIO] at javax.microedition.midlet.MIDletTunnelImpl.callStartApp(64)
[cRIO] at com.sun.squawk.imp.MIDletMainWrapper.main(110)
[cRIO] in virtual method #95 of com.sun.squawk.Klass(bci=25)
[cRIO] at com.sun.squawk.Isolate.run(1506)
[cRIO] at java.lang.Thread.run(231)
[cRIO] in virtual method #47 of com.sun.squawk.VMThread(bci=42)
[cRIO] in static method #3 of com.sun.squawk.VM(bci=6)
[cRIO] WARNING: Robots don't quit!
[cRIO] ---> The startCompetition() method (or methods called by it) should have handled the exception above.
[cRIO] Robot Drive... Output not updated often enough.
[cRIO] Robot Drive... Output not updated often enough.
Our actual code is available at here and here. (Yes, we messed with DriverStationLCD as an experiment, maybe that’s the problem but we’ve tried it without it.)
I’ve been looking around on CD and some others, and all I’ve concluded from them is that it either has to do with one of our initialized classes (which is most likely - but which one?) or it has to do with the startCompetition() method in SimpleRobot. I’ve also gathered from looking into operatorControl() that it implements a few methods from robotBase(), might that be the source of the problem(Not the actual methods but missing libraries? We use subversion to transfer code)?
Also, if there is any other errors we are making in the code, suggestions are greatly appreciated. This is our first year doing FRC, and I just started learning Java in the middle of the season (Our programming team was almost down the drain before I came to save the day ) Well anyways, thanks in advance for the help, its greatly appreciated. We just want to get onto bigger and better things than just driving!
Joelg236
Team 4334