1

I've been learning Android for a while now and have decided on making an attempt to create a simple app project. The project is a simple game where you would hold the phone in your hand and make a throwing motion, after which the app would calculate the distance thrown (and possibly trajectory) based on the force of the throwing motion and how high the phone was held.

Now, what I'm looking for is mostly a bit of advice on where to start as I really don't yet have any experience on using the built in sensors (part of the reason why I chose this project). Specifically which sensors to you think I should use (I'm assuming a combination of the Accelerometer and Gravity sensors?) and how I should use them to calculate the distance thrown.

Could anyone just point me in the right direction? How would you have implemented it?

yzfr1
  • 202
  • 4
  • 12
  • not really an answer, but just a shot of it: It's a 2 part project. 1) programming - I agree, accelerometer and gravity (magnetometer, right?). Start back on the docs to see what the numbers they supply actually mean. I read not long ago people putting some open source stuff that just logs and shows the sensors data, google it, check the code. 2) physics - wikipedia is great for basic physics like this. Also a physics specific forum will give you a great help on how to crunch those numbers to physical values. – Budius Aug 15 '12 at 13:16
  • A challenge would be to determine at what point the user intended to let go of the object to be thrown (assuming they're not supposed to actually throw the device itself). – martijno Aug 15 '12 at 13:17
  • Bedius: thanks for the tips. The magnetometer just gives compass readings though, right? Nothing to do with force, distance, etc? martijno: well, I guess that part should be as easy as treat it as thrown the moment the 'force' decreases, shouldn't it? I'm just guessing here, but it sounds believable to me that the force would be at its highest the moment you 'let go'.. – yzfr1 Aug 15 '12 at 13:26
  • If I were to do this, I'd do lots of recorded tests that are as repeatable as possible to get a feel for how the update frequency of the sensors affect accuracy and with which frequency I can do something useful with the sensor values. Perhaps dangle my device from a stick with a string and let it fall against a thick pillow or something. – HonkyTonk Aug 15 '12 at 14:19
  • Now, is this doable in practise, in a relatively easy way? I just read the responses on this [question](http://stackoverflow.com/questions/6647314/need-to-find-distance-using-gyroaccelerometer) which pointed to 23:20 in this [youtube video](http://www.youtube.com/watch?v=C7JQ7Rpwn2k) and the way I understand it the measurements get way wrong by just the slightest anomaly? I have relatively limited experience with android and very little knowledge in physics.. Would you think this is something to pursue or should I just make something else...? – yzfr1 Aug 15 '12 at 15:03

1 Answers1

1

As far as I understand, the task is in practise near impossible to get right, in part based on the top answer to this question which points out this video from Google Tech Talk, specifically at 23:20, explaining the difficulty with this kind of task.

The physics is way beyond my understanding, so I can't offer an explanation as to specifically why, but I'm just gonna accept that as my answer.

Community
  • 1
  • 1
yzfr1
  • 202
  • 4
  • 12