Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Atonomous (http://www.chiefdelphi.com/forums/showthread.php?t=113376)

inkspell4 12-02-2013 21:24

Atonomous
 
How can an autonomous command in the command base robot be used?

Can it call other commands to run?

Any examples would be helpful.

Thanks

inkspell4 12-02-2013 21:48

The title is spelled wrong it should be autonomous!

Team3266Spencer 12-02-2013 23:28

Re: Atonomous
 
You would create a class thats extends CommandGroup and start it in the initAutonomous method in the robot template class. Look it it up in the WPI cookbook.

BradAMiller 13-02-2013 16:03

Re: Atonomous
 
Here is an example of creating a command group that can run during the autonomous period. It is important to note that once you have created the command, it can be used during teleop too. So for this year, if you have a command that can, say for example, shoot from the pyramid, then if the robot finds itself next to the pyramid during teleop and you have that command "wired" to a button, you can use it.

http://Wpilib.screenstepslive.com/s/3120/m/7952/l/97994

Brad

inkspell4 13-02-2013 21:19

How could i add a wait statement into the code between the commands as they run?

Ginto8 13-02-2013 21:48

Re: Atonomous
 
Quote:

Originally Posted by inkspell4 (Post 1232973)
How could i add a wait statement into the code between the commands as they run?

You can either add a WaitCommand:
Code:

addSequential(new WaitCommand(5));
or you can use a command that does nothing (we have a command called DoNothing which does nothing and returns false from isFinished()) along with addSequential's timeout parameter:
Code:

addSequential(new DoNothing(),5);


All times are GMT -5. The time now is 10:10.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi