Code:
public Joystick leftStick = new Joystick(1);
public Joystick rightStick = new Joystick(2);
/* Here, the cRIO allocates slot 1-4 of the PWM.
Which means if you try to allocate them again in
another part of the code, you'll get errors. */
public Jaguar jagFrontLeft = new Jaguar(1);
public Jaguar jagFrontRight = new Jaguar(2);
public Jaguar jagBackLeft = new Jaguar(3);
public Jaguar jagBackRight = new Jaguar(4);
/* See? Here, you're allocating the EXACT SAME
PWM slots AGAIN. Which creates problems and are
most likely the cause of your problem. */
public RobotDrive driveRobot = new RobotDrive(1, 3, 2, 4);
Comments in navy blue. Here's the solution:
Code:
Joystick leftStick = new Joystick(1);
Joystick rightStick = new Joystick(2);
/* Code removed because it creates problems */
// Jaguar jagFrontLeft = new Jaguar(1);
// Jaguar jagFrontRight = new Jaguar(2);
// Jaguar jagBackLeft = new Jaguar(3);
// Jaguar jagBackRight = new Jaguar(4);
RobotDrive driveRobot = new RobotDrive(1, 3, 2, 4);
Gyro roboGyro = new Gyro(7);
double leftX =0;
double leftY =0;
double rotationRate =0;
double gyroAngle =0;
int i = 0;
Edit: Darn. Someone beat me to it.
