Go to Post We built an ineffective machine, all by ourselves! Yay for us! - Alan Anderson [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 02-11-2013, 12:11 AM
arithehun arithehun is offline
Registered User
AKA: Ari Falkner
FRC #3024
Team Role: Programmer
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Ashland, Oregon
Posts: 27
arithehun is an unknown quantity at this point
Subsystem cannot be null

I am sorry for the lack of resources, but I am not with my robot at present, and thus cannot provide the full stack trace. But basically, I am both command programming my robot and using CAN-based jaguars. So, in my subsystem constructors, I have to add the line "throws CANTimeoutException" because that is where I naturally initialize my jaguars. However, when I compile and deploy my Java code, right before the line in the console that says "GOT_CONNECTION_FROM_CLIENT", I see a stack-trace that says "Subsystem must not be null". Again, I apologize that I don't have the stack trace message, but it basically finds the error in the line of code that says that that the required(whateverSubsystem) line is throwing the exception. I have a strong suspicion that the two are linked. When I commented out this line, I got a CANTimeoutException after the "GOT_CONNECTION_FROM_CLIENT" line when I clicked "Enable" in the driver station app. Naturally, because the subsystem constructors throw the error, so does the init() method of the CommandBase.

Has anyone experienced this? Should I replace all of my "throws" statements with internal try/catch blocks? Other options? I'll try post the stack trace errors during my Advisory period at school when I can access the robot next, which would be no later than 10:15 AM PST, but it maybe as late as 2:15 PM if that is not possible.

Thank you all.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-11-2013, 12:17 AM
Team3266Spencer's Avatar
Team3266Spencer Team3266Spencer is offline
Team Captain and Lead Programmer
AKA: Spencer Lanman
FRC #3266 (Robots-R-US)
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Richmond, Indiana
Posts: 280
Team3266Spencer is an unknown quantity at this point
Re: Subsystem cannot be null

Is your OI initiAlized before your subsystems?
__________________
2012: Buckeye Regional, Queen City Regional, Human Player
2013: Queen City Regional, Buckeye Regional, Crossroads Regional
Shooter Operator
2014: Crossroads Regional, Queen City Regional
Catapult Operator
2015: Georgia Southern Classic Regional (Winner), Queen City Regional
Chainsaw Operator
Want to talk? TeamSpeak: team3266.noip.me
Reply With Quote
  #3   Spotlight this post!  
Unread 02-11-2013, 01:25 AM
arithehun arithehun is offline
Registered User
AKA: Ari Falkner
FRC #3024
Team Role: Programmer
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Ashland, Oregon
Posts: 27
arithehun is an unknown quantity at this point
Re: Subsystem cannot be null

Yes. Does that the commands initialize before the oi is set? That would make sense.

Last edited by arithehun : 02-11-2013 at 01:28 AM.
Reply With Quote
  #4   Spotlight this post!  
Unread 02-11-2013, 01:27 AM
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: Subsystem cannot be null

Quote:
Originally Posted by arithehun View Post
Yes.
Then one of your buttons' commands is probably require()ing a subsystem that hasn't been initialized yet, and is thus null. I'd recommend leaving OI as the last to be initialized.
__________________
I code stuff.
Reply With Quote
  #5   Spotlight this post!  
Unread 02-11-2013, 01:30 AM
arithehun arithehun is offline
Registered User
AKA: Ari Falkner
FRC #3024
Team Role: Programmer
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Ashland, Oregon
Posts: 27
arithehun is an unknown quantity at this point
Re: Subsystem cannot be null

Yeah, I just realized that. Wow, I can be an idiot sometimes.

Last edited by arithehun : 02-11-2013 at 01:35 AM.
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 07:51 AM.

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