Ok so thank you for all your help. We fixed our problem by changing our code. The new code is posted below. But now the problem is that when we turn the joystick left the robot goes right and vice-versa. Though it goes back and forth perfectly. Any input would be appreciated. When running the program no errors show up.
Code:
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Timer;
public class RobotTemplate extends SimpleRobot {
RobotDrive chassis = new RobotDrive(1,2);
Joystick mainStick = new Joystick(1);
public void autonomous() {
}
public void operatorControl() {
chassis.setSafetyEnabled(true);
while (isOperatorControl() && isEnabled()) {
double speed;
double rot;
speed = mainStick.getY();
rot = mainStick.getX();
chassis.arcadeDrive (speed, rot);
}
}
public void test() {
}
}