Quote:
Originally Posted by Dinnesy
Your autonomous function should look like
Code:
public void autonomous() {
while(isAutonomous()){ //Place everything in a loop.
robotDrive.drive(0.5,0.0);//drive at 50% speed 0% turn
Timer.delay(5.0);//wait 5 seconds
}
|
You don't need to iterate in autonomous; assuming you have a sequence of statements (e.g. drive forwards, stop, shoot) they should only execute once each. Look at
this example.
Try the following instead:
Code:
public void autonomous() {
robotDrive.setSafetyEnabled(false);
robotDrive.drive(0.5,0.0);//drive at 50% speed 0% turn
Timer.delay(5.0);//wait 5 seconds
}
When setSafetyEnabled is true (by default it is), the robot won't drive if the code continues for too long. That's probably causing your robot to stop entirely after ~0.1 seconds.