View Single Post
  #7   Spotlight this post!  
Unread 25-01-2014, 10:09
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Mechanum wheel programming in C++

Quote:
Originally Posted by Ether View Post

Questions? Fire away.

What about field-centric? My team tried this out a few times but got really weird results. Would the following code snippet be correct?
Code:
[...] gyro->Reset(); float theta = gyro->GetAngle(); [...]

yVal2=(float) (yVal*Math.cos(theta) - xVal*Math.sin(theta));
xVal2=(float) (yVal*Math.sin(theta) + xVal*Math.cos(theta));
When we tried using this in our mecanum code method the robot could drive straight but would jitter and twitch if we tried to rotate it (like some robots do when their power draw exceeds the operating power of the motor controllers when your battery is low).
Reply With Quote