Quote:
Originally Posted by VaneRaklan
Code:
public class RobotMap {
public static SpeedController frontLeft;
public static CANTalon frontRight;
public static CANTalon backLeft;
public static CANTalon backRight;
public static RobotDrive robotDrive;
public static void init(){
frontLeft = new CANTalon(3, 0);
// frontRight = new CANTalon(4);
// backLeft = new CANTalon(1);
// backRight = new CANTalon(0);
robotDrive = new RobotDrive(frontLeft, frontRight, backLeft, backRight);
robotDrive.setSafetyEnabled(false);
}
}
|
The frontRight, backLeft, and backRight pointers are null because those constructor lines are commented out. This would likely cause a null pointer exception in the robotDrive constructor. Also, if you wrap your code in code tags (highlight the block and click the # symbol), it's easier to read.