[eigen] Cumbersome syntax questions/feedback

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi guys,

After converting to Eigen in a couple of work projects (mobile robotics
stuff), and being very happy with the results (great job! :), I've
started to convert an open source project of mine to Eigen as well
(http://www.peekabot.org). However I ran into some minor troubles with
cumbersome syntax -- some questions/feedback below.

First, I dabbled with replacing our own rudimentary Matrix4f class used
for affine coordinate system transformations with Eigen::Transform3f.
Works wonderfully, but expressions involving inverse() becomes a bit
cumbersome (I'm using 2.0.4):

  Eigen::Transform3f A, B, C;
  ...
  C = A.inverse() * // doesn't compile, inverse() returns a matrix type
      Eigen::Translation3f(...) *
      Eigen::AngleAxisf(...) *
      Eigen::Translation3f(...) *
      B;

  C = Eigen::Transform3f(A.inverse()) * // works, but a bit cumbersome
      Eigen::Translation3f(...) *
      ...

What's the reason that Transform3f::inverse() returns a matrix type
rather than a transform type?

Looking for a less cumbersome syntax I tried to use Eigen::Matrix4f
instead, but ran into a similar issue:

  Eigen::Matrix4f A;
  ...
  A = A * Eigen::Translation3f(...).matrix(); // error, no such method

  A = A * Eigen::Transform3f(Eigen::Translation3f(...)).matrix(); //
works, but a bit cumbersome to use

Any special reason that Translation3f and friends doesn't have a
matrix() method? Or am I doing something plain wrong here?

It's nothing I can't cope with, but in an ideal world the syntax would
be a bit less cumbersome :) I guess the above "workarounds" might
involve some unnecessary temporaries as well.

A reason to justify the current syntax would be greatly appreciated
(maybe that could be put in the documentation as well).


/Staffan

Attachment: signature.asc
Description: This is a digitally signed message part



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/