Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Help With illegalUseOfCommand Exception? (http://www.chiefdelphi.com/forums/showthread.php?t=155068)

JLuna 10-02-2017 19:18

Help With illegalUseOfCommand Exception?
 
Hi,
I'm the programmer from team 2523, and I've run into a really frustrating error that nothing seems to fix. From what I can tell, the issue is that my driverunner subsystem, which runs methods from my driveTrain subsystem, does not "require" the driveTrain subsystem. The only thing is, it does, or at least should. I've checked quite a few times, and the "requires(Robot.driveTrain)" call is spelled correctly and in the right place. Is there anything else that could cause this?

Also, after that, the system says that "startCompetition()" should have handled the error.

Here is the full error (ignore the joystick error, ours is still in a box from last year :yikes: ):
********** Robot program starting **********
NT: server: client CONNECTED: 169.254.105.173 port 63780
Warning at org.usfirst.frc.team2523.robot.OI.<init>(OI.java:5 0): Joystick Button 1 on port 1 not available, check if controller is plugged in
Error at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:249): ERROR Unhandled exception: edu.wpi.first.wpilibj.command.IllegalUseOfCommandE xception: A default command must require the subsystem at [edu.wpi.first.wpilibj.command.Subsystem.setDefault Command(Subsystem.java:101), org.usfirst.frc.team2523.robot.subsystems.DriveTra in.initDefaultCommand(DriveTrain.java:71), edu.wpi.first.wpilibj.command.Subsystem.getDefault Command(Subsystem.java:123), edu.wpi.first.wpilibj.command.Scheduler.run(Schedu ler.java:223), org.usfirst.frc.team2523.robot.Robot.disabledPerio dic(Robot.java:95), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:88), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:247)]
WARNING: Robots don't quit!
---> The startCompetition() method (or methods called by it) should have handled the exception above.

MuskieProgramme 10-02-2017 21:11

Re: Help With illegalUseOfCommand Exception?
 
Your DriveTrain is setting a default command which doesn't require it. The fix would be to modify your command so that it requires the drive train.


All times are GMT -5. The time now is 20:19.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi