/** * Sets the user-specified yaw offset to the current * yaw value reported by the navX MXP. * * This user-specified yaw offset is automatically * subtracted from subsequent yaw values reported by * the getYaw() method. */ void IMU::ZeroYaw() { if ( this->IsBoardYawResetSupported() ) { /* navX MXP supports on-board yaw offset reset */ EnqueueIntegrationControlMessage( NAVX_INTEGRATION_CTL_RESET_YAW ); } else { yaw_offset = GetAverageFromYawHistory(); } }
void IMU::ZeroYaw() { yaw_offset = GetAverageFromYawHistory(); }