public class AnalogGyro extends AnalogInput implements SensorModule, PIDSource, LiveWindowSendable, AngleSource, RateSource
AnalogInput.AccumulatorResult, AnalogInput.AnalogTriggerTypeAnalogIO.AnalogChannel, AnalogIO.DirectionInterface.InterfaceTypePIDSource.PIDSourceType| Modifier and Type | Field and Description |
|---|---|
static int |
AVERAGE_BITS |
static double |
CALIBRATE_SAMPLE_TIME |
static double |
DEF_VOLTAGE_PER_DEGREE |
private int |
m_center |
private double |
m_co |
private double |
m_offset |
private AnalogInput.AccumulatorResult |
m_results |
private PIDSource.PIDSourceType |
m_sType |
private double |
m_VperDperS |
static int |
OVERSAMPLE_BITS |
static double |
SAMPLE_RATE |
static double |
SAMPLES_PER_SEC |
m_tablem_channel, m_port, m_portPointerm_ifaceType, MAX_ANALOG_IN_CHANNELS, MAX_ANALOG_OUT_CHANNELS, MAX_DIGITAL_CHANNELS, MAX_PWM_CHANNELS, MAX_RELAY_CHANNELS| Constructor and Description |
|---|
AnalogGyro(AnalogIO.AnalogChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
void |
disableModule()
Disable the module
|
void |
enableModule()
Enable the module
|
double |
get()
Get the value of this double source
|
double |
getAngle()
Return the actual angle in degrees that the robot is currently facing.
|
boolean |
getModuleEnabled() |
double |
getRate()
Return the rate of rotation of the gyro
The rate is based on the most recent reading of the gyro analog value
|
java.lang.String |
getSmartDashboardType()
Live Window code, only does anything if live window is activated.
|
double |
pidGet() |
void |
reset()
Reset the gyro.
|
void |
setDeadband(double volts)
Set the size of the neutral zone.
|
void |
setPIDSourceType(PIDSource.PIDSourceType sType)
Set which parameter of the gyro you are using as a process control
variable.
|
void |
setSensitivity(double voltsPerDegreesPerSecond)
Set the gyro sensitivity.
|
void |
updateTable() |
createTriggerOutput, free, getAccumulatorCount, getAccumulatorOutput, getAccumulatorValue, getAverageBits, getAverageValue, getAverageVoltage, getGlobalSampleRate, getInWindow, getLSBWeight, getOffset, getOversampleBits, getTable, getTriggerIndex, getTriggerState, getValue, getVoltage, initAccumulator, initTable, initTrigger, isAccumulatorChannel, resetAccumulator, setAccumulatorCenter, setAccumulatorDeadband, setAccumulatorInitialValue, setAverageBits, setAveraged, setFiltered, setGlobalSampleRate, setLimitsRaw, setLimitsVoltage, setOversampleBits, startLiveWindowMode, stopLiveWindowModegetChannel, getChannelNumberallocateMXPPin, checkAnalogInputChannel, checkAnalogOutputChannel, checkDigitalChannel, checkPWMChannel, checkRelayChannel, freeMXPPin, getInterfaceTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitstartLiveWindowMode, stopLiveWindowModepublic static final int OVERSAMPLE_BITS
public static final int AVERAGE_BITS
public static final double SAMPLES_PER_SEC
public static final double SAMPLE_RATE
public static final double CALIBRATE_SAMPLE_TIME
public static final double DEF_VOLTAGE_PER_DEGREE
private double m_VperDperS
private double m_offset
private double m_co
private int m_center
private AnalogInput.AccumulatorResult m_results
private PIDSource.PIDSourceType m_sType
public AnalogGyro(AnalogIO.AnalogChannel channel)
public void reset()
public double getAngle()
getAngle in interface AngleSourcepublic double get()
AnalogInputget in interface NumberSourceget in class AnalogInputpublic double getRate()
getRate in interface RateSourcepublic void setSensitivity(double voltsPerDegreesPerSecond)
voltsPerDegreesPerSecond - The sensitivity in Volts/degree/second.public void setDeadband(double volts)
volts - The size of the deadband in voltspublic void setPIDSourceType(PIDSource.PIDSourceType sType)
sType - An enum to select the parameter.public java.lang.String getSmartDashboardType()
getSmartDashboardType in interface SendablegetSmartDashboardType in class AnalogInputpublic void updateTable()
updateTable in interface UpdatingSendableupdateTable in class AnalogInputpublic void enableModule()
enableModule in interface Modulepublic void disableModule()
disableModule in interface Modulepublic boolean getModuleEnabled()
getModuleEnabled in interface Module