Giter Club home page Giter Club logo

adafruit_bno055's Introduction

Adafruit Unified BNO055 Driver (AHRS/Orientation) Build StatusDocumentation

This driver is for the Adafruit BNO055 Breakout, and is based on Adafruit's Unified Sensor Library (Adafruit_Sensor).

Tested and works great with the Adafruit Si4713 Breakout Board. To work with the Arduino Zero, the BNO055's ADR pin must be high.

What is the Adafruit Unified Sensor Library?

The Adafruit Unified Sensor Library (Adafruit_Sensor) provides a common interface and data type for any supported sensor. It defines some basic information about the sensor (sensor limits, etc.), and returns standard SI units of a specific type and scale for each supported sensor type.

It provides a simple abstraction layer between your application and the actual sensor HW, allowing you to drop in any comparable sensor with only one or two lines of code to change in your project (essentially the constructor since the functions to read sensor data and get information about the sensor are defined in the base Adafruit_Sensor class).

This is important and useful for two reasons:

1.) You can use the data right away because it's already converted to SI units that you understand and can compare, rather than meaningless values like 0..1023.

2.) Because SI units are standardised in the sensor library, you can also do quick sanity checks when working with new sensors, or drop in any comparable sensor if you need better sensitivity or if a lower cost unit becomes available, etc.

Light sensors will always report units in lux, gyroscopes will always report units in rad/s, etc. ... freeing you up to focus on the data, rather than digging through the datasheet to understand what the sensor's raw numbers really mean.

Adafruit invests time and resources providing this open source code. Please support Adafruit and open-source hardware by purchasing products from Adafruit!

Kevin (KTOWN) Townsend Adafruit Industries. MIT license, check license.txt for more information All text above must be included in any redistribution

To install, use the Arduino Library Manager and search for "Adafruit BNO055" and install the library.

adafruit_bno055's People

Contributors

aerialist avatar bryant1410 avatar caternuson avatar combinacijus avatar davgibbs avatar devgordon avatar dhiltonp avatar dubois avatar evaherrada avatar hoffmannjan avatar kattni avatar ladyada avatar makermelissa avatar microbuilder avatar mrkaroshi avatar paulstoffregen avatar potto216 avatar rampageservices avatar siddacious avatar szymonkaliski avatar tdicola avatar toddtreece avatar tones29 avatar tyeth avatar ulysse314 avatar wetmelon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adafruit_bno055's Issues

.obj file

Hello I have question to ask. I use the cuberotate file from Adafruit BNo055 file (example_processing file) and I tried to change the bunny.obj to other object. I have the autocad 3D modelling file in .obj and .mtl I tried to change the bunny into my 3D autocad object but it written this:

Loading this = headexcavator.obj
Loading this = headexcavator.mtl
material: ‘DefaultMaterial’
Obj Name: default
and nothing appeared when I run the coding. Can somebody help me? Thank you.

Gyroscope output is in deg/s

Not a problem per say, but looks like the library outputs gyro data in degrees/s, whereas the tutorial claims it's in radians per second?

Reasons for believing this to be so:

  1. When moving the sensor around, the output easily reaches >100, which is around 1000rpm had it been in r/s.

  2. Reading the source: I see the unit setting code in the lib is commented out:

/* Set the output units */
/*
uint8_t unitsel = (0 << 7) | // Orientation = Android
(0 << 4) | // Temperature = Celsius
(0 << 2) | // Euler = Degrees
(1 << 1) | // Gyro = Rads
(0 << 0); // Accelerometer = m/s^2
write8(BNO055_UNIT_SEL_ADDR, unitsel);

and this code

case VECTOR_GYROSCOPE:
/* 1dps = 16 LSB */
xyz[0] = ((double)x)/16.0;
xyz[1] = ((double)y)/16.0;
xyz[2] = ((double)z)/16.0;

divides the raw output by 16, which is right for degree output (for radian output, it would have been to divide by 900).

Mainly a documentation issue (though I know the Unified Sensor lib prefers r/s, but that would be a breaking behaviour for this lib...)

  • Feather M0
  • PlatformIO v5.3.2
  • Adafruit BNO055 v1.1.6

getEvent returns incorrect type for gravity data

When playing with the read_all_data example it was noticed that adding a VECTOR_GRAVITY event in loop() and modifying the printEvent() code to process event->type==SENSOR_TYPE_GRAVITY, the displayed type was 1 (SENSOR_TYPE_ACCELEROMETER), not the expected 9 (SENSOR_TYPE_GRAVITY). Looking at the getEvent() code in the Adafruit_BNO055.cpp source, one sees
...
else if (vec_type == Adafruit_BNO055::VECTOR_GRAVITY)
{
event->type = SENSOR_TYPE_ ACCELEROMETER;
vec = getVector(Adafruit_BNO055::VECTOR_GRAVITY);

event->acceleration.x = vec.x();
event->acceleration.y = vec.y();
event->acceleration.z = vec.z();

}
...

