Why would our robot try to run off? After I uploaded the code and enabled it on the driver station, without touching the joystick, the wheels started running at full speed and wouldn't stop.
Here's the code and I was using a Logitech Dual Action controller.
Code:
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.*; //Imports everything
public class RobotTemplate extends SimpleRobot {
RobotDrive drive = new RobotDrive(1,2,3,4); //Signal wires from jaguars to digital sidecar
Joystick stick = new Joystick(1); //Logitech Dual Action controller
Joystick arm = new Joystick(2); //Logitech Attack 3 controller
public RobotTemplate(){
getWatchdog().setExpiration(0.5);
compressor.start();
}
public void autonomous() { //Autonomous
}
public void operatorControl() {
while (true && isOperatorControl() && isEnabled()) {
getWatchdog().feed();
drive.mecanumDrive_Polar(stick.getDirectionDegrees(), stick.getMagnitude(),stick.getRawAxis(4));
Timer.delay(0.005);
}
}
}
Any ideas?