Quote:
Originally Posted by Ether
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).