It appears to me that the first line in the "else if" block should be

event->type = SENSOR_TYPE_ GRAVITY;

Note that this (potential) issue is similar to issue #67 (fixed in #68).

Two attachments.

  1. new_read_all_data.txt, which is your example read_all_data with additions to also print VECTOR_ACCELEROMETER, VECTOR_MAGNETOMETER, and VECTOR_GRAVITY data. (It also (correctly) prints VECTOR_LINEAR_ACCEL since the current example does not. This is fixed in a pull request (#74) that has not yet been merged into the master repository.)

  2. issue_bno055_gravity.txt shows output produced by new_read_all_data, both before and after the above suggested change.

If you agree with this change, I can try to generate a pull request. However, I am brand-new to github and am not sure how to officially do this. I've done the "newbie" intro to github tutorial, where one creates a repositiry with a README.md file, creates a branch, edits the README.md file, commits the changes, does a pull request, then merges it into the master. I've also created a fork of the Adafruit BNO055 master. I'm assuming that I can do something similar to the tutorial there, but am not sure if a pull request in my forked version ends up being sent to you.

Regards, John Ganci

new_read_all_data.txt
issue_bno055_gravity.txt

BNO055 position tracking (Indoor navigation system with max accuracy)

Thank you for opening an issue on an Adafruit Arduino library repository. To
improve the speed of resolution please review the following guidelines and
common troubleshooting steps below before creating the issue:

  • Do not use GitHub issues for troubleshooting projects and issues. Instead use
    the forums at http://forums.adafruit.com to ask questions and troubleshoot why
    something isn't working as expected. In many cases the problem is a common issue
    that you will more quickly receive help from the forum community. GitHub issues
    are meant for known defects in the code. If you don't know if there is a defect
    in the code then start with troubleshooting on the forum first.

  • If following a tutorial or guide be sure you didn't miss a step. Carefully
    check all of the steps and commands to run have been followed. Consult the
    forum if you're unsure or have questions about steps in a guide/tutorial.

  • For Arduino projects check these very common issues to ensure they don't apply:

    • For uploading sketches or communicating with the board make sure you're using
      a USB data cable and not a USB charge-only cable. It is sometimes
      very hard to tell the difference between a data and charge cable! Try using the
      cable with other devices or swapping to another cable to confirm it is not
      the problem.

    • Be sure you are supplying adequate power to the board. Check the specs of
      your board and plug in an external power supply. In many cases just
      plugging a board into your computer is not enough to power it and other
      peripherals.

    • Double check all soldering joints and connections. Flakey connections
      cause many mysterious problems. See the guide to excellent soldering for examples of good solder joints.

    • Ensure you are using an official Arduino or Adafruit board. We can't
      guarantee a clone board will have the same functionality and work as expected
      with this code and don't support them.

If you're sure this issue is a defect in the code and checked the steps above
please fill in the following fields to provide enough troubleshooting information.
You may delete the guideline and text above to just leave the following details:

  • Arduino board: INSERT ARDUINO BOARD NAME/TYPE HERE

  • Arduino IDE version (found in Arduino -> About Arduino menu): INSERT ARDUINO
    VERSION HERE

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too): LIST REPRO STEPS BELOW

The adafruit_bno055_offsets_t should be signed and not unsigned values

Correct me if i'm wrong but i think that the values you get from any sensor offet registers (LSB +MSB) are representing a signed value and not unsigned. So it should be int16_t and not uint16_t in the adafruit_bno055_offsets_t

 typedef struct
{
    uint16_t accel_offset_x;
    uint16_t accel_offset_y;
    uint16_t accel_offset_z;
    uint16_t gyro_offset_x;
    uint16_t gyro_offset_y;
    uint16_t gyro_offset_z;
    uint16_t mag_offset_x;
    uint16_t mag_offset_y;
    uint16_t mag_offset_z;

    uint16_t accel_radius;
    uint16_t mag_radius;
} adafruit_bno055_offsets_t;

Looking at the BNO055 datasheet it is mentionned that values can be negatives !

Changing the default configuration setting of BNO055

As I was scrolling on the data sheet of BNO055 I notice that the Acc_config, Gyro_config 0, Gyro_config 1, and Mag_config were all in "read only". If this is in read only then how will the user put their desire to set up when they need to? Also, will fusion mode overwrite the inputted set up when it is called at the end of the setup routine? See the example problem application below:

setup

proof

regconfig

readonly

(The yellow highlighted part were related to the said questions)

Reference link: www.mouser.com/ds/2/783/BST_BNO055_DS000_13-838248.pdf . Page 53, Register map Page 1.

Restoring Calibration does not work

  • Arduino board: Nucleo64 G071RB

  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.10

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too):

