|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
||||
|
||||
|
Re: Subsystem cannot be null
Is your OI initiAlized before your subsystems?
|
|
#3
|
|||
|
|||
|
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. |
|
#4
|
||||
|
||||
|
Re: Subsystem cannot be null
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.
|
|
#5
|
|||
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|