I am a little confused about iPhone's accelerometer and gyro data. I had worked with SDK at iOS 3.x times and as far as I remember it only gives rotation around axes. But with iPhone 4 I saw that it has a gyroscope; which is used for rotation again. If gyro is a new feature, what info does accelerometer give? I want to catch displacement of iPhone/iPod (without rotation) is there a way to catch this with any of the features?
The 3D accelerometer in the iPhone 3G produces results that contain a mix of acceleration and orientation with respect to gravity. It doesn't really give a great answer for either acceleration or orientation as long as the phone is in changing motion. The Apple provided filtering algorithms only partially separate out the data, so each component can be slightly or greatly wrong. Rotation is then estimated from any changes in the estimated direction of gravity (the down vector with respect to the device). And estimates can be wrong.
The Core Motion API in iOS 4.x, combined with the 3 axis gyros in an iPhone 4, uses actual rotation measurements to try to subtract out rotation from the potentially mixed-up 3D accelerometer data, usually producing a much better estimates of orientation, rotation, and acceleration.
Displacement is much harder to measure, as the double integral of acceleration sums so much noise into the result, that the result will quickly diverge to be complete out of the park.