View Single Post
  #3   Spotlight this post!  
Unread 28-01-2015, 19:00
jojoguy10's Avatar
jojoguy10 jojoguy10 is offline
Programming/Controls Mentor
AKA: Joe Kelly
FRC #0997 (Spartan Robotics) and FRC #2990 (Hotwire Robotics)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Stayton, OR
Posts: 283
jojoguy10 is a glorious beacon of lightjojoguy10 is a glorious beacon of lightjojoguy10 is a glorious beacon of lightjojoguy10 is a glorious beacon of lightjojoguy10 is a glorious beacon of light
Re: NavX Field-Centric drive (LabView)

Quote:
Originally Posted by Ether View Post
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?
__________________


Reply With Quote