AGHSEagleRobotics / frc1388-2023

0 stars 0 forks source link

Unified IMU subsystem #26

Open jtechau opened 1 year ago

jtechau commented 1 year ago

We currently have subsystems for both ADIS16448 and ADIS16470 IMUs. This allows us to use either of these sensor boards. However, having separate classes for each board is burdensome for other classes which must know the type of the IMU used in the system. It would be better to have a single IMU subsystem class which accommodates either board.

This task is to create a subsystem class which supports both ADIS16448 and ADIS16470 IMUs. (And potentially others.)

This could be accomplished by creating a generic IMU subsystem class which has separate constructors for each supported IMU type, and providing generic methods which return the various axis data and types based on the type of the sensor board provided when constructing an object from the class.

See also issue #24.

jtechau commented 1 year ago

I've added a MultiChannelADIS class, which is a replacement for the WPILib ADIS16470_IMU class. MultiChannelADIS provides methods to get all three gyro axes from the sensor.

This code hasn't been tested. We'll need to integrate this additional gyro type into the GyroSubsystem. We additionally need to test (and possibly debug) the MultiChannelADIS class itself.

Many thanks to team 340 for their efforts to integrate all three gyro axes into the ADIS16470_IMU class!

https://www.chiefdelphi.com/t/analog-devices-adis-16470-eng-basic-java-gyro-code-help/422553/17