Shell - IMU Bricklet 3.0

This is the description of the Shell API bindings for the IMU Bricklet 3.0. General information and technical specifications for the IMU Bricklet 3.0 are summarized in its hardware description.

An installation guide for the Shell API bindings is part of their general description.

Examples

The example code below is Public Domain (CC0 1.0).

Simple

Download (example-simple.sh)

1
2
3
4
5
6
7
#!/bin/sh
# Connects to localhost:4223 by default, use --host and --port to change this

uid=XYZ # Change XYZ to the UID of your IMU Bricklet 3.0

# Get current quaternion
tinkerforge call imu-v3-bricklet $uid get-quaternion

All Data

Download (example-all-data.sh)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#!/bin/sh
# Connects to localhost:4223 by default, use --host and --port to change this

uid=XYZ # Change XYZ to the UID of your IMU Bricklet 3.0

# Handle incoming all data callbacks
tinkerforge dispatch imu-v3-bricklet $uid all-data &

# Set period for all data callback to 0.1s (100ms)
tinkerforge call imu-v3-bricklet $uid set-all-data-callback-configuration 100 false

echo "Press key to exit"; read dummy

kill -- -$$ # Stop callback dispatch in background

Callback

Download (example-callback.sh)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#!/bin/sh
# Connects to localhost:4223 by default, use --host and --port to change this

uid=XYZ # Change XYZ to the UID of your IMU Bricklet 3.0

# Handle incoming quaternion callbacks
tinkerforge dispatch imu-v3-bricklet $uid quaternion &

# Set period for quaternion callback to 0.1s (100ms)
tinkerforge call imu-v3-bricklet $uid set-quaternion-callback-configuration 100 false

echo "Press key to exit"; read dummy

kill -- -$$ # Stop callback dispatch in background

API

Possible exit codes for all tinkerforge commands are:

  • 1: interrupted (ctrl+c)
  • 2: syntax error
  • 21: Python 2.5 or newer is required
  • 22: Python argparse module is missing
  • 23: socket error
  • 24: other exception
  • 25: invalid placeholder in format string
  • 26: authentication error
  • 201: timeout occurred
  • 209: invalid argument value
  • 210: function is not supported
  • 211: unknown error

Command Structure

The common options of the call and dispatch commands are documented here. The specific command structure is shown below.

tinkerforge call imu-v3-bricklet [<option>..] <uid> <function> [<argument>..]
Parameters:
  • <uid> – Type: String
  • <function> – Type: String

The call command is used to call a function of the IMU Bricklet 3.0. It can take several options:

  • --help shows help for the specific call command and exits
  • --list-functions shows a list of known functions of the IMU Bricklet 3.0 and exits
tinkerforge dispatch imu-v3-bricklet [<option>..] <uid> <callback>
Parameters:
  • <uid> – Type: String
  • <callback> – Type: String

The dispatch command is used to dispatch a callback of the IMU Bricklet 3.0. It can take several options:

  • --help shows help for the specific dispatch command and exits
  • --list-callbacks shows a list of known callbacks of the IMU Bricklet 3.0 and exits
tinkerforge call imu-v3-bricklet <uid> <function> [<option>..] [<argument>..]
Parameters:
  • <uid> – Type: String
  • <function> – Type: String

The <function> to be called can take different options depending of its kind. All functions can take the following options:

  • --help shows help for the specific function and exits

Getter functions can take the following options:

  • --execute <command> shell command line to execute for each incoming response (see section about output formatting for details)

Setter functions can take the following options:

  • --expect-response requests response and waits for it

The --expect-response option for setter functions allows to detect timeouts and other error conditions calls of setters as well. The device will then send a response for this purpose. If this option is not given for a setter function then no response is sent and errors are silently ignored, because they cannot be detected.

tinkerforge dispatch imu-v3-bricklet <uid> <callback> [<option>..]
Parameters:
  • <uid> – Type: String
  • <callback> – Type: String

The <callback> to be dispatched can take several options:

  • --help shows help for the specific callback and exits
  • --execute <command> shell command line to execute for each incoming response (see section about output formatting for details)

Basic Functions

tinkerforge call imu-v3-bricklet <uid> get-orientation
Output:
  • heading – Type: Int, Unit: 1/16 °, Range: [0 to 5760]
  • roll – Type: Int, Unit: 1/16 °, Range: [-1440 to 1440]
  • pitch – Type: Int, Unit: 1/16 °, Range: [-2880 to 2880]

