read-orientation

wayland/bno055-aos/read-orientation

Reads orientation in Euler angles (heading/yaw, pitch and roll).
read-orientation
@/read-orientation
Reads orientation in Euler angles (heading/yaw, pitch and roll).
DEV@/bno055-device
A bno055 device.
UPDpulse
Update. Triggers new read.
read-orientation
DEV
UPD
X
Y
Z
DONE
DONEpulse
Pulses on completion of read.
Znumber
Orientation in Z-axis (pitch) in degrees. +180° to -180° (turning clockwise decreases values).
Ynumber
Orientation in Y-axis (roll) in degrees. -90° to +90° (increasing with increasing inclination).
Xnumber
Orientation in X-axis (heading/yaw) in degrees. 0° to 360° (turning clockwise increases values).
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::Vector<3> euler = aos->getVector(Adafruit_BNO055::VECTOR_EULER);
    emitValue<output_X>(ctx,euler.x());
    emitValue<output_Y>(ctx,euler.y());
    emitValue<output_Z>(ctx,euler.z());
    emitValue<output_DONE>(ctx, 1);
}