View Single Post
  #2   Spotlight this post!  
Unread 25-01-2016, 19:23
TimTheGreat's Avatar
TimTheGreat TimTheGreat is offline
ArchdukeTim
FRC #1418 (Vae Victis)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Falls Church
Posts: 236
TimTheGreat has a spectacular aura aboutTimTheGreat has a spectacular aura aboutTimTheGreat has a spectacular aura about
Re: Extremely Broken Code Please Help!

Just a quick question. Are you reading the errors or just posting them here? It's ok if you are because they aren't the most lovely things to read (though you should try. It'll be much faster) What it's giving you is what's called a stack trace. It basically tells you the path the code took before it got an error. I've added a comment on what the error tells you.

Code:
ERROR Unhandled exception: java.lang.IllegalArgumentException: Subsystem must not be null. at [
edu.wpi.first.wpilibj.command.Command.requires(Com mand.java:194),  #6
org.usfirst.frc.team4623.robot.commands.Extend.<in it>(Extend.java:16), #5
^------------This is the file-------------------------^---------------Line #- ^
org.usfirst.frc.team4623.robot.OI.<init>(OI.java:5 6), #4
org.usfirst.frc.team4623.robot.Robot.robotInit(Rob ot.java:44), #3
du.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:72), #2
edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:241)] #1
So you start at the bottom and read up. Notice how it goes to robotInit at #3, then goes into OI at 4, then to the Extend class. At Line 16 (note my comment in the code) is where the error is. Looking at line 16 in the code shows

Code:
requires(Robot.pnue);
Looking in the Robot class I can see pneu, but the problem is it's initialized AFTER OI. So OI is looking for a null object, hence the error. Try putting OI after everything.
__________________
There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.



2012 - Gracious Professionalism - Greater DC
2014 - Regional Finalist - Virginia | Industrial Design - Virginia | Regional Finalist - Greater DC
2015 - Innovation in Control - Greater DC
2016 - District Event Winner - VAHAY | Innovation in Control - VAHAY | District Event Winner - MDBET | Industrial Design - MDBET | District Champion - CHCMP | Innovation in Control - CHCMP

Last edited by TimTheGreat : 25-01-2016 at 20:25.
Reply With Quote