Returns the current orientation (heading, roll, pitch) of the IMU Brick as independent Euler angles. Note that Euler angles always experience a 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 the orientation callback and set the period with set-orientation-callback-configuration.

tinkerforge call imu-v3-bricklet <uid> get-linear-acceleration
Output:
  • x – Type: Int, Unit: 1 cm/s², Range: ?
  • y – Type: Int, Unit: 1 cm/s², Range: ?
  • z – Type: Int, Unit: 1 cm/s², Range: ?

Returns the linear acceleration of the IMU Brick for the x, y and z axis. The acceleration is in the range configured with set-sensor-configuration.

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, see get-gravity-vector.

If you want to get the linear acceleration periodically, it is recommended to use the linear-acceleration callback and set the period with set-linear-acceleration-callback-configuration.

tinkerforge call imu-v3-bricklet <uid> get-gravity-vector
Output:
  • x – Type: Int, Unit: 1 cm/s², Range: [-981 to 981]
  • y – Type: Int, Unit: 1 cm/s², Range: [-981 to 981]
  • z – Type: Int, Unit: 1 cm/s², Range: [-981 to 981]

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, see get-linear-acceleration.

If you want to get the gravity vector periodically, it is recommended to use the gravity-vector callback and set the period with set-gravity-vector-callback-configuration.

tinkerforge call imu-v3-bricklet <uid> get-quaternion
Output:
  • w – Type: Int, Unit: 1/16383, Range: [-214 + 1 to 214 - 1]
  • x – Type: Int, Unit: 1/16383, Range: [-214 + 1 to 214 - 1]
  • y – Type: Int, Unit: 1/16383, Range: [-214 + 1 to 214 - 1]
  • z – Type: Int, Unit: 1/16383, Range: [-214 + 1 to 214 - 1]

Returns the current orientation (w, x, y, z) of the IMU Brick as quaternions.

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 the quaternion callback and set the period with set-quaternion-callback-configuration.

tinkerforge call imu-v3-bricklet <uid> get-all-data
Output:
  • acceleration – Type: Int Array, Length: 3
    • 0: x – Type: Int, Unit: 1 cm/s², Range: ?
    • 1: y – Type: Int, Unit: 1 cm/s², Range: ?
    • 2: z – Type: Int, Unit: 1 cm/s², Range: ?
  • magnetic-field – Type: Int Array, Length: 3
    • 0: x – Type: Int, Unit: 1/16 µT, Range: [-20800 to 20800]
    • 1: y – Type: Int, Unit: 1/16 µT, Range: [-20800 to 20800]
    • 2: z – Type: Int, Unit: 1/16 µT, Range: [-40000 to 40000]
  • angular-velocity – Type: Int Array, Length: 3
    • 0: x – Type: Int, Unit: 1/16 °/s, Range: ?
    • 1: y – Type: Int, Unit: 1/16 °/s, Range: ?
    • 2: z – Type: Int, Unit: 1/16 °/s, Range: ?
  • euler-angle – Type: Int Array, Length: 3
    • 0: heading – Type: Int, Unit: 1/16 °, Range: [0 to 5760]
    • 1: roll – Type: Int, Unit: 1/16 °, Range: [-1440 to 1440]
    • 2: pitch – Type: Int, Unit: 1/16 °, Range: [-2880 to 2880]
  • quaternion – Type: Int Array, Length: 4
    • 0: w – Type: Int, Unit: 1/16383, Range: [-214 + 1 to 214 - 1]
    • 1: x – Type: Int, Unit: 1/16383, Range: [-214 + 1 to 214 - 1]
    • 2: y – Type: Int, Unit: 1/16383, Range: [-214 + 1 to 214 - 1]
    • 3: z – Type: Int, Unit: 1/16383, Range: [-214 + 1 to 214 - 1]
  • linear-acceleration – Type: Int Array, Length: 3
    • 0: x – Type: Int, Unit: 1 cm/s², Range: ?
    • 1: y – Type: Int, Unit: 1 cm/s², Range: ?
    • 2: z – Type: Int, Unit: 1 cm/s², Range: ?
  • gravity-vector – Type: Int Array, Length: 3
    • 0: x – Type: Int, Unit: 1 cm/s², Range: [-981 to 981]
    • 1: y – Type: Int, Unit: 1 cm/s², Range: [-981 to 981]
    • 2: z – Type: Int, Unit: 1 cm/s², Range: [-981 to 981]
  • temperature – Type: Int, Unit: 1 °C, Range: [-128 to 127]
  • calibration-status – Type: Int, Range: [0 to 255]

