So I’m having an issue where my autonomous wont finish all of it’s code, I don’t know why this is.
void pre_auton( void ) {
// All activities that occur before the competition starts
// Example: clearing encoders, setting servo positions, ...
}
void autonomous( void ) {
// ..........................................................................
//Set Brakes
LeftF.stop(brakeType::hold);
RightF.stop(brakeType::hold);
LeftB.stop(brakeType::hold);
RightB.stop(brakeType::hold);
task::sleep(100);
//Lower Cappy for 3 rotations
Cappy.rotateFor(1080,rotationUnits::deg,100,velocityUnits::rpm);
task::sleep(100);
//Drive for 3.25 rotations
LeftF.rotateFor(1134,rotationUnits::deg,200,velocityUnits::rpm,false);
RightF.rotateFor(1134,rotationUnits::deg,200,velocityUnits::rpm,false);
LeftB.rotateFor(1134,rotationUnits::deg,200,velocityUnits::rpm,false);
RightB.rotateFor(1134,rotationUnits::deg,200,velocityUnits::rpm);
task::sleep(200);
//Raise Cappy for 1.5
Cappy.rotateFor(-540,rotationUnits::deg,100,velocityUnits::rpm);
task::sleep(100);
//Turn around
LeftF.rotateFor(-720,rotationUnits::deg,75,velocityUnits::rpm,false);
RightF.rotateFor(720,rotationUnits::deg,75,velocityUnits::rpm,false);
LeftB.rotateFor(-720,rotationUnits::deg,75,velocityUnits::rpm,false);
RightB.rotateFor(720,rotationUnits::deg,75,velocityUnits::rpm);
task::sleep(100);
//Drive back for 3 rotations
LeftF.rotateFor(900,rotationUnits::deg,100,velocityUnits::rpm,false);
RightF.rotateFor(900,rotationUnits::deg,100,velocityUnits::rpm,false);
LeftB.rotateFor(900,rotationUnits::deg,100,velocityUnits::rpm,false);
RightB.rotateFor(900,rotationUnits::deg,100,velocityUnits::rpm);
task::sleep(100);
//Turn Right for .5
LeftF.rotateFor(180,rotationUnits::deg,75,velocityUnits::rpm,false);
RightF.rotateFor(-180,rotationUnits::deg,75,velocityUnits::rpm,false);
LeftB.rotateFor(180,rotationUnits::deg,75,velocityUnits::rpm,false);
RightB.rotateFor(-180,rotationUnits::deg,75,velocityUnits::rpm);
task::sleep(100);
//Lift Up
LiftL.rotateFor(254,rotationUnits::deg,100,velocityUnits::rpm,false);
LiftR.rotateFor(254,rotationUnits::deg,100,velocityUnits::rpm);
task::sleep(100);
// BREAK ABOVE CODE WORKS BUT DOESNT CONTINUE CODE BELOW
//Drive for .5 rotations
LeftF.rotateFor(180,rotationUnits::deg,100,velocityUnits::rpm,false);
RightF.rotateFor(180,rotationUnits::deg,100,velocityUnits::rpm,false);
LeftB.rotateFor(180,rotationUnits::deg,100,velocityUnits::rpm,false);
RightB.rotateFor(180,rotationUnits::deg,100,velocityUnits::rpm);
task::sleep(100);
//Lift Down
LiftL.rotateFor(-200,rotationUnits::deg,100,velocityUnits::rpm,false);
LiftR.rotateFor(-200,rotationUnits::deg,100,velocityUnits::rpm);
task::sleep(100);