read-angular-velocity

wayland/bno055-aos/read-angular-velocity

Reads angular velocity in each of the three axes.
read-angular-velocity
@/read-angular-velocity
Reads angular velocity in each of the three axes.
DEV@/bno055-device
UPDpulse
read-angular-velocity
X
Y
Z
DONE
DEV
UPD
DONEpulse
Pulses on completion of read.
Znumber
Angular velocity in Z-axis (degrees per second).
Ynumber
Angular velocity in Y-axis (degrees per second).
Xnumber
Angular velocity in X-axis (degrees per second).
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> gyroscope = aos->getVector(Adafruit_BNO055::VECTOR_GYROSCOPE);
    emitValue<output_X>(ctx,gyroscope.x());
    emitValue<output_Y>(ctx,gyroscope.y());
    emitValue<output_Z>(ctx,gyroscope.z());
    emitValue<output_DONE>(ctx, 1);
}