Return all of the available data of the IMU Brick.

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 the all-data callback and set the period with set-all-data-callback-configuration.

Advanced Functions

tinkerforge call imu-v3-bricklet <uid> get-acceleration
Output:
  • x – Type: Int, Unit: 1 cm/s², Range: ?
  • y – Type: Int, Unit: 1 cm/s², Range: ?
  • z – Type: Int, Unit: 1 cm/s², Range: ?

Returns the calibrated acceleration from the accelerometer for the x, y and z axis. The acceleration is in the range configured with set-sensor-configuration.

If you want to get the acceleration periodically, it is recommended to use the acceleration callback and set the period with set-acceleration-callback-configuration.

tinkerforge call imu-v3-bricklet <uid> get-magnetic-field
Output:
  • x – Type: Int, Unit: 1/16 µT, Range: [-20800 to 20800]
  • y – Type: Int, Unit: 1/16 µT, Range: [-20800 to 20800]
  • z – Type: Int, Unit: 1/16 µT, Range: [-40000 to 40000]

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 the magnetic-field callback and set the period with set-magnetic-field-callback-configuration.

tinkerforge call imu-v3-bricklet <uid> get-angular-velocity
Output:
  • x – Type: Int, Unit: 1/16 °/s, Range: ?
  • y – Type: Int, Unit: 1/16 °/s, Range: ?
  • z – Type: Int, Unit: 1/16 °/s, Range: ?

Returns the calibrated angular velocity from the gyroscope for the x, y and z axis. The angular velocity is in the range configured with set-sensor-configuration.

If you want to get the angular velocity periodically, it is recommended to use the angular-velocity acallback nd set the period with set-angular-velocity-callback-configuration.

tinkerforge call imu-v3-bricklet <uid> get-temperature
Output:
  • temperature – Type: Int, Unit: 1 °C, Range: [-128 to 127]

Returns the temperature of the IMU Brick. The temperature is measured in the core of the BNO055 IC, it is not the ambient temperature

tinkerforge call imu-v3-bricklet <uid> save-calibration
Output:
  • calibration-done – Type: Bool

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.

tinkerforge call imu-v3-bricklet <uid> set-sensor-configuration <magnetometer-rate> <gyroscope-range> <gyroscope-bandwidth> <accelerometer-range> <accelerometer-bandwidth>
Parameters:
  • <magnetometer-rate> – Type: Int, Range: See symbols, Default: 5
  • <gyroscope-range> – Type: Int, Range: See symbols, Default: 0
  • <gyroscope-bandwidth> – Type: Int, Range: See symbols, Default: 7
  • <accelerometer-range> – Type: Int, Range: See symbols, Default: 1
  • <accelerometer-bandwidth> – Type: Int, Range: See symbols, Default: 3
Output:
  • no output

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.

The following symbols are available for this function:

For <magnetometer-rate>:

  • magnetometer-rate-2hz = 0
  • magnetometer-rate-6hz = 1
  • magnetometer-rate-8hz = 2
  • magnetometer-rate-10hz = 3
  • magnetometer-rate-15hz = 4
  • magnetometer-rate-20hz = 5
  • magnetometer-rate-25hz = 6
  • magnetometer-rate-30hz = 7

For <gyroscope-range>:

  • gyroscope-range-2000dps = 0
  • gyroscope-range-1000dps = 1
  • gyroscope-range-500dps = 2
  • gyroscope-range-250dps = 3
  • gyroscope-range-125dps = 4

For <gyroscope-bandwidth>:

  • gyroscope-bandwidth-523hz = 0
  • gyroscope-bandwidth-230hz = 1
  • gyroscope-bandwidth-116hz = 2
  • gyroscope-bandwidth-47hz = 3
  • gyroscope-bandwidth-23hz = 4
  • gyroscope-bandwidth-12hz = 5
  • gyroscope-bandwidth-64hz = 6
  • gyroscope-bandwidth-32hz = 7

For <accelerometer-range>:

  • accelerometer-range-2g = 0
  • accelerometer-range-4g = 1
  • accelerometer-range-8g = 2
  • accelerometer-range-16g = 3

For <accelerometer-bandwidth>:

  • accelerometer-bandwidth-7-81hz = 0
  • accelerometer-bandwidth-15-63hz = 1
  • accelerometer-bandwidth-31-25hz = 2
  • accelerometer-bandwidth-62-5hz = 3
  • accelerometer-bandwidth-125hz = 4
  • accelerometer-bandwidth-250hz = 5
  • accelerometer-bandwidth-500hz = 6
  • accelerometer-bandwidth-1000hz = 7
tinkerforge call imu-v3-bricklet <uid> get-sensor-configuration
Output:
  • magnetometer-rate – Type: Int, Range: See symbols, Default: 5
  • gyroscope-range – Type: Int, Range: See symbols, Default: 0
  • gyroscope-bandwidth – Type: Int, Range: See symbols, Default: 7
  • accelerometer-range – Type: Int, Range: See symbols, Default: 1
  • accelerometer-bandwidth – Type: Int, Range: See symbols, Default: 3

Returns the sensor configuration as set by set-sensor-configuration.

The following symbols are available for this function:

For magnetometer-rate:

  • magnetometer-rate-2hz = 0
  • magnetometer-rate-6hz = 1
  • magnetometer-rate-8hz = 2
  • magnetometer-rate-10hz = 3
  • magnetometer-rate-15hz = 4
  • magnetometer-rate-20hz = 5
  • magnetometer-rate-25hz = 6
  • magnetometer-rate-30hz = 7

For gyroscope-range:

  • gyroscope-range-2000dps = 0
  • gyroscope-range-1000dps = 1
  • gyroscope-range-500dps = 2
  • gyroscope-range-250dps = 3
  • gyroscope-range-125dps = 4

For gyroscope-bandwidth:

  • gyroscope-bandwidth-523hz = 0
  • gyroscope-bandwidth-230hz = 1
  • gyroscope-bandwidth-116hz = 2
  • gyroscope-bandwidth-47hz = 3
  • gyroscope-bandwidth-23hz = 4
  • gyroscope-bandwidth-12hz = 5
  • gyroscope-bandwidth-64hz = 6
  • gyroscope-bandwidth-32hz = 7

For accelerometer-range:

  • accelerometer-range-2g = 0
  • accelerometer-range-4g = 1
  • accelerometer-range-8g = 2
  • accelerometer-range-16g = 3

For accelerometer-bandwidth:

  • accelerometer-bandwidth-7-81hz = 0
  • accelerometer-bandwidth-15-63hz = 1
  • accelerometer-bandwidth-31-25hz = 2
  • accelerometer-bandwidth-62-5hz = 3
  • accelerometer-bandwidth-125hz = 4
  • accelerometer-bandwidth-250hz = 5
  • accelerometer-bandwidth-500hz = 6
  • accelerometer-bandwidth-1000hz = 7
tinkerforge call imu-v3-bricklet <uid> set-sensor-fusion-mode <mode>
Parameters:
  • <mode> – Type: Int, Range: See symbols, Default: 1
Output:
  • no output

If the fusion mode is turned off, the functions get-acceleration, get-magnetic-field and get-angular-velocity 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.

The following symbols are available for this function:

For <mode>:

  • sensor-fusion-off = 0
  • sensor-fusion-on = 1
  • sensor-fusion-on-without-magnetometer = 2
  • sensor-fusion-on-without-fast-magnetometer-calibration = 3
tinkerforge call imu-v3-bricklet <uid> get-sensor-fusion-mode
Output:
  • mode – Type: Int, Range: See symbols, Default: 1

Returns the sensor fusion mode as set by set-sensor-fusion-mode.

The following symbols are available for this function:

For mode:

  • sensor-fusion-off = 0
  • sensor-fusion-on = 1
  • sensor-fusion-on-without-magnetometer = 2
  • sensor-fusion-on-without-fast-magnetometer-calibration = 3
tinkerforge call imu-v3-bricklet <uid> get-spitfp-error-count
Output:
  • error-count-ack-checksum – Type: Int, Range: [0 to 232 - 1]
  • error-count-message-checksum – Type: Int, Range: [0 to 232 - 1]
  • error-count-frame – Type: Int, Range: [0 to 232 - 1]
  • error-count-overflow – Type: Int, Range: [0 to 232 - 1]

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.

tinkerforge call imu-v3-bricklet <uid> set-status-led-config <config>
Parameters:
  • <config> – Type: Int, Range: See symbols, Default: 3
Output:
  • no output

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.

The following symbols are available for this function:

For <config>:

  • status-led-config-off = 0
  • status-led-config-on = 1
  • status-led-config-show-heartbeat = 2
  • status-led-config-show-status = 3
tinkerforge call imu-v3-bricklet <uid> get-status-led-config
Output:
  • config – Type: Int, Range: See symbols, Default: 3

Returns the configuration as set by set-status-led-config

The following symbols are available for this function:

For config:

  • status-led-config-off = 0
  • status-led-config-on = 1
  • status-led-config-show-heartbeat = 2
  • status-led-config-show-status = 3
tinkerforge call imu-v3-bricklet <uid> get-chip-temperature
Output:
  • temperature – Type: Int, Unit: 1 °C, Range: [-215 to 215 - 1]

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.

tinkerforge call imu-v3-bricklet <uid> reset
Output:
  • no output

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!

tinkerforge call imu-v3-bricklet <uid> get-identity
Output:
  • uid – Type: String, Length: up to 8
  • connected-uid – Type: String, Length: up to 8
  • position – Type: Char, Range: [a to h, z]
  • hardware-version – Type: Int Array, Length: 3
    • 0: major – Type: Int, Range: [0 to 255]
    • 1: minor – Type: Int, Range: [0 to 255]
    • 2: revision – Type: Int, Range: [0 to 255]
  • firmware-version – Type: Int Array, Length: 3
    • 0: major – Type: Int, Range: [0 to 255]
    • 1: minor – Type: Int, Range: [0 to 255]
    • 2: revision – Type: Int, Range: [0 to 255]
  • device-identifier – Type: Int, Range: [0 to 216 - 1]

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 Isolator Bricklet is always at position 'z'.

The device identifier numbers can be found here

Callback Configuration Functions

tinkerforge call imu-v3-bricklet <uid> set-acceleration-callback-configuration <period> <value-has-to-change>
Parameters:
  • <period> – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • <value-has-to-change> – Type: Bool, Default: false
Output:
  • no output

The period is the period with which the acceleration callback is triggered periodically. A value of 0 turns the callback off.

If the value has to change-parameter is set to true, the callback is only triggered after the value has changed. If the value didn't change within the period, the callback is triggered immediately on change.

If it is set to false, the callback is continuously triggered with the period, independent of the value.

tinkerforge call imu-v3-bricklet <uid> get-acceleration-callback-configuration
Output:
  • period – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • value-has-to-change – Type: Bool, Default: false

Returns the callback configuration as set by set-acceleration-callback-configuration.

tinkerforge call imu-v3-bricklet <uid> set-magnetic-field-callback-configuration <period> <value-has-to-change>
Parameters:
  • <period> – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • <value-has-to-change> – Type: Bool, Default: false
Output:
  • no output

The period is the period with which the magnetic-field callback is triggered periodically. A value of 0 turns the callback off.

If the value has to change-parameter is set to true, the callback is only triggered after the value has changed. If the value didn't change within the period, the callback is triggered immediately on change.

If it is set to false, the callback is continuously triggered with the period, independent of the value.

tinkerforge call imu-v3-bricklet <uid> get-magnetic-field-callback-configuration
Output:
  • period – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • value-has-to-change – Type: Bool, Default: false

Returns the callback configuration as set by set-magnetic-field-callback-configuration.

tinkerforge call imu-v3-bricklet <uid> set-angular-velocity-callback-configuration <period> <value-has-to-change>
Parameters:
  • <period> – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • <value-has-to-change> – Type: Bool, Default: false
Output:
  • no output

The period is the period with which the angular-velocity callback is triggered periodically. A value of 0 turns the callback off.

If the value has to change-parameter is set to true, the callback is only triggered after the value has changed. If the value didn't change within the period, the callback is triggered immediately on change.

If it is set to false, the callback is continuously triggered with the period, independent of the value.

tinkerforge call imu-v3-bricklet <uid> get-angular-velocity-callback-configuration
Output:
  • period – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • value-has-to-change – Type: Bool, Default: false

Returns the callback configuration as set by set-angular-velocity-callback-configuration.

tinkerforge call imu-v3-bricklet <uid> set-temperature-callback-configuration <period> <value-has-to-change>
Parameters:
  • <period> – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • <value-has-to-change> – Type: Bool, Default: false
Output:
  • no output

The period is the period with which the temperature callback is triggered periodically. A value of 0 turns the callback off.

If the value has to change-parameter is set to true, the callback is only triggered after the value has changed. If the value didn't change within the period, the callback is triggered immediately on change.

If it is set to false, the callback is continuously triggered with the period, independent of the value.

tinkerforge call imu-v3-bricklet <uid> get-temperature-callback-configuration
Output:
  • period – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • value-has-to-change – Type: Bool, Default: false

