Quote:
Originally Posted by Ether
That is explained on the second page:
Code:
front_left = forward + clockwise + right;
front_right = forward - clockwise - right;
rear_left = forward + clockwise - right;
rear_right = forward - clockwise + right;
// Finally, normalize the wheel speed commands
// so that no wheel speed command exceeds magnitude of 1:
max = abs(front_left);
if (abs(front_right)>max) max = abs(front_right);
if (abs(rear_left)>max) max = abs(rear_left);
if (abs(rear_right)>max) max = abs(rear_right);
if (max>1)
{front_left/=max; front_right/=max; rear_left/=max; rear_right/=max;}
// You're done. Send these four wheel commands to their respective wheels
front_left, front_right, rear_left, rear_right are the commands to send to each mecanum wheel.
If that's not what you were asking, please clarify your question and I'll try again.
|
Okay, thanks again. So I just send those wheels in the drive train like so:
Code:
RobotDrive driveTrain = new RobotDrive(front_left, rear_left, front_right, rear_right);
Then invert the motors like I've been doing, or...?