Go to Post I hope that kids will stop asking us if we build Battlebots and start asking us if we build Transformers. To that, I will answer with a resounding yes. - Madison [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:43.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi