I’m having trouble with my code, as whenever I start it, it takes 3 seconds to start moving. This only happens when there is a turn at the very beginning, not when there is a normal drive command. Please Help.
share the code please
this is the code
def Left_Yellow():
global Left_Front, Right_Front, Left_Back, Right_Back, Mode, Turn, Move, AUTO_MODE, vexcode_brain_precision, vexcode_console_precision, vexcode_controller_1_precision
drivetrain.set_heading(0, DEGREES)
drivetrain.set_turn_velocity(90, PERCENT)
drivetrain.set_drive_velocity(90, PERCENT)
drivetrain.turn_to_heading(7, DEGREES)
drivetrain.drive_for(FORWARD, 42, INCHES, wait=True)
drivetrain.set_drive_velocity(50, PERCENT)
drivetrain.drive_for(FORWARD, 2, INCHES, wait=True)
drivetrain.set_drive_velocity(90, PERCENT)
Claw.spin(FORWARD)
wait(0.5, SECONDS)
Claw.stop()
drivetrain.drive_for(REVERSE, 35, INCHES, wait=True)
drivetrain.set_drive_velocity(50, PERCENT)
Claw.spin(REVERSE)
wait(0.5, SECONDS)
Claw.stop()
drivetrain.drive_for(REVERSE, 5, INCHES, wait=True)
drivetrain.turn_to_heading(-25, DEGREES)
drivetrain.drive_for(FORWARD, 2, INCHES, wait=True)
Front_Lift.spin_for(FORWARD, 1.5, SECONDS)
drivetrain.set_drive_velocity(30, PERCENT)
drivetrain.drive_for(REVERSE, 2, INCHES, wait=True)
drivetrain.drive_for(FORWARD, 4, INCHES, wait=True)
Front_Lift.spin_for(REVERSE, .5, SECONDS)
Do you use an inertial sensor?
If so, is it calibrated before the program starts?
yes, its calibrated in preauton, this only happens when a turn is near the start of the code
Just wondering, why do you even turn in the first place, why not just turned a little bit?
dont feel like having to set it up at the same angle each time, even with a guide. That has gone very wrong in past years
nvm got it
Why don’t you share how you solved the problem so that others with the same issue in the future might also be helped?
well I was using vexcode and stupid me put it in the preauton function, and since it has a turn it calibrates. Even though it calibrates when the program starts