Re: [eigen] Eigen and rigid body simulation |
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
I can then write something like : double data[4] = {1,3,4,5}; Rotd d, dr; RotMapd dm(data); dr = d *dm;Yes it's definitely easier to write when using it, but in the end there's still a lot of machinery to simply avoid using free functions. In your case, the wrapper also involves performance issues since values are copied all around.
In fact they are not copied, at least for the objects I tried. Since I was focused on tiny elements like Quaternion or Matrix<Scalar, 1, 7>, the copy are elided by the compiler and I didn't see this issue. I haven't checked with more complex objects. But it may indeed involve unecessary copy.
and then: Foo a, b, c; c = a.lie() * b.lie().inverse(); or ( with a helper lie_wrap template function ) : c = lie_wrap(a) * lie_wrap(b).inverse() (which is only a matter of taste) If i'm bothered with all those pesky "lie" calls, i can always do: lie::wrap<Foo> aa(a), bb(b); c = aa * bb.inverse();
I still have my same concerns with this implementation. I think it's too complicated for rigid body simulations where we only want to use so3, se3, SO3 and SE3 elements (with nice names :) ). But for a more complex use (group product, etc.), your suggestion may be more appropriated and the more complex syntax would be then unavoidable.
I'll check again my implementation with more complex cases (if you have any example, it would help).
-- Mathieu
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |