Go to Post At least try to make sure other teams are aware of you. Don't be obnoxious, but don't be a wall flower either. - Joe Johnson [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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-02-2015, 06:50 PM
pluto7443 pluto7443 is offline
Registered User
FRC #4917
 
Join Date: Mar 2014
Location: Canada
Posts: 17
pluto7443 is an unknown quantity at this point
Unhappy Two Commands Co-Existing depsite Requires()

So, we have a problem with using two commands that both require our IntakeSub subsystem. One is the default command, used for manual control of the intake with a joystick, and the other is a command which should override the default. The manual control works fine, however, when the command is called (by pressing a button), the command starts to run, not interrupting the default command. Both commands use Requires(mIntakeSub) in their constructor - why doesn't the button command interrupt the default?
Reply With Quote
  #2   Spotlight this post!  
Unread 02-02-2015, 08:48 PM
afiolmahon afiolmahon is offline
Registered User
FRC #1218
 
Join Date: Dec 2014
Location: Philadelphia
Posts: 7
afiolmahon is an unknown quantity at this point
Re: Two Commands Co-Existing depsite Requires()

Are you able to post the code for both commands?
Reply With Quote
  #3   Spotlight this post!  
Unread 02-02-2015, 09:52 PM
JohnSmooth42 JohnSmooth42 is offline
Is writing code
FRC #0375 (The Robotic Plague)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2012
Location: New York
Posts: 27
JohnSmooth42 is an unknown quantity at this point
Re: Two Commands Co-Existing depsite Requires()

Have you made sure you have code in the IsInterrupted() function of the command? I decided to try out the command based framework two days ago(ported all the SampleRobot code in 10 hours ) and we had a similar problem, which was fixed by making sure the commands actually ended when we wanted them to.
Reply With Quote
  #4   Spotlight this post!  
Unread 02-02-2015, 10:43 PM
TFleig78's Avatar
TFleig78 TFleig78 is offline
Registered User
AKA: Tyler
FRC #0078 (Air Strike)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Rhode Island
Posts: 58
TFleig78 will become famous soon enoughTFleig78 will become famous soon enough
Re: Two Commands Co-Existing depsite Requires()

Quote:
Originally Posted by pluto7443 View Post
why doesn't the button command interrupt the default?
How do you know it's not interrupting the default command? Do you have code in the interrupted function?
Reply With Quote
  #5   Spotlight this post!  
Unread 02-02-2015, 10:46 PM
GeeTwo's Avatar
GeeTwo GeeTwo is online now
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,539
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Two Commands Co-Existing depsite Requires()

This may sound like "is the computer plugged in", but is this actually running under the command based robot model?
Reply With Quote
  #6   Spotlight this post!  
Unread 02-09-2015, 07:46 PM
pluto7443 pluto7443 is offline
Registered User
FRC #4917
 
Join Date: Mar 2014
Location: Canada
Posts: 17
pluto7443 is an unknown quantity at this point
Re: Two Commands Co-Existing depsite Requires()

The solution was that we had OI initialized before some other subsystems, which was causing strange behaviour. ALWAYS INIT OI LAST!
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 09:15 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