chokkarg / omnidroid

Automatically exported from code.google.com/p/omnidroid
Apache License 2.0
0 stars 0 forks source link

Possible bug in PhoneIsFallingMonitor #45

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Dmitriy,

This doesn't look right to me:

      // Only broadcasts if the Phone exceeded minimum acceleration.
      if (acceleration < MIN_ACCELERATION) {
          [snip]
      }

Seems like this is the opposite of what it should be (less-than instead of
greater-than), but in further consideration I would think maybe it should be:

      // Only broadcasts if the device is outside of accepted parameters
      if (MIN_ACCELERATION < acceleration > MAX_ACCELERATION) {
          [snip]
      }

If you're still working on the project, maybe you can take ownership of
this.  If you're moving on, let me know if you think this is right and I'll
make the change.

Thanks for all the hard work this summer!  I hope you'll continue to
develop the app with us.

--
Drew

Original issue reported on code.google.com by case.and...@gmail.com on 11 Aug 2009 at 10:46

GoogleCodeExporter commented 8 years ago
Andrew,

There is no bug. Please close the issue.
Because of the way accelerator sensor works, 9.8 is resting acceleration (phone 
rests on the table).
And 0 is freefall with absense of air resistance.
Unfortunately accelerometer is far from being precise so I've defined an 
approximate 
boundary for it.
Therefore MIN_ACCELERATION (as it is documented) is a minimum acceleration for 
not 
falling.
MAX_ACCELERATION is used to determine if phone is flying up. And is currently 
unused.

Please let me know if I can be of assistance.
I'm going to continue to work on the project. I actually have some ideas to 
drastically improve design.

- Dmitriy Ofenbakh.

Original comment by dvo...@gmail.com on 12 Aug 2009 at 3:53

GoogleCodeExporter commented 8 years ago

Original comment by case.and...@gmail.com on 12 Aug 2009 at 4:41