[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Toon-members] SE3: relation of input-translation to output-translat
From: |
Rafael Spring |
Subject: |
Re: [Toon-members] SE3: relation of input-translation to output-translation |
Date: |
Tue, 23 Jun 2009 21:10:39 +0200 |
Thanks very much for clearing that up! I was only familiar (sort of)
with representing rotations by the exponential map but didn't know
this extends to euclidean transforms as well.
I should get more familiar with this kind of representation.
Rafael
--------------
Gerhard Reitmayr wrote:
Hi Rafael,
The relationship between the 6 vector and the resulting 4x4 matrix is
given by the Lie algebra of SE(3). Essentially the following goes on:
the 6-vector (tx, ty, tz, a, b, c) is put into a 4x4 matrix of the
following form:
0 -c b tx
M = c 0 -a ty
-b a 0 tz
Then the transformation matrix T is the matrix exponential of M:
T = expm(M)
the matrix exponential is not the exp of all the elements, but the
Taylor series of exp applied to the matrix M:
T ~ I + M + M*M/2 + ...
(Its not actually calculated that way, but that doesn't matter)
The 6 vector only defines a linear combination of 6 matrices:
M = tx Gx + ty Gy + tz Gz + a Ga + b Gb + c Gc
where the Gs have the 1s to put the elements into M.
Why all of that ?
One way to think about it is in terms of a limit:
I + M is not really an SE(3) but sort of a description of what we
want. But
I + M/2 is closer to an SE(3) but only have the transformation, so
lets apply it twice:
(I + M/2)(I + M/2)
doing this more finely yields:
(I + M/n)(I + M/n)....(I+M/n) = (I + M/n) ^ n
each element is almost an SE(3) (for large n) and thus the product is
close to an SE3(3). We are now moving along the represented
transformation in small steps. in the limit we get:
T = lim (I + M/n) ^ n for n-> inf, which is just another definition
of exp.
Another way is via differentials:
Essentially all the matrices M (that can be defined by these 6
vectors) are possible differentials of the identity matrix I when
changed to a small different SE(3) transformation. This is quite
clear for the translation, but a bit less obvious for the rotation.
However, if you use any parameterisation of a rotation matrix and
differentiate it at the identity, you can observe just that.
T = expm(M) is then only the solution to a differential equation
where M is the differential:
dT/dt = M and T(0) = I and
T = Int M dt from 0 to 1
So, yes it was ment to work like that... which is a bit different
than first applying R then T. I hope I could clear that up a bit.
cheers,
Gerhard
--------------
Rafael Spring wrote:
Hello gentlemen,
I am using TooN for a while now and I really appreciate it. Scope,
usability and speed are really great and I couldn't imagine working
without it.
However, today, I've had some weird behavior and I'm unsure if TooN
is supoosed to behave like that (Btw. I am using TooN beta3) or if my
understanding of SE3s is insufficient. The question boils down to
what happens to an input translation after exponentiating.
Consider the following sourcecode:
----
Vector<3> rotation = makeVector(0.4, 0.6, 0.15); //arbitrary numbers..
Vector<3> translation = makeVector(-1, 0, 0.5); //arbitrary numbers..
Vector<6> mu;
mu.slice(0,3) = translation;
mu.slice(3,3) = rotation;
SE3<> se = SE3<>::exp(mu);
Vector<3> t = se.get_translation();
----
Now, I was expecting:
t == (-1, 0, 0.5)
following the assumption that a euclidean transformation by an SE3
equals to an orthogonal transformation (exp'ing the rotation part of
mu) + a translation.
The true value, however, is:
t == (-0.789750 , -0.19886, 0.734775)
So I reversed my assumption: It could be a translation by t followed
by an orthogonal transform (this would correspond to the translation-
part of mu being the inverse camera translation as seen from camera 1
and get_translation() being the inverse translation as seen from
camera 2). This assumption, however, was neither confirmed:
----
// make a rotation-only SE3
Vector<6> mu_ = mu;
mu_.slice(0,3) = makeVector(0,0,0);
SE3<> se_ = SE3<>::exp(mu_);
// make a translation-only SE3 Vector<6> mu__ = mu;
mu__.slice(3,3) = makeVector(0,0,0);
SE3<> se__ = SE3<>::exp(mu__);
// 1st translate then rotate
Vector3 t_ = (se_ * se__).get_translation();
// t_ == (-0.5293 , -0.412372 , 0.89431)
----
Now to the part beyond my understanding: The second assumption holds
(roughly) if I halve the rotation amount in mu:
----
Vector<6> mu_;
mu_.slice(0,3) = makeVector(0,0,0);
mu_.slice(3,3) = rotation / 2.0;
SE3<> se_ = SE3<>::exp(mu_); //se_ is half the rotation
Vector<6> mu__ = mu;
mu__.slice(3,3) = makeVector(0,0,0);
SE3<> se__ = SE3<>::exp(mu__); //se__ is only translation
Vector3 t__ = (se_ * se__).get_translation(); // 1st translate then
rotate
// t__ == (-0.8024 , -0.19517 , 0.75371)
// t__ is roughly == t
----
Is this within the general logic of SE3 members (am I missing
something?) or might there be something wrong with the SE3 class?
Thanks!
Rafael
- Re: [Toon-members] SE3: relation of input-translation to output-translation,
Rafael Spring <=