SoonerRobotics / robomagellan-2019

Sooner Competitive Robotics code base for the 2019 Robogames RoboMagellan competition
http://ou.edu/scr/
4 stars 0 forks source link

Get velocity from accelerometer data #19

Closed jkleiber closed 5 years ago

jkleiber commented 5 years ago

Estimate the velocity of the robot using the accelerometer data obtained from the IMU. You can find this by running the following equation in a timed loop:

v = vi + 1/2 (lastA + curA) deltaT deltaT: the time between each acceleration measurement lastA: last acceleration measurement curA: current acceleration measurement vi: last velocity. If first time running the loop, this is 0 v: the robot velocity

Add this to the IMU class

jkleiber commented 5 years ago

This is ready for testing now. I added the functionality during the last meeting

jkleiber commented 5 years ago

The IMU velocity integrates with no bound. This may be a sensor error, or we need to filter out data to get a more accurate reading (or both)

jkleiber commented 5 years ago

In the future, we will use the encoders to get speed most likely