Hi there, we’re having issues with a robot spinning when we ask it to turn, I’m attaching our functions to this as well as the auton section from their competition code.
Any ideas?
motor_group LeftSide(leftFront,leftBack);
motor_group RightSide(rightFront, rightBack);
motor_group StrafeL(leftFront,rightBack);
motor_group StrafeR(rightFront,leftBack);
inertial Inertial17 = inertial(PORT17);
smartdrive robotDrive(LeftSide, RightSide, Inertial17, 12.56, 15, 5, distanceUnits::in);
void drivingF(int distance, int speed,directionType direction){
robotDrive.driveFor(direction,distance, distanceUnits::in, speed, velocityUnits::pct);
}
void slideL (int distance, int speed){ //Strafe left and right
StrafeL.rotateFor(-distance, rotationUnits::deg,speed, velocityUnits::pct, false);
StrafeR.rotateFor(distance, rotationUnits::deg,speed, velocityUnits::pct);
}
void turningT(int degrees, int speed){ //- means left + means right
robotDrive.turnFor(degrees, rotationUnits::deg, speed,velocityUnits::pct);
}
void autonomous(void) {
drivingF(20,100,fwd);
slideL(300,100);
turningT(-90,100);
driving forward and strafeing work fine, just turns are not working and we’re not sure why.
Attaching a video