@Mikets, This seems like a problem in wpilib. TankDrive expects you to have set the setInverted flags on the motors and MecanumDrive expects you to have not set those flags. It's inconsistent and unintuitive.
@arhowk What makes you say `setInverted` is for debugging purposes only? If you're going to set motor power in multiple places, it's much cleaner just to call setInverted once when you create the motor instead of putting a negative sign in every place you set the motor power.
Code:
if(shouldBeArcadeDrive){
drive.arcadeDrive(joy.getRawAxis(KXbox.Move), -joy.getRawAxis(KXbox.Rotate))
}else{
drive.mecanumDrive(joy.getRawAxis(KXbox.Move), joy.getRawAxis(KXbox.Rotate))
}
I think this code is a great example of why there is a problem in WPILib. Sure this example took two seconds to write, but they get more complicated than this. When libraries like WPILib are inconsistent it makes the code that uses them less readable and more prone to error.
I've noticed a lot of inconsistencies in WPILib. Team 973 also wraps a bunch of WPILib functionality to protect ourselves from the madness. Thanks, Mike, for pointing out the problem and sharing a clean solution.