Skip to content

Task 03: Recording IMU Data and FFT

Michael Bleier edited this page Jul 10, 2024 · 2 revisions

The sensor data of the Inertial Measurement Unit (IMU) is provided by the message imu_raw with a sample rate of 100 Hz. The sensor is a Bosch BNO055 Inertial Measurement Unit:
https://www.bosch-sensortec.com/products/smart-sensor-systems/bno055/

Each JSON message includes a single sensor reading:

{"msg":"imu_raw","stamp":0,"seq":0,"ax":0.449999988,"ay":0.319999993,"az":9.770000458,"wx":0.25,"wy":-0.0625,"wz":0.0625,"mx":-18.0625,"my":-2.1875,"mz":-35.25}
  • stamp: Time stamp of the sensor recording (UNIX time stamp in seconds)
  • seq: Sequence number
  • ax/ay/az: Vector of the linear acceleration $\left( a_x, a_y, a_z \right)^T$ in $\frac{\mathrm{m}}{s^2}$
  • wx/wy/wz: Vector of the angular velocity $\left( \omega_x, \omega_y, \omega_z \right)^T$ in $\frac{\mathrm{deg}}{s}$
  • mx/my/mz: Vector of the magnetic flux density in $\mu T$
  1. Run the IMU display tool an familarilize yourself with the IMU measurments. Move/Rotate the IMU around all axis.
python3 showIMU.py
  1. How are the axes of the IMU aligned?

  2. Record IMU data to a file. You can use the following tool:

python3 recordMessages.py -m imu_raw -f imu_data.json

Hint: You can use this tool without the file option to print any message!

python3 recordMessages.py -m <message_type>
  1. Plot the data of the recorded file:
python3 plotIMU.py imu_data.json
  1. Compute the Fast Fourier Transform (FFT) of the acceleration:
python3 fftIMU.py imu_data.json

Note: This Python script computes the FFT of the norm of the acceleration vector.

  1. Redo the experiment and record an IMU log while moving the IMU up an down with a constant frequency, e.g., approximately 2 Hz.

  2. Interpret the FFT plot for this data log. What do the peaks in the FFT represent?

  3. Why is the plot symmetric with respect to the central frequency of 50 Hz?

  4. What is this frequency called?

  5. Assume the signal is bandlimited with no frequencies higher than $B$ hertz. Why do we need to sample signals with a sample rate of $f_s &gt; 2B$? What happens if a signal is sampled with exactly twice the bandlimit $f_s = 2B$?

Clone this wiki locally