Calculating location using onboard accel/gyro

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
summerij
 
Posts: 27
Joined: Mon Jul 13, 2020 1:38 pm

Calculating location using onboard accel/gyro

Post by summerij »

I was not certain which forum to place this but I have a CLUE. Has anyone worked a project where they used the accel/gyro to determine location? I want to use the CLUE to determine where I am after driving around. I will start small by driving around a parking lot where I can use the lines as a makeshift grid. Just want to know if anyone has info on getting started. Thanks.

User avatar
adafruit_support_bill
 
Posts: 88142
Joined: Sat Feb 07, 2009 10:11 am

Re: Calculating location using onboard accel/gyro

Post by adafruit_support_bill »

Assuming that your CLUE is mounted horizontally on the vehicle, you can calculate relative changes in orientation by integrating the instantaneous rate of rotation around the Z axis as reported by your Gyro.

And assuming that the X axis of your Clue is aligned with the forward axis of your vehicle, you can calculate speed by integrating the instantaneous acceleration along the X axis.

Finally, you can calculate location by integrating the combined speed and direction over time.

At least that is how it would work in theory. All of the above also assumes that the measurements have infinite precision and zero error.

In practice, using low-cost accelerometers and gyros, the incremental noise and quantization errors will accumulate due to the double integration. So your location estimates will begin to drift.

Inertial sensor data is usually combined with absolute sensor data such as GPS to produce higher resolution location data than is possible with GPS alone.

Locked
Please be positive and constructive with your questions and comments.

Return to “CLUE Board”