View Single Post
  #2   Spotlight this post!  
Unread 28-01-2015, 18:30
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,025
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: NavX Field-Centric drive (LabView)

Quote:
Originally Posted by jojoguy10 View Post
From a LabView perspective (using the Holonomic drive VI), will it take an input of -180 to +180?
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.


Reply With Quote