01-09-2020 02:04
01-09-2020 02:04
Hi,
Is there an easy way to remove the gravity readings from the accelerometer?
Thanks,
01-09-2020 12:04
01-09-2020 12:04
Perhaps not a trivially easy way...
Convert the acceleration readings to a vector (magnitude and angles). Subtract g from the magnitude of the vector. Convert the modified vector back to (x,y,z).
I find that the inclusion of gravity is helpful because it lets me use accelerometer readings as de facto orientation readings, when there is no separate orientation sensor.
01-10-2020 01:01
01-10-2020 01:01
01-15-2020 08:41 - edited 01-15-2020 08:42
01-15-2020 08:41 - edited 01-15-2020 08:42
for velocity i would go with a vector as said :
convert xyz readings to a distance using this formula :
var movement_total = Math.round((Math.round(10000 * Math.sqrt(accelerometer.x * accelerometer.x + accelerometer.y * accelerometer.y + accelerometer.z * accelerometer.z)) / 100))
then do this at a time T1 then at a time T2, substract the first measure to the second will automatically remove the gravity from the equation.
edit : physicists would correct, it's not a distance since it's acceleration that is measured, but it will work.
01-16-2020 02:20
01-16-2020 02:20
Thanks,
I don't think I am following though. The equation seems to be calculating the actual acceleration. What do the 10000 and 100 represent?
If acceleration is a constant 5m/s/s(accelerometer readings of 3,4,0). Are you saying the calculation measured ove1 second should be
5*1 - 5*0 = 5.
So the velocity is 5m/s?
01-16-2020 02:30
01-16-2020 02:30
so the x10000 / 100 is only there to round to 2 digits after 0 (with math.round function), not useful in your case.
For your case, let's say that acceleration is 5m/s^2 as you said, basically after one second, your device would have move 5 meters from the starting point so the calculation is right (5m/s). The difficult part is to get to distances when acceleration is null, which depends on initial velocity and direction.
For accounting for direction, I would calculate the delta of each coordinate acceleration, so a deceleration would be taken into account.
01-16-2020 02:41
01-16-2020 02:41
The issue I have there then is that Fitbit includes gravity. So instead of acceleration readings of 3,4,0 the reading would be 3,4,9.8 which works out at an acceleration of 11m/s/s and a velocity of 11m/s according to the above.
01-16-2020 05:41
01-16-2020 05:41
yes true- so the only solution is to get orientation, in order to know where the g value should be corrected at t0 and t1. Then
From what I know, the Ionic is the only one with orientation/gyroscope