We are coding in the latest version of VexCode. Our autonomous works perfectly on a competition switch. When we plug the controller into a field controller, only the drive base motors function in autonomous. This continues for each iteration of autonomous until we restart the robot. All motors work well in teleop.
Our autonomous function:
void autonomous(void)
{
// ..........................................................................
// Insert autonomous user code here.
// ..........................................................................
setAllDriveVelocity(80);
setIntakeVelocity(127);
setTiltVelocity(60);
setAllDriveVelocity(60);
Motor_Intake_Right.spin(directionType::rev);
Motor_Intake_Left.spin(directionType::rev);
wait(250, msec);
rotateAllDriveMotorsFor(50);
wait(4500, msec);
setAllDriveVelocity(127);
rotateAllDriveMotorsFor(-46);
wait(2250, msec);
setAllDriveVelocity(90);
rotateRightDriveFor(14.8);
rotateLeftDriveFor(-14.8);
wait(1500, msec);
setAllDriveVelocity(80);
rotateAllDriveMotorsFor(17);
Motor_Intake_Right.stop();
Motor_Intake_Left.stop();
wait(2000, msec);
setIntakeVelocity(-127);
rotateTiltFor(26.5);
wait(2000, msec);
Motor_Intake_Right.spin(directionType::rev);
Motor_Intake_Left.spin(directionType::rev);
wait(1000, msec);
rotateAllDriveMotorsFor(-10);
wait(5000, msec);
}
The associated helper functions within autonomous:
void rotateAllDriveMotorsFor(double dist)
{
dist = dist / (4 * M_PI);
Motor_BLeft.rotateFor(dist, rotationUnits::rev, false);
Motor_FLeft.rotateFor(dist, rotationUnits::rev, false);
Motor_BRight.rotateFor(dist, rotationUnits::rev, false);
Motor_FRight.rotateFor(dist, rotationUnits::rev, false);
}
void rotateRightDriveFor(double dist)
{
dist = dist / (4 * M_PI);
Motor_BRight.rotateFor(dist, rotationUnits::rev, false);
Motor_FRight.rotateFor(dist, rotationUnits::rev, false);
}
void rotateLeftDriveFor(double dist)
{
dist = dist / (4 * M_PI);
Motor_BLeft.rotateFor(dist, rotationUnits::rev, false);
Motor_FLeft.rotateFor(dist, rotationUnits::rev, false);
}
void rotateTiltFor(double dist)
{
dist = dist / (4 * M_PI);
Motor_Tilt.rotateFor(dist, rotationUnits::rev, false);
}
void setAllDriveVelocity(int speed)
{
Motor_BLeft.setVelocity(speed, velocityUnits::rpm);
Motor_FLeft.setVelocity(speed, velocityUnits::rpm);
Motor_FRight.setVelocity(speed, velocityUnits::rpm);
Motor_BRight.setVelocity(speed, velocityUnits::rpm);
}
void setIntakeVelocity(int speed)
{
Motor_Intake_Left.setVelocity(speed, velocityUnits::rpm);
Motor_Intake_Right.setVelocity(speed, velocityUnits::rpm);
}
void setTiltVelocity(int speed)
{
Motor_Tilt.setVelocity(speed, velocityUnits::rpm);
}
We tried updating all of the firmware and creating an entirely new project but the issue still remains.