Whenever I move the joysticks the motors dont move at all. Here is my drive.cpp file and the setDrive function.
void setDrive( int lateral, int linear, int rotation ) {
lateral = controller1.get_analog (ANALOG_LEFT_X);
linear = controller1.get_analog (ANALOG_LEFT_Y);
rotation = controller1.get_analog (ANALOG_RIGHT_X);
// Y component, X component, Rotation
topLeftDrive.move( -linear - lateral - rotation);
topRightDrive.move( linear - lateral - rotation);
backLeftDrive.move( linear + lateral - rotation);
backRightDrive.move( -linear + lateral - rotation);
if (abs( lateral ) < 10) {
lateral = 0 ;
}
if (abs( linear ) < 10) {
linear = 0 ;
}
if (abs( rotation ) < 10) {
rotation = 0 ;
}
}
This is what I have in my opcontrol file.
void opcontrol() {
while ( true ) {
setDrive(0,0,0);
}
pros::delay(20);
}
Im still not sure whats going on and what im doing wrong.