A ROS2 Compatible node that interfaces with the BNO085 IMU sensor via python
TODO: Added Requirements.txt
The node communicates with the BNO08x via i2c on the Raspberry Pi and Python. The required software/libraries to run this code:
The Raspberry Pi hardware I2C implementation doesn't handle clock stretching due to a bug. This is a problem when using the BNO085 (and it's cousins it appears, the BNO55 and BNO080) because it causes the crashes when the sensor is communicating with the Pi's programs.
There are 2 recommended options across the internet:
- Slow the I2C Clock
- This didn't work well for me, as continues to crashed the script, or if too low wouldn't even detect the sensor.
- Also follow the suggestion in this hookup guide and setting the Clock faster @400KHz made it worst and crashed more quickly
- Configure and Use software I2C instead which supports clock stretching at the cost of a slight increase in CPU usage.
- Using this guide in addition to the previous link, I update the code the use the software I2C interface with
SDAonGPIO23, andSCLonGPIO24and giving the bus id3
- Using this guide in addition to the previous link, I update the code the use the software I2C interface with
As an extra: config.txt on ubuntu on the Pi is located in /boot/firmware/config.txt instead of /boot/config.txt
- Platform: Raspberry Pi 4
- OS: Ubuntu 22.04.2 LTS
- ROS: ROS2 Humble
- Python: 3.10.6
Bug fixes and additions are welcome via pull requests (might be a nice opportunity for people to make there first contributions to open-source code that helps others!!)
I only ask that:
- The requests are somewhat clear on what the changes are for/why (basically I think it's fair that the changes are documented somewhere for both others and myself)
- Please be patient with me, as I get around to actually merging them in.