|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.nxt.I2CSensor lejos.nxt.addon.DIMUGyro
public class DIMUGyro
This class provides access to the gyro of Dexter Industries IMU sensor. Rate data can be fetched using the fetchAllRate method. Temperature data can be fetched using the fetchTemperature method.
Orientation of Axes: Assuming the flat side of the dIMU sensor is facing you and the sensor port is at the bottom, the axes are as follows: X axis runs from top to bottom, Y axis runs left to right, Z axis comes directly out the front of the sensor board.
Nested Class Summary | |
---|---|
static class |
DIMUGyro.Axis
Axis units supported by the sensor. |
static class |
DIMUGyro.Range
Dynamic ranges supported by the sensor |
static class |
DIMUGyro.RateUnits
Rotation units supported by the sensor |
static class |
DIMUGyro.SampleRate
Internal sample rates supported by the sensor |
static class |
DIMUGyro.TemperatureUnits
Temperature units supported by the sensor |
Field Summary | |
---|---|
protected boolean[] |
dynamicOffset
|
protected float |
I
|
protected float[] |
offset
|
protected DIMUGyro.Range |
range
|
protected DIMUGyro.RateUnits |
rateUnit
|
protected DIMUGyro.SampleRate |
sampleRate
|
protected DIMUGyro.TemperatureUnits |
temperatureUnit
|
Fields inherited from class lejos.nxt.I2CSensor |
---|
DEFAULT_I2C_ADDRESS, port, REG_PRODUCT_ID, REG_VENDOR_ID, REG_VERSION |
Fields inherited from interface lejos.nxt.SensorConstants |
---|
BLACK, BLANK_INDEX, BLUE, BLUE_INDEX, GREEN, GREEN_INDEX, MAX_AD_RAW, MAX_TYPE, MIN_TYPE, MODE_ANGLESTEP, MODE_BOOLEAN, MODE_CELSIUS, MODE_FARENHEIT, MODE_PCTFULLSCALE, MODE_PERIODCOUNTER, MODE_RAW, MODE_TRANSITIONCNT, RED, RED_INDEX, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, TYPE_HISPEED, TYPE_LIGHT_ACTIVE, TYPE_LIGHT_INACTIVE, TYPE_LOWSPEED, TYPE_LOWSPEED_9V, TYPE_NO_SENSOR, TYPE_REFLECTION, TYPE_SOUND_DB, TYPE_SOUND_DBA, TYPE_SWITCH, TYPE_TEMPERATURE, WHITE, YELLOW |
Constructor Summary | |
---|---|
DIMUGyro(I2CPort port)
|
Method Summary | |
---|---|
void |
calculateOffset()
Calibrates the sensor |
void |
fetchAllRate(float[] ret)
|
void |
fetchAllRate(float[] ret,
DIMUGyro.RateUnits unit)
|
float |
fetchTemperature()
Temperature is not calibrated. |
Gyroscope |
getAxis(DIMUGyro.Axis axis)
This method returns an instance of one of the three axes (X, Y, or Z) that the dIMU can supply. |
boolean[] |
getDynamicOffset()
|
float |
getOffsetCorrectionSpeed()
|
java.lang.String |
getProductID()
Read the sensor's product identifier. |
DIMUGyro.Range |
getRange()
|
DIMUGyro.RateUnits |
getRateUnit()
|
void |
getRawRate(int[] ret)
|
DIMUGyro.SampleRate |
getSampleRate()
|
DIMUGyro.TemperatureUnits |
getTemperatureUnit()
|
java.lang.String |
getVendorID()
Read the sensor's vendor identifier. |
java.lang.String |
getVersion()
Read the sensor's version string. |
protected boolean |
isDataOverrun()
|
boolean |
isNewDataAvailable()
Returns true if new data is available from the sensor |
void |
setDynamicOffset(boolean[] set)
Enables or disables the dynamic offset correction mechanism of the sensor Dynamic offset correction assumes that in the long run the sensor keeps its orientation. |
void |
setOffsetCorrectionSpeed(float i)
|
void |
setRange(DIMUGyro.Range range)
|
void |
setRateUnit(DIMUGyro.RateUnits unit)
|
void |
setSampleRate(DIMUGyro.SampleRate rate)
|
void |
setTemperatureUnit(DIMUGyro.TemperatureUnits unit)
|
Methods inherited from class lejos.nxt.I2CSensor |
---|
fetchString, getAddress, getData, getData, getData, getId, sendData, sendData, sendData, setAddress |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected float I
protected boolean[] dynamicOffset
protected float[] offset
protected DIMUGyro.Range range
protected DIMUGyro.SampleRate sampleRate
protected DIMUGyro.TemperatureUnits temperatureUnit
protected DIMUGyro.RateUnits rateUnit
Constructor Detail |
---|
public DIMUGyro(I2CPort port)
Method Detail |
---|
public Gyroscope getAxis(DIMUGyro.Axis axis)
axis
- The axis (X, Y or Z) to retrieve Gyroscope object
public void calculateOffset()
public void fetchAllRate(float[] ret)
public void fetchAllRate(float[] ret, DIMUGyro.RateUnits unit)
public float fetchTemperature()
public boolean[] getDynamicOffset()
public float getOffsetCorrectionSpeed()
public java.lang.String getProductID()
I2CSensor
getProductID
in class I2CSensor
public final DIMUGyro.Range getRange()
public DIMUGyro.RateUnits getRateUnit()
public void getRawRate(int[] ret)
public final DIMUGyro.SampleRate getSampleRate()
public java.lang.String getVendorID()
I2CSensor
getVendorID
in class I2CSensor
public DIMUGyro.TemperatureUnits getTemperatureUnit()
public java.lang.String getVersion()
I2CSensor
getVersion
in class I2CSensor
protected boolean isDataOverrun()
public boolean isNewDataAvailable()
public void setDynamicOffset(boolean[] set)
It is advised not to use dynamic offset for this sensor.
set
- an 3-element array of booleans. True enables Dynamic Offset
Correction, false disables it. Order of elements is X, Y, Z.public void setOffsetCorrectionSpeed(float i)
public void setRange(DIMUGyro.Range range)
public void setRateUnit(DIMUGyro.RateUnits unit)
public void setSampleRate(DIMUGyro.SampleRate rate)
public void setTemperatureUnit(DIMUGyro.TemperatureUnits unit)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |