In my autonomous code, to get the triball out of the corner, I need to lift it up a certain amount so it can get past the bar but also not hit the robot itself and have it fall out. I used the Motor.spinFor() function to do this but it sometimes just gets stopped in the middle of spinning the motor and seems to halt the rest of the code with it. I am pretty sure this happens because there is too much force on the motor and something gets called to stop the robot as a failsafe.
Here is a picture of it where it stops.
I set the torque limit of the motor to max but that doesn’t change anything, this is the point of the autonomous that it stops at.
Drivetrain.driveFor(forward, 375, mm);
// Moves onto the bar to grab the tirball
SpinTime(Intake, -70, 1.25);
// Slams intake down on tribal to grab it
Intake.setMaxTorque(100, percent);
// Attempt to avoid motor stopping during next function
Intake.spinFor(forward, 0.85, turns);
// Problem area, meant to lift triball over bar
Intake.stop(hold);
// Holds intake in place
Drivetrain.driveFor(reverse, 210, mm);
// Backs up robot