Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADIS16470 IMU does not work in Java #45

Open
jfabellera opened this issue Nov 16, 2024 · 2 comments · Fixed by wpilibsuite/allwpilib#7434
Open

ADIS16470 IMU does not work in Java #45

jfabellera opened this issue Nov 16, 2024 · 2 comments · Fixed by wpilibsuite/allwpilib#7434
Labels
bug Something isn't working WPILib - Java

Comments

@jfabellera
Copy link
Contributor

I was updating REV's MAXSwerve Java and C++ templates which use an ADIS16470 as the gyro, and I was getting a driver station error in Java on initialization about being unable to find the ADIS16470 on the SPI port (I don't have the exact error at the moment). I wasn't getting any gyro readings, and of course the field centric driving did not work.

However, in C++ there were no issues on the same exact robot. I did not change any of the gyro setup since the 2024 version of the program, which I know was working then.

Here are where they are instantiated in the two languages:

I am running WPILib 2025 beta 1 and NI game tools beta 1.

@jfabellera jfabellera added bug Something isn't working WPILib - Java labels Nov 16, 2024
@rzblue
Copy link
Member

rzblue commented Nov 16, 2024

There are a few commits that changed the ADIS16470 driver- since it's all at the java layer, would you be able to copy and paste the class into the project and bisect the history to find where it broke?

https://github.com/wpilibsuite/allwpilib/commits/main/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADIS16470_IMU.java

@rzblue
Copy link
Member

rzblue commented Nov 16, 2024

One possibility (though I haven't walked through all the logic to see why it didn't hit this last year) is that the product ID it's checking for is incorrect:

https://github.com/wpilibsuite/allwpilib/blob/bade0a8716f63266be251bd167747cf16adf401b/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADIS16470_IMU.java#L482

According to the ADIS16470 datasheet the PROD_ID should be 0x4056 (16470), not 16982

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working WPILib - Java
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants