Thread: WCD vs. Swerve
View Single Post
  #59   Spotlight this post!  
Unread 24-12-2011, 14:11
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,049
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: WCD vs. Swerve

Quote:
Originally Posted by Ether View Post
Code:
omega = ((sFR*cos(atan2(W,L)+pi/2-aFR)+sFL*cos(atan2(-W,L)+pi/2-aFL)
+sRL*cos(atan2(-W,-L)+pi/2-aRL)+sRR*cos(atan2(W,-L)+pi/2-aRR))/4)/
(sqrt(L^2+W^2)/2);
Quote:
Originally Posted by JamesTerm View Post
This is what I have confirmed the omega equation to be:
Code:
const double omega = (((_.sFR*cos(atan2(W,L)+(HP-_.aFR))/4)+
(_.sFL*cos(atan2(-W,L)+(HP-_.aFL))/4)+
(_.sRL*cos(atan2(-W,-L)+(HP-_.aRL))/4)+
(_.sRR*cos(atan2(W,-L)+(HP-_.aRR))/4)));
Assuming "HP" means "pi/2", then the equation you posted is arithmetically identical to the one I gave you, with the exception that you removed the final "/(sqrt(L^2+W^2)/2)"... which is required if you want omega to be in units of angular velocity (rad/sec).

There was a typo in my original post. The notes at the bottom said "L and W are wheelbase and trackwidth in inches". That should have said feet.




Last edited by Ether : 24-12-2011 at 15:36. Reason: added note about units for L & W
Reply With Quote