Inertial Measurement Unit (IMU)
The VPU includes a built-in Inertial Measurement Unit (IMU) which is always mapped to the port port 6
.
The IMU measures the rotation rates - gyroscope [rad/sec]
and acceleration - accelerometer [m/sec²]
in three-dimensional space.
The IMU is IIM-42652, and the full datasheet can be found on the official TDK website.
Users can access the IMU data in firmware versions 1.4.30 and higher.
Configuration
A few of the IMU parameters can be configured in the JSON configuration:
Parameter |
Description |
---|---|
|
Configure the IMU state. |
|
Only one mode is available: |
|
The |
The default mode, imu_1_khz
, configures the IMU with the following settings, which cannot be edited by the user:
The output rate is
1 KHz
for both the gyroscope and acceleration.The full-scale range is set to ± 4 g for accelerometer and to ± 500 degrees per second for gyroscope.
For both accelerometer and gyroscope, the low-noise mode is enabled.
The timestamp resolution is set to 16 µs.
Output
Each frame received from the IMU
contains the following output.
Description |
Type |
---|---|
The current version of IMU |
|
The list of IMU samples. The number of elements in list depends on |
|
The IMU sample data |
|
Number of samples received |
|
Extrinsic calibration parameters IMU with respect to |
|
Extrinsic calibration parameters IMU with respect to |
|
Receive timestamp |
|
The IMU output is unfiltered.
Additionally, the IMU data is not impacted by the extrinsic calibration set for port6
. Any transformation to a custom coordinate system has to be performed by the user.
IMUSample
Description |
Type |
---|---|
The hardware timestamp, as reported by the IMU |
|
Acquisition timestamp: hardware timestamps scaled to OVP time. |
|
IMU temperature |
|
Linear acceleration along X-Axis (m/sec²) |
|
Linear acceleration along Y-Axis (m/sec²) |
|
Linear acceleration along Z-Axis (m/sec²) |
|
Angular velocity along X-Axis (rad/sec) |
|
Angular velocity along Y-Axis (rad/sec) |
|
Angular velocity along Z-Axis (rad/sec) |
|
ExtrinsicCalibrationStructure
Description |
Type |
---|---|
Translation parameter along X-Axis(m) |
|
Translation parameter along Y-Axis(m) |
|
Translation parameter along Z-Axis(m) |
|
Rotation parameter along X-Axis (m) |
|
Rotation parameter along Y-Axis (m) |
|
Rotation parameter along Z-Axis (m) |
|
Example
Accessing the IMU data is possible with the ifm3d API version 1.5.3 and above. As of ifm3d API 1.5.3, a custom deserializer has to be implemented and only a Python example is available.
Please find the Python example code that accesses and prints the IMU data at ifm3d-examples
The output looks like:
$ python3 imu_data.py
IMU version: 1
Number of Samples: 51
First sample:
Hardware timestamp: 19591
Acquisition timestamp: 1651191293281612492
Temperature: 32.729469299316406
Acceleration:
x: -0.07661445438861847
y: -0.17717093229293823
z: -9.770736694335938
Gyroscope:
x: 0.008788431994616985
y: -0.006391586735844612
z: -0.001065264455974102
Extrinsic IMU to User:
rot_x: 0.0
rot_y: 3.1415927410125732
rot_z: 3.1415927410125732
trans_x: 0.05280037596821785
trans_y: 0.01630011759698391
trans_z: 0.020900148898363113
Extrinsic IMU to VPU:
rot_x: 0.0
rot_y: 3.1415927410125732
rot_z: 3.1415927410125732
trans_x: 0.052799999713897705
trans_y: 0.016300000250339508
trans_z: 0.020899999886751175
Receive Timestamp: 1651191293330924608