Returns the callback configuration as set by set-temperature-callback-configuration.

tinkerforge call imu-v3-bricklet <uid> set-orientation-callback-configuration <period> <value-has-to-change>
Parameters:
  • <period> – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • <value-has-to-change> – Type: Bool, Default: false
Output:
  • no output

The period is the period with which the orientation callback is triggered periodically. A value of 0 turns the callback off.

If the value has to change-parameter is set to true, the callback is only triggered after the value has changed. If the value didn't change within the period, the callback is triggered immediately on change.

If it is set to false, the callback is continuously triggered with the period, independent of the value.

tinkerforge call imu-v3-bricklet <uid> get-orientation-callback-configuration
Output:
  • period – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • value-has-to-change – Type: Bool, Default: false

Returns the callback configuration as set by set-orientation-callback-configuration.

tinkerforge call imu-v3-bricklet <uid> set-linear-acceleration-callback-configuration <period> <value-has-to-change>
Parameters:
  • <period> – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • <value-has-to-change> – Type: Bool, Default: false
Output:
  • no output

The period is the period with which the linear-acceleration callback is triggered periodically. A value of 0 turns the callback off.

If the value has to change-parameter is set to true, the callback is only triggered after the value has changed. If the value didn't change within the period, the callback is triggered immediately on change.

If it is set to false, the callback is continuously triggered with the period, independent of the value.

tinkerforge call imu-v3-bricklet <uid> get-linear-acceleration-callback-configuration
Output:
  • period – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • value-has-to-change – Type: Bool, Default: false

Returns the callback configuration as set by set-linear-acceleration-callback-configuration.

tinkerforge call imu-v3-bricklet <uid> set-gravity-vector-callback-configuration <period> <value-has-to-change>
Parameters:
  • <period> – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • <value-has-to-change> – Type: Bool, Default: false
Output:
  • no output

The period is the period with which the gravity-vector callback is triggered periodically. A value of 0 turns the callback off.

If the value has to change-parameter is set to true, the callback is only triggered after the value has changed. If the value didn't change within the period, the callback is triggered immediately on change.

If it is set to false, the callback is continuously triggered with the period, independent of the value.

tinkerforge call imu-v3-bricklet <uid> get-gravity-vector-callback-configuration
Output:
  • period – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • value-has-to-change – Type: Bool, Default: false

Returns the callback configuration as set by set-gravity-vector-callback-configuration.

tinkerforge call imu-v3-bricklet <uid> set-quaternion-callback-configuration <period> <value-has-to-change>
Parameters:
  • <period> – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • <value-has-to-change> – Type: Bool, Default: false
Output:
  • no output

The period is the period with which the quaternion callback is triggered periodically. A value of 0 turns the callback off.

If the value has to change-parameter is set to true, the callback is only triggered after the value has changed. If the value didn't change within the period, the callback is triggered immediately on change.

If it is set to false, the callback is continuously triggered with the period, independent of the value.

tinkerforge call imu-v3-bricklet <uid> get-quaternion-callback-configuration
Output:
  • period – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • value-has-to-change – Type: Bool, Default: false

Returns the callback configuration as set by set-quaternion-callback-configuration.

tinkerforge call imu-v3-bricklet <uid> set-all-data-callback-configuration <period> <value-has-to-change>
Parameters:
  • <period> – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • <value-has-to-change> – Type: Bool, Default: false
Output:
  • no output

The period is the period with which the all-data callback is triggered periodically. A value of 0 turns the callback off.

If the value has to change-parameter is set to true, the callback is only triggered after the value has changed. If the value didn't change within the period, the callback is triggered immediately on change.

If it is set to false, the callback is continuously triggered with the period, independent of the value.

tinkerforge call imu-v3-bricklet <uid> get-all-data-callback-configuration
Output:
  • period – Type: Int, Unit: 1 ms, Range: [0 to 232 - 1], Default: 0
  • value-has-to-change – Type: Bool, Default: false

Returns the callback configuration as set by set-all-data-callback-configuration.

Callbacks

Callbacks can be used to receive time critical or recurring data from the device:

tinkerforge dispatch imu-v3-bricklet <uid> example

The available callbacks are described below.

Note

Using callbacks for recurring events is always preferred compared to using getters. It will use less USB bandwidth and the latency will be a lot better, since there is no round trip time.