Hello!
I have 2 Steps which i start by serialcommand
Step 1:
do the Calibration and store it to EEPROM.

void cmd_run_cal(SerialCommands* sender)
{
  Serial.println("Please calibrate me!!!"); Serial.println("");

  /* Initialise the sensor */
  if (!bno.begin())
  {
    /* There was a problem detecting the BNO055 ... check your connections */
    Serial.print("Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!");
    while (1);
  }

  delay(1000);

  /* Display the current temperature */
  int8_t temp = bno.getTemp();
  Serial.print("Current Temperature: ");
  Serial.print(temp);
  Serial.println(" C");
  Serial.println("");

  bno.setExtCrystalUse(true);
  bno.setMode(Adafruit_BNO055::OPERATION_MODE_NDOF);

  Serial.println("Calibration status values: 0=uncalibrated, 3=fully calibrated");
  //Calibration
  while (!bno.isFullyCalibrated())
  {
    
    bno.getCalibration(&sys, &gyro, &accel, &mag);
    Serial.print("CALIBRATION: Sys=");
    Serial.print(sys, DEC);
    Serial.print(" Gyro=");
    Serial.print(gyro, DEC);
    Serial.print(" Accel=");
    Serial.print(accel, DEC);
    Serial.print(" Mag=");
    Serial.println(mag, DEC);

    delay(BNO055_SAMPLERATE_DELAY_MS);

  }
  adafruit_bno055_offsets_t newCalib;
  bno.getSensorOffsets(newCalib);
  EEPROM.put(eeAddress, newCalib);
  
  EEPROM.get(eeAddress, newCalib);
  displaySensorOffsets(newCalib);
}

Step 2:
Read Calibration from EEPROM and put them in the BNO

void cmd_run_setcal(SerialCommands* sender)
{
  adafruit_bno055_offsets_t calibData2;
  delay(500);
  EEPROM.get(eeAddress, calibData2);
  displaySensorOffsets(calibData2);
  bno.setSensorOffsets(calibData2);
  delay(500);
  bno.getSensorOffsets(calibData2);
  displaySensorOffsets(calibData2);
}

Output of Step 1 looks fine:
['-16']['-68']['-21']['-2']['-2']['0']['8']['103']['39']['1000']['767']

Output of Step 2 after Reset:

Data from EEPROM:
['-16'], ['-68'], ['-21'], ['-2'], ['-2'], ['0'], ['8'], ['103'], ['39'], ['1000'], ['767']
Data from BNO after setSensorOffsets:
['-1'], ['-1'], ['-1'], ['-1'], ['-1'], ['-1'], ['-1'], ['-1'], ['-1'], ['-1'], ['-1']

And yes Calibrationstatus stays zero on all everything.

Sudden error while compiling

Hello,

I've been using Arduino Create for working on past projects. I've been using BNO055 with Arduino Mini Pro for the past few months with satisfaction. However, today, a new issue has risen with the library.

The issue rises as early as including the library without any code manipulation yet. The relevant code:
#include <Adafruit_Sensor.h> #include "Adafruit_BNO055.h" #include <utility/imumaths.h>

The error I'm getting when trying to compile:
`In file included from /home/ubuntu/opt/libraries/latest/bno055simplepacketcoms_0_0_1/src/GetIMU.h:12:0,

from /home/ubuntu/opt/libraries/latest/bno055simplepacketcoms_0_0_1/src/GetIMU.cpp:8:

/home/ubuntu/opt/libraries/latest/simplepacketcoms_0_0_6/src/SimplePacketComs.h:5:18: fatal error: vector: No such file or directory

#include

^

compilation terminated.

exit status 1`

First time that I'm having trouble with the library. Any ideas?

setSensorOffsets(const uint8_t* ...) writes to wrong registers

  • Arduino board: found on Teensy 3.1, but would affect all micro-controllers

  • Arduino IDE version (found in Arduino -> About Arduino menu): found with v1.8.1, but would affect all versions

The following operation should simply save and restore the offsets:

uint8_t savedCalibration[22];
bno.getSensorOffsets(savedCalibration);
bno.setSensorOffsets(savedCalibration);

However, the method void setSensorOffsets(const uint8_t* calibrate); has switched the registers that store the calibration offsets for the magnetometer and gyro. The sensor offset register map shown on page 51 of the BNO055 specification sheet shows the order of registers as: accelerometer (55 - 5A), magnetometer (5B - 60), gyro (61 - 66), acc radius (67 - 68), mag radius (69 - 6A).

The actual order used in the method is: accelerometer, gyro, magnetometer, acc radius, mag radius.

    write8(ACCEL_OFFSET_X_LSB_ADDR, calibData[0]);
    write8(ACCEL_OFFSET_X_MSB_ADDR, calibData[1]);
    write8(ACCEL_OFFSET_Y_LSB_ADDR, calibData[2]);
    write8(ACCEL_OFFSET_Y_MSB_ADDR, calibData[3]);
    write8(ACCEL_OFFSET_Z_LSB_ADDR, calibData[4]);
    write8(ACCEL_OFFSET_Z_MSB_ADDR, calibData[5]);

    write8(GYRO_OFFSET_X_LSB_ADDR, calibData[6]);
    write8(GYRO_OFFSET_X_MSB_ADDR, calibData[7]);
    write8(GYRO_OFFSET_Y_LSB_ADDR, calibData[8]);
    write8(GYRO_OFFSET_Y_MSB_ADDR, calibData[9]);
    write8(GYRO_OFFSET_Z_LSB_ADDR, calibData[10]);
    write8(GYRO_OFFSET_Z_MSB_ADDR, calibData[11]);

    write8(MAG_OFFSET_X_LSB_ADDR, calibData[12]);
    write8(MAG_OFFSET_X_MSB_ADDR, calibData[13]);
    write8(MAG_OFFSET_Y_LSB_ADDR, calibData[14]);
    write8(MAG_OFFSET_Y_MSB_ADDR, calibData[15]);
    write8(MAG_OFFSET_Z_LSB_ADDR, calibData[16]);
    write8(MAG_OFFSET_Z_MSB_ADDR, calibData[17]);

    write8(ACCEL_RADIUS_LSB_ADDR, calibData[18]);
    write8(ACCEL_RADIUS_MSB_ADDR, calibData[19]);

    write8(MAG_RADIUS_LSB_ADDR, calibData[20]);
    write8(MAG_RADIUS_MSB_ADDR, calibData[21]);

Orientation

This may be super simple to answer. In the adafruit documentation it says that axis mapping isn't implemented but it looks like it is?

In my project the sensor is mounted edge on - as I guess it would be in a phone. In the documentation it talks about changing the orientation (which would interchange x and y and inverted where chip is mounted upside down) - but I don't quite get how you'd configure it for edge on because all the positions are on the same x-y plane.

On the section above on the datasheet there's another bit - AXIS_MAP_CONFIG. So I would presumably swap my axis there?

Hopefully thats all there is to it?

BNO055 Euler Heading

Dear All,
I am working on a marine application of model surface vessel in which the 9-axis BNO055 is useful for attitude determination and eventual linear acc evaluation (to be later on completed with GPS Kalman Filtering). I have some doubts not cleared completely :

  1. Is the default mode the NDOF?
  2. In the default mode are the Euler Angles referred to north?
    (in my case did not, neither after some time.. leading to the 1st doubt)
  3. Does anybody observe drift in the Euler Angle heading (supposing it rotated to refer to nord across magnetometers at initial time?)?

In my case Euler heading drifts a lot in time: hence again leading to the doubt 1.. Shouldn't the fusion process unbias measurments across Mag in combination with GYRO? In my tests the Euler heading result much much more similar to a trapeze integration than a fusion.

In figure below:
Mag Heading in blue,
Euler heading (manually initialized to Mag heading) in orange,
external GPS course over ground in black (confirming MAG)
brutal trapeze integration of gyro rate (very similar to Euler) in red

[img width=500 height=112]https://varuj77995.i.lithium.com/t5/image/serverpage/image-id/2592iDAE3AB549656E3F7/image-size/large?v=1.0&px=999[/img]
https://varuj77995.i.lithium.com/t5/image/serverpage/image-id/2592iDAE3AB549656E3F7/image-size/large?v=1.0&px=999
Some sailing and turning

I tested two different IMU on two different vessels, leading to the same qualitative conclusions.
The calibration of GYRO and ACC is executed in lab and stored in order to be reloaded, while MAG are calibrated all start up. Finally: I read about the euler mismatch with quaternions of the BNO055 library, but just when tilting the IMU. Does it affect also heading fusion?
Regards

My setup: Arduino Mega 2560
Libraries:
#include <Adafruit_Sensor.h>
#include <Adafruit_BNO055.h>
#include <utility/imumaths.h>

BNO055 Restore_Offsets Question

Hi
Calibration values are stored successfully using Restore_Offsets.
The only problem is: when I rerun the sensor (Power On) it asks for: "Move sensor slightly to calibrate magnetometers"
Does it mean that my sensor is not able to get_calibration values from EEPROM or it is a secondary magnetometer calibration?!

