![]() |
BNO055 9DOF Java Class for FRC roboRio
After seeing someone mention the BNO055 from in this thread, and watching the demos on the Adafruit website. I thought I'd give this little sensor a try. I've done a bunch of bench testing with this sensor, specifically as a gyro replacement (providing relative heading). I have to say I'm really impressed so far.
Out of the box, there is (literally) zero static drift in position and rotation seems repeatable to roughly within +/- 2 degrees. The built in calibration sequence seems quite robust. The sensor doesn't report that it has completed calibration until it's sat statically for a short duration of time. Although prior to reporting that the device is calibration, it does appear that the reported position data is accurate. I've also had a chance to set this sensor up temporarily on a practice chassis and observed similar results. Since this thing looks promising, I've ported the adafruit arduino code over to Java on the roboRio. I'll be maintaining the code at this github repository. I tested it out quickly tonight and it's communicating with the BNO055 over I2C, calibrating it and can read XYZ coordinate data. At this point there's probably still bugs in the code. It's only got a few hours of testing on it. There's certainly room for improvement in the comment department. The plan is to clean this up as I continue to test this sensor out. What's next:
If you have any questions about the sensor, the code, or want me to test out something specific before you buy your own, ask here and I'll try to help out the best I can. If you're interested in checking out the sensor in operation there are some videos I recorded while evaluating the sensor (note these weren't recorded for public consumption so there's some ramblings):
|
Re: BNO055 9DOF Java Class for FRC roboRio
FYI: Looks like DigiKey is carrying this adafruit breakout board now.
http://www.digikey.com/product-detai...426-ND/5699182 So you can get this sensor for free through the Virtual KOP Digikey PDV: http://www.firstinspires.org/node/5616 |
Re: BNO055 9DOF Java Class for FRC roboRio
First off, I wanted to say thanks for posting the I2C code for communicating with the BNO055 sensor. It has made our lives much easier.
We have been using the OPERATION_MODE_NDOF and VECTOR_EULER options when constructing our instance as we are primarily interested in using the sensor's gyro. We have seen good results most of the time, however it seems like we sometimes observe communication drop outs where we stop getting readings when connected to the roboRIO (or pauses in communications). At the moment we are chalking it up to our temporary breadboard/jumper cable connection. I would be curious to hear how your experience has been when using the sensor to date and whether you plan to stick with it for this season. |
Sorry for the late reply.
We've had this sensor setup on a few different robots w/ various semipermanent wirings and haven't had issues with communications with the sensor. I would recommend not using the sensor in NDOF mode (I use IMU mode) unless you actually want absolute heading (relative to the earths mag field). The NDOF mode will be susceptible to magnetic interference from motors, and calibration is more involved in this mode of operation. Which version BNO055 breakout board are you using? We are primarily using the Atmel board on our bots, but the ad a fruit board was used for preliminary development of the class. If you want a more prompt response, shoot me an email at james@team2168.org |
Re: BNO055 9DOF Java Class for FRC roboRio
Thanks for pointing out that we should be using IMU mode instead of NDOF mode when using this sensor as a measurement of rotation. I had misinterpreted the data sheet and thought that I needed one of the absolute modes in order to have the sensor accumulate the rotation. I had not realized that this sensor's absolute modes (like NDOF) were referring to tracking the rotation with respect to the earth's magnetic field.
We are using the Adafruit version of the breakout board for the BNO055 sensor (https://www.adafruit.com/products/2472). If you are interested, we have added a GyroAdapter class to our library that can be used as a WPIlib Gyro implementation. I have added some methods to your BNO055 code to allow for the creation of these gyro instances. Something along the lines of: Code:
// New getInstance() that puts sensor in IMU/Euler modehttps://github.com/frc868/frc868-lib...hounds/sensors A word of warning about the soure. We are still in the process of testing and have only been working with the x-axis rotation on our robot. Thanks again for you help. |
Re: BNO055 9DOF Java Class for FRC roboRio
Just as a side note, I've ported your library to C++(although a bit amateurishly) and am hoping to release it tomorrow on GitHub. Thanks for your amazing work, you've saved us many hours!
|
Awesome to hear. Note a lot of the heavy lifting was done by Adafruit, I just extended their efforts.
Also it would be great to have a C++ library publicly available, that would cover the majority of the languages for this sensor (there's a LabVIEW implementation already). Keep an eye on the repo, as I have code which implements a reset() method, and code to save/load a calibration data set. |
| All times are GMT -5. The time now is 08:05 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi