Go to Post I'm sure someone somewhere worked [I]really hard[/I] on this and I congratulate them for the attempt. Unfortunately, its one of those things that should be taken down and recorded in the company journal as a bad idea. - Katie_UPS [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 20-01-2015, 17:09
calvinred calvinred is offline
Registered User
None #5340
 
Join Date: Jan 2015
Location: United States
Posts: 3
calvinred is an unknown quantity at this point
Unhandled exception instantiating robot - Code Not Showing on driver station

Our code deploys just fine (and simple robot code will run and we can drive the robot) but our current code deploys successfully, but the driver station does not recognize it and says we have no code. it also gives as this error:

ERROR Unhandled exception instantiating robot org.usfirst.frc.team5340.robot.Robot java.lang.ExceptionInInitializerError at [org.usfirst.frc.team5340.robot.Robot.<clinit>(Robo t.java:23), java.lang.Class.forName0(Native Method), java.lang.Class.forName(Class.java:259), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:197)]

Please Help!
Attached Files
File Type: java Robot (1).java (2.7 KB, 26 views)
Reply With Quote
  #2   Spotlight this post!  
Unread 20-01-2015, 18:15
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 431
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Unhandled exception instantiating robot - Code Not Showing on driver station

I actually debugged this exact problem last night. For us, it was caused by attempting to two motor controllers on the same PWM channel. Pretty terrible error message.

What I think is happening is RobotBase attempts to load the Robot class by looking it up by name. The Robot class doesn't exist though because a runtime error occurred during its creation (in our case attempting to open two controllers on the same port number).

I cant check your source code right now, on my phone, but I would start by checking all the port numbers for your hardware iare unique.
__________________
http://team2168.org
Reply With Quote
  #3   Spotlight this post!  
Unread 21-01-2015, 08:09
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is online now
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,722
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Unhandled exception instantiating robot - Code Not Showing on driver station

The one thing that I don't like about the new system is that it is much harder to debug code exceptions. The errors you get aren't really helpful.

We had this same error, it turned out to be that we were trying to instantiate our OI class prior to our subsystems.
Reply With Quote
  #4   Spotlight this post!  
Unread 21-01-2015, 09:47
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 431
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Unhandled exception instantiating robot - Code Not Showing on driver station

Looking at your Robot.java. it looks like you are accessing accessing subsystems that are stored within the OI class?

You also never actually initialize your oi variable. So if you're likely running into dependency issues which are causing runtime errors.

Instantiate your subsystems within the Robot class.
Instantiate oi in robotInit(), then instantiate any commands after this.

If you need an example of how drivetrain code should be laid out in a command base robot project, there's a foot example here from team 3019:
https://github.com/fauge7/Firebird-R...team3019/robot
__________________
http://team2168.org

Last edited by otherguy : 21-01-2015 at 09:55. Reason: added link to example code
Reply With Quote
Reply


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 11:52.

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