Package com.tinkerforge
Class BrickIMUV2
- java.lang.Object
-
- com.tinkerforge.DeviceBase
-
- com.tinkerforge.Device
-
- com.tinkerforge.BrickIMUV2
-
public class BrickIMUV2 extends Device
Full fledged AHRS with 9 degrees of freedom
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
BrickIMUV2.Acceleration
static interface
BrickIMUV2.AccelerationListener
This listener is triggered periodically with the period that is set bysetAccelerationPeriod(long)
.class
BrickIMUV2.AllData
static interface
BrickIMUV2.AllDataListener
This listener is triggered periodically with the period that is set bysetAllDataPeriod(long)
.class
BrickIMUV2.AngularVelocity
static interface
BrickIMUV2.AngularVelocityListener
This listener is triggered periodically with the period that is set bysetAngularVelocityPeriod(long)
.class
BrickIMUV2.GravityVector
static interface
BrickIMUV2.GravityVectorListener
This listener is triggered periodically with the period that is set bysetGravityVectorPeriod(long)
.class
BrickIMUV2.LinearAcceleration
static interface
BrickIMUV2.LinearAccelerationListener
This listener is triggered periodically with the period that is set bysetLinearAccelerationPeriod(long)
.class
BrickIMUV2.MagneticField
static interface
BrickIMUV2.MagneticFieldListener
This listener is triggered periodically with the period that is set bysetMagneticFieldPeriod(long)
.class
BrickIMUV2.Orientation
static interface
BrickIMUV2.OrientationListener
This listener is triggered periodically with the period that is set bysetOrientationPeriod(long)
.class
BrickIMUV2.Protocol1BrickletName
class
BrickIMUV2.Quaternion
static interface
BrickIMUV2.QuaternionListener
This listener is triggered periodically with the period that is set bysetQuaternionPeriod(long)
.class
BrickIMUV2.SensorConfiguration
class
BrickIMUV2.SPITFPBaudrateConfig
class
BrickIMUV2.SPITFPErrorCount
static interface
BrickIMUV2.TemperatureListener
This listener is triggered periodically with the period that is set bysetTemperaturePeriod(long)
.-
Nested classes/interfaces inherited from class com.tinkerforge.Device
Device.Identity
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description BrickIMUV2(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(BrickIMUV2.AccelerationListener listener)
Adds a Acceleration listener.void
addAllDataListener(BrickIMUV2.AllDataListener listener)
Adds a AllData listener.void
addAngularVelocityListener(BrickIMUV2.AngularVelocityListener listener)
Adds a AngularVelocity listener.void
addGravityVectorListener(BrickIMUV2.GravityVectorListener listener)
Adds a GravityVector listener.void
addLinearAccelerationListener(BrickIMUV2.LinearAccelerationListener listener)
Adds a LinearAcceleration listener.void
addMagneticFieldListener(BrickIMUV2.MagneticFieldListener listener)
Adds a MagneticField listener.void
addOrientationListener(BrickIMUV2.OrientationListener listener)
Adds a Orientation listener.void
addQuaternionListener(BrickIMUV2.QuaternionListener listener)
Adds a Quaternion listener.void
addTemperatureListener(BrickIMUV2.TemperatureListener listener)
Adds a Temperature listener.boolean
areLedsOn()
Returns *true* if the orientation and direction LEDs of the IMU Brick are on, *false* otherwise.void
disableStatusLED()
Disables the status LED.void
enableStatusLED()
Enables the status LED.BrickIMUV2.Acceleration
getAcceleration()
Returns the calibrated acceleration from the accelerometer for the x, y and z axis.long
getAccelerationPeriod()
Returns the period as set bysetAccelerationPeriod(long)
.BrickIMUV2.AllData
getAllData()
Return all of the available data of the IMU Brick.long
getAllDataPeriod()
Returns the period as set bysetAllDataPeriod(long)
.BrickIMUV2.AngularVelocity
getAngularVelocity()
Returns the calibrated angular velocity from the gyroscope for the x, y and z axis.long
getAngularVelocityPeriod()
Returns the period as set bysetAngularVelocityPeriod(long)
.short
getChipTemperature()
Returns the temperature as measured inside the microcontroller.BrickIMUV2.GravityVector
getGravityVector()
Returns the current gravity vector of the IMU Brick for the x, y and z axis.long
getGravityVectorPeriod()
Returns the period as set bysetGravityVectorPeriod(long)
.Device.Identity
getIdentity()
Returns the UID, the UID where the Brick is connected to, the position, the hardware and firmware version as well as the device identifier.BrickIMUV2.LinearAcceleration
getLinearAcceleration()
Returns the linear acceleration of the IMU Brick for the x, y and z axis.long
getLinearAccelerationPeriod()
Returns the period as set bysetLinearAccelerationPeriod(long)
.BrickIMUV2.MagneticField
getMagneticField()
Returns the calibrated magnetic field from the magnetometer for the x, y and z axis.long
getMagneticFieldPeriod()
Returns the period as set bysetMagneticFieldPeriod(long)
.BrickIMUV2.Orientation
getOrientation()
Returns the current orientation (heading, roll, pitch) of the IMU Brick as independent Euler angles.long
getOrientationPeriod()
Returns the period as set bysetOrientationPeriod(long)
.BrickIMUV2.Protocol1BrickletName
getProtocol1BrickletName(char port)
Returns the firmware and protocol version and the name of the Bricklet for a given port.BrickIMUV2.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>`__.long
getQuaternionPeriod()
Returns the period as set bysetQuaternionPeriod(long)
.long
getSendTimeoutCount(short communicationMethod)
Returns the timeout count for the different communication methods.BrickIMUV2.SensorConfiguration
getSensorConfiguration()
Returns the sensor configuration as set bysetSensorConfiguration(short, short, short, short, short)
.short
getSensorFusionMode()
Returns the sensor fusion mode as set bysetSensorFusionMode(short)
.long
getSPITFPBaudrate(char brickletPort)
Returns the baudrate for a given Bricklet port, seesetSPITFPBaudrate(char, long)
.BrickIMUV2.SPITFPBaudrateConfig
getSPITFPBaudrateConfig()
Returns the baudrate config, seesetSPITFPBaudrateConfig(boolean, long)
.BrickIMUV2.SPITFPErrorCount
getSPITFPErrorCount(char brickletPort)
Returns the error count for the communication between Brick and Bricklet.byte
getTemperature()
Returns the temperature of the IMU Brick.long
getTemperaturePeriod()
Returns the period as set bysetTemperaturePeriod(long)
.boolean
isStatusLEDEnabled()
Returns *true* if the status LED is enabled, *false* otherwise.void
ledsOff()
Turns the orientation and direction LEDs of the IMU Brick off.void
ledsOn()
Turns the orientation and direction LEDs of the IMU Brick on.short[]
readBrickletPlugin(char port, short offset)
Reads 32 bytes of firmware from the bricklet attached at the given port.void
removeAccelerationListener(BrickIMUV2.AccelerationListener listener)
Removes a Acceleration listener.void
removeAllDataListener(BrickIMUV2.AllDataListener listener)
Removes a AllData listener.void
removeAngularVelocityListener(BrickIMUV2.AngularVelocityListener listener)
Removes a AngularVelocity listener.void
removeGravityVectorListener(BrickIMUV2.GravityVectorListener listener)
Removes a GravityVector listener.void
removeLinearAccelerationListener(BrickIMUV2.LinearAccelerationListener listener)
Removes a LinearAcceleration listener.void
removeMagneticFieldListener(BrickIMUV2.MagneticFieldListener listener)
Removes a MagneticField listener.void
removeOrientationListener(BrickIMUV2.OrientationListener listener)
Removes a Orientation listener.void
removeQuaternionListener(BrickIMUV2.QuaternionListener listener)
Removes a Quaternion listener.void
removeTemperatureListener(BrickIMUV2.TemperatureListener listener)
Removes a Temperature listener.void
reset()
Calling this function will reset the Brick.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
setAccelerationPeriod(long period)
Sets the period with which theBrickIMUV2.AccelerationListener
listener is triggered periodically.void
setAllDataPeriod(long period)
Sets the period with which theBrickIMUV2.AllDataListener
listener is triggered periodically.void
setAngularVelocityPeriod(long period)
Sets the period with which theBrickIMUV2.AngularVelocityListener
listener is triggered periodically.void
setGravityVectorPeriod(long period)
Sets the period with which theBrickIMUV2.GravityVectorListener
listener is triggered periodically.void
setLinearAccelerationPeriod(long period)
Sets the period with which theBrickIMUV2.LinearAccelerationListener
listener is triggered periodically.void
setMagneticFieldPeriod(long period)
Sets the period with which theBrickIMUV2.MagneticFieldListener
listener is triggered periodically.void
setOrientationPeriod(long period)
Sets the period with which theBrickIMUV2.OrientationListener
listener is triggered periodically.void
setQuaternionPeriod(long period)
Sets the period with which theBrickIMUV2.QuaternionListener
listener is triggered periodically.void
setSensorConfiguration(short magnetometerRate, short gyroscopeRange, short gyroscopeBandwidth, short accelerometerRange, short accelerometerBandwidth)
Sets the available sensor configuration for the Magnetometer, Gyroscope and Accelerometer.void
setSensorFusionMode(short mode)
If the fusion mode is turned off, the functionsgetAcceleration()
,getMagneticField()
andgetAngularVelocity()
return uncalibrated and uncompensated sensor data.void
setSPITFPBaudrate(char brickletPort, long baudrate)
Sets the baudrate for a specific Bricklet port.void
setSPITFPBaudrateConfig(boolean enableDynamicBaudrate, long minimumDynamicBaudrate)
The SPITF protocol can be used with a dynamic baudrate.void
setTemperaturePeriod(long period)
Sets the period with which theBrickIMUV2.TemperatureListener
listener is triggered periodically.void
writeBrickletPlugin(char port, short offset, short[] chunk)
Writes 32 bytes of firmware to the bricklet attached at the given port.-
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_LEDS_ON
public static final byte FUNCTION_LEDS_ON
- See Also:
- Constant Field Values
-
FUNCTION_LEDS_OFF
public static final byte FUNCTION_LEDS_OFF
- See Also:
- Constant Field Values
-
FUNCTION_ARE_LEDS_ON
public static final byte FUNCTION_ARE_LEDS_ON
- See Also:
- Constant Field Values
-
FUNCTION_SAVE_CALIBRATION
public static final byte FUNCTION_SAVE_CALIBRATION
- See Also:
- Constant Field Values
-
FUNCTION_SET_ACCELERATION_PERIOD
public static final byte FUNCTION_SET_ACCELERATION_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_GET_ACCELERATION_PERIOD
public static final byte FUNCTION_GET_ACCELERATION_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_SET_MAGNETIC_FIELD_PERIOD
public static final byte FUNCTION_SET_MAGNETIC_FIELD_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_GET_MAGNETIC_FIELD_PERIOD
public static final byte FUNCTION_GET_MAGNETIC_FIELD_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_SET_ANGULAR_VELOCITY_PERIOD
public static final byte FUNCTION_SET_ANGULAR_VELOCITY_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_GET_ANGULAR_VELOCITY_PERIOD
public static final byte FUNCTION_GET_ANGULAR_VELOCITY_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_SET_TEMPERATURE_PERIOD
public static final byte FUNCTION_SET_TEMPERATURE_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_GET_TEMPERATURE_PERIOD
public static final byte FUNCTION_GET_TEMPERATURE_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_SET_ORIENTATION_PERIOD
public static final byte FUNCTION_SET_ORIENTATION_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_GET_ORIENTATION_PERIOD
public static final byte FUNCTION_GET_ORIENTATION_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_SET_LINEAR_ACCELERATION_PERIOD
public static final byte FUNCTION_SET_LINEAR_ACCELERATION_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_GET_LINEAR_ACCELERATION_PERIOD
public static final byte FUNCTION_GET_LINEAR_ACCELERATION_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_SET_GRAVITY_VECTOR_PERIOD
public static final byte FUNCTION_SET_GRAVITY_VECTOR_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_GET_GRAVITY_VECTOR_PERIOD
public static final byte FUNCTION_GET_GRAVITY_VECTOR_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_SET_QUATERNION_PERIOD
public static final byte FUNCTION_SET_QUATERNION_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_GET_QUATERNION_PERIOD
public static final byte FUNCTION_GET_QUATERNION_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_SET_ALL_DATA_PERIOD
public static final byte FUNCTION_SET_ALL_DATA_PERIOD
- See Also:
- Constant Field Values
-
FUNCTION_GET_ALL_DATA_PERIOD
public static final byte FUNCTION_GET_ALL_DATA_PERIOD
- 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_SPITFP_BAUDRATE_CONFIG
public static final byte FUNCTION_SET_SPITFP_BAUDRATE_CONFIG
- See Also:
- Constant Field Values
-
FUNCTION_GET_SPITFP_BAUDRATE_CONFIG
public static final byte FUNCTION_GET_SPITFP_BAUDRATE_CONFIG
- See Also:
- Constant Field Values
-
FUNCTION_GET_SEND_TIMEOUT_COUNT
public static final byte FUNCTION_GET_SEND_TIMEOUT_COUNT
- See Also:
- Constant Field Values
-
FUNCTION_SET_SPITFP_BAUDRATE
public static final byte FUNCTION_SET_SPITFP_BAUDRATE
- See Also:
- Constant Field Values
-
FUNCTION_GET_SPITFP_BAUDRATE
public static final byte FUNCTION_GET_SPITFP_BAUDRATE
- 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_ENABLE_STATUS_LED
public static final byte FUNCTION_ENABLE_STATUS_LED
- See Also:
- Constant Field Values
-
FUNCTION_DISABLE_STATUS_LED
public static final byte FUNCTION_DISABLE_STATUS_LED
- See Also:
- Constant Field Values
-
FUNCTION_IS_STATUS_LED_ENABLED
public static final byte FUNCTION_IS_STATUS_LED_ENABLED
- See Also:
- Constant Field Values
-
FUNCTION_GET_PROTOCOL1_BRICKLET_NAME
public static final byte FUNCTION_GET_PROTOCOL1_BRICKLET_NAME
- 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_BRICKLET_PLUGIN
public static final byte FUNCTION_WRITE_BRICKLET_PLUGIN
- See Also:
- Constant Field Values
-
FUNCTION_READ_BRICKLET_PLUGIN
public static final byte FUNCTION_READ_BRICKLET_PLUGIN
- 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 short MAGNETOMETER_RATE_2HZ
- See Also:
- Constant Field Values
-
MAGNETOMETER_RATE_6HZ
public static final short MAGNETOMETER_RATE_6HZ
- See Also:
- Constant Field Values
-
MAGNETOMETER_RATE_8HZ
public static final short MAGNETOMETER_RATE_8HZ
- See Also:
- Constant Field Values
-
MAGNETOMETER_RATE_10HZ
public static final short MAGNETOMETER_RATE_10HZ
- See Also:
- Constant Field Values
-
MAGNETOMETER_RATE_15HZ
public static final short MAGNETOMETER_RATE_15HZ
- See Also:
- Constant Field Values
-
MAGNETOMETER_RATE_20HZ
public static final short MAGNETOMETER_RATE_20HZ
- See Also:
- Constant Field Values
-
MAGNETOMETER_RATE_25HZ
public static final short MAGNETOMETER_RATE_25HZ
- See Also:
- Constant Field Values
-
MAGNETOMETER_RATE_30HZ
public static final short MAGNETOMETER_RATE_30HZ
- See Also:
- Constant Field Values
-
GYROSCOPE_RANGE_2000DPS
public static final short GYROSCOPE_RANGE_2000DPS
- See Also:
- Constant Field Values
-
GYROSCOPE_RANGE_1000DPS
public static final short GYROSCOPE_RANGE_1000DPS
- See Also:
- Constant Field Values
-
GYROSCOPE_RANGE_500DPS
public static final short GYROSCOPE_RANGE_500DPS
- See Also:
- Constant Field Values
-
GYROSCOPE_RANGE_250DPS
public static final short GYROSCOPE_RANGE_250DPS
- See Also:
- Constant Field Values
-
GYROSCOPE_RANGE_125DPS
public static final short GYROSCOPE_RANGE_125DPS
- See Also:
- Constant Field Values
-
GYROSCOPE_BANDWIDTH_523HZ
public static final short GYROSCOPE_BANDWIDTH_523HZ
- See Also:
- Constant Field Values
-
GYROSCOPE_BANDWIDTH_230HZ
public static final short GYROSCOPE_BANDWIDTH_230HZ
- See Also:
- Constant Field Values
-
GYROSCOPE_BANDWIDTH_116HZ
public static final short GYROSCOPE_BANDWIDTH_116HZ
- See Also:
- Constant Field Values
-
GYROSCOPE_BANDWIDTH_47HZ
public static final short GYROSCOPE_BANDWIDTH_47HZ
- See Also:
- Constant Field Values
-
GYROSCOPE_BANDWIDTH_23HZ
public static final short GYROSCOPE_BANDWIDTH_23HZ
- See Also:
- Constant Field Values
-
GYROSCOPE_BANDWIDTH_12HZ
public static final short GYROSCOPE_BANDWIDTH_12HZ
- See Also:
- Constant Field Values
-
GYROSCOPE_BANDWIDTH_64HZ
public static final short GYROSCOPE_BANDWIDTH_64HZ
- See Also:
- Constant Field Values
-
GYROSCOPE_BANDWIDTH_32HZ
public static final short GYROSCOPE_BANDWIDTH_32HZ
- See Also:
- Constant Field Values
-
ACCELEROMETER_RANGE_2G
public static final short ACCELEROMETER_RANGE_2G
- See Also:
- Constant Field Values
-
ACCELEROMETER_RANGE_4G
public static final short ACCELEROMETER_RANGE_4G
- See Also:
- Constant Field Values
-
ACCELEROMETER_RANGE_8G
public static final short ACCELEROMETER_RANGE_8G
- See Also:
- Constant Field Values
-
ACCELEROMETER_RANGE_16G
public static final short ACCELEROMETER_RANGE_16G
- See Also:
- Constant Field Values
-
ACCELEROMETER_BANDWIDTH_7_81HZ
public static final short ACCELEROMETER_BANDWIDTH_7_81HZ
- See Also:
- Constant Field Values
-
ACCELEROMETER_BANDWIDTH_15_63HZ
public static final short ACCELEROMETER_BANDWIDTH_15_63HZ
- See Also:
- Constant Field Values
-
ACCELEROMETER_BANDWIDTH_31_25HZ
public static final short ACCELEROMETER_BANDWIDTH_31_25HZ
- See Also:
- Constant Field Values
-
ACCELEROMETER_BANDWIDTH_62_5HZ
public static final short ACCELEROMETER_BANDWIDTH_62_5HZ
- See Also:
- Constant Field Values
-
ACCELEROMETER_BANDWIDTH_125HZ
public static final short ACCELEROMETER_BANDWIDTH_125HZ
- See Also:
- Constant Field Values
-
ACCELEROMETER_BANDWIDTH_250HZ
public static final short ACCELEROMETER_BANDWIDTH_250HZ
- See Also:
- Constant Field Values
-
ACCELEROMETER_BANDWIDTH_500HZ
public static final short ACCELEROMETER_BANDWIDTH_500HZ
- See Also:
- Constant Field Values
-
ACCELEROMETER_BANDWIDTH_1000HZ
public static final short ACCELEROMETER_BANDWIDTH_1000HZ
- See Also:
- Constant Field Values
-
SENSOR_FUSION_OFF
public static final short SENSOR_FUSION_OFF
- See Also:
- Constant Field Values
-
SENSOR_FUSION_ON
public static final short SENSOR_FUSION_ON
- See Also:
- Constant Field Values
-
SENSOR_FUSION_ON_WITHOUT_MAGNETOMETER
public static final short SENSOR_FUSION_ON_WITHOUT_MAGNETOMETER
- See Also:
- Constant Field Values
-
SENSOR_FUSION_ON_WITHOUT_FAST_MAGNETOMETER_CALIBRATION
public static final short SENSOR_FUSION_ON_WITHOUT_FAST_MAGNETOMETER_CALIBRATION
- See Also:
- Constant Field Values
-
COMMUNICATION_METHOD_NONE
public static final short COMMUNICATION_METHOD_NONE
- See Also:
- Constant Field Values
-
COMMUNICATION_METHOD_USB
public static final short COMMUNICATION_METHOD_USB
- See Also:
- Constant Field Values
-
COMMUNICATION_METHOD_SPI_STACK
public static final short COMMUNICATION_METHOD_SPI_STACK
- See Also:
- Constant Field Values
-
COMMUNICATION_METHOD_CHIBI
public static final short COMMUNICATION_METHOD_CHIBI
- See Also:
- Constant Field Values
-
COMMUNICATION_METHOD_RS485
public static final short COMMUNICATION_METHOD_RS485
- See Also:
- Constant Field Values
-
COMMUNICATION_METHOD_WIFI
public static final short COMMUNICATION_METHOD_WIFI
- See Also:
- Constant Field Values
-
COMMUNICATION_METHOD_ETHERNET
public static final short COMMUNICATION_METHOD_ETHERNET
- See Also:
- Constant Field Values
-
COMMUNICATION_METHOD_WIFI_V2
public static final short COMMUNICATION_METHOD_WIFI_V2
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BrickIMUV2
public BrickIMUV2(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 BrickIMUV2.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(short, short, short, short, short)
. If you want to get the acceleration periodically, it is recommended to use theBrickIMUV2.AccelerationListener
listener and set the period withsetAccelerationPeriod(long)
.- Throws:
TinkerforgeException
-
getMagneticField
public BrickIMUV2.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 theBrickIMUV2.MagneticFieldListener
listener and set the period withsetMagneticFieldPeriod(long)
.- Throws:
TinkerforgeException
-
getAngularVelocity
public BrickIMUV2.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(short, short, short, short, short)
. If you want to get the angular velocity periodically, it is recommended to use theBrickIMUV2.AngularVelocityListener
alistener nd set the period withsetAngularVelocityPeriod(long)
.- Throws:
TinkerforgeException
-
getTemperature
public byte 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 BrickIMUV2.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 theBrickIMUV2.OrientationListener
listener and set the period withsetOrientationPeriod(long)
.- Throws:
TinkerforgeException
-
getLinearAcceleration
public BrickIMUV2.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(short, short, short, short, short)
. 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 theBrickIMUV2.LinearAccelerationListener
listener and set the period withsetLinearAccelerationPeriod(long)
.- Throws:
TinkerforgeException
-
getGravityVector
public BrickIMUV2.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 theBrickIMUV2.GravityVectorListener
listener and set the period withsetGravityVectorPeriod(long)
.- Throws:
TinkerforgeException
-
getQuaternion
public BrickIMUV2.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 theBrickIMUV2.QuaternionListener
listener and set the period withsetQuaternionPeriod(long)
.- Throws:
TinkerforgeException
-
getAllData
public BrickIMUV2.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 theBrickIMUV2.AllDataListener
listener and set the period withsetAllDataPeriod(long)
.- Throws:
TinkerforgeException
-
ledsOn
public void ledsOn() throws TinkerforgeException
Turns the orientation and direction LEDs of the IMU Brick on.- Throws:
TinkerforgeException
-
ledsOff
public void ledsOff() throws TinkerforgeException
Turns the orientation and direction LEDs of the IMU Brick off.- Throws:
TinkerforgeException
-
areLedsOn
public boolean areLedsOn() throws TinkerforgeException
Returns *true* if the orientation and direction LEDs of the IMU Brick are on, *false* otherwise.- 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
-
setAccelerationPeriod
public void setAccelerationPeriod(long period) throws TinkerforgeException
Sets the period with which theBrickIMUV2.AccelerationListener
listener is triggered periodically. A value of 0 turns the listener off.- Throws:
TinkerforgeException
-
getAccelerationPeriod
public long getAccelerationPeriod() throws TinkerforgeException
Returns the period as set bysetAccelerationPeriod(long)
.- Throws:
TinkerforgeException
-
setMagneticFieldPeriod
public void setMagneticFieldPeriod(long period) throws TinkerforgeException
Sets the period with which theBrickIMUV2.MagneticFieldListener
listener is triggered periodically. A value of 0 turns the listener off.- Throws:
TinkerforgeException
-
getMagneticFieldPeriod
public long getMagneticFieldPeriod() throws TinkerforgeException
Returns the period as set bysetMagneticFieldPeriod(long)
.- Throws:
TinkerforgeException
-
setAngularVelocityPeriod
public void setAngularVelocityPeriod(long period) throws TinkerforgeException
Sets the period with which theBrickIMUV2.AngularVelocityListener
listener is triggered periodically. A value of 0 turns the listener off.- Throws:
TinkerforgeException
-
getAngularVelocityPeriod
public long getAngularVelocityPeriod() throws TinkerforgeException
Returns the period as set bysetAngularVelocityPeriod(long)
.- Throws:
TinkerforgeException
-
setTemperaturePeriod
public void setTemperaturePeriod(long period) throws TinkerforgeException
Sets the period with which theBrickIMUV2.TemperatureListener
listener is triggered periodically. A value of 0 turns the listener off.- Throws:
TinkerforgeException
-
getTemperaturePeriod
public long getTemperaturePeriod() throws TinkerforgeException
Returns the period as set bysetTemperaturePeriod(long)
.- Throws:
TinkerforgeException
-
setOrientationPeriod
public void setOrientationPeriod(long period) throws TinkerforgeException
Sets the period with which theBrickIMUV2.OrientationListener
listener is triggered periodically. A value of 0 turns the listener off.- Throws:
TinkerforgeException
-
getOrientationPeriod
public long getOrientationPeriod() throws TinkerforgeException
Returns the period as set bysetOrientationPeriod(long)
.- Throws:
TinkerforgeException
-
setLinearAccelerationPeriod
public void setLinearAccelerationPeriod(long period) throws TinkerforgeException
Sets the period with which theBrickIMUV2.LinearAccelerationListener
listener is triggered periodically. A value of 0 turns the listener off.- Throws:
TinkerforgeException
-
getLinearAccelerationPeriod
public long getLinearAccelerationPeriod() throws TinkerforgeException
Returns the period as set bysetLinearAccelerationPeriod(long)
.- Throws:
TinkerforgeException
-
setGravityVectorPeriod
public void setGravityVectorPeriod(long period) throws TinkerforgeException
Sets the period with which theBrickIMUV2.GravityVectorListener
listener is triggered periodically. A value of 0 turns the listener off.- Throws:
TinkerforgeException
-
getGravityVectorPeriod
public long getGravityVectorPeriod() throws TinkerforgeException
Returns the period as set bysetGravityVectorPeriod(long)
.- Throws:
TinkerforgeException
-
setQuaternionPeriod
public void setQuaternionPeriod(long period) throws TinkerforgeException
Sets the period with which theBrickIMUV2.QuaternionListener
listener is triggered periodically. A value of 0 turns the listener off.- Throws:
TinkerforgeException
-
getQuaternionPeriod
public long getQuaternionPeriod() throws TinkerforgeException
Returns the period as set bysetQuaternionPeriod(long)
.- Throws:
TinkerforgeException
-
setAllDataPeriod
public void setAllDataPeriod(long period) throws TinkerforgeException
Sets the period with which theBrickIMUV2.AllDataListener
listener is triggered periodically. A value of 0 turns the listener off.- Throws:
TinkerforgeException
-
getAllDataPeriod
public long getAllDataPeriod() throws TinkerforgeException
Returns the period as set bysetAllDataPeriod(long)
.- Throws:
TinkerforgeException
-
setSensorConfiguration
public void setSensorConfiguration(short magnetometerRate, short gyroscopeRange, short gyroscopeBandwidth, short accelerometerRange, short 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. .. versionadded:: 2.0.5$nbsp;(Firmware)- Throws:
TinkerforgeException
-
getSensorConfiguration
public BrickIMUV2.SensorConfiguration getSensorConfiguration() throws TinkerforgeException
Returns the sensor configuration as set bysetSensorConfiguration(short, short, short, short, short)
. .. versionadded:: 2.0.5$nbsp;(Firmware)- Throws:
TinkerforgeException
-
setSensorFusionMode
public void setSensorFusionMode(short 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. .. versionadded:: 2.0.5$nbsp;(Firmware)- Throws:
TinkerforgeException
-
getSensorFusionMode
public short getSensorFusionMode() throws TinkerforgeException
Returns the sensor fusion mode as set bysetSensorFusionMode(short)
. .. versionadded:: 2.0.5$nbsp;(Firmware)- Throws:
TinkerforgeException
-
setSPITFPBaudrateConfig
public void setSPITFPBaudrateConfig(boolean enableDynamicBaudrate, long minimumDynamicBaudrate) throws TinkerforgeException
The SPITF protocol can be used with a dynamic baudrate. If the dynamic baudrate is enabled, the Brick will try to adapt the baudrate for the communication between Bricks and Bricklets according to the amount of data that is transferred. The baudrate will be increased exponentially if lots of data is sent/received and decreased linearly if little data is sent/received. This lowers the baudrate in applications where little data is transferred (e.g. a weather station) and increases the robustness. If there is lots of data to transfer (e.g. Thermal Imaging Bricklet) it automatically increases the baudrate as needed. In cases where some data has to transferred as fast as possible every few seconds (e.g. RS485 Bricklet with a high baudrate but small payload) you may want to turn the dynamic baudrate off to get the highest possible performance. The maximum value of the baudrate can be set per port with the functionsetSPITFPBaudrate(char, long)
. If the dynamic baudrate is disabled, the baudrate as set bysetSPITFPBaudrate(char, long)
will be used statically. .. versionadded:: 2.0.10$nbsp;(Firmware)- Throws:
TinkerforgeException
-
getSPITFPBaudrateConfig
public BrickIMUV2.SPITFPBaudrateConfig getSPITFPBaudrateConfig() throws TinkerforgeException
Returns the baudrate config, seesetSPITFPBaudrateConfig(boolean, long)
. .. versionadded:: 2.0.10$nbsp;(Firmware)- Throws:
TinkerforgeException
-
getSendTimeoutCount
public long getSendTimeoutCount(short communicationMethod) throws TinkerforgeException
Returns the timeout count for the different communication methods. The methods 0-2 are available for all Bricks, 3-7 only for Master Bricks. This function is mostly used for debugging during development, in normal operation the counters should nearly always stay at 0. .. versionadded:: 2.0.7$nbsp;(Firmware)- Throws:
TinkerforgeException
-
setSPITFPBaudrate
public void setSPITFPBaudrate(char brickletPort, long baudrate) throws TinkerforgeException
Sets the baudrate for a specific Bricklet port. If you want to increase the throughput of Bricklets you can increase the baudrate. If you get a high error count because of high interference (seegetSPITFPErrorCount(char)
) you can decrease the baudrate. If the dynamic baudrate feature is enabled, the baudrate set by this function corresponds to the maximum baudrate (seesetSPITFPBaudrateConfig(boolean, long)
). Regulatory testing is done with the default baudrate. If CE compatibility or similar is necessary in your applications we recommend to not change the baudrate. .. versionadded:: 2.0.5$nbsp;(Firmware)- Throws:
TinkerforgeException
-
getSPITFPBaudrate
public long getSPITFPBaudrate(char brickletPort) throws TinkerforgeException
Returns the baudrate for a given Bricklet port, seesetSPITFPBaudrate(char, long)
. .. versionadded:: 2.0.5$nbsp;(Firmware)- Throws:
TinkerforgeException
-
getSPITFPErrorCount
public BrickIMUV2.SPITFPErrorCount getSPITFPErrorCount(char brickletPort) 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 Brick side. All Bricklets have a similar function that returns the errors on the Bricklet side. .. versionadded:: 2.0.5$nbsp;(Firmware)- Throws:
TinkerforgeException
-
enableStatusLED
public void enableStatusLED() throws TinkerforgeException
Enables the status LED. The status LED is the blue LED next to the USB connector. If enabled is is on and it flickers if data is transfered. If disabled it is always off. The default state is enabled.- Throws:
TinkerforgeException
-
disableStatusLED
public void disableStatusLED() throws TinkerforgeException
Disables the status LED. The status LED is the blue LED next to the USB connector. If enabled is is on and it flickers if data is transfered. If disabled it is always off. The default state is enabled.- Throws:
TinkerforgeException
-
isStatusLEDEnabled
public boolean isStatusLEDEnabled() throws TinkerforgeException
Returns *true* if the status LED is enabled, *false* otherwise.- Throws:
TinkerforgeException
-
getProtocol1BrickletName
public BrickIMUV2.Protocol1BrickletName getProtocol1BrickletName(char port) throws TinkerforgeException
Returns the firmware and protocol version and the name of the Bricklet for a given port. This functions sole purpose is to allow automatic flashing of v1.x.y Bricklet plugins.- Throws:
TinkerforgeException
-
getChipTemperature
public short 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 an accuracy of ±15%. 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 Brick. Calling this function on a Brick inside of a stack will reset the whole stack. After a reset you have to create new device objects, calling functions on the existing ones will result in undefined behavior!- Throws:
TinkerforgeException
-
writeBrickletPlugin
public void writeBrickletPlugin(char port, short offset, short[] chunk) throws TinkerforgeException
Writes 32 bytes of firmware to the bricklet attached at the given port. The bytes are written to the position offset * 32. This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.- Throws:
TinkerforgeException
-
readBrickletPlugin
public short[] readBrickletPlugin(char port, short offset) throws TinkerforgeException
Reads 32 bytes of firmware from the bricklet attached at the given port. The bytes are read starting at the position offset * 32. This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.- Throws:
TinkerforgeException
-
getIdentity
public Device.Identity getIdentity() throws TinkerforgeException
Returns the UID, the UID where the Brick is connected to, the position, the hardware and firmware version as well as the device identifier. The position is the position in the stack from '0' (bottom) to '8' (top). 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(BrickIMUV2.AccelerationListener listener)
Adds a Acceleration listener.
-
removeAccelerationListener
public void removeAccelerationListener(BrickIMUV2.AccelerationListener listener)
Removes a Acceleration listener.
-
addMagneticFieldListener
public void addMagneticFieldListener(BrickIMUV2.MagneticFieldListener listener)
Adds a MagneticField listener.
-
removeMagneticFieldListener
public void removeMagneticFieldListener(BrickIMUV2.MagneticFieldListener listener)
Removes a MagneticField listener.
-
addAngularVelocityListener
public void addAngularVelocityListener(BrickIMUV2.AngularVelocityListener listener)
Adds a AngularVelocity listener.
-
removeAngularVelocityListener
public void removeAngularVelocityListener(BrickIMUV2.AngularVelocityListener listener)
Removes a AngularVelocity listener.
-
addTemperatureListener
public void addTemperatureListener(BrickIMUV2.TemperatureListener listener)
Adds a Temperature listener.
-
removeTemperatureListener
public void removeTemperatureListener(BrickIMUV2.TemperatureListener listener)
Removes a Temperature listener.
-
addLinearAccelerationListener
public void addLinearAccelerationListener(BrickIMUV2.LinearAccelerationListener listener)
Adds a LinearAcceleration listener.
-
removeLinearAccelerationListener
public void removeLinearAccelerationListener(BrickIMUV2.LinearAccelerationListener listener)
Removes a LinearAcceleration listener.
-
addGravityVectorListener
public void addGravityVectorListener(BrickIMUV2.GravityVectorListener listener)
Adds a GravityVector listener.
-
removeGravityVectorListener
public void removeGravityVectorListener(BrickIMUV2.GravityVectorListener listener)
Removes a GravityVector listener.
-
addOrientationListener
public void addOrientationListener(BrickIMUV2.OrientationListener listener)
Adds a Orientation listener.
-
removeOrientationListener
public void removeOrientationListener(BrickIMUV2.OrientationListener listener)
Removes a Orientation listener.
-
addQuaternionListener
public void addQuaternionListener(BrickIMUV2.QuaternionListener listener)
Adds a Quaternion listener.
-
removeQuaternionListener
public void removeQuaternionListener(BrickIMUV2.QuaternionListener listener)
Removes a Quaternion listener.
-
addAllDataListener
public void addAllDataListener(BrickIMUV2.AllDataListener listener)
Adds a AllData listener.
-
removeAllDataListener
public void removeAllDataListener(BrickIMUV2.AllDataListener listener)
Removes a AllData listener.
-
-