public class AbsoluteIMU extends BaseSensor
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 }
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 | Field and Description |
---|---|
static java.lang.String |
END_CALIBRATION |
static int |
GYRO_FILTER |
static int |
HIGH |
static int |
LOW |
static int |
MEDIUM |
private static java.lang.String |
MINDSENSORS_ABSOLUTEIMU |
static java.lang.String |
MODE_ACCELEROMETER |
static java.lang.String |
MODE_COMPASS |
static java.lang.String |
MODE_GYRO |
static java.lang.String |
MODE_MAGNETIC |
static java.lang.String |
MODE_TILT |
static java.lang.String |
SET_ACCELERATION_16G |
static java.lang.String |
SET_ACCELERATION_2G |
static java.lang.String |
SET_ACCELERATION_4G |
static java.lang.String |
SET_ACCELERATION_8G |
static java.lang.String |
START_CALIBRATION |
static int |
VERY_HIGH |
currentMode, modes, SWITCH_DELAY
LEGO_ANALOG_SENSOR, LEGO_I2C, LEGO_UART_SENSOR, SENSOR_MODE, SENSOR_MODES
ADDRESS, CURRENT_PLATFORM, DEVICE, ev3DevProperties, LEGO_PORT, LEGO_SENSOR, MODE, PATH_DEVICE
Constructor and Description |
---|
AbsoluteIMU(Port portName) |
Modifier and Type | Method and Description |
---|---|
SensorMode |
getAccelerationMode()
Return a SensorMode object that will acceleration data for the X, Y and Z
axis.
|
SensorMode |
getCompassMode()
Return a SensorMode object that will provide tilt compensated compass data
.
|
SensorMode |
getGyroMode() |
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 |
getTiltMode() |
void |
sendCommand(java.lang.String cmd)
Send a single byte command represented by a letter
|
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.
|
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, getSystemMode, sampleSize, setCurrentMode, setCurrentMode, setModes, switchMode
detect, getIntegerAttribute, getStringAttribute, setIntegerAttribute, setStringAttribute
private static final java.lang.String MINDSENSORS_ABSOLUTEIMU
public static final java.lang.String MODE_TILT
public static final java.lang.String MODE_ACCELEROMETER
public static final java.lang.String MODE_COMPASS
public static final java.lang.String MODE_MAGNETIC
public static final java.lang.String MODE_GYRO
public static final java.lang.String START_CALIBRATION
public static final java.lang.String END_CALIBRATION
public static final int LOW
public static final int MEDIUM
public static final int HIGH
public static final int VERY_HIGH
public static final java.lang.String SET_ACCELERATION_2G
public static final java.lang.String SET_ACCELERATION_4G
public static final java.lang.String SET_ACCELERATION_8G
public static final java.lang.String SET_ACCELERATION_16G
public static final int GYRO_FILTER
public void sendCommand(java.lang.String cmd)
cmd
- the letter that identifies the commandpublic SensorMode getCompassMode()
public SensorMode getAccelerationMode()
public SensorMode getMagneticMode()
public SensorMode getGyroMode()
public SensorMode getTiltMode()
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()
public void stopCalibration()