Auton Code not completing

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);

Sounds dumb, but if you are using the V5 controller for Auton its auto cuts off at 15 seconds. maybe run out of time?

You could troubleshoot it by attempting to complete you //Lift Up section twice, which should tell you if the problem is at the end of the lift up, or the beginning of the following //Drive code.

Also, you have functional //Drive code earlier in the program which you could copy and paste in the //Drive for .5 Rotation section.

Finally, this is the first time you are using your lift in the program, so you may want to test if the lift code could work earlier in the script. Have you tried reshuffling the steps just to see where the code breaks?

Thank you for your replies I think we might’ve figured it out. We think the motors couldn’t reach the end goal so we changed the numbers. This might’ve also been a problem on some of my previous autons so I’ll have to check on them. Thank you again!

Could be that the auton timer ran out. See you at Maiden!