M
M
Maxim2016-01-26 19:27:01
iOS
Maxim, 2016-01-26 19:27:01

Gyroscope in iOS?

Good people, help someone with what they can
. How can I learn to track the movements of a person who presses a barbell in the gym using a gyroscope in an iPhone?
The gyroscope tracks movements in 3 planes.
The bench press is 1 plane. That is, it is necessary that the app in the iPhone somehow cut off 2 planes and recorded the movement in only one.
For calibration, it is necessary to somehow derive the average value of movement in space. Let 5-10 people shake and, based on these data, derive the average + - tolerances for the error in the length of the hands of people.
Tell me how to think

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
IgorKamenev, 2016-01-27
@IgorKamenev

Does a person, in addition to the barbell, also hold an iPhone? Or an iPhone in your pocket? :)

V
Vyacheslav Beltyukov, 2016-01-27
@maestrro712

Core Motion allows you to take the following information: acceleration, direction of gravity, position of the phone in space, barometric altitude, magnetic field.
It is necessary to take the position of the phone in space. An instance of the class CMAttitudehas a property rotationMatrixthat allows you to convert coordinates from the CS associated with the phone to the CS associated with the Earth. With it, you can determine the acceleration strictly along the vertical axis:

CMRotationMatrix *attitude = motionManager.deviceMotion.attitude.rotationMatrix;
CMAcceleration *acceleration = motionManager.accelerometerData.acceleration;
double ay = attitude.m21*acceleration.x + attitude.m22*acceleration.y + attitude.m23*acceleration.z;

Of course, the object motionManagermust be initialized and activated.
Read more in reference on Core Motion

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question