How do you know that it is only last command that gets executed?
Could it be the first command that starts but never reaches the target distance?
Also, could it be that wheels move unevenly and some reach target while FL doesn’t?
Could you, please, try this code:
void Drive(double distance, int speed)
{
FLMotor.move_relative(distance, speed);
BLMotor.move_relative(distance, speed);
FRMotor.move_relative(distance, speed);
BRMotor.move_relative(distance, speed);
while(1)
{
double avgPos = (
FLMotor.get_position() +
BLMotor.get_position() +
FRMotor.get_position() +
BRMotor.get_position() ) / 4.0;
if( fabs(avgPos-distance)<5.0 ) break;
pros::delay(2);
}
}