We also found a potential bug in ArcadeDrive. According to the code below, a positive rotateValue will make the robot turn left and negative will make it turn right. As far as I understand it, this is opposite to convention. I cross checked this with MecanumDrive_Cartesian where positive rotation will turn right and negative rotation will turn left (which agrees with convention). We found this by accident because we had to change our wheels from Mecanum to regular and all the sudden the robot turns the other way.
Code:
void RobotDrive::ArcadeDrive(float moveValue, float rotateValue, bool squaredInputs)
{
....
if (moveValue > 0.0)
{
if (rotateValue > 0.0)
{
leftMotorOutput = moveValue - rotateValue;
rightMotorOutput = max(moveValue, rotateValue);
}
else
{
leftMotorOutput = max(moveValue, -rotateValue);
rightMotorOutput = moveValue + rotateValue;
}
}
else
{
if (rotateValue > 0.0)
{
leftMotorOutput = - max(-moveValue, rotateValue);
rightMotorOutput = moveValue + rotateValue;
}
else
{
leftMotorOutput = moveValue - rotateValue;
rightMotorOutput = - max(-moveValue, -rotateValue);
}
}
}