Do not differentiate the norm at gimbal lock At gimbal lock, the norm determining the middle Euler angle is exactly zero. Its kink carries over through atan2, so the angle has no derivative. Differentiating the norm anyway produces NaN derivatives. Compute the norm only away from gimbal lock and use its zero subgradient otherwise. Likewise, compute the norms in the quaternion manifold test functor only if they are nonzero. Change-Id: Ic5c4eaaf1b268b7f002c1489296b212fd45f7727
Ceres Solver is an open source C++ library for modeling and solving large, complicated optimization problems. It is a feature rich, mature and performant library which has been used in production at Google since 2010. Ceres Solver can solve two kinds of problems.
Please see ceres-solver.org for more information.