Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Quaternion offset

$
0
0

@pandereto wrote:

Hi

I have an x-imu which gives me orientation in a quaternion, works great, but now i need to take in account the initial orientation.

Just like in iOs example

// get an offset
CMDeviceMotion *deviceMotion = motionManager.deviceMotion;
CMAttitude *attitude = deviceMotion.attitude;
referenceAttitude = [attitude copy];

process

CMAttitude *attitude = deviceMotion.attitude;
if (referenceAttitude != nil ) {
    [attitude multiplyByInverseOfAttitude:referenceAttitude];
}

// Attitude
//
CMQuaternion quat = attitude.quaternion;
attitudeQuat.set(quat.x, quat.y, quat.z, quat.w);

How can i do this with ofQuaternion?

Best
Natxo Pedreira Gonzalez

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles