Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/unit selection and fixing wrong scale values #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Darkproduct
Copy link

Hi, we found a bug with all BNO055 drivers that we tried and decided to fix this one and implement the unit selection feature of the BNO055.

The Bug

The linear_acceleration scale factor is set to 1000, but has to be 100.
From the BNO055 Data Sheet - 3.6.1 Unit selection - Table 3-17: Accelerometer Unit settings:

Unit Representation
m/s² 1 m/s² = 100 LSB
mg 1 mg = 1 LSB

One annoyance

Only the linear acceleration would used as acceleration data witch doesn't include gravity.

3.6.5.1 Acceleration data
In non-fusion mode uncompensated acceleration data for each axis X/Y/Z, can be read from
the appropriate ACC_DATA_LSB and ACC_DATAMSB registers. In fusion mode the fusion algorithm output offset compensated acceleration data for each axis
X/Y/Z, the output data can be read from the appropriate ACC_DATA
LSB and
ACC_DATA
_MSB registers. Refer table below for information regarding the data types
for the acceleration data.

This one will include the gravity vector.

3.6.5.6 Linear Acceleration
Linear acceleration output only available in fusion operating modes. The fusion algorithm output linear acceleration data for each axis x/y/z, the output data can be
read from the appropriate LIA_DATA_LSB and LIA_DATA_MSB registers.
Refer to the table below for further information regarding the data types and the unit
representation for Linear acceleration.

This won't.

Why do we want included gravity?

The gravity vector can be used to get information about the tilt of the robot, which is especially useful in 3D mapping.
See Cartographer ROS - Why is IMU data required for 3D SLAM but not for 2D?

If there is a need to get the acceleration data without gravity, we could implement two different solutions:

  1. Adding a parameter to switch between acceleration data with and without gravity.
  2. Adding another publisher to output both types.

Unit Parameters

We added a few parameters to select the units of the data output. This is documented in the readme as well.

It is highly adviced to use the default values to adher to REP 103.

Param Values Description
unit.angular_velocity "rps" radians per second
"rps" radians per second
unit.linear_acceleration "mps2" meter per second squared
"mg" milli force
"g" force
unit.magnetic_field "T" tesla
"uT" micro tesla
unit.temperature "C" celsius
"F" fahrenheit

@TranDuyNhat
Copy link

hello i am new in ros2, I have had bno055 connected with usb cp2102, I want to read data from this sensor. Please help me the command to run this package using uart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants