Quote:
Originally Posted by Ether
The Java WPILib code will. There's a good chance the LabVIEW will too.
It's a very simple vector rotation.
Code:
/**
* Rotate a vector in Cartesian space.
*/
protected static double[] rotateVector(double x, double y, double angle) {
double cosA = Math.cos(angle * (3.14159 / 180.0));
double sinA = Math.sin(angle * (3.14159 / 180.0));
double out[] = new double[2];
out[0] = x * cosA - y * sinA;
out[1] = x * sinA + y * cosA;
return out;
}
What's important is that the gyro angle is increasing in the clockwise direction.
|
Right, inside the Holonomic VI, this calculation is going on. Will it handle negative inputs?