read-orientation-quaternion

wayland/bno055-aos/read-orientation-quaternion

Reads orientation in quaternions.
read-orientation-quaternion
@/read-orientation-quaternion
Reads orientation in quaternions.
DEV@/bno055-device
A bno055 device.
UPDpulse
Update. Triggers new read.
read-orientation-quaternion
W
X
Y
Z
DONE
DEV
UPD
DONEpulse
Pulses on completion of read.
Znumber
Ynumber
Xnumber
Wnumber
To use the node in your project you should have the wayland/bno055-aos library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    // The node responds only if there is an input pulse
    if (!isInputDirty<input_UPD>(ctx))
        return;

    // Get a pointer to the `Adafruit_BNO055` class instance
    auto aos = getValue<input_DEV>(ctx);

    imu::Quaternion quaternion = aos->getQuat();
    emitValue<output_W>(ctx,quaternion.w());
    emitValue<output_X>(ctx,quaternion.x());
    emitValue<output_Y>(ctx,quaternion.y());
    emitValue<output_Z>(ctx,quaternion.z());
    emitValue<output_DONE>(ctx, 1);
}