Using NavX with StatusSignal

Hello,

Our team is trying to use the NavX as a gyro for our bot but I’m having issues figuring out how to get it to fit with the StatusSignal class.

NavX.getYaw() returns the yaw reading as a float. StatusSignal does not seem to understand how to convert a Float to a Double.

public final AHRS gyro = new AHRS(SerialPort.Port.kMXP);
private final StatusSignal<Double> yaw = gyro.getYaw(); 

Has anyone been successful doing this? Does Phoenix6 not support NavX?

Could you cast it?

Phoenix does not support NavX as it is not a CTRE device.

2 Likes

Understood thank you.

Is it possible to use NavX with AdvantageKit then? If so is there an example of this somewhere?

I understand that AdvantageKit is not tied to a vendor, but I’m having trouble finding an example of creating a “custom” IO source

The AdvantageKit example projects show creation of custom IO interfaces/classes, and the input seems to be the gyro reading moreso than the gyro itself, so replacing the Pigeon with a NavX seems like it’d be pretty straightforward (looking mostly at the diff_drive example project).

We’ve added our own custom GyroIO file and are doing quite well with it! I’m liking AdvantageKit quite a lot! Very helpful