Quote:
Originally Posted by jojoguy10
Hey NavX people,
Would it be possible to make a block that can reset the gyro to whatever you want (instead of zero)? I was going to go into your block and make the edit, but I found that it's a built-in function in the firmware on the board itself.
|
As you discovered, the "zero yaw" functionality is now performed by the navX-MXP onboard firmware. There were a few reasons for this, including that other values (specifically, the quaternions which represent numerically all of the cumulative rotations from the 0,0,0 origin point) also need to be updated as well to keep them in synch w/the navX-MXP yaw angle.
However,
here's a link to some Java code that implements an "offset tracker" which can be used to subtract a given offset from any of the navX-MXP angles, including the yaw. Specifically, look at the applyOffset() method. You may find this helpful as you work on your own offset adjustment. What you want to do should be pretty straightforward - basically, you are subtracting a known value from the angle provided by navX-MXP. The only part that's a little complicated is handling the wraparound (at -180/+180 degrees).