1

I get a list of acceleration and gyroscope data from the myo armband. The acceleration data is given like [[-0.11474609375, -0.13037109375, 0.9873046875], [-0.111328125, -0.12890625, 0.9892578125], [-0.11376953125, -0.12255859375, 0.98828125]...] where the values represent each the x,y and z axis values. I know to get the velocity, you have to integrate it once and for the location you have to double integrate it.

The problems I encounter are:

  • In some questions/articles/answers it's stated you need the initial velocity to correctly calculate it. But how do i get it from the accelerometer (and/or gyroscope) data?
  • For the quad function from scipy a function is required to integrate the data. How do i find out which function is correct? Can i just take f(x) where x is the current value and iterate over all values?
  • The same question is for dblquad, just that it takes multiple values.

The time period for those collected data is relatively short (around 5-7 seconds), so i don't think that the error drift will sum up much in this time.

Background: Those data is needed as an feature for ML algos with detecting handwritten letters. So velocity might vary due to the point since each person writes with a different tempo, but an average tempo could be used.

Some question already asked like this refer to real positioning, which isn't my goal. Also would this be enough aka just summing up without using the integration at all?

Lukas S
  • 315
  • 1
  • 3
  • 15
  • Don't forget that accels read gravity. You need to subtract that off as a constant bias before integrating: you don't want to integrate the DC component (unless you're in freefall) – Mad Physicist Aug 28 '21 at 17:12

2 Answers2

2

They are correct you cannot determine the velocity from just the acceleration. Remember that accelaration is the rate at which the velocity changes... so for instance if you had an object who went from 0 m/s to 10 m/s in 1s its acceleration would be calculated by applying the following formula a =(vf-vi)/t which would result in (10-0)/1 =10 m/s^2 and if on the ohter hand you got an object who went form 100m/s to 110 m/s you would still get the same acceleration.

To know the velocity you would neet to know the position of the object, remember that velocity is the rate at which an object changes position from a certain reference-fram, dji's drones fro example use GPS coordinates to estimate its velocity relative to ground.

Jóskua
  • 76
  • 3
  • Thats what i thought ... But why is it then still possible to calculate velocity and location from acceleration? If integrated, thats the area under the curve ... but how does the area relate to to the data? – Lukas S Aug 23 '21 at 17:20
  • That is because all those graphs come fom the position graph... let's say you are tracking the movement of an object and you get its position x relative to the time t and describe it with a formula x(t), when you get the derivative you get the rate at which x changes with respect of t which is what we call the velocity or x'(t) or dx/dt, when you once more derivate you get the rate at which velocity changes x''(t) or dx^2/dt and thats the acceleration. The inverse process is to integrate... but they all come from the position function. – Jóskua Aug 23 '21 at 17:37
  • Thank you for your great explanations! I got another question: The armband has also a quaternion sensor, which gives the orientation on the x,y,z and w axis. If i know the inertial orientation, is it possible to track the movements via the orientation, gyroscope and acceleration relatively? Like plotting the movements on a 2d plane. – Lukas S Aug 24 '21 at 17:09
  • If you have a pose quaternion, you can make some sane assumptions about the velocity (set average to zero or so). That quaternion will drift around quite a bit though. – Mad Physicist Aug 28 '21 at 17:15
  • Now if you have timestamped pixels, on the other hand, you're in business – Mad Physicist Aug 28 '21 at 17:16
0

Hello Luka answering to your question the answer is: yes it is posible if you add a gyro into to mix to estimate the position hence the velocity but it is hard and not too reliable (depnding on the accuracy and precision of your sensors).

What you are proposing is an inertial navigation system, which works on the principle of detecting the subtle changes in acceleration with respect to a given inertial-frame, in this case the planet Earth which rotates at a constant speed. For more in depth info I found this article hope this helps!

Jóskua
  • 76
  • 3
  • Thank you! But i still don't quite understand the integration part (site 6 of the paper). It states to integrate (twice), but no where i can find which function is used to integrate. Is it just f(x) or something special? How come it's never stated? – Lukas S Aug 30 '21 at 09:52