ros-imu-bno055
ros-imu-bno055 copied to clipboard
ROS package for the BNO055 IMU via I2C
ROS1/ROS2 C++ driver for Bosch BNO055 IMU (I2C)
This is a light weight, C++ ROS node for the BNO055 IMU that communicates via I2C and without any dependencies besides libi2c-dev. It is specifically targeted at using a BNO055 with NVIDIA Jetson (Xavier, Orin, etc.) platforms but should work with a Raspberry Pi 5, or in an earlier Raspberry Pi using the software I2C mode.
The BNO055 supports I2C and UART communication. This driver supports I2C only. If you are looking for a UART driver, see this driver by mdrwiega instead.
Where to buy
Installation
Install the prerequisites:
sudo apt install libi2c-dev
Copy or rename the appropriate CMakeLists file:
cp CMakeLists.ros1.txt CMakeLists.txt # for ROS1
cp CMakeLists.ros2.txt CMakeLists.txt # for ROS2
and then you are ready to drop this package into a catkin (ROS1) or colcon (ROS2) workspace.
How to run
rosrun imu_bno055 bno055_i2c_node # for ROS1
ros2 run imu_bno055 bno055_i2c_node # for ROS2
Parameters:
- device -- the path to the i2c device. Default is /dev/i2c-1. Use i2cdetect in the i2c-tools package to find out which bus your IMU is on.
- address -- the i2c address of the IMU. Default is 0x28.
Outputs topics:
- /data (sensor_msgs/Imu) -- fused IMU data
- /raw (sensor_msgs/Imu) -- raw accelerometer data
- /mag (sensor_msgs/MagneticField) -- raw magnetic field data
- /temp (sensor_msgs/Temperature) -- temperature data
- /status (diagnostic_msgs/DiagnosticStatus) -- a DiagnosticStatus object showing the current calibration, interrupt, system status of the IMU
Service calls:
- /reset (std_srvs/Trigger) -- resets the IMU
- /calibrate (std_srvs/Trigger) -- not yet implemented
Usage notes
Raspberry Pi
The Raspberry Pi <=4 hardware I2C does not support clock stretching. You have a few options:
- Upgrade to Raspberry Pi 5
- Use software I2C instead which supports clock stretching but will increase CPU usage slightly.
- Slow down the I2C clock drastically, since the Pi does not support clock stretching. I have not tested this method.
NVIDIA Jetson platforms
You may need to add your user to the i2c group, e.g. sudo usermod -aG i2c nvidia
. It should just work after that.