|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
I've been trying to deploy the code to our test bot, but I keep getting am error message everytime and after searching around for quite awhile I haven't really gotten any closer to finding out what's wrong so I was hoping someone here could help.
Error Message: Unhandled exception instantiating robot org.usfirst.frc.team3655.robot.Robot java.lang.ExceptionInInitializerError at [java.lang.Class.forName0(Native Method), java.lang.Class.forName(Class.java:259), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:197)] Robot class Code Code:
package org.usfirst.frc.team3655.robot;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.command.Scheduler;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
import org.usfirst.frc.team3655.robot.commands.*;
import org.usfirst.frc.team3655.robot.subsystems.*;
/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the IterativeRobot
* documentation. If you change the name of this class or the package after
* creating this project, you must also update the manifest file in the resource
* directory.
*/
public class Robot extends IterativeRobot
{
//Update EVERYtime you make a change to make sure you deployed the correct version!!
public static final String VERSION = "0.0.04";
//SubSystem Variables
public static final Elevator elevator = new Elevator();
public static final Gyroscope gyro = new Gyroscope();
public static final MecanumDrive mecanumDrive = new MecanumDrive();
public static final RotaryEncoder encoder = new RotaryEncoder();
public static OI oi = new OI();
//Commands
Command teleOpDrive;
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
public void robotInit()
{
System.out.println("Robot Init v: " + VERSION);
oi = new OI();
// instantiate the command used for the autonomous period
teleOpDrive = new TeleOpDrive();
}
public void disabledPeriodic()
{
Scheduler.getInstance().run();
}
public void autonomousInit()
{
}
/**
* This function is called periodically during autonomous
*/
public void autonomousPeriodic()
{
Scheduler.getInstance().run();
}
public void teleopInit()
{
//Starts TeleOP drive base
if (teleOpDrive != null) {
teleOpDrive.start();
}
}
/**
* This function is called when the disabled button is hit.
* You can use it to reset subsystems before shutting down.
*/
public void disabledInit()
{
//Kills the drive base for teleOP
if (teleOpDrive != null) {
teleOpDrive.cancel();
}
}
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic()
{
Scheduler.getInstance().run();
//Runs the button checking, probably not the best way but it'll work for now.
oi.teleOpJoyStick();
}
/**
* This function is called periodically during test mode
*/
public void testPeriodic()
{
LiveWindow.run();
}
}
|
|
#2
|
|||
|
|||
|
Re: Robot Initilization failure on deploy
You sir.. Have a logic error. You never connect up anything so the program is a dead program.. The error your getting is hoping you will go find the line in your code and debug it with the debugging window in eclipse. Set break points and find exactly what line.. I think you'll be amazed at where your logic error is. You have no type of speed controllers set. You have no place where your mechanum drive is hooked up to your motors. Try those first.
|
|
#3
|
||||
|
||||
|
Re: Robot Initilization failure on deploy
Quote:
Last edited by gastew15 : 25-01-2015 at 18:22. |
|
#4
|
||||||
|
||||||
|
Re: Robot Initilization failure on deploy
Did you rename your class after creating the project?
|
|
#5
|
||||
|
||||
|
Re: Robot Initilization failure on deploy
No, I left the main class' name the same. I do use EGit with eclipse though, so do you think it's possible that it might affect it in someway?
|
|
#6
|
||||
|
||||
|
Re: Robot Initilization failure on deploy
I don't know if this is causing this error, but I wouldn't instantiate OI twice like you're doing. I would only instantiate OI in robotInit(), where all subsystems are guaranteed to be constructed. If you change the line "public static OI oi = new OI()" to "public static OI oi", you may fix the problem.
|
|
#7
|
||||
|
||||
|
Re: Robot Initilization failure on deploy
Quote:
![]() *Git also probably had nothing to do with it either, so that was a waste of time copying all that too, but oh well if it works I'll be a happy man. Last edited by gastew15 : 25-01-2015 at 19:04. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|