artivis / manif

A small C++11 header-only library for Lie theory.
https://artivis.github.io/manif
MIT License
1.46k stars 239 forks source link

Practical benefit of SE(3) / Sim(3) vs T(3) x SO(3) #281

Closed w-hc closed 5 months ago

w-hc commented 9 months ago

On Page 11 of micro lie theory, Section "Example 7: SE(n) vs T(n) x SO(n)", there's a discussion on the difference between these two ways of parameterizing rigid body poses: "simultaneously as a continuum" vs "chained translation+rotation".

I wonder if empirically there is a significant difference for these two approaches, since SE3 does involve more complicated expressions for right Jacobians.  

In a similar vein, what would be the practical benefit of Sim3 vs simple rotation + translation + scaling?

I have seen for example that the tutorial by Blanco uses pseudo-exp and pseudo-log for SE3, whereas sophus and lietorch implement full Sim3 support.

Thanks a lot for the help.

artivis commented 8 months ago

Hi @w-hc,

tldr As the update tends to infinitely small, these representations tend to be the same. It is only as the update grows away from zero that the difference shows.

@joansola may have a better explanation and most importantly I remember a drawing of several circles for different tau that might be useful here.

joansola commented 8 months ago

Hi @w-hc

This is the drawing @artivis is referring to:

imatge

They all represent motion integration of a body in the plane, following linear velocity v and angular velocity w for a period of time dt.

The left sketch is what you do in SE(2). You can see that the black arc is a "simultaneous translation and rotation as a continuum". If X=[R T ; 0 1], the formula for this motion is

X+ = X (+) [v*dt, w*dt] = [R*exp(w*dt),  T + V(w_dt)*R*v*dt ; 0, 1]

and the whole arc can be computed in just one step, no matter how large w*dt is, as long as v and w are constant..

In the other sketches, the blue trajectories correspond to integrating motion in R2xSO(2) for different values of w*dt. The validity of the approximation depends on the magnitude of w*dt = d_theta. You can see that the blue trajectory performs "chained translation and rotation". The formula for each step is:

X+ = X (+) [v*dt, w*dt] = [R*exp(w*dt),  T + R*v*dt ; 0, 1]

that is, the V() has become the identity matrix. For this, you need small steps in w*dt, even if v and w are constant, otherwise you would just translate along the X axis and only turn at the end of the trajectory, which would be awfully wrong.

The red trajectories are not relevant here -- they are just a way to produce "chained translation and rotation" that respects the continuous trajectory at the evaluation points. But this is NOT what happens in plain R2xSO(2).

In 3D it's the same idea, just one has to consider the magnitude |w|*dt = |d_theta| as the parameter that determines the validity of the approximation.

In almost all practical cases, R3xSO(3) does just fine.

However, if you want to use the Lie math for Invariant filtering, that is, if you want to pull from some interesting properties of Lie groups that allow you to build EKF's that act as if they were linear, then you have no more choice and you need to select your group carefully. Read Bonnabel and Barrau papers on these matters is you are interested.

stefangachter commented 8 months ago

@joansola, thanks for the concise explanation! Is the figure from an article that is publicly available? I would like to dig a little more into the "integration" part.

joansola commented 8 months ago

Hi @stefangachter

You can consult Section 2.3.4. of this document . However, the document does not deal with Lie theory, just with good old plain motion integration. It happens that the drawing serves well the purpose of this issue.

joansola commented 8 months ago

It is finally interesting to see that the integration of the arc, leading to eqs. 2.41:

imatge

is equivalent to the exponential of SE(2), which can be seen in eqs. 156--158 in the micro-Lie paper:

imatge

just see that the terms sin theta / theta and (1 - cos theta) / theta match in both cases, as it must be.