FIRST-Tech-Challenge / FIRST-Tech-Challenge/FtcRobotController

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

Open
#565 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.3k
Forks
9.9k
Avg merge
18m
Merged PRs (30d)
1

Description

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
- FTC 7172 Coach
[adafruitled.zip](https://github.com/FIRST-Tech-Challenge/FtcRobotController/files/10438581/adafruitled.zip)
[AdafruitLEDBackpack.java.txt](https://github.com/FIRST-Tech-Challenge/FtcRobotController/files/10438582/AdafruitLEDBackpack.java.txt)
[ConceptAdafruit.java.txt](https://github.com/FIRST-Tech-Challenge/FtcRobotController/files/10438583/ConceptAdafruit.java.txt)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.