Author Topic: IMU Brick 2.0 get position  (Read 2651 times)


  • Newbie
  • *
  • Posts: 7
    • View Profile
IMU Brick 2.0 get position
« on: August 29, 2018, 11:36:36 »
Hello everybody,

I'm trying to implement a code (Python) to get position x y z from IMU Brick 2.0 accelerometer, in live mode.
In the first step, I implemented the rotate accelerometer by quaternion to remove the gravity and rotation of my sensor.
After i integrate directly to have velocity and position :
example :
Vx(k) = Vx(k-1)+Ax(k)*dt
X(k) = X(k-1) + Vx(k)*dt 

Nevertheless, into my accel. data I have an offset.

Somebody would have already implemented this type of code to remove the offset (drift) ? to get the position

I don't know if i must a kalman filter or other....

Thank you
« Last Edit: August 29, 2018, 12:00:54 by JPannetier »


  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: IMU Brick 2.0 get position
« Reply #1 on: September 02, 2018, 17:36:55 »
Hello JPannetier,

I wanted to do the same a while back and did some research and I want to help not wasting time on this. To sum things up: you can't get good position information over time by only using an IMU. This topic is called Dead reckoning ( and is way harder to get running as it seems to be at first sight.

A lot of people had this idea and ended up using something different. See here for reference:

The problem is noise and precision of measurement when using acceleration or velocity data over time for estimating a position. To get a grasp of the topic I can recommend watching this video (the starting position marks the explanation of why your double integration leads to a drift):

In fact VR-headsets use sensor fusion by combining their IMU data (gyroscope and accelerometer) with their optical IR-light-based marker positions (also called pose estimation). I can recommend a very good talk by Philipp Zabel about HMD tracking systems (german language but images and animations should give you some impressions) and some related videos on youtube:

So what you could do is to:

  • Add internal sensors which track the current position with markers, by scanning a known environment with markerless tracking algorithms or by using systems like GPS
  • Add external sensors which track the position and orientation of your system and use it to recalibrate your IMU data with at least more than 30 Hz
  • Use position sensors which will inevitably affect the shape and size of your system (

Hope this helps :)

« Last Edit: September 02, 2018, 17:40:37 by pwab »