Public Member Functions |
| | Gyro (UINT8 moduleNumber, UINT32 channel) |
| | Gyro (UINT32 channel) |
| | Gyro (AnalogChannel *channel) |
|
| Gyro (AnalogChannel &channel) |
| virtual | ~Gyro () |
| virtual float | GetAngle () |
| void | SetSensitivity (float voltsPerDegreePerSecond) |
| virtual void | Reset () |
| double | PIDGet () |
| void | UpdateTable () |
| void | StartLiveWindowMode () |
| void | StopLiveWindowMode () |
| std::string | GetSmartDashboardType () |
| void | InitTable (ITable *subTable) |
| ITable * | GetTable () |
| | SensorBase () |
| virtual | ~SensorBase () |
|
virtual Error & | GetError () |
| | Retrieve the current error. Get the current error information associated with this sensor.
|
|
virtual const Error & | GetError () const |
| virtual void | SetErrnoError (const char *contextMessage, const char *filename, const char *function, UINT32 lineNumber) const |
| | Set error information associated with a C library call that set an error to the "errno" global variable.
|
| virtual void | SetImaqError (int success, const char *contextMessage, const char *filename, const char *function, UINT32 lineNumber) const |
| | Set the current error information associated from the nivision Imaq API.
|
| virtual void | SetError (Error::Code code, const char *contextMessage, const char *filename, const char *function, UINT32 lineNumber) const |
| | Set the current error information associated with this sensor.
|
| virtual void | SetWPIError (const char *errorMessage, const char *contextMessage, const char *filename, const char *function, UINT32 lineNumber) const |
| | Set the current error information associated with this sensor.
|
|
virtual void | CloneError (ErrorBase *rhs) const |
|
virtual void | ClearError () const |
| | Clear the current error information associated with this sensor.
|
| virtual bool | StatusIsFatal () const |
| | Check if the current error code represents a fatal error.
|
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. This gyro class must be used with a channel that is assigned one of the Analog accumulators from the FPGA. See AnalogChannel for the current accumulator assignments.
Definition at line 27 of file Gyro.h.
| float Gyro::GetAngle |
( |
void |
| ) |
|
|
virtual |
Return the actual angle in degrees that the robot is currently facing.
The angle is based on the current accumulator value corrected by the oversampling rate, the gyro type and the A/D calibration values. The angle is continuous, that is can go beyond 360 degrees. This make algorithms that wouldn't want to see a discontinuity in the gyro output as it sweeps past 0 on the second time around.
- Returns
- the current heading of the robot in degrees. This heading is based on integration of the returned rate from the gyro.
Definition at line 154 of file Gyro.cpp.