Replies: 2 comments 9 replies
-
That makes no sense. Could you send a screencap of it happening and shorten your fix then submit a PR? |
Beta Was this translation helpful? Give feedback.
-
Looking deeper found this: Now, using getZ() function: for both the original and inverted values, this formula yields -3.0276 which is why the yaw is not changing after inversion |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have two robots, both with navX, one is upside down, and works great with yagsl out of the box. The other is right side up and I could not get it to work with invert true or false, so I looked in the code and found that the inversion seemed to be having no effect on getZ() from gyro, so I downloaded the library and changed the code in navXSwerve.java to do the inversion in getRotation3d instead of getRawRotation3d and that seems to work.
The right-side-up navX I set invert to true and now it works with this code change:
public Rotation3d getRotation3d()
{
if (inverted) {
return getRawRotation3d().rotateBy(offset.unaryMinus()).unaryMinus();
}
else {
return getRawRotation3d().rotateBy(offset.unaryMinus());
}
}
Don't know why, maybe I am imagining things...
Beta Was this translation helpful? Give feedback.
All reactions