FtcRobotController icon indicating copy to clipboard operation
FtcRobotController copied to clipboard

custom i2c drivers in OnBot Java always require robot restart on rebuild

Open pmichaud opened this issue 2 years ago • 0 comments

Reporting this as an issue after a brief discussion and recommendation from a core FtcRobotController developer.

We have some I2C devices on our robot that we have written I2C drivers for, using the guide at https://github.com/FIRST-Tech-Challenge/ftcrobotcontroller/wiki/Writing-an-I2C-Driver . An example driver for the Adafruit LED Backpack ( https://www.adafruit.com/product/902 ) is attached.

Whenever we do "Rebuild Everything" in OnBot Java, running an OpMode results in the I2C hardware devices being not found in the hardwareMap via hardwareMap.get() . We find we have to do a "Robot Restart" from the Driver Station in order to get the I2C device to be available again. This occurs even if the I2C device code remains unmodified -- any change to the the OnBot Java files requires a robot restart to be able to look up the I2C device in the hardwareMap .

I have theories for why this happens, but was advised that this is a bug and should be reported here.

Knowing that there might not be a new release on the horizon, are there any good workarounds in the meantime? The team can obviously continue to Restart Robot after every build, but that gets a bit tedious after a while. We'd also be happy to create precompiled versions of the drivers (.jar, .class, .aar) to be made available on OnBot Java, but we're not quite sure how to do that in the FtcRobotController ecosystem.

Thanks for any assistance to be provided here.

Pm

pmichaud avatar Jan 17 '23 19:01 pmichaud