How to offset axis on ADIS16448

Hello everyone, I am looking for some help with programming our swerve. Ideally I know that an IMU should be placed at the center of the robot, and we will be close. The problem is that because of the limitations of our design, the RIO will be pitched back at roughly a 37.5 degree angle. How might I compensate for this?

If you have a three axis gyro, your pitch axis being not quite level shouldn’t affect anything. The yaw axis will remain unaffected, which is what you need for swerve anyway.

For reference, i am using YAGSL. I believe that It keeps track of movement for field oriented drive from looking at acceleration along an axis. So I think Field oriented drive would not work.

Pretty sure YAGSL doesn’t use that, most frameworks would use the yaw axis gyro for field oriented.

I’m sure @nstrike can chime in here to provide YAGSL support.

Uhm, not centering on your robot is fine but please straighten it if you can, if you can’t you can use SwerveDrive.setGyroOffset to compensate. YAGSL ONLY works with Yaw right now, (adding support for others is in the backlog and i tried to do it this week but didn’t find a good way to).

I have yet to see a team use this feature, so please let me know if there’s any bugs you encounter.

As for being pitched back, I am not sure how your NavX will respond. I don’t think you need to set an offset as long as your roborio is parallel with the side of the robot facing the front.

Could be wrong, but I think OP means that the gyro is offset in the pitch axis, not the yaw.

That shouldn’t affect anything, right?

1 Like

I got that after i reread it, it shouldn’t affect anything but i am not sure. I don’t think you can calibrate a NavX like that.

Yeah afaik, the navX should ideally be placed such that one axis is perfectly perpendicular to gravity.

But the yaw axis should be fine even in OP’s case.

1 Like

Awesome, thanks for the input!

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