Skip to content
Snippets Groups Projects
Commit 44a8cbb6 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

[Minor][C++] Add assert to check norm in firstOrderNormalize

parent 4ebb5b9d
No related branches found
No related tags found
No related merge requests found
......@@ -71,6 +71,7 @@ namespace se3
template <typename D> void
firstOrderNormalize(const Eigen::QuaternionBase<D> & q)
{
assert(std::fabs(q.norm() - 1) < 1e-2);
typedef typename D::Scalar Scalar;
const Scalar alpha = ((Scalar)3 - q.squaredNorm()) / 2;
const_cast <Eigen::QuaternionBase<D> &> (q).coeffs() = alpha * q.derived().coeffs();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment