Go to Post You just have to care enough to give it a try. Your mentors will appreciate the effort. - Koko Ed [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 01-19-2014, 08:15 PM
AlexanderTheOK AlexanderTheOK is offline
Guy
no team
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Los Angeles
Posts: 146
AlexanderTheOK is just really niceAlexanderTheOK is just really niceAlexanderTheOK is just really niceAlexanderTheOK is just really nice
RobotBuilder parallel commands.

I have been experimenting with robotBuilder and have found a strange occurrence. commands seem to not run in parallel. The two commands both use the same subsystem. When both of them "required" it, the second command would cause the first to stop and replace it. I made it so neither "required" the subsystem, and neither operates on the same part of the subsystem. Now the second one simply does not do anything.(It's simply changing a certain internal variable) does anyone know how to make the two commands work together?
Reply With Quote
  #2   Spotlight this post!  
Unread 01-19-2014, 08:55 PM
Pault's Avatar
Pault Pault is offline
Registered User
FRC #0246 (Overclocked)
Team Role: College Student
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Boston
Posts: 618
Pault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond repute
Re: RobotBuilder parallel commands.

The requires function is in there for a reason: no 2 commands can run in parallel if they require the same subsystem. This is to idiot-proof* the structure so that you don't send conflicting information to a motor/solenoid/etc and confusing the robot. And you need to "require" a subsytem in order to use it, for the same reason as above. Without knowing the details of what you are doing, it is tough for me to make a recommendation, but I will try to offer some general advice. Look at the subsystem you have, and see if it can be divided up into 2+ smaller subsytems. This will eliminate the problem you are currently having, as well as save you a lot of trouble further down the line when you run into other similar problems. If you can't divide up the subsystem, then you are just going to have to figure out how to combine the 2 commands into 1.

Hope this helps.

*I say idiot-proof, but its a pretty common mistake, actually, and can cause big problems.
Reply With Quote
  #3   Spotlight this post!  
Unread 01-19-2014, 09:21 PM
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,547
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: RobotBuilder parallel commands.

Paul covered why they can't both run when they both require the subsystem.
Can you give more details over how you are calling them when they both do not require a subsytem and still don't operate in parallel?
Reply With Quote
  #4   Spotlight this post!  
Unread 01-20-2014, 07:56 AM
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,712
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: RobotBuilder parallel commands.

If the two command are not using the same parts of the subsystem you can just remove the requires part of the command. The only issue can you have with this is you will have to make sure the command is going to stop on its own if you need it to stop. We leave some commands without the requires if the all the command is going is actuating a solenoid and is only going to run once, but for the most part your commands should all require the subsystem that they are using.

Here is a beginners guide on Command Based Java that our team presented at the VA FRC Workshop this past fall if you'd like to take a look.

Last edited by notmattlythgoe : 01-20-2014 at 07:58 AM.
Reply With Quote
  #5   Spotlight this post!  
Unread 01-20-2014, 01:03 PM
krieck's Avatar
krieck krieck is offline
Registered User
AKA: Keith
FRC #2846 (Firebears)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Minnesota
Posts: 49
krieck is an unknown quantity at this point
Re: RobotBuilder parallel commands.

Or, instead of removing the "requires" statement, you could refactor your subsystem into two independent 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 09:02 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