I have no idea how to code to setup and interface with the Adafruit BNO055 gyro breakout (link).
We are running Android Studio on version 9.0 to program the bot and we have plugged the gyro into our control hub at the i2c port 0. It’s correctly wired for gnd, power, sda, and scl on the breakout.
We can not use our control hub’s integrated IMU since it is too big to fit in the space we need the gyro to be in. Also, the IMU in the control hub resets to 0 when driving which is not a code issue but it’s not helpful.
How do you code for the breakout and how would I return the y-axis using that code?
We’ve had pretty good luck using NavX2 on our FTC robot.
The main benefit with NavX is the example code they provide which makes integration relatively simple. I imagine a non-FIRST tailored IMU will be more difficult to set up, since I think you basically have to program the I2C interface yourself (we’ve abandoned a few different sensor projects for reasons like this).
Totally agree about the issues with the internal IMU. Ours was cutting out constantly, breaking field-oriented drive, set up the NavX and no more gyro issues.
Sure, but the control hubs also have libraries to support that natively. As far as I know, there’s nothing like that for a standalone I2C IMU.
I’m not a programmer so I don’t know the details, other than that interfacing with any I2C device without the appropriate libraries for that specific device can be quite a challenge.
We used an external BNO055 last year as our control hubs were mounted on a turret and we still wanted tracking for our chassis. IIRC you just have to name the external gyro what the internal gyro defaults to in the hardware map.
First off, I’d suggest plugging it into port 1 so that it doesn’t conflict with the IMU already in port 0.
Secondly, I believe there is actually an AdafruitBNO055IMU class in the hardwaremap and SDK that you can use to interface with it. Its actually just a wrapper around the BNO055IMU class, so plugging it into port 1 and indicating there is a “Rev Internal IMU (BNO055)” in that port should work as well.
Fun fact: The SDK BNO055 IMU driver is loosely inspired by the Adafruit BNO055 IMU driver they provide as an example
Just be sure that, instead of using the default port 0 IMU named “imu”, you add a new device to port 1, name it something different (like “adafruitIMU”), and use that name everywhere else.