iPhone4 iOS5 is there a physics engine to convert CMDeviceMotion events into displacement? - ios5

I'm running a CMDeviceMotion processing queue on iPhone 4, which gives me user-induced acceleration, along with the rotation rates. I can filter this data myself.
What I'm trying to understand is how to convert these discrete samples of acceleration, device attitude and rotational rate into a 3 dimensional displacement. This is possible with classical mechanics for straight lines, but I"m thinking of more advanced calculations - for example curves. This can be handled with GPS, but I'm looking for a much better resolution - lets say within 10 feet. GPS under clear sky has an average accuracy of about 30 feet.
Is there some sort of a physics engine or physics processor that can take a set of device motion or acceleration/turn rate events and give me a distance of how far the phone is from the original location?
I know that there are various pedometer and bike GPS trackers for iPhone. Are they based on GPS or do they actually do the acceleration integration like I'm describing?

Unfortunately, the acceleration integration you are describing won't work in itself.
However, you may improve the accuracy by fusing with the GPS signal and/or make domain specific assumptions. For details, see the above link.

Related

iOS: Core Motion used to detect larger movements over distance?

I have a GPS app that I would like to detect if the user is standing still and not moving. Using Core Location works for this, but is sometimes not accurate because new updates move and gives the illusion of speed and motion.
So, I am wondering if in addition to that, I can also use Core Motion. Is this a good idea to detect motion such as someone walking, running, driving, etc, and know when they are no longer doing that motion? Or, is Core Motion only for small movements such as tilting the device or lifting it to your ear?
I wanted to tell others who visit this question what I've learned and what I think about this approach.
I have been doing some research of my own to know whether this is possible, and more importantly, even if it is what is the battery consumption and accuracy of the location change detected. For Android though, this question was asked quite sometime back. The answer provides links to this Google Tech Talk. At 23:20, the speaker talks about how difficult it is to achieve this and the accuracy you will achieve in the results.
Even though I have to come to realize the battery consumption from sensors on the iPhone is a little lesser than in most Android phones, I still think this is a costly affair in terms of accuracy and battery consumption.
you can use the GPS with the sensor readings to distinguish between walking, running, etc. if you combine the tilt angle frequency change and the GPS speed information (you need to do some work to get some of this info of course, but thats the way to do it).
You are talking about 4 different measurements from 4 different sensors (technically more than 4 but..) -
Latitude & Longitude - from CoreLocation. It uses a mix of GPS + cell tower triangulation.
Accelerometer - the current orientation of the device in 3D space.
Gyroscope - orientation of the device on its own axis.
Magnetometer - which tells you which direction a device is point w.r.t south,north,east,west
Of all these I think only Latitude & Longitude are of use to you. Basically what you do is to make the sensitivity (i.e. the update rate from the sensor) a bit more relaxed. With some tweaking around with this you should be able to tell with good accuracy if a person is standing or moving.

Detecting the user's spinning motion

I have been experimenting with the Core Motion framework to detect a user spinning around, say on a merry-go-round, holding an iphone in his hand.
There are ways to detect the device motion around its own axes, but what is a good way to detect the iPhone spinning in circles?
Thanks
You can use the gyroscope. Take a look here: Gyroscope example
You have to remind that it is only availble on iPhone4 and iPhone4S.
There is one degenerate case where you can run into trouble, only magnetometer (compass) can help in that particular case.
If you put the device (a) on the desk in stationary position then (b) on a perfectly horizontal turntable rotating slowly you will get the same qualitative sensor readings. Both the gyro and the accelerometer readings are constant in the two cases, although the readings quantitatively differ. The sad part is: gyro bias error can render case (a) to look like (b) and vice-versa. In this particular case you need a compass to cancel the gyro drift. Case (a) is typical for a phone.
Apart from this degenerate case, gyroscopes and accelerometers with sensor fusion are sufficient to track arbitrary rotations of the device.

Detecting the timeframe of accelerometer detected motion

How does one detect the amount of time the device has detected motion on the accelerometer?
If I wanted to detect continuous motion detection on the device such as 10 seconds of motion. How is this done? When I use the accelerometer delegate method, it keeps being called and is difficult to handle the time calculation.
As commented, accelerometer delivers acceleration values and not speed - so you will have to integrate over incoming values. Bu bevare of:
- earth gravity is always there
- there is a lot of noise (accelerometer chips built in phones are really cheap, crappy and
sell for 10$ a bucket)

accelerometers uses- smartphone

It is known that the raw accelerometer data is combination of both linear acceleration and gravity. In order to isolate them w need to apply appropriate filters. I would like to know the real time applications where we would need only "gravity" or only "linear acceleration".
Gravity is used when you are trying to figure out the orientation of the phone. In other words, when you are trying to figure out how the user holds the phone. It is good for tilt games, for example you use the phone to drive a car, etc.
Linear acceleration is used when you are trying to figure out how the phone is shaken. It good for shaking games.
I highly recommend this video. In particular, between 4:15-6:10 and staring from 33:30 you see demos.

6DOF using accelerometer and gyroscope

Has any one developed 6DOF pose estimation using only the iPhone sensors, not video? Drift from the accelerometer and gyroscope are understood.
The gyroscope provides fairly reliable relative orientation rates. I've been able to develop with the gyroscope data.
However, I'm having more problems deriving translation from the accelerometer. Double integration of the acceleration leads to useless position data very quickly (less than half a second).
I have attempted to remove the bias with a calibration step, but the position is still poor. What's worse, is the bias isn't constant. It changes over time, and the noise drowse the signal.
I'm interested if anyone has been able to develop a 6DOF with only the accelerometer and gyroscope that works reliably for 5-10 seconds with little drift in both translation and orientation.
The gyro yaw using DeviceMotion has a drift when you first start updating, try not to take those samples and everyone will be happy.
I made a post about this: Get orientation device in the iPhone for Opengl Es, I having the same issue, I´m just trying to make a filter but it´s not working good, there is a book about these http://www.amazon.com/iOS-Sensor-Programming-Augmented-Location/dp/1449382657, but I didn´t read this book.