Taring quaternion attitude
Hello everyone, I have a question concerning the base orientation (default) of the sensors. I'm interested in using the sensors in pairs, to find differences in orientation of two sensor mounting positions.
My question is whether or not the sensor reference orientation can be changed or is fixed, with reference output being (W:1,X:0,Y:0,Z:0). When aligning the sensors in the same physical orientation they do not output exactly the same attitude estimation and it benefits me greatly to be able to adjust this "tare" or reference position on the sensor so that they all have the same reference.
This discussion has been closed.
Comments
self.getLeftLowerSensor().sensorFusion!.mode = MBLSensorFusionMode(rawValue: 2)!;
Then I start listening for the quaternion events for each one like this:
self.getLeftLowerSensor().sensorFusion!.quaternion.startNotificationsAsync { (data, error) in
if let data = data {
quaternionSync(1,data,error);
}
}
And when I run this, the two nodes are sitting in the same orientation on the desk. These are the readings of each sensor:
let n1 = (r.w*q.x + r.x*q.w - r.y*q.z + r.z*q.y);
let n2 = (r.w*q.y + r.x*q.z + r.y*q.w - r.z*q.x);
let n3 = (r.w*q.z - r.x*q.y + r.y*q.x + r.z*q.w);
return Quaternion(w:n0, x:n1, y:n2, z:n3);
}
self.x = -self.x;
self.y = -self.y;
self.z = -self.z;
return self;
}