Package com.tinkerforge
Class BrickletIMUV3
- java.lang.Object
-
- com.tinkerforge.DeviceBase
-
- com.tinkerforge.Device
-
- com.tinkerforge.BrickletIMUV3
-
public class BrickletIMUV3 extends Device
Full fledged AHRS with 9 degrees of freedom
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.tinkerforge.Device
Device.Identity
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description BrickletIMUV3(java.lang.String uid, IPConnection ipcon)
Creates an object with the unique device ID \c uid.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAccelerationListener(BrickletIMUV3.AccelerationListener listener)
Adds a Acceleration listener.void
addAllDataListener(BrickletIMUV3.AllDataListener listener)
Adds a AllData listener.void
addAngularVelocityListener(BrickletIMUV3.AngularVelocityListener listener)
Adds a AngularVelocity listener.void
addGravityVectorListener(BrickletIMUV3.GravityVectorListener listener)
Adds a GravityVector listener.void
addLinearAccelerationListener(BrickletIMUV3.LinearAccelerationListener listener)
Adds a LinearAcceleration listener.void
addMagneticFieldListener(BrickletIMUV3.MagneticFieldListener listener)
Adds a MagneticField listener.void
addOrientationListener(BrickletIMUV3.OrientationListener listener)
Adds a Orientation listener.void
addQuaternionListener(BrickletIMUV3.QuaternionListener listener)
Adds a Quaternion listener.void
addTemperatureListener(BrickletIMUV3.TemperatureListener listener)
Adds a Temperature listener.BrickletIMUV3.Acceleration
getAcceleration()
Returns the calibrated acceleration from the accelerometer for the x, y and z axis.BrickletIMUV3.AccelerationCallbackConfiguration
getAccelerationCallbackConfiguration()
Returns the listener configuration as set bysetAccelerationCallbackConfiguration(long, boolean)
.BrickletIMUV3.AllData
getAllData()
Return all of the available data of the IMU Brick.BrickletIMUV3.AllDataCallbackConfiguration
getAllDataCallbackConfiguration()
Returns the listener configuration as set bysetAllDataCallbackConfiguration(long, boolean)
.BrickletIMUV3.AngularVelocity
getAngularVelocity()
Returns the calibrated angular velocity from the gyroscope for the x, y and z axis.BrickletIMUV3.AngularVelocityCallbackConfiguration
getAngularVelocityCallbackConfiguration()
Returns the listener configuration as set bysetAngularVelocityCallbackConfiguration(long, boolean)
.int
getBootloaderMode()
Returns the current bootloader mode, seesetBootloaderMode(int)
.int
getChipTemperature()
Returns the temperature as measured inside the microcontroller.BrickletIMUV3.GravityVector
getGravityVector()
Returns the current gravity vector of the IMU Brick for the x, y and z axis.BrickletIMUV3.GravityVectorCallbackConfiguration
getGravityVectorCallbackConfiguration()
Returns the listener configuration as set bysetGravityVectorCallbackConfiguration(long, boolean)
.Device.Identity
getIdentity()
Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier.BrickletIMUV3.LinearAcceleration
getLinearAcceleration()
Returns the linear acceleration of the IMU Brick for the x, y and z axis.BrickletIMUV3.LinearAccelerationCallbackConfiguration
getLinearAccelerationCallbackConfiguration()
Returns the listener configuration as set bysetLinearAccelerationCallbackConfiguration(long, boolean)
.BrickletIMUV3.MagneticField
getMagneticField()
Returns the calibrated magnetic field from the magnetometer for the x, y and z axis.BrickletIMUV3.MagneticFieldCallbackConfiguration
getMagneticFieldCallbackConfiguration()
Returns the listener configuration as set bysetMagneticFieldCallbackConfiguration(long, boolean)
.BrickletIMUV3.Orientation
getOrientation()
Returns the current orientation (heading, roll, pitch) of the IMU Brick as independent Euler angles.BrickletIMUV3.OrientationCallbackConfiguration
getOrientationCallbackConfiguration()
Returns the listener configuration as set bysetOrientationCallbackConfiguration(long, boolean)
.BrickletIMUV3.Quaternion
getQuaternion()
Returns the current orientation (w, x, y, z) of the IMU Brick as `quaternions <https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation>`__.BrickletIMUV3.QuaternionCallbackConfiguration
getQuaternionCallbackConfiguration()
Returns the listener configuration as set bysetQuaternionCallbackConfiguration(long, boolean)
.BrickletIMUV3.SensorConfiguration
getSensorConfiguration()
Returns the sensor configuration as set bysetSensorConfiguration(int, int, int, int, int)
.int
getSensorFusionMode()
Returns the sensor fusion mode as set bysetSensorFusionMode(int)
.BrickletIMUV3.SPITFPErrorCount
getSPITFPErrorCount()
Returns the error count for the communication between Brick and Bricklet.int
getStatusLEDConfig()
Returns the configuration as set bysetStatusLEDConfig(int)
int
getTemperature()
Returns the temperature of the IMU Brick.BrickletIMUV3.TemperatureCallbackConfiguration
getTemperatureCallbackConfiguration()
Returns the listener configuration as set bysetTemperatureCallbackConfiguration(long, boolean)
.long
readUID()
Returns the current UID as an integer.void
removeAccelerationListener(BrickletIMUV3.AccelerationListener listener)
Removes a Acceleration listener.void
removeAllDataListener(BrickletIMUV3.AllDataListener listener)
Removes a AllData listener.void
removeAngularVelocityListener(BrickletIMUV3.AngularVelocityListener listener)
Removes a AngularVelocity listener.void
removeGravityVectorListener(BrickletIMUV3.GravityVectorListener listener)
Removes a GravityVector listener.void
removeLinearAccelerationListener(BrickletIMUV3.LinearAccelerationListener listener)
Removes a LinearAcceleration listener.void
removeMagneticFieldListener(BrickletIMUV3.MagneticFieldListener listener)
Removes a MagneticField listener.void
removeOrientationListener(BrickletIMUV3.OrientationListener listener)
Removes a Orientation listener.void
removeQuaternionListener(BrickletIMUV3.QuaternionListener listener)
Removes a Quaternion listener.void
removeTemperatureListener(BrickletIMUV3.TemperatureListener listener)
Removes a Temperature listener.void
reset()
Calling this function will reset the Bricklet.boolean
saveCalibration()
A call of this function saves the current calibration to be used as a starting point for the next restart of continuous calibration of the IMU Brick.void
setAccelerationCallbackConfiguration(long period, boolean valueHasToChange)
The period is the period with which theBrickletIMUV3.AccelerationListener
listener is triggered periodically.void
setAllDataCallbackConfiguration(long period, boolean valueHasToChange)
The period is the period with which theBrickletIMUV3.AllDataListener
listener is triggered periodically.void
setAngularVelocityCallbackConfiguration(long period, boolean valueHasToChange)
The period is the period with which theBrickletIMUV3.AngularVelocityListener
listener is triggered periodically.int
setBootloaderMode(int mode)
Sets the bootloader mode and returns the status after the requested mode change was instigated.void
setGravityVectorCallbackConfiguration(long period, boolean valueHasToChange)
The period is the period with which theBrickletIMUV3.GravityVectorListener
listener is triggered periodically.void
setLinearAccelerationCallbackConfiguration(long period, boolean valueHasToChange)
The period is the period with which theBrickletIMUV3.LinearAccelerationListener
listener is triggered periodically.void
setMagneticFieldCallbackConfiguration(long period, boolean valueHasToChange)
The period is the period with which theBrickletIMUV3.MagneticFieldListener
listener is triggered periodically.void
setOrientationCallbackConfiguration(long period, boolean valueHasToChange)
The period is the period with which theBrickletIMUV3.OrientationListener
listener is triggered periodically.void
setQuaternionCallbackConfiguration(long period, boolean valueHasToChange)
The period is the period with which theBrickletIMUV3.QuaternionListener
listener is triggered periodically.void
setSensorConfiguration(int magnetometerRate, int gyroscopeRange, int gyroscopeBandwidth, int accelerometerRange, int accelerometerBandwidth)
Sets the available sensor configuration for the Magnetometer, Gyroscope and Accelerometer.void
setSensorFusionMode(int mode)
If the fusion mode is turned off, the functionsgetAcceleration()
,getMagneticField()
andgetAngularVelocity()
return uncalibrated and uncompensated sensor data.void
setStatusLEDConfig(int config)
Sets the status LED configuration.void
setTemperatureCallbackConfiguration(long period, boolean valueHasToChange)
The period is the period with which theBrickletIMUV3.TemperatureListener
listener is triggered periodically.void
setWriteFirmwarePointer(long pointer)
Sets the firmware pointer forwriteFirmware(int[])
.int
writeFirmware(int[] data)
Writes 64 Bytes of firmware at the position as written bysetWriteFirmwarePointer(long)
before.void
writeUID(long uid)
Writes a new UID into flash.-
Methods inherited from class com.tinkerforge.DeviceBase
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
-
-
-
-
Field Detail
-
DEVICE_IDENTIFIER
public static final int DEVICE_IDENTIFIER
- See Also:
- Constant Field Values
-
DEVICE_DISPLAY_NAME
public static final java.lang.String DEVICE_DISPLAY_NAME
- See Also:
- Constant Field Values
-
FUNCTION_GET_ACCELERATION
public static final byte FUNCTION_GET_ACCELERATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_MAGNETIC_FIELD
public static final byte FUNCTION_GET_MAGNETIC_FIELD
- See Also:
- Constant Field Values
-
FUNCTION_GET_ANGULAR_VELOCITY
public static final byte FUNCTION_GET_ANGULAR_VELOCITY
- See Also:
- Constant Field Values
-
FUNCTION_GET_TEMPERATURE
public static final byte FUNCTION_GET_TEMPERATURE
- See Also:
- Constant Field Values
-
FUNCTION_GET_ORIENTATION
public static final byte FUNCTION_GET_ORIENTATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_LINEAR_ACCELERATION
public static final byte FUNCTION_GET_LINEAR_ACCELERATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_GRAVITY_VECTOR
public static final byte FUNCTION_GET_GRAVITY_VECTOR
- See Also:
- Constant Field Values
-
FUNCTION_GET_QUATERNION
public static final byte FUNCTION_GET_QUATERNION
- See Also:
- Constant Field Values
-
FUNCTION_GET_ALL_DATA
public static final byte FUNCTION_GET_ALL_DATA
- See Also:
- Constant Field Values
-
FUNCTION_SAVE_CALIBRATION
public static final byte FUNCTION_SAVE_CALIBRATION
- See Also:
- Constant Field Values
-
FUNCTION_SET_SENSOR_CONFIGURATION
public static final byte FUNCTION_SET_SENSOR_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_SENSOR_CONFIGURATION
public static final byte FUNCTION_GET_SENSOR_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_SET_SENSOR_FUSION_MODE
public static final byte FUNCTION_SET_SENSOR_FUSION_MODE
- See Also:
- Constant Field Values
-
FUNCTION_GET_SENSOR_FUSION_MODE
public static final byte FUNCTION_GET_SENSOR_FUSION_MODE
- See Also:
- Constant Field Values
-
FUNCTION_SET_ACCELERATION_CALLBACK_CONFIGURATION
public static final byte FUNCTION_SET_ACCELERATION_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_ACCELERATION_CALLBACK_CONFIGURATION
public static final byte FUNCTION_GET_ACCELERATION_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_SET_MAGNETIC_FIELD_CALLBACK_CONFIGURATION
public static final byte FUNCTION_SET_MAGNETIC_FIELD_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_MAGNETIC_FIELD_CALLBACK_CONFIGURATION
public static final byte FUNCTION_GET_MAGNETIC_FIELD_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_SET_ANGULAR_VELOCITY_CALLBACK_CONFIGURATION
public static final byte FUNCTION_SET_ANGULAR_VELOCITY_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_ANGULAR_VELOCITY_CALLBACK_CONFIGURATION
public static final byte FUNCTION_GET_ANGULAR_VELOCITY_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_SET_TEMPERATURE_CALLBACK_CONFIGURATION
public static final byte FUNCTION_SET_TEMPERATURE_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_TEMPERATURE_CALLBACK_CONFIGURATION
public static final byte FUNCTION_GET_TEMPERATURE_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_SET_ORIENTATION_CALLBACK_CONFIGURATION
public static final byte FUNCTION_SET_ORIENTATION_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_ORIENTATION_CALLBACK_CONFIGURATION
public static final byte FUNCTION_GET_ORIENTATION_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_SET_LINEAR_ACCELERATION_CALLBACK_CONFIGURATION
public static final byte FUNCTION_SET_LINEAR_ACCELERATION_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_LINEAR_ACCELERATION_CALLBACK_CONFIGURATION
public static final byte FUNCTION_GET_LINEAR_ACCELERATION_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_SET_GRAVITY_VECTOR_CALLBACK_CONFIGURATION
public static final byte FUNCTION_SET_GRAVITY_VECTOR_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_GRAVITY_VECTOR_CALLBACK_CONFIGURATION
public static final byte FUNCTION_GET_GRAVITY_VECTOR_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_SET_QUATERNION_CALLBACK_CONFIGURATION
public static final byte FUNCTION_SET_QUATERNION_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_QUATERNION_CALLBACK_CONFIGURATION
public static final byte FUNCTION_GET_QUATERNION_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_SET_ALL_DATA_CALLBACK_CONFIGURATION
public static final byte FUNCTION_SET_ALL_DATA_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_ALL_DATA_CALLBACK_CONFIGURATION
public static final byte FUNCTION_GET_ALL_DATA_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_SPITFP_ERROR_COUNT
public static final byte FUNCTION_GET_SPITFP_ERROR_COUNT
- See Also:
- Constant Field Values
-
FUNCTION_SET_BOOTLOADER_MODE
public static final byte FUNCTION_SET_BOOTLOADER_MODE
- See Also:
- Constant Field Values
-
FUNCTION_GET_BOOTLOADER_MODE
public static final byte FUNCTION_GET_BOOTLOADER_MODE
- See Also:
- Constant Field Values
-
FUNCTION_SET_WRITE_FIRMWARE_POINTER
public static final byte FUNCTION_SET_WRITE_FIRMWARE_POINTER
- See Also:
- Constant Field Values
-
FUNCTION_WRITE_FIRMWARE
public static final byte FUNCTION_WRITE_FIRMWARE
- See Also:
- Constant Field Values
-
FUNCTION_SET_STATUS_LED_CONFIG
public static final byte FUNCTION_SET_STATUS_LED_CONFIG
- See Also:
- Constant Field Values
-
FUNCTION_GET_STATUS_LED_CONFIG
public static final byte FUNCTION_GET_STATUS_LED_CONFIG
- See Also:
- Constant Field Values
-
FUNCTION_GET_CHIP_TEMPERATURE
public static final byte FUNCTION_GET_CHIP_TEMPERATURE
- See Also:
- Constant Field Values
-
FUNCTION_RESET
public static final byte FUNCTION_RESET
- See Also:
- Constant Field Values
-
FUNCTION_WRITE_UID
public static final byte FUNCTION_WRITE_UID
- See Also:
- Constant Field Values
-
FUNCTION_READ_UID
public static final byte FUNCTION_READ_UID
- See Also:
- Constant Field Values
-
FUNCTION_GET_IDENTITY
public static final byte FUNCTION_GET_IDENTITY
- See Also:
- Constant Field Values
-
MAGNETOMETER_RATE_2HZ
public static final int MAGNETOMETER_RATE_2HZ
- See Also:
- Constant Field Values
-
MAGNETOMETER_RATE_6HZ
public static final int MAGNETOMETER_RATE_6HZ
- See Also:
- Constant Field Values
-
MAGNETOMETER_RATE_8HZ
public static final int MAGNETOMETER_RATE_8HZ
- See Also:
- Constant Field Values
-
MAGNETOMETER_RATE_10HZ
public static final int MAGNETOMETER_RATE_10HZ
- See Also:
- Constant Field Values
-
MAGNETOMETER_RATE_15HZ
public static final int MAGNETOMETER_RATE_15HZ
- See Also:
- Constant Field Values
-
MAGNETOMETER_RATE_20HZ
public static final int MAGNETOMETER_RATE_20HZ
- See Also:
- Constant Field Values
-
MAGNETOMETER_RATE_25HZ
public static final int MAGNETOMETER_RATE_25HZ
- See Also:
- Constant Field Values
-
MAGNETOMETER_RATE_30HZ
public static final int MAGNETOMETER_RATE_30HZ
- See Also:
- Constant Field Values
-
GYROSCOPE_RANGE_2000DPS
public static final int GYROSCOPE_RANGE_2000DPS
- See Also:
- Constant Field Values
-
GYROSCOPE_RANGE_1000DPS
public static final int GYROSCOPE_RANGE_1000DPS
- See Also:
- Constant Field Values
-
GYROSCOPE_RANGE_500DPS
public static final int GYROSCOPE_RANGE_500DPS
- See Also:
- Constant Field Values
-
GYROSCOPE_RANGE_250DPS
public static final int GYROSCOPE_RANGE_250DPS
- See Also:
- Constant Field Values
-
GYROSCOPE_RANGE_125DPS
public static final int GYROSCOPE_RANGE_125DPS
- See Also:
- Constant Field Values
-
GYROSCOPE_BANDWIDTH_523HZ
public static final int GYROSCOPE_BANDWIDTH_523HZ
- See Also:
- Constant Field Values
-
GYROSCOPE_BANDWIDTH_230HZ
public static final int GYROSCOPE_BANDWIDTH_230HZ
- See Also:
- Constant Field Values
-
GYROSCOPE_BANDWIDTH_116HZ
public static final int GYROSCOPE_BANDWIDTH_116HZ
- See Also:
- Constant Field Values
-
GYROSCOPE_BANDWIDTH_47HZ
public static final int GYROSCOPE_BANDWIDTH_47HZ
- See Also:
- Constant Field Values
-
GYROSCOPE_BANDWIDTH_23HZ
public static final int GYROSCOPE_BANDWIDTH_23HZ
- See Also:
- Constant Field Values
-
GYROSCOPE_BANDWIDTH_12HZ
public static final int GYROSCOPE_BANDWIDTH_12HZ
- See Also:
- Constant Field Values
-
GYROSCOPE_BANDWIDTH_64HZ
public static final int GYROSCOPE_BANDWIDTH_64HZ
- See Also:
- Constant Field Values
-
GYROSCOPE_BANDWIDTH_32HZ
public static final int GYROSCOPE_BANDWIDTH_32HZ
- See Also:
- Constant Field Values
-
ACCELEROMETER_RANGE_2G
public static final int ACCELEROMETER_RANGE_2G
- See Also:
- Constant Field Values
-
ACCELEROMETER_RANGE_4G
public static final int ACCELEROMETER_RANGE_4G
- See Also:
- Constant Field Values
-
ACCELEROMETER_RANGE_8G
public static final int ACCELEROMETER_RANGE_8G
- See Also:
- Constant Field Values
-
ACCELEROMETER_RANGE_16G
public static final int ACCELEROMETER_RANGE_16G
- See Also:
- Constant Field Values
-
ACCELEROMETER_BANDWIDTH_7_81HZ
public static final int ACCELEROMETER_BANDWIDTH_7_81HZ
- See Also:
- Constant Field Values
-
ACCELEROMETER_BANDWIDTH_15_63HZ
public static final int ACCELEROMETER_BANDWIDTH_15_63HZ
- See Also:
- Constant Field Values
-
ACCELEROMETER_BANDWIDTH_31_25HZ
public static final int ACCELEROMETER_BANDWIDTH_31_25HZ
- See Also:
- Constant Field Values
-
ACCELEROMETER_BANDWIDTH_62_5HZ
public static final int ACCELEROMETER_BANDWIDTH_62_5HZ
- See Also:
- Constant Field Values
-
ACCELEROMETER_BANDWIDTH_125HZ
public static final int ACCELEROMETER_BANDWIDTH_125HZ
- See Also:
- Constant Field Values
-
ACCELEROMETER_BANDWIDTH_250HZ
public static final int ACCELEROMETER_BANDWIDTH_250HZ
- See Also:
- Constant Field Values
-
ACCELEROMETER_BANDWIDTH_500HZ
public static final int ACCELEROMETER_BANDWIDTH_500HZ
- See Also:
- Constant Field Values
-
ACCELEROMETER_BANDWIDTH_1000HZ
public static final int ACCELEROMETER_BANDWIDTH_1000HZ
- See Also:
- Constant Field Values
-
SENSOR_FUSION_OFF
public static final int SENSOR_FUSION_OFF
- See Also:
- Constant Field Values
-
SENSOR_FUSION_ON
public static final int SENSOR_FUSION_ON
- See Also:
- Constant Field Values
-
SENSOR_FUSION_ON_WITHOUT_MAGNETOMETER
public static final int SENSOR_FUSION_ON_WITHOUT_MAGNETOMETER
- See Also:
- Constant Field Values
-
SENSOR_FUSION_ON_WITHOUT_FAST_MAGNETOMETER_CALIBRATION
public static final int SENSOR_FUSION_ON_WITHOUT_FAST_MAGNETOMETER_CALIBRATION
- See Also:
- Constant Field Values
-
BOOTLOADER_MODE_BOOTLOADER
public static final int BOOTLOADER_MODE_BOOTLOADER
- See Also:
- Constant Field Values
-
BOOTLOADER_MODE_FIRMWARE
public static final int BOOTLOADER_MODE_FIRMWARE
- See Also:
- Constant Field Values
-
BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT
public static final int BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT
- See Also:
- Constant Field Values
-
BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT
public static final int BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT
- See Also:
- Constant Field Values
-
BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT
public static final int BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_OK
public static final int BOOTLOADER_STATUS_OK
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_INVALID_MODE
public static final int BOOTLOADER_STATUS_INVALID_MODE
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_NO_CHANGE
public static final int BOOTLOADER_STATUS_NO_CHANGE
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT
public static final int BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT
public static final int BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_CRC_MISMATCH
public static final int BOOTLOADER_STATUS_CRC_MISMATCH
- See Also:
- Constant Field Values
-
STATUS_LED_CONFIG_OFF
public static final int STATUS_LED_CONFIG_OFF
- See Also:
- Constant Field Values
-
STATUS_LED_CONFIG_ON
public static final int STATUS_LED_CONFIG_ON
- See Also:
- Constant Field Values
-
STATUS_LED_CONFIG_SHOW_HEARTBEAT
public static final int STATUS_LED_CONFIG_SHOW_HEARTBEAT
- See Also:
- Constant Field Values
-
STATUS_LED_CONFIG_SHOW_STATUS
public static final int STATUS_LED_CONFIG_SHOW_STATUS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BrickletIMUV3
public BrickletIMUV3(java.lang.String uid, IPConnection ipcon)
Creates an object with the unique device ID \c uid. and adds it to the IP Connection \c ipcon.
-
-
Method Detail
-
getAcceleration
public BrickletIMUV3.Acceleration getAcceleration() throws TinkerforgeException
Returns the calibrated acceleration from the accelerometer for the x, y and z axis. The acceleration is in the range configured withsetSensorConfiguration(int, int, int, int, int)
. If you want to get the acceleration periodically, it is recommended to use theBrickletIMUV3.AccelerationListener
listener and set the period withsetAccelerationCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
getMagneticField
public BrickletIMUV3.MagneticField getMagneticField() throws TinkerforgeException
Returns the calibrated magnetic field from the magnetometer for the x, y and z axis. If you want to get the magnetic field periodically, it is recommended to use theBrickletIMUV3.MagneticFieldListener
listener and set the period withsetMagneticFieldCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
getAngularVelocity
public BrickletIMUV3.AngularVelocity getAngularVelocity() throws TinkerforgeException
Returns the calibrated angular velocity from the gyroscope for the x, y and z axis. The angular velocity is in the range configured withsetSensorConfiguration(int, int, int, int, int)
. If you want to get the angular velocity periodically, it is recommended to use theBrickletIMUV3.AngularVelocityListener
alistener nd set the period withsetAngularVelocityCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
getTemperature
public int getTemperature() throws TinkerforgeException
Returns the temperature of the IMU Brick. The temperature is measured in the core of the BNO055 IC, it is not the ambient temperature- Throws:
TinkerforgeException
-
getOrientation
public BrickletIMUV3.Orientation getOrientation() throws TinkerforgeException
Returns the current orientation (heading, roll, pitch) of the IMU Brick as independent Euler angles. Note that Euler angles always experience a `gimbal lock <https://en.wikipedia.org/wiki/Gimbal_lock>`__. We recommend that you use quaternions instead, if you need the absolute orientation. If you want to get the orientation periodically, it is recommended to use theBrickletIMUV3.OrientationListener
listener and set the period withsetOrientationCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
getLinearAcceleration
public BrickletIMUV3.LinearAcceleration getLinearAcceleration() throws TinkerforgeException
Returns the linear acceleration of the IMU Brick for the x, y and z axis. The acceleration is in the range configured withsetSensorConfiguration(int, int, int, int, int)
. The linear acceleration is the acceleration in each of the three axis of the IMU Brick with the influences of gravity removed. It is also possible to get the gravity vector with the influence of linear acceleration removed, seegetGravityVector()
. If you want to get the linear acceleration periodically, it is recommended to use theBrickletIMUV3.LinearAccelerationListener
listener and set the period withsetLinearAccelerationCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
getGravityVector
public BrickletIMUV3.GravityVector getGravityVector() throws TinkerforgeException
Returns the current gravity vector of the IMU Brick for the x, y and z axis. The gravity vector is the acceleration that occurs due to gravity. Influences of additional linear acceleration are removed. It is also possible to get the linear acceleration with the influence of gravity removed, seegetLinearAcceleration()
. If you want to get the gravity vector periodically, it is recommended to use theBrickletIMUV3.GravityVectorListener
listener and set the period withsetGravityVectorCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
getQuaternion
public BrickletIMUV3.Quaternion getQuaternion() throws TinkerforgeException
Returns the current orientation (w, x, y, z) of the IMU Brick as `quaternions <https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation>`__. You have to divide the return values by 16383 (14 bit) to get the usual range of -1.0 to +1.0 for quaternions. If you want to get the quaternions periodically, it is recommended to use theBrickletIMUV3.QuaternionListener
listener and set the period withsetQuaternionCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
getAllData
public BrickletIMUV3.AllData getAllData() throws TinkerforgeException
Return all of the available data of the IMU Brick. * acceleration (seegetAcceleration()
) * magnetic field (seegetMagneticField()
) * angular velocity (seegetAngularVelocity()
) * Euler angles (seegetOrientation()
) * quaternion (seegetQuaternion()
) * linear acceleration (seegetLinearAcceleration()
) * gravity vector (seegetGravityVector()
) * temperature (seegetTemperature()
) * calibration status (see below) The calibration status consists of four pairs of two bits. Each pair of bits represents the status of the current calibration. * bit 0-1: Magnetometer * bit 2-3: Accelerometer * bit 4-5: Gyroscope * bit 6-7: System A value of 0 means for "not calibrated" and a value of 3 means "fully calibrated". In your program you should always be able to ignore the calibration status, it is used by the calibration window of the Brick Viewer and it can be ignored after the first calibration. See the documentation in the calibration window for more information regarding the calibration of the IMU Brick. If you want to get the data periodically, it is recommended to use theBrickletIMUV3.AllDataListener
listener and set the period withsetAllDataCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
saveCalibration
public boolean saveCalibration() throws TinkerforgeException
A call of this function saves the current calibration to be used as a starting point for the next restart of continuous calibration of the IMU Brick. A return value of *true* means that the calibration could be used and *false* means that it could not be used (this happens if the calibration status is not "fully calibrated"). This function is used by the calibration window of the Brick Viewer, you should not need to call it in your program.- Throws:
TinkerforgeException
-
setSensorConfiguration
public void setSensorConfiguration(int magnetometerRate, int gyroscopeRange, int gyroscopeBandwidth, int accelerometerRange, int accelerometerBandwidth) throws TinkerforgeException
Sets the available sensor configuration for the Magnetometer, Gyroscope and Accelerometer. The Accelerometer Range is user selectable in all fusion modes, all other configurations are auto-controlled in fusion mode.- Throws:
TinkerforgeException
-
getSensorConfiguration
public BrickletIMUV3.SensorConfiguration getSensorConfiguration() throws TinkerforgeException
Returns the sensor configuration as set bysetSensorConfiguration(int, int, int, int, int)
.- Throws:
TinkerforgeException
-
setSensorFusionMode
public void setSensorFusionMode(int mode) throws TinkerforgeException
If the fusion mode is turned off, the functionsgetAcceleration()
,getMagneticField()
andgetAngularVelocity()
return uncalibrated and uncompensated sensor data. All other sensor data getters return no data. Since firmware version 2.0.6 you can also use a fusion mode without magnetometer. In this mode the calculated orientation is relative (with magnetometer it is absolute with respect to the earth). However, the calculation can't be influenced by spurious magnetic fields. Since firmware version 2.0.13 you can also use a fusion mode without fast magnetometer calibration. This mode is the same as the normal fusion mode, but the fast magnetometer calibration is turned off. So to find the orientation the first time will likely take longer, but small magnetic influences might not affect the automatic calibration as much.- Throws:
TinkerforgeException
-
getSensorFusionMode
public int getSensorFusionMode() throws TinkerforgeException
Returns the sensor fusion mode as set bysetSensorFusionMode(int)
.- Throws:
TinkerforgeException
-
setAccelerationCallbackConfiguration
public void setAccelerationCallbackConfiguration(long period, boolean valueHasToChange) throws TinkerforgeException
The period is the period with which theBrickletIMUV3.AccelerationListener
listener is triggered periodically. A value of 0 turns the listener off. If the `value has to change`-parameter is set to true, the listener is only triggered after the value has changed. If the value didn't change within the period, the listener is triggered immediately on change. If it is set to false, the listener is continuously triggered with the period, independent of the value.- Throws:
TinkerforgeException
-
getAccelerationCallbackConfiguration
public BrickletIMUV3.AccelerationCallbackConfiguration getAccelerationCallbackConfiguration() throws TinkerforgeException
Returns the listener configuration as set bysetAccelerationCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
setMagneticFieldCallbackConfiguration
public void setMagneticFieldCallbackConfiguration(long period, boolean valueHasToChange) throws TinkerforgeException
The period is the period with which theBrickletIMUV3.MagneticFieldListener
listener is triggered periodically. A value of 0 turns the listener off. If the `value has to change`-parameter is set to true, the listener is only triggered after the value has changed. If the value didn't change within the period, the listener is triggered immediately on change. If it is set to false, the listener is continuously triggered with the period, independent of the value.- Throws:
TinkerforgeException
-
getMagneticFieldCallbackConfiguration
public BrickletIMUV3.MagneticFieldCallbackConfiguration getMagneticFieldCallbackConfiguration() throws TinkerforgeException
Returns the listener configuration as set bysetMagneticFieldCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
setAngularVelocityCallbackConfiguration
public void setAngularVelocityCallbackConfiguration(long period, boolean valueHasToChange) throws TinkerforgeException
The period is the period with which theBrickletIMUV3.AngularVelocityListener
listener is triggered periodically. A value of 0 turns the listener off. If the `value has to change`-parameter is set to true, the listener is only triggered after the value has changed. If the value didn't change within the period, the listener is triggered immediately on change. If it is set to false, the listener is continuously triggered with the period, independent of the value.- Throws:
TinkerforgeException
-
getAngularVelocityCallbackConfiguration
public BrickletIMUV3.AngularVelocityCallbackConfiguration getAngularVelocityCallbackConfiguration() throws TinkerforgeException
Returns the listener configuration as set bysetAngularVelocityCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
setTemperatureCallbackConfiguration
public void setTemperatureCallbackConfiguration(long period, boolean valueHasToChange) throws TinkerforgeException
The period is the period with which theBrickletIMUV3.TemperatureListener
listener is triggered periodically. A value of 0 turns the listener off. If the `value has to change`-parameter is set to true, the listener is only triggered after the value has changed. If the value didn't change within the period, the listener is triggered immediately on change. If it is set to false, the listener is continuously triggered with the period, independent of the value.- Throws:
TinkerforgeException
-
getTemperatureCallbackConfiguration
public BrickletIMUV3.TemperatureCallbackConfiguration getTemperatureCallbackConfiguration() throws TinkerforgeException
Returns the listener configuration as set bysetTemperatureCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
setOrientationCallbackConfiguration
public void setOrientationCallbackConfiguration(long period, boolean valueHasToChange) throws TinkerforgeException
The period is the period with which theBrickletIMUV3.OrientationListener
listener is triggered periodically. A value of 0 turns the listener off. If the `value has to change`-parameter is set to true, the listener is only triggered after the value has changed. If the value didn't change within the period, the listener is triggered immediately on change. If it is set to false, the listener is continuously triggered with the period, independent of the value.- Throws:
TinkerforgeException
-
getOrientationCallbackConfiguration
public BrickletIMUV3.OrientationCallbackConfiguration getOrientationCallbackConfiguration() throws TinkerforgeException
Returns the listener configuration as set bysetOrientationCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
setLinearAccelerationCallbackConfiguration
public void setLinearAccelerationCallbackConfiguration(long period, boolean valueHasToChange) throws TinkerforgeException
The period is the period with which theBrickletIMUV3.LinearAccelerationListener
listener is triggered periodically. A value of 0 turns the listener off. If the `value has to change`-parameter is set to true, the listener is only triggered after the value has changed. If the value didn't change within the period, the listener is triggered immediately on change. If it is set to false, the listener is continuously triggered with the period, independent of the value.- Throws:
TinkerforgeException
-
getLinearAccelerationCallbackConfiguration
public BrickletIMUV3.LinearAccelerationCallbackConfiguration getLinearAccelerationCallbackConfiguration() throws TinkerforgeException
Returns the listener configuration as set bysetLinearAccelerationCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
setGravityVectorCallbackConfiguration
public void setGravityVectorCallbackConfiguration(long period, boolean valueHasToChange) throws TinkerforgeException
The period is the period with which theBrickletIMUV3.GravityVectorListener
listener is triggered periodically. A value of 0 turns the listener off. If the `value has to change`-parameter is set to true, the listener is only triggered after the value has changed. If the value didn't change within the period, the listener is triggered immediately on change. If it is set to false, the listener is continuously triggered with the period, independent of the value.- Throws:
TinkerforgeException
-
getGravityVectorCallbackConfiguration
public BrickletIMUV3.GravityVectorCallbackConfiguration getGravityVectorCallbackConfiguration() throws TinkerforgeException
Returns the listener configuration as set bysetGravityVectorCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
setQuaternionCallbackConfiguration
public void setQuaternionCallbackConfiguration(long period, boolean valueHasToChange) throws TinkerforgeException
The period is the period with which theBrickletIMUV3.QuaternionListener
listener is triggered periodically. A value of 0 turns the listener off. If the `value has to change`-parameter is set to true, the listener is only triggered after the value has changed. If the value didn't change within the period, the listener is triggered immediately on change. If it is set to false, the listener is continuously triggered with the period, independent of the value.- Throws:
TinkerforgeException
-
getQuaternionCallbackConfiguration
public BrickletIMUV3.QuaternionCallbackConfiguration getQuaternionCallbackConfiguration() throws TinkerforgeException
Returns the listener configuration as set bysetQuaternionCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
setAllDataCallbackConfiguration
public void setAllDataCallbackConfiguration(long period, boolean valueHasToChange) throws TinkerforgeException
The period is the period with which theBrickletIMUV3.AllDataListener
listener is triggered periodically. A value of 0 turns the listener off. If the `value has to change`-parameter is set to true, the listener is only triggered after the value has changed. If the value didn't change within the period, the listener is triggered immediately on change. If it is set to false, the listener is continuously triggered with the period, independent of the value.- Throws:
TinkerforgeException
-
getAllDataCallbackConfiguration
public BrickletIMUV3.AllDataCallbackConfiguration getAllDataCallbackConfiguration() throws TinkerforgeException
Returns the listener configuration as set bysetAllDataCallbackConfiguration(long, boolean)
.- Throws:
TinkerforgeException
-
getSPITFPErrorCount
public BrickletIMUV3.SPITFPErrorCount getSPITFPErrorCount() throws TinkerforgeException
Returns the error count for the communication between Brick and Bricklet. The errors are divided into * ACK checksum errors, * message checksum errors, * framing errors and * overflow errors. The errors counts are for errors that occur on the Bricklet side. All Bricks have a similar function that returns the errors on the Brick side.- Throws:
TinkerforgeException
-
setBootloaderMode
public int setBootloaderMode(int mode) throws TinkerforgeException
Sets the bootloader mode and returns the status after the requested mode change was instigated. You can change from bootloader mode to firmware mode and vice versa. A change from bootloader mode to firmware mode will only take place if the entry function, device identifier and CRC are present and correct. This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.- Throws:
TinkerforgeException
-
getBootloaderMode
public int getBootloaderMode() throws TinkerforgeException
Returns the current bootloader mode, seesetBootloaderMode(int)
.- Throws:
TinkerforgeException
-
setWriteFirmwarePointer
public void setWriteFirmwarePointer(long pointer) throws TinkerforgeException
Sets the firmware pointer forwriteFirmware(int[])
. The pointer has to be increased by chunks of size 64. The data is written to flash every 4 chunks (which equals to one page of size 256). This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.- Throws:
TinkerforgeException
-
writeFirmware
public int writeFirmware(int[] data) throws TinkerforgeException
Writes 64 Bytes of firmware at the position as written bysetWriteFirmwarePointer(long)
before. The firmware is written to flash every 4 chunks. You can only write firmware in bootloader mode. This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.- Throws:
TinkerforgeException
-
setStatusLEDConfig
public void setStatusLEDConfig(int config) throws TinkerforgeException
Sets the status LED configuration. By default the LED shows communication traffic between Brick and Bricklet, it flickers once for every 10 received data packets. You can also turn the LED permanently on/off or show a heartbeat. If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.- Throws:
TinkerforgeException
-
getStatusLEDConfig
public int getStatusLEDConfig() throws TinkerforgeException
Returns the configuration as set bysetStatusLEDConfig(int)
- Throws:
TinkerforgeException
-
getChipTemperature
public int getChipTemperature() throws TinkerforgeException
Returns the temperature as measured inside the microcontroller. The value returned is not the ambient temperature! The temperature is only proportional to the real temperature and it has bad accuracy. Practically it is only useful as an indicator for temperature changes.- Throws:
TinkerforgeException
-
reset
public void reset() throws TinkerforgeException
Calling this function will reset the Bricklet. All configurations will be lost. After a reset you have to create new device objects, calling functions on the existing ones will result in undefined behavior!- Throws:
TinkerforgeException
-
writeUID
public void writeUID(long uid) throws TinkerforgeException
Writes a new UID into flash. If you want to set a new UID you have to decode the Base58 encoded UID string into an integer first. We recommend that you use Brick Viewer to change the UID.- Throws:
TinkerforgeException
-
readUID
public long readUID() throws TinkerforgeException
Returns the current UID as an integer. Encode as Base58 to get the usual string version.- Throws:
TinkerforgeException
-
getIdentity
public Device.Identity getIdentity() throws TinkerforgeException
Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier. The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port). A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at position 'z'. The device identifier numbers can be found :ref:`here <device_identifier>`. |device_identifier_constant|- Specified by:
getIdentity
in classDevice
- Throws:
TinkerforgeException
-
addAccelerationListener
public void addAccelerationListener(BrickletIMUV3.AccelerationListener listener)
Adds a Acceleration listener.
-
removeAccelerationListener
public void removeAccelerationListener(BrickletIMUV3.AccelerationListener listener)
Removes a Acceleration listener.
-
addMagneticFieldListener
public void addMagneticFieldListener(BrickletIMUV3.MagneticFieldListener listener)
Adds a MagneticField listener.
-
removeMagneticFieldListener
public void removeMagneticFieldListener(BrickletIMUV3.MagneticFieldListener listener)
Removes a MagneticField listener.
-
addAngularVelocityListener
public void addAngularVelocityListener(BrickletIMUV3.AngularVelocityListener listener)
Adds a AngularVelocity listener.
-
removeAngularVelocityListener
public void removeAngularVelocityListener(BrickletIMUV3.AngularVelocityListener listener)
Removes a AngularVelocity listener.
-
addTemperatureListener
public void addTemperatureListener(BrickletIMUV3.TemperatureListener listener)
Adds a Temperature listener.
-
removeTemperatureListener
public void removeTemperatureListener(BrickletIMUV3.TemperatureListener listener)
Removes a Temperature listener.
-
addLinearAccelerationListener
public void addLinearAccelerationListener(BrickletIMUV3.LinearAccelerationListener listener)
Adds a LinearAcceleration listener.
-
removeLinearAccelerationListener
public void removeLinearAccelerationListener(BrickletIMUV3.LinearAccelerationListener listener)
Removes a LinearAcceleration listener.
-
addGravityVectorListener
public void addGravityVectorListener(BrickletIMUV3.GravityVectorListener listener)
Adds a GravityVector listener.
-
removeGravityVectorListener
public void removeGravityVectorListener(BrickletIMUV3.GravityVectorListener listener)
Removes a GravityVector listener.
-
addOrientationListener
public void addOrientationListener(BrickletIMUV3.OrientationListener listener)
Adds a Orientation listener.
-
removeOrientationListener
public void removeOrientationListener(BrickletIMUV3.OrientationListener listener)
Removes a Orientation listener.
-
addQuaternionListener
public void addQuaternionListener(BrickletIMUV3.QuaternionListener listener)
Adds a Quaternion listener.
-
removeQuaternionListener
public void removeQuaternionListener(BrickletIMUV3.QuaternionListener listener)
Removes a Quaternion listener.
-
addAllDataListener
public void addAllDataListener(BrickletIMUV3.AllDataListener listener)
Adds a AllData listener.
-
removeAllDataListener
public void removeAllDataListener(BrickletIMUV3.AllDataListener listener)
Removes a AllData listener.
-
-