objective c - Transforming Pitch and Roll values in iOS -
i have been trying compare pitch , roll pattern (2 second recording) readings.
what have done record pitch , roll values 10 seconds. in 10 seconds similar motion applied device.
when plot these on graph, values same.
this happens when providing motion device same orientation/position. example, device lying down on table , motion provided device. readings same.
but if device rotate 180 deg. ccw, readings inverted.
is there way can achieve same reading every position? via applying transformation formula? have done acceleration values using pitch roll , yaw. but, don't know how achieve pitch , roll itself.
basically, want achieve pitch , roll values should independent of yaw.
here plot pitch values.. readings same expect 2 starting 1.5 in graph. these 2 times when device rotated 180 deg. ccw
update:
i tried store cmattitude in nsuserdefaults , applied multiplybyinverseofattitude. still graph plot inverse.
cmattitude *currentatt = motion.attitude;
if (firstattitude)//firstattitude stored cmattitude { [currentatt multiplybyinverseofattitude:firstattitude]; } cmquaternion quat = currentatt.quaternion;
Comments
Post a Comment