Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   swerve math quiz (http://www.chiefdelphi.com/forums/showthread.php?t=129185)

Ether 01-05-2014 10:00

Re: swerve math quiz
 
Quote:

Originally Posted by Ether (Post 1380886)
That's the beauty of using atan2, instead of atan with an offset correction.

Generalizing this exercise for any number of wheels N in any configuration:

Let XYrobot be a standard Cartesian coordinate system fixed with respect to the robot, with +Y axis pointing in the robot "forward" direction, and origin located at point C (which can be anywhere within the robot frame, or even outside the frame of the robot).

Let (Xi,Yi), i=1..N, be the coordinates of the robot's N wheels in the XYrobot coordinate system.

Then, the wheel tangential speeds and steering angles for clockwise rotation of the robot about the point C at ω radians/sec are given by:

speedi = ω√(Xi2+Yi2)

anglei = atan2(Yi,-Xi)

...where anglei is zero at the "straight forward" position and is measured clockwise therefrom with range ±π





All times are GMT -5. The time now is 22:07.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi