View Single Post
  #1   Spotlight this post!  
Unread 25-06-2015, 11:26
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Using PID on Talon SRX with Gyro for feedback

Quote:
Originally Posted by GeeTwo View Post
gyroscopes don't give you an output of what direction you're heading, but what your rate of rotation is.
True, but the WPILib Gyro class uses the FPGA to integrate the gyro's rate to give the robot's angular orientation... which is used by many teams for field-centric control and driving straight.

Code:
/**
 * Use a rate gyro to return the robots heading relative to a starting position.
 * The Gyro class tracks the robots heading based on the starting position. As
 * the robot rotates the new heading is computed by integrating the rate of
 * rotation returned by the sensor. When the class is instantiated, it does a
 * short calibration routine where it samples the gyro while at rest to
 * determine the default offset. This is subtracted from each sample to
 * determine the heading.
 */
Reply With Quote