Skip to content
Snippets Groups Projects
Unverified Commit 6cbb2350 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

[Spatial] Avoid unecessary allocations

parent b660db09
No related branches found
No related tags found
No related merge requests found
......@@ -231,10 +231,12 @@ namespace se3
if(t > 1e-15)
{
const Scalar inv_t = Scalar(1)/t;
Matrix3 S(alphaSkew(inv_t, w));
Scalar ct,st; SINCOS(t,&st,&ct);
Matrix3 V((Scalar(1) - ct) * inv_t * S + inv_t * inv_t * (Scalar(1) - st * inv_t) * w * w.transpose());
Vector3 p(inv_t * st * v + V * v);
const Scalar alpha_wxv = (Scalar(1) - ct) * inv_t * inv_t;
const Scalar alpha_v = inv_t * st;
const Scalar alpha_w = inv_t * inv_t * (Scalar(1) - st * inv_t) * w.dot(v);
Vector3 p(alpha_v*v + alpha_w*w + alpha_wxv*w.cross(v));
return SE3(exp3(w), p);
}
else
......
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