Pigeon 2.0 on swerve

Hi, does anybody know a way to connect the values given by the pigeon to the swerve, specifically values like Gyro or the accelerometer, if so thanks.

Hello, looks like you got left behind. Did you get past the issue?

If not, could you provide some more details? Like what swerve code you’re currently using and if you can read values from the Pigeon or not.

Thank you, we were using labview last year but we have changed to java, we are currently practicing so we haven’t gotten to the pigeon part yet.

This example project might answer some of your questions. If not, please ask again. I think you’ll find you get a lot more response here for Java than for LabVIEW.

BTW, PigeonIMU does not implement the Gyro interface, and does not provide a getRotation2d method. I can’t lay my hands on a public example, but a good practice would be to write a wrapper class for PigeonIMU that implements Gyro.

Update: Not exactly the way I would have written it, but here is an example.

WPI_Pigeon2 and WPI_PigeonIMU exist for this purpose.

Ha! It seemed a strange omission. I wonder why I’ve never come across those.

Update: I came here trying to help someone, and instead I learnt something useful. Today is a good day. :slight_smile:

2 Likes

Probably because they’re hidden away in this tiny little page that barely even explains the motors, let alone the gyroscope classes?

Noticing a common theme with teams not knowing stuff exists in WPILib and Phoenix…

In all fairness, the page I linked to does say:

Inherited by com.ctre.phoenix.sensors.WPI_PigeonIMU.

It’s always worth checking for “Inherited by” in Java documentation, as it’s often a sign that you shouldn’t be instantiating a class directly.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.