tinkerforge dispatch imu-v3-bricklet <uid> acceleration
Output:
  • x – Type: Int, Unit: 1 cm/s², Range: ?
  • y – Type: Int, Unit: 1 cm/s², Range: ?
  • z – Type: Int, Unit: 1 cm/s², Range: ?

This callback is triggered periodically with the period that is set by set-acceleration-callback-configuration. The parameters are the acceleration for the x, y and z axis.

tinkerforge dispatch imu-v3-bricklet <uid> magnetic-field
Output:
  • x – Type: Int, Unit: 1/16 µT, Range: [-20800 to 20800]
  • y – Type: Int, Unit: 1/16 µT, Range: [-20800 to 20800]
  • z – Type: Int, Unit: 1/16 µT, Range: [-40000 to 40000]

This callback is triggered periodically with the period that is set by set-magnetic-field-callback-configuration. The parameters are the magnetic field for the x, y and z axis.

tinkerforge dispatch imu-v3-bricklet <uid> angular-velocity
Output:
  • x – Type: Int, Unit: 1/16 °/s, Range: ?
  • y – Type: Int, Unit: 1/16 °/s, Range: ?
  • z – Type: Int, Unit: 1/16 °/s, Range: ?

This callback is triggered periodically with the period that is set by set-angular-velocity-callback-configuration. The parameters are the angular velocity for the x, y and z axis.

tinkerforge dispatch imu-v3-bricklet <uid> temperature
Output:
  • temperature – Type: Int, Unit: 1 °C, Range: [-128 to 127]

This callback is triggered periodically with the period that is set by set-temperature-callback-configuration. The parameter is the temperature.

tinkerforge dispatch imu-v3-bricklet <uid> linear-acceleration
Output:
  • x – Type: Int, Unit: 1 cm/s², Range: ?
  • y – Type: Int, Unit: 1 cm/s², Range: ?
  • z – Type: Int, Unit: 1 cm/s², Range: ?

This callback is triggered periodically with the period that is set by set-linear-acceleration-callback-configuration. The parameters are the linear acceleration for the x, y and z axis.

tinkerforge dispatch imu-v3-bricklet <uid> gravity-vector
Output:
  • x – Type: Int, Unit: 1 cm/s², Range: [-981 to 981]
  • y – Type: Int, Unit: 1 cm/s², Range: [-981 to 981]
  • z – Type: Int, Unit: 1 cm/s², Range: [-981 to 981]

This callback is triggered periodically with the period that is set by set-gravity-vector-callback-configuration. The parameters gravity vector for the x, y and z axis.

tinkerforge dispatch imu-v3-bricklet <uid> orientation
Output:
  • heading – Type: Int, Unit: 1/16 °, Range: [0 to 5760]
  • roll – Type: Int, Unit: 1/16 °, Range: [-1440 to 1440]
  • pitch – Type: Int, Unit: 1/16 °, Range: [-2880 to 2880]

This callback is triggered periodically with the period that is set by set-orientation-callback-configuration. The parameters are the orientation (heading (yaw), roll, pitch) of the IMU Brick in Euler angles. See get-orientation for details.

tinkerforge dispatch imu-v3-bricklet <uid> quaternion
Output:
  • w – Type: Int, Unit: 1/16383, Range: [-214 + 1 to 214 - 1]
  • x – Type: Int, Unit: 1/16383, Range: [-214 + 1 to 214 - 1]
  • y – Type: Int, Unit: 1/16383, Range: [-214 + 1 to 214 - 1]
  • z – Type: Int, Unit: 1/16383, Range: [-214 + 1 to 214 - 1]

This callback is triggered periodically with the period that is set by set-quaternion-callback-configuration. The parameters are the orientation (w, x, y, z) of the IMU Brick in quaternions. See get-quaternion for details.

tinkerforge dispatch imu-v3-bricklet <uid> all-data
Output:
  • acceleration – Type: Int Array, Length: 3
    • 0: x – Type: Int, Unit: 1 cm/s², Range: ?
    • 1: y – Type: Int, Unit: 1 cm/s², Range: ?
    • 2: z – Type: Int, Unit: 1 cm/s², Range: ?
  • magnetic-field – Type: Int Array, Length: 3
    • 0: x – Type: Int, Unit: 1/16 µT, Range: [-20800 to 20800]
    • 1: y – Type: Int, Unit: 1/16 µT, Range: [-20800 to 20800]
    • 2: z – Type: Int, Unit: 1/16 µT, Range: [-40000 to 40000]
  • angular-velocity – Type: Int Array, Length: 3
    • 0: x – Type: Int, Unit: 1/16 °/s, Range: ?
    • 1: y – Type: Int, Unit: 1/16 °/s, Range: ?
    • 2: z – Type: Int, Unit: 1/16 °/s, Range: ?
  • euler-angle – Type: Int Array, Length: 3
    • 0: heading – Type: Int, Unit: 1/16 °, Range: [0 to 5760]
    • 1: roll – Type: Int, Unit: 1/16 °, Range: [-1440 to 1440]
    • 2: pitch – Type: Int, Unit: 1/16 °, Range: [-2880 to 2880]
  • quaternion – Type: Int Array, Length: 4
    • 0: w – Type: Int, Unit: 1/16383, Range: [-214 + 1 to 214 - 1]
    • 1: x – Type: Int, Unit: 1/16383, Range: [-214 + 1 to 214 - 1]
    • 2: y – Type: Int, Unit: 1/16383, Range: [-214 + 1 to 214 - 1]
    • 3: z – Type: Int, Unit: 1/16383, Range: [-214 + 1 to 214 - 1]
  • linear-acceleration – Type: Int Array, Length: 3
    • 0: x – Type: Int, Unit: 1 cm/s², Range: ?
    • 1: y – Type: Int, Unit: 1 cm/s², Range: ?
    • 2: z – Type: Int, Unit: 1 cm/s², Range: ?
  • gravity-vector – Type: Int Array, Length: 3
    • 0: x – Type: Int, Unit: 1 cm/s², Range: ?
    • 1: y – Type: Int, Unit: 1 cm/s², Range: ?
    • 2: z – Type: Int, Unit: 1 cm/s², Range: ?
  • temperature – Type: Int, Unit: 1 °C, Range: [-128 to 127]
  • calibration-status – Type: Int, Range: [0 to 255]

This callback is triggered periodically with the period that is set by set-all-data-callback-configuration. The parameters are as for get-all-data.

Internal Functions

Internal functions are used for maintenance tasks such as flashing a new firmware of changing the UID of a Bricklet. These task should be performed using Brick Viewer instead of using the internal functions directly.

tinkerforge call imu-v3-bricklet <uid> set-bootloader-mode <mode>
Parameters:
  • <mode> – Type: Int, Range: See symbols
Output:
  • status – Type: Int, Range: See symbols

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.

The following symbols are available for this function:

For <mode>:

  • bootloader-mode-bootloader = 0
  • bootloader-mode-firmware = 1
  • bootloader-mode-bootloader-wait-for-reboot = 2
  • bootloader-mode-firmware-wait-for-reboot = 3
  • bootloader-mode-firmware-wait-for-erase-and-reboot = 4

For status:

  • bootloader-status-ok = 0
  • bootloader-status-invalid-mode = 1
  • bootloader-status-no-change = 2
  • bootloader-status-entry-function-not-present = 3
  • bootloader-status-device-identifier-incorrect = 4
  • bootloader-status-crc-mismatch = 5
tinkerforge call imu-v3-bricklet <uid> get-bootloader-mode
Output:
  • mode – Type: Int, Range: See symbols

Returns the current bootloader mode, see set-bootloader-mode.

The following symbols are available for this function:

For mode:

  • bootloader-mode-bootloader = 0
  • bootloader-mode-firmware = 1
  • bootloader-mode-bootloader-wait-for-reboot = 2
  • bootloader-mode-firmware-wait-for-reboot = 3
  • bootloader-mode-firmware-wait-for-erase-and-reboot = 4
tinkerforge call imu-v3-bricklet <uid> set-write-firmware-pointer <pointer>
Parameters:
  • <pointer> – Type: Int, Unit: 1 B, Range: [0 to 232 - 1]
Output:
  • no output

Sets the firmware pointer for write-firmware. 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.

tinkerforge call imu-v3-bricklet <uid> write-firmware <data>
Parameters:
  • <data> – Type: Int Array, Length: 64, Range: [0 to 255]
Output:
  • status – Type: Int, Range: [0 to 255]

Writes 64 Bytes of firmware at the position as written by set-write-firmware-pointer 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.

tinkerforge call imu-v3-bricklet <uid> write-uid <uid>
Parameters:
  • <uid> – Type: Int, Range: [0 to 232 - 1]
Output:
  • no output

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.

tinkerforge call imu-v3-bricklet <uid> read-uid
Output:
  • uid – Type: Int, Range: [0 to 232 - 1]

Returns the current UID as an integer. Encode as Base58 to get the usual string version.