Answer the question
In order to leave comments, you need to log in
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
Does a person, in addition to the barbell, also hold an iPhone? Or an iPhone in your pocket? :)
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 CMAttitude
has a property rotationMatrix
that 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;
motionManager
must be initialized and activated. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question