Go to Post I am a mechanical engineer. I have known since I was about 12 that I wanted to make complicated mechanisms. - Paul Copioli [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 Yesterday, 19:18
JLuna JLuna is offline
Registered User
FRC #2523
 
Join Date: Sep 2016
Location: Lyndonville, Vermont
Posts: 2
JLuna is an unknown quantity at this point
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 ):
********** 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.
Reply With Quote
  #2   Spotlight this post!  
Unread Yesterday, 21:11
MuskieProgramme MuskieProgramme is offline
Registered User
FRC #6420
Team Role: Programmer
 
Join Date: Dec 2016
Rookie Year: 2014
Location: Muscatine, IA
Posts: 40
MuskieProgramme is an unknown quantity at this point
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.
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 13:15.

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