Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to create a new CMAttitude Reference Frame to make the gravity be on the Y axis
    primarykey
    data
    text
    <p>I want to be able to change the Device Motion Manager Reference frame (for the gyro) so that I have my gravity vector on the Y axis.</p> <p>Usually when you start Device Motion Manager Updates you will only have the z axis of the phone aligned with gravity.</p> <p>You can change this to use the magnetometer to make the x axis be aligned with either the magnetic or true north pole. With this I have my X axis Pointing north and my Z axis pointing down.</p> <p>What I want to do is have my Y axis (negative) pointing down (so that its aligned with the gravity) and also have my X axis pointing the true magnetic pole.</p> <p>The result I want is such that when have my phone standing still in a vertical (portrait) orientation the right of the phone will be aligned to the north pole and all my readings (roll, pitch, yaw) will read as 0. Then with this if i rotate my phone on the X axis the pitch will change, and if I rotate around the Y axis the yaw will change.</p> <p>So far I know i can set my own reference frame if I multiply by the inverse of the attitude a previously stored attitude, (like i could set my phone in this orientation MANUALLY, save that attitude and simply keep multiplying the new attitude by the inverse of this stored one and all my readings will be exactly like the ones i want).</p> <p>But setting it manually is not an option, so how do i make this programatically?</p> <p>I don't think there is a function to create my own attitude reference frame, or if at least there was a function to multiply the attitude by a rotation matrix then i could probably solve this. (because i would just multiply all the attitude by a 90 degrees change in the pitch).</p> <p>I hope I explained myself clearly,</p> <p>I will appreciate any suggestions. thanks</p> <p>PD: These are the iPhone Orientation coordinates:</p> <p><img src="https://i.stack.imgur.com/WRzv1.jpg" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload