public class MindsensorsAbsoluteIMU extends I2CSensor implements SensorModes, Calibrate
Supported modes | |||
---|---|---|---|
Mode name | Description | unit(s) | Getter |
Magnetic | Measures the strength of the magnetic field over three axes | getMagneticMode() |
|
Compass | Measures the orientation of the sensor | Degrees, corresponding to the compass rose | getCompassMode() |
Angle | Measures the orientation of the sensor | Degrees, corresponding to the right hand coordinate system | getAngleMode() |
Acceleration | The Acceleration mode measures the linear acceleration of the sensor over three axes | Metres/second^2 | getAccelerationMode() |
Rate | The Rate mode measures the angular speed of the sensor over three axes | Degrees/second | getRateMode() |
Sensor configuration
The gyro sensor of the AbsoluteIMU uses a filter to remove noise from
the samples. The filter can be configured using the setGyroFilter(int)
method.
The compass sensor of the AbsoluteIMU can be calibrated to compensate for magnetical disturbances on the robot (soft iron
calibration) using the startCalibration()
and stopCalibration()
methods.
To calibrate Compass, mount it on your robot where it will be used and issue startCalibration method and then rotate AbsoluteIMU slowly along all three axes. (The Compass in AbsoluteIMU is a 3 axis compass, and hence needs to be turned along all three axes, and if it's mounted on your robot, the whole robot needs to rotate). Rotate one axis at a time, turn once in clock-wise direction completing at-least 360 degrees, and then turn it in anti-clock-wise direction, then go to next axis. Upon finishing turning along all axes, issue stopCalibration method.
See Mindsensors IMU user guide"> Sensor Product page
See The
leJOS sensor framework
See leJOS conventions for
SampleProviders
Modifier and Type | Class and Description |
---|---|
protected class |
MindsensorsAbsoluteIMU.ShortSensorMode |
Modifier and Type | Field and Description |
---|---|
protected static int |
ACCEL_DATA |
protected MindsensorsAbsoluteIMU.ShortSensorMode |
accelMode |
protected MindsensorsAbsoluteIMU.ShortSensorMode |
angleMode |
protected static int |
COMMAND |
protected static int |
COMPASS_DATA |
protected MindsensorsAbsoluteIMU.ShortSensorMode |
compassMode |
static int |
DEFAULT_I2C_ADDRESS
The default I2C address of the sensor
|
protected static byte |
END_CALIBRATION |
protected static int |
GYRO_DATA |
protected static int |
GYRO_FILTER |
protected MindsensorsAbsoluteIMU.ShortSensorMode |
gyroMode |
static int |
HIGH |
static int |
LOW |
protected static int |
MAG_DATA |
protected MindsensorsAbsoluteIMU.ShortSensorMode |
magMode |
static int |
MEDIUM |
protected static byte |
SENSITIVITY_BASE |
protected static byte |
START_CALIBRATION |
static int |
VERY_HIGH |
address, port, REG_PRODUCT_ID, REG_VENDOR_ID, REG_VERSION, retryCount
currentMode, modes
BLACK, BLANK_INDEX, BLUE, BLUE_INDEX, BROWN, GREEN, GREEN_INDEX, MAX_TYPE, MIN_TYPE, MODE_RAW, NXT_ADC_RES, RED, RED_INDEX, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, TYPE_HIGHSPEED, TYPE_HIGHSPEED_9V, 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 and Description |
---|
MindsensorsAbsoluteIMU(I2CPort port) |
MindsensorsAbsoluteIMU(I2CPort port,
int address) |
MindsensorsAbsoluteIMU(Port port) |
MindsensorsAbsoluteIMU(Port port,
int address) |
Modifier and Type | Method and Description |
---|---|
SensorMode |
getAccelerationMode()
Return a SensorMode object that will acceleration data for the X, Y and Z
axis.
|
SensorMode |
getAngleMode()
Return a SensorMode object that will provide angle data.
|
SensorMode |
getCompassMode()
Return a SensorMode object that will provide tilt compensated compass data
.
|
SensorMode |
getMagneticMode()
Return a SensorMode object that will return Magnetic data for the X, Y and
Z axis The data is returned in Guass
|
SensorMode |
getRateMode()
Return a SensorMode object that will angular velocity data for the X, Y and
Z axis.
|
protected void |
init() |
void |
setGyroFilter(int value)
Set the smoothing filter for the gyro.
|
void |
setRange(int range)
Set the sensitivity used by the sensor.
|
void |
startCalibration()
To calibrate Compass, mount it on your robot where it will be used and
issue startCalibration method and then rotate AbsoluteIMU slowly along all
three axes.
|
void |
stopCalibration()
Ends calibration sequence.
|
fetchString, getAddress, getData, getData, getPort, getProductID, getRetryCount, getVendorID, getVersion, sendData, sendData, sendData, setAddress, setRetryCount
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
close, releaseOnClose
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, setCurrentMode, setCurrentMode
getName
fetchSample, sampleSize
public static final int DEFAULT_I2C_ADDRESS
protected static final int ACCEL_DATA
protected static final int COMPASS_DATA
protected static final int MAG_DATA
protected static final int GYRO_DATA
protected static final int COMMAND
protected static final int GYRO_FILTER
protected static final byte SENSITIVITY_BASE
protected static final byte START_CALIBRATION
protected static final byte END_CALIBRATION
public static final int LOW
public static final int MEDIUM
public static final int HIGH
public static final int VERY_HIGH
protected MindsensorsAbsoluteIMU.ShortSensorMode accelMode
protected MindsensorsAbsoluteIMU.ShortSensorMode magMode
protected MindsensorsAbsoluteIMU.ShortSensorMode gyroMode
protected MindsensorsAbsoluteIMU.ShortSensorMode compassMode
protected MindsensorsAbsoluteIMU.ShortSensorMode angleMode
public MindsensorsAbsoluteIMU(I2CPort port, int address)
public MindsensorsAbsoluteIMU(I2CPort port)
public MindsensorsAbsoluteIMU(Port port, int address)
public MindsensorsAbsoluteIMU(Port port)
protected void init()
public SensorMode getCompassMode()
public SensorMode getAngleMode()
public SensorMode getAccelerationMode()
public SensorMode getMagneticMode()
public SensorMode getRateMode()
public void setRange(int range)
range
- the selected range (LOW/MEDIUM/HIGH/VERY_HIGH)public void setGyroFilter(int value)
value
- (range 0-7)public void startCalibration()
startCalibration
in interface Calibrate
public void stopCalibration()
stopCalibration
in interface Calibrate