== Autonomous In the previous examples, we learned to [wiki:ControlSystems/SoftwareTeam/Training/GettingStarted/DCMotor apply power to the wheel motors] and to see how far the wheel has turned using [wiki:ControlSystems/SoftwareTeam/Training/GettingStarted/Encoders encoders]. Now we're going to put them together to drive the robot a controlled distance. We're also going to learn about autonomous mode. Every FRC match starts with a 15 second autonmous period where the robot drives itself and tries to accomplish some task with no human driver. For this example, our task is to drive 3 feet forward and then stop (harder than it sounds). Create another program using the !TimedRobot java template and name it AutonomousTest1. * Follow [wiki:ControlSystems/SoftwareTeam/Training/GettingStarted/Autonomous/PWM these instructions] for motors with PWM motor controllers (Macadamia). * Follow [wiki:ControlSystems/SoftwareTeam/Training/GettingStarted/Autonomous/CAN these instructions] for motors with CAN motor controllers (Hazelnut, Almond). When you launch the driver station, you'll need to select "Autonomous" mode (look above the Enable button) and then press the Enable button. The autonomousInit() method will run first and then the autonomousPeriodic() method will be called repeatedly until the robot is disabled. If your robot isn't doing what it should be, press the Disable button immediately to stop the robot. It's usually a good idea to test your code with the robot up on a stool or blocks (wheels not touching the ground) in case your code doesn't work properly. Why didn't the robot go straight? === Extra credit === Try to make the robot travel in a straight line. ==Vision== Follow [wiki:ControlSystems/SoftwareTeam/Training/GettingStarted/Autonomous/Vision]