View Single Post
  #1   Spotlight this post!  
Unread 11-03-2015, 20:21
seshaw415 seshaw415 is offline
Registered User
AKA: Seiji Shaw
FRC #6000 (Firehawk Robotics)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Los Angeles
Posts: 8
seshaw415 is an unknown quantity at this point
Unexpected Error when Running Robot Code

Hello,

After trying to clean up my code utilizing an IO class with static instances of all my objects, I am running into a few problems.

When I upload the robot code and enable, I get this error in the driver station:

Code:
ERROR Unhandled exception: java.lang.ExceptionInInitializerError at [org.usfirst.frc.team4159.robot.IO.<clinit>(IO.java:15), org.usfirst.frc.team4159.robot.Robot.teleopInit(Robot.java:58), edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:142), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:234)]
Here is the code referenced first in the error: (line 15 is the line is where OctoDrive is instantiated)

Code:
package org.usfirst.frc.team4159.robot;

import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.I2C;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.networktables.NetworkTable;

public class IO {
	public static Joystick leftStick = new Joystick(1);                           //Joystick Declaration
	public static Joystick rightStick = new Joystick(2);
	public static Joystick secondaryStick = new Joystick(3);
	
	private static DriveWheels wheelSet = new DriveWheels(0, 1, 2, 3);			  //Drivetrain Declarations
	private static DrivePistons pistonSet = new DrivePistons(0, 1, 2, 3);		  
	public static OctoDrive mainDrive = new OctoDrive(wheelSet, pistonSet);
	static {
		mainDrive.octoShift(true);
		mainDrive.invertMotor("rearRight", true);
    	mainDrive.invertMotor("frontRight", true);
    	mainDrive.invertMotor("leftSide", true);
	}
	
	public static ToteLifter elevator = new ToteLifter(4, 5);					  //ToteLifter Declarations
	public static DigitalInput lowLimit = new DigitalInput(8);
	public static DigitalInput highLimit = new DigitalInput(9);
	static {
		elevator.setHighLow(lowLimit, highLimit);
	}
	
	public static GyroManager mainGyro = new GyroManager(new gyroSampler          //Gyro Declaration
				(new GyroITG3200(I2C.Port.kOnboard)));
	
	
	public static NetworkTable imageValues;											  //RoboRealm NetworkTable Declaration
	static {
		imageValues = NetworkTable.getTable("");
	}
	public static DigitalInput toteSensor = new DigitalInput(10);
	
}

Is there something I am doing wrong here? All the people I am asking are saying that it looks fine.

Thanks in advance!
Reply With Quote