Thursday, 15 January 2015

ios - Determine total Delta rotation of iPhone -



ios - Determine total Delta rotation of iPhone -

i've been trying break understanding of core motion, , feels i'm failing.

i'm not engineer, nor mathematician, rotational matrices , euler angles, etc. (as of yet) hard concept me wrap head around.

i'm trying write app can calculate angle of rotation iphone. basically, i'm trying measure range of motion for, say, someone's elbow.

i've gotten few different test projects working, , seems right way go using cmattitude instances core motion framework.

i've gotten far (sort of) understand taking reference frame when begin asking motion data, , using multiplebyinverseofattitude: determine net alter in mental attitude (did state correctly?).

what don't understand do calculated cmattitude. assuming user has iphone in hand, begins measurement , flexes arm, elbow collapses extended (180º) collapsed (say, 45º). depending on how holding device, seems very, different calculated attitudes.

in scenario, user holds iphone in hand palm-up. then, without moving arm (the phone stays "in place"), rotate hand palm-down. clearly, that's 180º rotation.

now, in both of above scenarios, think figure out how measurement if can guarantee how user holding device start. elbow, have them hold device "top / screen left", mean yaw measurement give me reply seek.

for wrist rotation, if user starts phone "screen / top right", isolate pitch measurement.

what i'd find more generic way find mutual angle of rotation between 2 attitudes (or, single, calculated, "delta" attitude).

am thinking of correctly?

if you're going respond advanced math, please give me resources or simple explanations. don't mind reading on topic, of answers i've seen related on other questions dense don't know start them.

edit

i've been reading on more on past few hours, , have idea, wanted run more experience on matter. i've been running on-device experiments , experiencing gimbal lock @ border of pitch's range , oddities @ border of roll's range.

so, can tell, cmattitude instance represents iphone's position in 3-dimensional space. can asked represent in euler angles (pitch, roll, yaw), or quaternions (x, y, z, w).

if so, purposes, calculate angle between 2 quaternions' vectors (x1, y1, z1) vs. (x2, y2, z3) , compare difference between w1 , w2? if angle of difference between vectors sufficiently small, wouldn't difference between "w" rotations seek? create sense, or have missed essence of quaternions?

ios rotation core-motion

No comments:

Post a Comment