I believe that you do not need the part at the top defining your variables. You could just put that when you are defining your functions. So, your program should look like:
void setDrive(void){
int lateral = controller1.get_analog (ANALOG_LEFT_X);
int linear = controller1.get_analog (ANALOG_LEFT_Y);
int rotation = controller1.get_analog (ANALOG_RIGHT_X);
//et cetera et cetera et cetera
In the code you posted there are a number of issues.
no need to pass parameters and then immediately redefine them.
The deadband needs to be before passing the values to the motors.
and you need a delay in opcontrol, you have it outside the while loop.
void setDrive() {
int lateral = controller1.get_analog (ANALOG_LEFT_X);
int linear = controller1.get_analog (ANALOG_LEFT_Y);
int rotation = controller1.get_analog (ANALOG_RIGHT_X);
if (abs( lateral ) < 10) {
lateral = 0 ;
}
if (abs( linear ) < 10) {
linear = 0 ;
}
if (abs( rotation ) < 10) {
rotation = 0 ;
}
// 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);
}