Thanks

Remove _wire->begin()

Calling begin on a wire object in a library is bad practice as it resets the bus.

Doing so makes it imposible to use another TwoWire object, like one assigned for different SERCOM pins on SAMD boards as they require pinPeripheral to be set after begin, and calling begin again in the library resets this.

Support of motion detection

Accelerometer and gyroscope "any motion" and "no motion" events triggered by an interrupt pin (p39-45 & p53 of the BN055 documentation ) are not supported by this library.

These are very interesting features for any project which do anything other than processing 100Hz of acc/gyr samples.

Not compatible with other wire libraries

I'm not able to use this library together with the teensy specific wire library ( #include <i2c_t3.h>)

I would request that the bno library doesn't include wire.h inside its code. Then one could provide ones own wire implementation.

Accelerometer bandwidth

Hello! Im currently trying to set up my bno055 to estimate its position and im looking for a way to change accelerometer bandwidth from 62.5 Hz to something like 100 Hz or 200 Hz for more accurate measurement. Can you tell me how exactly i can do that? Im interested if one can change bandwidth to later use it in fusion mode.
P.S. Im using arduino nano to communicate with bno055.

Pitch sometimes jumps

  • Arduino board: ESP8266

  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.5

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too): LIST REPRO STEPS BELOW

I have tested a couple of BNO055, and found pitch sometimes jumps from -81 to 81. This issue makes the rotation a bit strange and stop rotation in that position (should change from -81 to -90 then to 81). Could you give any suggestion ?

No API for this libary / no explanation how to use the BNO with an alternative address

Board:
Feather M0 Adalogger

IDE:
1.6.13

I've got a question about changing the address of the BNO055. The address of this module can be set to 0x28 and 0x29. If I am correct, the address needs to be set in the constructor of the Adafruit_BNO055 class. However, examples show the value 55, which converts to hex 0x37, which is neither of those. When I scan the i2C ports, my alternative address BNO055 does show up as 0x29. So my understanding is incorrect.

The best way to find out what I am doing wrong is to read the API of the library. However, I can not find it on the Adafruit website or on the Github.

Could any of you create an API or make an example how to work with the BNO or point me to the API or explanation which I totally missed?

Thanks in advance.

Wrong license? Shouldn't this library be GPL v3?

Hello, I was poking around and noticed the license on the vector, quaternion, etc files you have in the utility directory has this:

    Inertial Measurement Unit Maths Library
    Copyright (C) 2013-2014  Samuel Cowen
        www.camelsoftware.com
    Bug fixes and cleanups by Gé Vissers ([email protected])
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

This is GPL code ... how is this library then MIT? I would suggest ditching this code, I don't think it is really fully utilized any ways and you could just use a simple struct (or something) to hold the data ... JMHO

Euler Angles Problem

Hello,

While trying the example "rawdata", it shows one of the pitch and the roll angle reverse. (For example, when the pitch angle is 5 degree, it shows -5 degree) I am not sure which one is wrong. Could you fix that?

Huseyin

Software issue causing the BNO to sometimes stall when powered on

As discussed in this forum thread, there seems to be an issue with this library that sometimes causes the bno055 to become unresponsive on startup. Read the whole forum thread to better understand the problem.

The issue can apparently be resolved by adding a delay of about 30ms after the first call to write8(adafruit_bno055_reg_t, byte value);

write8(BNO055_SYS_TRIGGER_ADDR, 0x20);

Active work on adding Interrupt Support

Hi folks, great library (as always). Is there any active work on adding basic interrupt support into this library? From the datasheet, it looks like it's just a matter of writing the right code to the right registers via I2C. I am looking to use this in a low-power project and I'd like to use the "Any Motion" interrupt to wake the MCU from a low-power state.

If not, I will take a stab at doing it myself, but I'd rather know if there's anyone on this since I can reorder my work to take advantage of it.

Thanks
Bill

Xbee serial communication

