# IMU Double Integration Python Code

**URL:** <https://discuss.bluerobotics.com/t/imu-double-integration-python-code/11295>\
**Category:** Sensors\
**Tags:** guide, pymavlink, positioning, underwater-gps\
**Created:** [January 5, 2022, 2:40pm UTC](https://discuss.bluerobotics.com/t/imu-double-integration-python-code/11295 "2022-01-05T14:40:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![moro](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@moro](https://discuss.bluerobotics.com/u/moro)\
**Post date:** [January 5, 2022, 2:40pm UTC](https://discuss.bluerobotics.com/t/imu-double-integration-python-code/11295/1 "2022-01-05T14:40:06Z")

</div>

Hey guys,

We are currently trying to automate the BlueROV2 to scan our university pool. We need underwater GPS to correct for the positioning. Although we know that double integrating the IMU may lead to highly inaccurate results, we want to try it initially.

Is there a Python code that is ready to use for this? I have been searching for days and am unable to find one.

Thanks!

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [January 6, 2022, 11:21pm UTC](https://discuss.bluerobotics.com/t/imu-double-integration-python-code/11295/2 "2022-01-06T23:21:25Z")

</div>

Hi @moro,

I’m not aware of existing available Python code for that, although it likely exists in various repositories.  
[This stackexchange response](https://robotics.stackexchange.com/a/16772) may be a useful reference for the process involved. I believe the [DataFlash `.bin` logs](https://www.ardusub.com/reference/data-logging.html#dataflash-logs) from on the Pixhawk will have a higher data rate than the `.tlog` files saved by QGroundControl, so may provide more accurate results.
