Yesterday, or maybe the day before, all our code stopped working. We had a robot that was fully drivable with the joysticks. However, now any code we run starts throwing exceptions, no matter how simple.
For example, when we attempt to run code as simple as this:
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Jaguar;
public class RobotTemplate extends IterativeRobot {
Joystick left;
Joystick right;
RobotDrive robot;
public void robotInit() {
Joystick left = new Joystick(1);
Joystick right = new Joystick(2);
RobotDrive robot = new RobotDrive(1,2,3,4);
}
/**
* This function is called periodically during autonomous
*/
public void autonomousPeriodic() {
}
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
robot.tankDrive(left, right);
}
}
It throws this exception when we put it into teleop mode
java.lang.NullPointerException
[cRIO] at edu.wpi.first.wpilibj.templates.RobotTemplate.teleopPeriodic(RobotTemplate.java:43)
[cRIO] at edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:145)
[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.
[cRIO] Robot Drive... Output not updated often enough.
[cRIO] Robot Drive... Output not updated often enough.
The “[cRIO] Robot Drive… Output not updated often enough.” output goes on forever.
We are testing this code without any motors attached to the jaguars since our team is working on the frame. Could this be an issue?
Also, one of our other programmers was trying his hand at programming on this. I am not 100% sure what he did, but this problem is persisting throughout all new projects we create. Do these errors indicate that he may have mistakenly modified the API’s we received from first?