Struct Bno055

Source
pub struct Bno055 { /* private fields */ }

Implementations§

Source§

impl Bno055

Source

pub fn new(i2c_bus: &str) -> Result<Self, Error>

Creates a new BNO055 device instance using the specified I2C bus.

§Arguments
  • i2c_bus - The I2C bus path (e.g., “/dev/i2c-1”)
Source

pub fn reset(&mut self) -> Result<(), Error>

Source

pub fn get_quaternion(&mut self) -> Result<Quaternion, Error>

Returns the current orientation as a quaternion. The quaternion values are normalized and unitless.

Source

pub fn get_euler_angles(&mut self) -> Result<EulerAngles, Error>

Returns the current orientation in Euler angles. All angles (roll, pitch, yaw) are in degrees.

Source

pub fn get_linear_acceleration(&mut self) -> Result<Vector3, Error>

Returns the linear acceleration vector with gravity compensation. All components (x, y, z) are in meters per second squared (m/s²).

Source

pub fn get_gravity_vector(&mut self) -> Result<Vector3, Error>

Returns the gravity vector with linear acceleration compensation. All components (x, y, z) are in meters per second squared (m/s²).

Source

pub fn set_mode(&mut self, mode: OperationMode) -> Result<(), Error>

Sets the operation mode of the BNO055.

§Arguments
  • mode - The operation mode to set.
Source

pub fn get_accelerometer(&mut self) -> Result<Vector3, Error>

Returns the raw accelerometer readings including gravity. All components (x, y, z) are in meters per second squared (m/s²).

Source

pub fn get_magnetometer(&mut self) -> Result<Vector3, Error>

Returns the magnetometer readings. All components (x, y, z) are in microTesla (µT).

Source

pub fn get_gyroscope(&mut self) -> Result<Vector3, Error>

Returns the gyroscope readings. All components (x, y, z) are in degrees per second (°/s).

Source

pub fn get_temperature(&mut self) -> Result<i8, Error>

Returns the chip temperature. Temperature is in degrees Celsius (°C).

Source

pub fn get_calibration_status(&mut self) -> Result<u8, Error>

Returns the calibration status byte. Bits 5-4: gyroscope (0-3) Bits 3-2: accelerometer (0-3) Bits 1-0: magnetometer (0-3) For each sensor, 0 = uncalibrated, 3 = fully calibrated

Auto Trait Implementations§

§

impl Freeze for Bno055

§

impl RefUnwindSafe for Bno055

§

impl Send for Bno055

§

impl Sync for Bno055

§

impl Unpin for Bno055

§

impl UnwindSafe for Bno055

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.