6 pinMode(18, INPUT_PULLUP);
7 pinMode(19, INPUT_PULLUP);
11 Serial.println(
"No BNO055 detected");
13 Serial.println(
"BNO055 was detected");
18 bno.setExtCrystalUse(
true);
A class for interfacing with the Adafruit BNO055 sensor.
Quaternion GetAbsoluteOrientation()
Retrieves the absolute orientation as a quaternion.
Vector3D GetLocalAcceleration()
Retrieves the raw local acceleration vector.
Quaternion absoluteOrientation
Computed absolute orientation.
Vector3D GetLocalForce()
Retrieves the computed local force vector.
Adafruit_BNO055 bno
BNO055 sensor instance.
VectorRunningAverageFilter< 10 > localAngulKF
Filter for angular velocity.
Vector3D ReadMagneticField()
Reads the magnetic field vector from the sensor.
Vector3D GetLocalAngularVelocityFiltered()
Retrieves the filtered local angular velocity vector.
VectorRunningAverageFilter< 10 > localGraviKF
Filter for gravity vector.
Vector3D localAngularVelocity
Raw local angular velocity data.
BNO055()
Constructs a BNO055 instance.
sensors_event_t magnetometerData
Vector3D GetLocalAccelerationFiltered()
Retrieves the filtered local acceleration vector.
sensors_event_t angVelocityData
Vector3D localForce
Computed local force.
Vector3D ReadLocalAcceleration()
Reads the local acceleration vector from the sensor.
sensors_event_t accelerometerData
Vector3D ReadLocalAngularVelocity()
Reads the local angular velocity vector from the sensor.
VectorRunningAverageFilter< 10 > localAccelKF
Filter for acceleration.
Vector3D GetLocalAngularVelocity()
Retrieves the raw local angular velocity vector.
Vector3D localMagneticField
Raw local magnetic field data.
sensors_event_t gravityData
Sensor event data.
long previousMicros
Timestamp of the previous sensor update.
Vector3D localAcceleration
Raw local acceleration data.
Vector3D ReadLocalGravityVector()
Reads the local gravity vector from the sensor.
void Update()
Updates the sensor data and applies filtering.
Vector3D localGravityVector
Raw local gravity vector data.
Vector3D GetLocalMagneticField()
Retrieves the local magnetic field vector.
A mathematical construct representing a rotation in 3D space.
static Quaternion SphericalInterpolation(const Quaternion &q1, const Quaternion &q2, const float &ratio)
Performs spherical linear interpolation (slerp) between two quaternions.
Quaternion UnitQuaternion() const
Returns a unit quaternion (normalized) version of this quaternion.
Quaternion DeltaRotation(const Vector3D &angularVelocity, const float &timeDelta) const
Computes a small rotation quaternion given an angular velocity and time delta.
Handles 3D rotations and conversions between various rotation representations.
Quaternion GetQuaternion()
Gets the quaternion representation of the rotation.
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.
Vector3D CrossProduct(const Vector3D &vector) const
Computes the cross product of this vector with another Vector3D.
Vector3D UnitSphere() const
Normalizes this vector such that its magnitude is 1 (if non-zero).
Vector3D Filter(Vector3D input)
Filters a 3D vector input using the running average filter.