1

We have an embedded device mounted in a vehicle. It has accelerometer, gyrosopce and GPS sensors on board. The goal is to distinguish when vehicle is moving forward and backward (in reverse gear). Sensor's axis are aligned with vehicle's axis. Here's our observations:

  • It's not enough to check direction of acceleration, because going backwards and braking while moving forward would show results in the same direction.
  • We could say that if GPS speed decreased 70 -> 60 km/h it was a braking event. But it becomes tricky when speed is < 20 km/h. Decrease 20 -> 10 km/h is possible when going both directions.
  • We can't rely on GPS angle at low speeds.

How could we approach this problem? Any ideas, articles or researches would be helpful.

Mohamed Taher Alrefaie
  • 15,698
  • 9
  • 48
  • 66
Igoris
  • 11
  • 4

1 Answers1

3

You are looking for Attitude and heading reference system implementation. Here's an open source code library. It works by fusing the two data sources (IMU and GPS) to determine the location and the heading.

AHRS provides you with roll, pitch and yaw which are the angles around X, Y and Z axises of the IMU device.

There are different algorithms to do that. Examples of AHRS algorithms are Madgwick and Mahony algorithms. They will provide you with quaternion and Eurler angles which can easily help you identify the orientation of the vehicle at any time.

This is a cool video of AHRS algo running in real time.

Similar question is here.

EDIT

Without Mag data, you won't get high accuracy and your drift will increase over time.

Still, you can perform AHRS on 6DoF (Acc XYZ and Gyr XYZ) using Madgwick algorithm. You can find an implementation here. If you want to dive into the theory of things, have a look at Madgwick's internal report.

Kalman Filter could be an option to merge your IMU 6DoF with GPS data which could dramatically reduce the drift over time. But that requires a good understanding of Kalman Filters and probably custom implementation.

Mohamed Taher Alrefaie
  • 15,698
  • 9
  • 48
  • 66
  • I realize that, but as I said we only have acc + gyro. With no magnetometer we can't compensate yaw drift which is the root of our issue. I was wondering if there's any way to get around it – Igoris Jan 24 '18 at 07:12