-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
I am working on simulating my team's 2022 robot. I was having issues with simulating the Pigeon IMU, and after a lot of digging through source code and trial and error, I found that the simulation worked as expected if instead of constructing the WPI_PigeonIMU object using a Talon (which reflects how it is wired on the bot), if I instead constructed it with a device ID (meaning it would be wired to the CAN bus), simulation works as it should. I would expect simulation to work the same whether the IMU is connected through CAN or a Talon data port.
For reference, this code does not change the simulated IMU angle:
WPI_TalonSRX talon = new WPI_TalonSRX(1);
WPI_PigeonIMU pigeon = new WPI_PigeonIMU(talon);
pigeon.getSimCollection().setRawHeading(drivetrainSim.getHeading().getDegrees());
And this code does change the simulated angle, reflecting what would be expected given drivetrain inputs:
WPI_PigeonIMU pigeon = new WPI_PigeonIMU(2);
pigeon.getSimCollection().setRawHeading(drivetrainSim.getHeading().getDegrees());
Metadata
Metadata
Assignees
Labels
No labels