Skip to content

Software

BNO08x ROS 2 driver

From github.com/bnbhat/bno08x_ros2_driver (opens in a new tab)

  • Perception
  • Driver or SDK
  • Apache-2.0

ROS 2 driver for the CEVA BNO08x inertial measurement unit (IMU).

Facts

GitHub stars
12read on 27 Nov 2026
Last update
31 May 2026Newest commit on master
Maintenance
Maintaineda commit in the last 12 months
Difficulty
Intermediate

Checked on GitHub on 27 Nov 2026.

Licenses

Code
Apache-2.0 (opens in a new tab)

Read by Robotheca from LICENSE (opens in a new tab) (Apache-2.0) at commit 1206976 (opens in a new tab), on 22 Oct 2026.

Commercial use
Yes

At a glance

What it is
In its creator's words: Open the repository on GitHub (opens in a new tab)
Robots on Robotheca
No robot on Robotheca uses it yet.
Licence
Apache-2.0. Commercial use: Yes. Where it was read
Maintenance
Maintained, last commit on 31 May 2026.

Use it

How to install it, in the creator's words: Open the repository on GitHub (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit 1206976

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: ReadMe.md by @bnbhat, at commit 1206976, under Apache-2.0 (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

BNO08x ROS2 Driver

ROS2 driver for the BNO08x sensor family based on the SH-2 protocol.

The BNO08x family (BNO085/BNO086) is a compact System in Package (SiP) with integrated accelerometer, gyroscope, magnetometer, and a 32-bit ARM® Cortex™-M0+ running CEVA's SH-2 firmware. It delivers real-time 3D orientation, heading, calibrated acceleration, and angular velocity, with on-board sensor fusion algorithms and calibration. It supports I2C, SPI, and UART interfaces for sensor data output. For more information, refer to the datasheet (opens in a new tab).

(opens in a new tab)

Supported Features:
Communication Interfaces:
  • I2C
  • UART (Not implemented)
  • SPI (Not implemented)
Data Rates:
  • IMU data up to 400Hz
  • Magnetic field data up to 100Hz
Parameters
ParameterTypeDefaultDescription
frame_idstring"bno085"Frame ID for sensor data messages.
publish.magnetic_field.enabledbooltrueEnable publishing of magnetic field data.
publish.magnetic_field.rateint100Rate at which to publish magnetic field data (Hz).
publish.imu.enabledbooltrueEnable publishing of IMU data.
publish.imu.rateint100Rate at which to publish IMU data (Hz).
i2c.enabledbooltrueEnable I2C communication.
i2c.devicestring"/dev/i2c-7"I2C device path.
i2c.addressstring"0x4A"I2C address of the BNO08x sensor.
Installation

Clone the repository:

cd ~/ros_ws/src
git clone https://github.com/bnbhat/bno08x-ros2-driver.git

Build the package:

cd ~/ros_ws
colcon build --packages-select bno08x_driver

Install any missing dependencies using rosdep:

rosdep install --from-paths src --ignore-src -r -y
Usage

Sensor is configured to I2C by default. To use other communication interfaces , you need to do a hardware change. Please refer to the datasheet (opens in a new tab) for more information. Once the hardware change is done, you can configure the driver to use UART/SPI communication interface.

[!CAUTION] If you want to use UART, make sure to select UART-SHTP mode in the sensor configuration.
UART-RVC is a simplified interface mode with minimal functionalities and is not supported by this driver.

I2C

To run the driver with I2C communication interface, you need to provide the I2C bus number and the I2C address of the BNO08x sensor.

example config file:

bno08x_driver:
  ros__parameters:

    frame_id: "bno085"  # The frame_id to use for the sensor data

    # Communication Interface
    # Select the communication interface to use 
    # (only one interface can be enabled at a time)
    # This requires a hardware change to the board
    # (see documentation for more information)
    i2c:
      enabled: true
      device: "/dev/i2c-18"
      address: "0x4A"

    publish:
      all: false
      magnetic_field: 
        enabled: true
        rate: 100   # max 100 Hz
      imu:
        enabled: true
        rate: 100   # max 400 Hz

Launch the driver:

ros2 launch bno08x_driver bno085_i2c.launch.py
Code Structure

At the core of this driver is a C++ class, BNO08x, which represents the BNO080/BNO085/BNO086 sensor and provides required methods to interact with the sensor using the SH-2 protocol (opens in a new tab).

The communication interface is abstracted using the CommInterface class, which can be implemented for any communication method (I2C, UART, SPI).

Currently, I2C communication interface is implemted and tested on Linux systems.

The Core BNO08x implementation can be used in any C++ project on any platform by implementing the CommInterface for the respective platform.

BNO08xROS is a wrapper class that uses the BNO08x class to provide ROS2 specific functionality.

The directory structure is as follows:

.
├── CMakeLists.txt
├── config
│   └── bno085_i2c.yaml
├── docs
│   ├── BNO080_085-Datasheet.pdf
│   └── SH-2-Reference-Manual.pdf
├── include
│   ├── bno08x_driver
│   │   ├── bno08x.hpp
│   │   ├── bno08x_ros.hpp
│   │   ├── comm_interface.hpp
│   │   ├── i2c_interface.hpp
│   │   ├── logger.h
│   │   ├── spi_interface.hpp
│   │   └── uart_interface.hpp
│   └── sh2
│       ├── CMakeLists.txt
│       ├── NOTICE.txt
│       ├── README.md
│       ├── sh2.c
│       ├── sh2_err.h
│       ├── sh2.h
│       ├── sh2_hal.h
│       ├── sh2_SensorValue.c
│       ├── sh2_SensorValue.h
│       ├── sh2_util.c
│       ├── sh2_util.h
│       ├── shtp.c
│       └── shtp.h
├── launch
│   └── bno085_i2c.launch.py
├── LICENSE
├── package.xml
├── ReadMe.md
└──  src
    ├── bno08x.cpp
    ├── bno08x_ros.cpp
    └── ros_node.cpp
Acknowledgements

This driver uses the SH-2 protocol library provided by Hillcrest Labs. It can be found in the include/sh2 directory. Visit the official repository here: SH-2 Protocol Library (opens in a new tab)

License

This project is licensed under the Apache License 2.0. You can find the full license text in the LICENSE (opens in a new tab) file of the repository.

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.