Skip to content

Commit

Permalink
Use first-order Taylor series expansion on 6-DOF
Browse files Browse the repository at this point in the history
  • Loading branch information
umgnunes committed Dec 4, 2021
1 parent 1fc8018 commit 0fd5112
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions include/EventEMin/model/model/six_dof.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,14 @@ struct SixDOF
{
const Map<const Vector<U, NVars> > varsMap(vars);
const Map<const Vector<U, NW> > w(varsMap.template segment<NW>(0).data());
const Map<const Vector<U, NW> > v(varsMap.template segment<NV>(NW).data());
const Map<const Vector<U, NV> > v(varsMap.template segment<NV>(NW).data());

// First-order Taylor expansion
Matrix<U, NMatrix, NMatrix> skewMtx;
skewMtx << T(0.0), -w(2), w(1), v(0), w(2), T(0.0), -w(0), v(1), -w(1),
w(0), T(0.0), v(2), T(0.0), T(0.0), T(0.0), T(0.0);
m = t * skewMtx;
m.diagonal().array() += T(1.0);
const U wNorm = w.norm();
if (U(0.0) < wNorm)
{
const U theta = t * wNorm;
skewMtx /= wNorm;
m += ((T(1.0) - cos(theta)) * skewMtx +
(theta - sin(theta)) * skewMtx * skewMtx) *
skewMtx;
}
}

template <typename U, typename V>
Expand Down

0 comments on commit 0fd5112

Please sign in to comment.