Go to Post It's not about going for any of the awards. Awards are to recognize what you are doing for First, your team, and the community. - SaraBailey [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-07-2016, 04:44 PM
grimmsterj grimmsterj is offline
Registered User
FRC #4203 (Robokronos)
Team Role: Leadership
 
Join Date: Nov 2013
Rookie Year: 2013
Location: New York
Posts: 7
grimmsterj is an unknown quantity at this point
Error while deploying Command-Based Code

Hi everybody,

So this year we are extremely inexperienced in the programming department, as our lead programmer has graduated and our only other programmer really wasn't at the level he needed to be. I have done a lot of learning over the past few weeks but currently I've ran into an error with my code that I can't seem to figure out.

I can provide code if anyone needs it, but basically I have a pneumatic subsystem along with a raise command and a lower(retract) command. (We did have one command that did both but switched to one for each in an attempt to get rid of some of the errors we faced). Very simple code all intended to open and close a piston.

When I deploy code and enable the bot, the compressor starts up and it acts like it's working and then I get a no code error and everything shuts down.

The main error I can't seem to get past is:

"nhandled exception: edu.wpi.first.wpilibj.command.IllegalUseOfCommandE xception: Can not add new requirement to command after being started or being added to a command group"

While we have other commands, most of them are doing nothing so I am almost certain it is something with the raise/lower commands. We don't have a command group so I'm assuming it has something to do with us trying to add a new requirement after a command is started. However, any "requires()" that I have in the commands is under init.

No idea why this error is coming up or how to solve/troubleshoot it. Any help would be greatly appreciated.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-07-2016, 05:13 PM
grimmsterj grimmsterj is offline
Registered User
FRC #4203 (Robokronos)
Team Role: Leadership
 
Join Date: Nov 2013
Rookie Year: 2013
Location: New York
Posts: 7
grimmsterj is an unknown quantity at this point
Re: Error while deploying Command-Based Code

After further troubleshooting, the exact lines of code causing the error are our command.start lines under teleopInit in the robot class. I have seen other FRC code using this in the same place, not sure what is causing ours to not work.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-07-2016, 05:16 PM
pblankenbaker pblankenbaker is offline
Registered User
FRC #0868
 
Join Date: Feb 2012
Location: Carmel, IN, USA
Posts: 102
pblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of light
Re: Error while deploying Command-Based Code

It would be useful if you could post the source code for your command.

The requires() statements should only be invoked in the Command's constructor. Is it possible you have placed them in the Command's initialize() method? This might be the reason you are getting the error.
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:28 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