Roborio isn't horizontal, will this cause gyro readings to be off?

If this is the case, is there a special way to calibrate the gyro to it’s rotation? Our team is mounting our roborio slanted

Our team tested this awhile ago because our RIO is mounted on a vertical electronics board. The accelerometer automatically recalibrates when you first turn it on, so you’d call values as if the RIO were mounted the ‘normal way’

1 Like

What kind of gyro are you using? Our team uses a NavX and recalibration is needed. How you do It is dependent on the type of gyro being used.

1 Like

With NavX you can use the getFusedHeading method to get an accurate rotation relative to the ground.

As stated by my junior, the Navx seems to understand when it is mounted perpendicular to horizontal and just changes it’s own return values.

Getters for pitch, yaw, and roll were all reporting values about the same axis independent of horizontal or perpendicular mounting.

When you say “isn’t horizontal”, I hope you don’t have it mounted on some inclined plane, that might make the calibration both necessary and/or impossible.

it is on an incline. Should we attempt to reposition the roborio or extend the MXP port and attach the NAVX at another point on the robot?

I’m not sure. the Navx may have calibration routines that will be able to “just work” on the incline in the same way they do with perpendicular mounting (according to our tests).

I’ve never tested that scenario, so I just don’t know what would be better or not.

From the navX OminMount page:
" * 1. During auto-calibration, one of the navX2-MXP axes MUST be perpendicular to the earth’s surface."

You need to make your board orthogonal. Either use a stock ribbon cable and mount separately to a vertical or horizontal location, or make a very short header standoff to zero out the angle on top of the Rio

Do you know if this applies to the original navX? My team has the originals but not the NavX2

Do you know if the same applies to the analog devices gyroscope?

Yes. The differences between the original navx and the navx2 are minimal.

1 Like

Which analog devices gyroscope? It certainly applies to any single axis gyroscope.

The adis16470

So we’ve mounted the roborio with the ADIS16470 perpendicular to the ground, as in the roborio is vertically mounted. Will the gyroscope still function properly? (assuming we adjust for the 90 degree offset in the code)

You will want to take a look at this (OmniMount | navX-MXP). After running that, the axis will be aligned properly. No need to adjust in code.

If you mount it that way, you need to call this function to set a different axis as yaw.