libbno055-linux
A high-performance, polyglot C++17, ROS 2, Python, C, and Rust driver for the Bosch BNO055 9-DOF IMU sensor on Linux systems.
Highlights
- Native I2C & UART Support: Fast POSIX drivers with hardware auto-recovery for I2C bus lockups and UART overrun errors.
- ROS 2 Lifecycle & Diagnostics: Production ROS 2 lifecycle nodes with zero-copy publishing and diagnostic streams.
- Multi-Language FFI Bindings: C++17 core engine with native C, Python (
pip), and safe Rust (crates.io) interfaces.
Why libbno055-linux?
| Feature | libbno055-linux |
Adafruit BNO055 | Bosch Reference |
|---|---|---|---|
| Linux I2C & UART | ✅ | ⚠️ | ❌ |
| Automatic Recovery | ✅ | ❌ | ❌ |
| ROS 2 & Lifecycle | ✅ | ❌ | ❌ |
| Zero-Allocation Hot Path | ✅ | ❌ | ❌ |
| Rust & Python Bindings | ✅ | ⚠️ | ❌ |
| Burst Read (18-Byte) | ✅ | ❌ | ❌ |
| GPIO IRQ Latency | ✅ | ❌ | ❌ |
Features
- Polyglot Bindings: First-class support for C++17, ROS 2, Python (
pip), Rust (crates.io), and native C. - Zero-Allocation Hot Path: Memory-optimized, no-heap allocations during high-rate sensor readouts.
- Robust Hardware Recovery: Auto-reconnects on I2C
EIObus lockups, clock-stretching glitches, and UART overrun errors. - High-Throughput Burst Reads: 18-Byte sequential I2C/UART burst reads (~450µs at 400kHz I2C).
- Linux GPIO Interrupt (IRQ): Sub-millisecond latency via hardware INT pin edge detection using POSIX
poll().
Quick Start by Language
Rust (crates.io)
cargo add libbno055
use libbno055::{BNO055, OpMode};
fn main() -> Result<(), &'static str> {
let mut imu = BNO055::new_i2c(0x28, "/dev/i2c-1")?;
if imu.begin(OpMode::NDOF) {
if let Some(q) = imu.get_quaternion() {
let euler = BNO055::to_euler_degrees(&q);
println!("Roll: {:.2}, Pitch: {:.2}, Yaw: {:.2}", euler.x, euler.y, euler.z);
}
}
Ok(())
}
Python (pip)
pip install libbno055-linux # Or: pip install . (from source)
import libbno055
imu = libbno055.BNO055(address=0x28, device="/dev/i2c-1")
if imu.begin(libbno055.OpMode.NDOF):
q = imu.get_quaternion()
if q:
euler = libbno055.to_euler_degrees(q)
print(f"Roll: {euler.x:.2f}, Pitch: {euler.y:.2f}, Yaw: {euler.z:.2f}")
C++17 (Native CMake)
#include <libbno055-linux/bno055.hpp>
#include <iostream>
int main() {
bno055lib::BNO055 imu(0x28, "/dev/i2c-1");
if (imu.begin(bno055lib::OpMode::NDOF)) {
if (auto q = imu.getQuaternionNoexcept()) {
auto euler = bno055lib::toEulerDegrees(*q);
std::cout << "Roll: " << euler.x << " Pitch: " << euler.y << " Yaw: " << euler.z << "\n";
}
}
}
ROS 2 Node (Binary Installation)
sudo apt update && sudo apt install ros-${ROS_DISTRO}-libbno055-linux
ros2 launch libbno055_linux bno055_launch.py
Documentation
- API Reference: Full class and function reference for C++, C, Python, and Rust.
- Integration & Tuning Guide: ROS 2 YAML parameters, EKF setup, 400kHz I2C, UART 921600 bps tuning, and Rust integration.
- Architecture & Design: PIMPL design, zero-copy transport, FFI layers, and state machines.
- Troubleshooting & FAQ: Hardware wiring, permissions, and clock-stretching fixes.
License
This project is released under the MIT License.
Metadata
Release files for libbno055-linux 1.5.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| libbno055_linux-1.5.4.tar.gz | 16.4 kB | Details |
Release files / libbno055_linux-1.5.4.tar.gz
| Download URL | libbno055_linux-1.5.4.tar.gz |
|---|---|
| Size | 16.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
121166c332f25707be2df04c324788156e5b06d9b81c8fa0fa9233195db4ea7d
|
|
BLAKE2b-256 checksum How to use checksums |
c0a5dca05ab040fab94a9b3217348b106f2b4d6acd73dc89ac89e8fcceda9ed0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.
Transparency log