Hi, I am trying to get the bunny cuberotate sketch to send serial communication to send over xbee wireless serial port. My setup is an arduino uno with a SparkFun XBee Shield and a bn005 9dof board which is connected via sda too a4 and scl to a5 the xbee`s are s1 modle and am using a hobbutronics xbee usb v2 usb breakout. how do i embed the xbee library in to the processing and ide code?

location of adafruit_bno055_rev_info_t in h file

In order to access the getRevInfo(adafruit_bno055_rev_info_t* info) function I moved the location of
//**************************************
typedef struct
{
uint8_t accel_rev;
uint8_t mag_rev;
uint8_t gyro_rev;
uint16_t sw_rev;
uint8_t bl_rev;
} adafruit_bno055_rev_info_t;
//**************************************

to outside of the CLASS definition, it is now directly below the adafruit_bno055_offsets_t typedef.

Should I have NOT done this? My solution works, but is there a preffered way to access the bn0055 revinfo data?

I tried to make a pull request but it wanted me to compare 2 branches, before enabling the create pull request.

wrong scaling for gyroscope

BNO055 specifications state (4.3.60 UNIT_SEL 0x3B) default units for gyroscope is degrees per second. Therefore the scale is wrong. Physical test of rotation rate shows scale should be 16 as specified.

in function
imu::Vector<3> Adafruit_BNO055::getVector(adafruit_vector_type_t vector_type)

case VECTOR_GYROSCOPE:
  /* 1rps = 900 LSB */
  xyz[0] = ((double)x)/900.0;
  xyz[1] = ((double)y)/900.0;
  xyz[2] = ((double)z)/900.0;

should be

case VECTOR_GYROSCOPE:
  /* 1dps = 16 LSB */
  xyz[0] = ((double)x)/16.0;
  xyz[1] = ((double)y)/16.0;
  xyz[2] = ((double)z)/16.0;

integration with rosserial

Thank you for opening an issue on an Adafruit Arduino library repository. To
improve the speed of resolution please review the following guidelines and
common troubleshooting steps below before creating the issue:

  • Do not use GitHub issues for troubleshooting projects and issues. Instead use
    the forums at http://forums.adafruit.com to ask questions and troubleshoot why
    something isn't working as expected. In many cases the problem is a common issue
    that you will more quickly receive help from the forum community. GitHub issues
    are meant for known defects in the code. If you don't know if there is a defect
    in the code then start with troubleshooting on the forum first.

  • If following a tutorial or guide be sure you didn't miss a step. Carefully
    check all of the steps and commands to run have been followed. Consult the
    forum if you're unsure or have questions about steps in a guide/tutorial.

  • For Arduino projects check these very common issues to ensure they don't apply:

    • For uploading sketches or communicating with the board make sure you're using
      a USB data cable and not a USB charge-only cable. It is sometimes
      very hard to tell the difference between a data and charge cable! Try using the
      cable with other devices or swapping to another cable to confirm it is not
      the problem.

    • Be sure you are supplying adequate power to the board. Check the specs of
      your board and plug in an external power supply. In many cases just
      plugging a board into your computer is not enough to power it and other
      peripherals.

    • Double check all soldering joints and connections. Flakey connections
      cause many mysterious problems. See the guide to excellent soldering for examples of good solder joints.

    • Ensure you are using an official Arduino or Adafruit board. We can't
      guarantee a clone board will have the same functionality and work as expected
      with this code and don't support them.

If you're sure this issue is a defect in the code and checked the steps above
please fill in the following fields to provide enough troubleshooting information.
You may delete the guideline and text above to just leave the following details:

  • Arduino board: teensy 3.6

  • Arduino IDE version (found in Arduino -> About Arduino menu): INSERT ARDUINO
    VERSION HERE

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too):
    Hi

I am using rosserial_python in order to run a ROS node on arduino.I was able to publish the odometry information from the arduino.Now i am trying to integrate IMU and i am using Adafruit 9-DOF Absolute orientation IMU Fusion Breatout-BNO055 (https://learn.adafruit.com/adafruit-bno055-absolute-orientation-sensor/overview).

I am able to read the data using th libaray (https://github.com/adafruit/Adafruit_BNO055) but when i try to integrate rosserial with the IMU and publish the IMU data as a rosnode i get the following issue

@agr:~$ rosrun rosserial_python serial_node.py _port:=/dev/ttyACM1 _baud:=9600
[INFO] [1503942062.205843]: ROS Serial Python Node
[INFO] [1503942062.211847]: Connecting to /dev/ttyACM1 at 9600 baud
[ERROR] [1503942077.316807]: Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

I am not sure what is the rootcause of this problem.any inputs on this issue appreciated.

Roll Pitch and Headings

I am getting sensible data but not reporting via the properties I'm asking. My heading is coming from orientation.roll and roll is coming from orientation.heading. Pitch looks ok.

Just in case I thought I was going mad I can move it around to get the limits of the outputs which allows you to see clearly which is which.

So roll gives me a value between 0 and 360 which isn't valid for roll but is for heading.
Pitch is right because it gives me +/- 90 which is sensible because exceeding 90 by 10 degrees is the same as 80 degrees but reciprocal heading. Heading gives me +/- 180 - that can be valid for heading but is more likely roll where -180 and 180 are the same - and it wouldn't really make sense as a heading because its supposed to be an absolute figure.

I could check these out in the web visualiser but that doesn't want to run on any of my computers or os'.

getEvent returns incorrect type for linear acceleration data

When requesting linear acceleration data using getEvent The type returned is SENSOR_TYPE_ACCELEROMETER instead of SENSOR_TYPE_LINEAR_ACCELERATION .
This occurs when running the code under:

  • Arduino board: UNO/R3
  • Arduino IDE version 1.8.9

To reproduce the problem create an IMU object and call getEvent requesting linear acceleration:

  Adafruit_BNO055 bno = Adafruit_BNO055(55);
  sensors_event_t linearAccelData;
  bno.getEvent(&linearAccelData, Adafruit_BNO055::VECTOR_LINEARACCEL);

The returned linearAccelData.type is equal to SENSOR_TYPE_ACCELEROMETER instead of SENSOR_TYPE_LINEAR_ACCELERATION.

This appears to be due to an assignment typo Adafruit_BNO055.cpp

bool Adafruit_BNO055::getEvent(sensors_event_t *event, adafruit_vector_type_t vec_type)
{
  ...
  if (vec_type == Adafruit_BNO055::VECTOR_LINEARACCEL)
  {
    event->type = SENSOR_TYPE_ACCELEROMETER;
    vec = getVector(Adafruit_BNO055::VECTOR_LINEARACCEL);

    event->acceleration.x = vec.x();
    event->acceleration.y = vec.y();
    event->acceleration.z = vec.z();
  } 
...
}

which should be:

    event->type = SENSOR_TYPE_LINEAR_ACCELERATION;

If this is an error I can create a pull request. Thanks, Paul

Update version number

Version 1.0.6 as downloaded from the Arduino IDE does not include new calibration features. I think the version number in library.properties needs to be bumped to trigger an automatic library update.

Master branch is not working with the example code on Adafruit website

The example code on this link doesn't seem to work with the master branch of this library. The code seems to get hung up on bno.begin() line. Switching the library to the 1.1.6 release fixes the issue.

The other sample sketches such as rawdata.ino or sensorapi.ino in the examples folder would also brick my board soon after it uploads. I would need to reflash it with the bootloader to get the board to work again. This issue also got resolved when I reverted back to the 1.1.6 release.

I'm using a custom PCB with Arduino Micro and the BNO055 using an external crystal.

matrix code issues

There are various issues with the matrix code in the utility directory. The most serious issues are:
*) The memset() calls in the constructors clear too many bytes, since the sizeof(double) is also squared.
*) the minor_matrix() function does not work, because the colCount variable is never reset. It actually accesses outside the _cell_data array. Consequently, the determinant() and invert() functions also fail.
*) The invert function should divide by the determinant of the matrix, not multiply by it.

Further issues:
*) The _cell pointer is superfluous
*) the copy constructor unnecessarily clears the matrix (it immediately overwrites the cleared data afterwards)
*) In matrix multiplication, row is unnecessarily copied for every element
*) matrices as arguments should really be passed as references
*) there are no const accessor functions (cell(), operator())

Extract IMU data whilst outputing orientation data

Hi, I'm very new to all this so my question may seem basic to more senior engineer.
This fusion sensor is very capable at outputing orientation data. I wonder if it is possible to take te IMU data ( Gyro, Magneto, Acelero) for position tracking purposes? All this shoul be done without sacrifying the orienation output.

New code not released?

Seems there has been some useful code added since the last release in 2016

Should I just use the code here or is there some reason a new release hasn’t been put out based on this code?

Sensor not found on ESP32

Hello,
i'm using the BNO-055 with an ESP32 (custom board, no breakout)
The BNO-055 seems to pass the I2C check but I can't connect with the Adafruit library to it.
It may not be a problem from the library as the devices is not scanned as well, but maybe people here have solutions for that still !
I came accross this issue on the esp32-arduino git : espressif/arduino-esp32#81

I'm using pins SDA 2 / SCL 4 and BNO is on address 0x28

Thanks !

No need to wait for Wire.available().

This line is not correct : "while (Wire.available() < len);".
It is not correct to wait for data after Wire.requestFrom(). When the Wire.requestFrom() returns, the I2C transmission has completely finished and the data is in the buffer.

Angular Velocity Vector

In the BN055 Adafruit product page, BN055 is supposed to have a "Angular Velocity Vector", but I see nothing of this in the library, nor in the documentation.
Am I missing something ?

  • Arduino board: Adafruit HUZZAH
  • Arduino IDE version 1.8.1

Bunny example should use external crystal as well

Hi, in the file "bunny.ino", in the setup() function the bno.setExtCrystalUse(true); line should be added after the bno.begin() command.

It is recommended that the BNO055 use an external crystal as the clock source whenever possible, it provides better timing accuracy than the internal RC clock

Teensy 3.6 issue while trying to run Bunny example

Arduino: 1.6.9 (Mac OS X), TD: 1.30, Board: "Teensy 3.6, Serial, 180 MHz, US English"

Warning: Board Intel:i686:izmir_ec doesn't define a 'build.board' preference. Auto-set to: I686_IZMIR_EC
failed MSpanList_Insert 0x30f400 0x1646750769f4a 0x0
fatal error: MSpanList_Insert

runtime stack:
runtime.MSpanList_Insert(0x2c6d90, 0x30f400)
/usr/local/go/src/runtime/mheap.c:692 +0x8f
runtime.MHeap_Alloc(0x2c6d20, 0x1, 0x10000000016, 0xf989)
/usr/local/go/src/runtime/mheap.c:240 +0x66
runtime.MCentral_CacheSpan(0x2cef18, 0x30f948)
/usr/local/go/src/runtime/mcentral.c:85 +0x167
runtime.MCache_Refill(0x308000, 0xc200000016, 0x30f948)
/usr/local/go/src/runtime/mcache.c:90 +0xa0

goroutine 1 [running]:
runtime.switchtoM()
/usr/local/go/src/runtime/asm_amd64.s:198 fp=0xc208030f78 sp=0xc208030f70
runtime.mallocgc(0x1a0, 0x0, 0xc200000003, 0xc2080fff80)
/usr/local/go/src/runtime/malloc.go:178 +0x849 fp=0xc208031028 sp=0xc208030f78
runtime.rawstring(0x187, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/runtime/string.go:195 +0x93 fp=0xc208031058 sp=0xc208031028
runtime.slicebytetostring(0xc208043d40, 0x187, 0x187, 0x0, 0x0)
/usr/local/go/src/runtime/string.go:69 +0x4b fp=0xc2080310e8 sp=0xc208031058
strings.Replace(0xc208043ba0, 0x19b, 0xc2080fff80, 0x14, 0x0, 0x0, 0x1, 0x0, 0x0)
/usr/local/go/src/strings/strings.go:706 +0x4ee fp=0xc208031190 sp=0xc2080310e8
arduino.cc/builder/props.PropertiesMap.ExpandPropsInString(0xc208100780, 0xc208043ba0, 0x19b, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/props/properties.go:151 +0x18e fp=0xc208031280 sp=0xc208031190
arduino.cc/builder/builder_utils.PrepareCommandForRecipe(0xc208100780, 0x1efb70, 0x15, 0xc208000001, 0x319d90, 0x2c09a0, 0x1d5d30, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/builder_utils/utils.go:312 +0x25e fp=0xc208031360 sp=0xc208031280
arduino.cc/builder/builder_utils.ExecRecipeCollectStdErr(0xc208100780, 0x1efb70, 0x15, 0x1, 0x319d90, 0x2c09a0, 0x0, 0x0, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/builder_utils/utils.go:333 +0xbb fp=0xc208031418 sp=0xc208031360
arduino.cc/builder.(*GCCPreprocRunnerForDiscoveringIncludes).Run(0xc2080ffe60, 0xc20806a000, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/gcc_preproc_runner.go:91 +0x303 fp=0xc208031528 sp=0xc208031418
arduino.cc/builder.runCommand(0xc20806a000, 0x31d0c0, 0xc2080ffe60, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/container_find_includes.go:94 +0x6c fp=0xc208031560 sp=0xc208031528
arduino.cc/builder.findIncludesUntilDone(0xc20806a000, 0xc208168a10, 0x6f, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/container_find_includes.go:112 +0x371 fp=0xc2080316c0 sp=0xc208031560
arduino.cc/builder.(*ContainerFindIncludes).Run(0x2c09a0, 0xc20806a000, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/container_find_includes.go:74 +0x717 fp=0xc2080318e8 sp=0xc2080316c0
arduino.cc/builder.runCommands(0xc20806a000, 0xc208031af8, 0x1c, 0x1c, 0x30c901, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/builder.go:181 +0x139 fp=0xc208031978 sp=0xc2080318e8
arduino.cc/builder.(*Builder).Run(0xc208031ce0, 0xc20806a000, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/builder.go:116 +0xe8e fp=0xc208031cc0 sp=0xc208031978
arduino.cc/builder.RunBuilder(0xc20806a000, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/builder.go:212 +0x49 fp=0xc208031ce8 sp=0xc208031cc0
main.main()
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/arduino-builder/main.go:316 +0x171b fp=0xc208031f98 sp=0xc208031ce8
runtime.main()
/usr/local/go/src/runtime/proc.go:63 +0xf3 fp=0xc208031fe0 sp=0xc208031f98
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc208031fe8 sp=0xc208031fe0
arduino-builder returned 2
Error compiling for board Teensy 3.6.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.