Go to Post It's not fair. it's not right, but stuff like this happens. If you don't get picked for finals tomorrow, get in those stands and cheer for those who did. Remember, this is FIRST. - wilsonmw04 [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 31-01-2014, 20:27
AutoBotAM AutoBotAM is offline
Registered User
AKA: Christian Reese
FRC #2077 (Laser Robotics (Laserbots))
Team Role: Programmer
 
Join Date: Mar 2012
Rookie Year: 2010
Location: Wisconsin
Posts: 34
AutoBotAM is an unknown quantity at this point
Parallel commands that depend on the same subsystem?

How would the two commands be ran in this situation? Either by running them in parallel in a command group, or if both commands were default commands of different subsystems.

I know that if one command is run that depends on a subsystem that another running command depends on, either of the commands are terminated depending on the circumstances. Is there a way to get two commands to literally run in parallel, accessing the same subsystem? So if commands A and B depend on subsystem C, the scheduler will execute A, then B, A, B, and so on.

Is there a way to get that working?

EDIT:

If there is not, I'll explain my design further. In this case command A would only read information from subsystem C. It would only use accessor methods and no mutator methods. So would it be safe to just omit the "requires" call?
__________________
"Mecanum drivetrains, like every other, have advantages and disadvantages, but some of the disadvantages being discussed here are overstated and/or misinformation." -buchanan

Last edited by AutoBotAM : 31-01-2014 at 20:31.
Reply With Quote
  #2   Spotlight this post!  
Unread 31-01-2014, 21:43
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,590
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Parallel commands that depend on the same subsystem?

Quote:
Originally Posted by AutoBotAM View Post
If there is not, I'll explain my design further. In this case command A would only read information from subsystem C. It would only use accessor methods and no mutator methods. So would it be safe to just omit the "requires" call?
Command A does not require exclusive access to Subsystem, so you should not use the requires call.
Reply With Quote
  #3   Spotlight this post!  
Unread 31-01-2014, 22:17
AutoBotAM AutoBotAM is offline
Registered User
AKA: Christian Reese
FRC #2077 (Laser Robotics (Laserbots))
Team Role: Programmer
 
Join Date: Mar 2012
Rookie Year: 2010
Location: Wisconsin
Posts: 34
AutoBotAM is an unknown quantity at this point
Re: Parallel commands that depend on the same subsystem?

Quote:
Originally Posted by Joe Ross View Post
Command A does not require exclusive access to Subsystem, so you should not use the requires call.
So there isn't a way to do the former. Otherwise answers my question, thanks!
__________________
"Mecanum drivetrains, like every other, have advantages and disadvantages, but some of the disadvantages being discussed here are overstated and/or misinformation." -buchanan
Reply With Quote
  #4   Spotlight this post!  
Unread 01-02-2014, 00:33
BigJ BigJ is offline
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 947
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Re: Parallel commands that depend on the same subsystem?

If A and B both "require" C in your case, either you are trying to control the same physical parts of the robot (motor controllers, solenoids, etc) with 2 commands (bad and can have unexpected results), or your subsystem has 2 different (sets of) physical parts that the commands are controlling (in which case you should refactor said subsystem into 2 subsystems).
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:11.

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