use of org.firstinspires.ftc.robotcore.external.navigation.Quaternion in project robotcode by OutoftheBoxFTC.
the class BNO055IMUImpl method getQuaternionOrientation.
public synchronized Quaternion getQuaternionOrientation() {
// Ensure we can see the registers we need
deviceClient.ensureReadWindow(new I2cDeviceSynch.ReadWindow(Register.QUA_DATA_W_LSB.bVal, 8, readMode), upperWindow);
// Section 3.6.5.5 of BNO055 specification
TimestampedData ts = deviceClient.readTimeStamped(Register.QUA_DATA_W_LSB.bVal, 8);
VectorData vector = new VectorData(ts, (1 << 14));
return new Quaternion(vector.next(), vector.next(), vector.next(), vector.next(), vector.data.nanoTime);
}
Aggregations