Log in

View Full Version : Atonomous


inkspell4
12-02-2013, 21:24
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
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
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
How could i add a wait statement into the code between the commands as they run?

You can either add a WaitCommand:
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:
addSequential(new DoNothing(),5);