It’s been a couple of years since we used our ADIS16448 and I see it’s now in WPIlib. However it’s drifting like crazy, as in degrees per second. We swapped units and still doing it, so it makes me think we need to do some kind of calibration or setup other than just instantiating the object.
We’re just creating the object with private ADIS16448_IMU gyro = new ADIS16448_IMU(); and then calling .reset(). We’ve also tried calling .calibrate() though I know (and can see from the logs) that it calibrates itself on startup. We’re just asking for the angle with .getAngle().
I feel like I’m missing something obvious here… Is there anything we should be looking at?
Hey thanks for the response. Yes, we’re all staring at the computer waiting for the bot to come up. But a good reminder for me to explain to the team how important it is not to touch the robot at that time.
This was bugging me and I didn’t want to wait until Saturday.
We thought something was up with the gyro because our field pose showed the robot spinning even when we were sitting still. It was the end of the meeting so our parting thoughts were something is up with the gyro because it gets wired straight into odometry, so what could be wrong there?
When I display the raw output of the gyro on a skeleton robot, the drift was roughly half a degree in 15 seconds, so nothing terrible. Added in the odometry code and the Pose2d was spinning again.
Turns out the default constructor of Rotation2d is radians, not degrees.