Go to Post If all you are is a nail, every hammer looks like a problem. - Alan Anderson [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 09-02-2016, 16:30
fireXtract fireXtract is offline
MegaHertz_Lux
FRC #2847 (Mega Hertz)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: fmt
Posts: 42
fireXtract is an unknown quantity at this point
Re: Threading?

Thank you! I was thinking quite narrow minded by thinking the only way I could do it was with threading! Thanks for showing me the way! One question, what does the super() thing do in the commandgroup? I use it in my PIDSubsystem to pass PID info, but what does it do in this case?

EDIT: I ended up doing this, the second parameter of the command can be used as a timeout ex. (addSequential(),1.5). I needed to do this so that the list doesn't get stuck in the SetShooterSpeedCommand as I don't have it exit unless its interrupted. This works as desired. Thanks for the help pblankenbaker!
Code:
	public KickNShootCommandGroup() {
		// super("KickNShootCommandGroup " + RobotMap.shootSpeed);

		// to get into default position
		addSequential(new SetKickerPositionCommand(RobotMap.kickDefaultAngle));

		// Start spinning up shooters and give them 2 seconds to reach speed
		addSequential(new SetShooterSpeedCommand(RobotMap.shootSpeed), 1.5);

		// Move kicker into kick position and give .5 second for boulder
		// to pass through
		addSequential(new SetKickerPositionCommand(RobotMap.kickHitAngle));
		addSequential(new WaitCommand(0.7));

		// Stop shooter and return kicker to default position

		addSequential(new SetKickerPositionCommand(RobotMap.kickDefaultAngle));
		addParallel(new SetShooterSpeedCommand(0), 0.5);
	}

Last edited by fireXtract : 09-02-2016 at 16:57. Reason: code
Reply With Quote
 


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 10:55.

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