View Single Post
  #279   Spotlight this post!  
Unread 25-02-2016, 12:26
slibert slibert is offline
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 349
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: ANNOUNCING: navX MXP Robotics Navigation Sensor

Quote:
Originally Posted by jojoguy10 View Post
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).
Reply With Quote