-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difficult to activate on drops #17
Comments
This is true. I don't have a great idea on how to fix it. Right now, the app uses the TYPE_LINEAR_ACCELERATION sensor to get the device's acceleration. This is often implemented in software, using the TYPE_ACCELEROMETER sensor internally and then cancelling out 9.81 metres per second from whatever axis is upright. I'm not sure if it does this just by calculating the magnitude of the vector or by using trigonometry and the orientation of the device, but it does a pretty good job. I have a feeling this sensor doesn't report negative values when it's in free-fall, so it doesn't allow for the phone to determine whether it is in free-fall. And once the phone ends up on the surface, the values just go back to zero. There seem to be two ways to 'solve' this:
Thanks for the input; I had almost forgotten that dropping is an issue that needs to be resolved. |
If there's some way to get the vectors (x,y,z) of acceleration, and look at each individually, then it's just a matter of finding some calibration constant to relate the magnitudes. I'm unsure if this exists. By the way, the accelerometer reports net acceleration on the phone (I assume -- the other way makes no sense). In the case of an object at rest, it'd have a net acceleration of zero. It's only under an acceleration of magnitude g when it's in freefall. Cancellation of force vectors and all that jazz. |
It's possible to get all three vectors separately. The docs mention that, indeed, the accelerometer's data include the acceleration from Fg. I've verified this with the values that I actually get from the accelerometer. I'm using the LINEAR_ACCELERATION soft-sensor because it performs the cancellation of these values for me. Realistically, it makes more sense for PluckLock to use jerk, rather than acceleration, to make these determinations. Then I wouldn't need to cancel anything out. In the future, this is probably what I'll end up doing. |
I tested by dropping my phone (LG G2) onto a bed.
At 5g, it was oversensitive to hand movements and barely sensitive enough for drop triggering.
Decreasing or increasing the threshold doesn't allow both to function. From what I can tell, it's related to the accelerometer having different sensitivites to forces from different directions.
Can anyone corrobrate this? I don't believe it's device specific.
The text was updated successfully, but these errors were encountered: