JuliaGeometry / CoordinateTransformations.jl

A fresh approach to coordinate transformations...
Other
179 stars 25 forks source link

Support for Lie Groups and Algebras #46

Closed jc211 closed 5 years ago

jc211 commented 5 years ago

I have a SLAM application where I want optimize for a transformation. I usually do this by representing the transformation using its lie algebra and subsequently finding the increment I need to add so that the cost function decreases.

I have seen mentioned in multiple places that this library is designed with SLAM in mind however I can't find any mention of Lie groups in the code. Is what I'm asking for currently supported by some other means perhaps? i.e. can I derive the transformation, get an increment and stay on the transformation manifold.

Or is it perhaps that this functionality needs to be added? Or perhaps created as a separate package. I'm mainly looking for an alternative for the Sophus C++ package and wondering if it should live here.

c42f commented 5 years ago

When I was actively using this package we hadn't fully realized its use for optimization purposes (though that was the end goal). I'm not sure if things have changed since then.

For SO3 our intention was to use a parameterization which ensured staying on the manifold of rotations, and optimizing in the space of the parameters of that rotation. Our answer to that was the package Rotations.jl, which provides many options for parameterizing SO3.

It appears that Sophus uses quaternions internally so perhaps this is a similar approach. https://github.com/strasdat/Sophus/blob/26c200265e2eb3d76e5ab00a99ada686d6a80d15/sophus/so3.hpp#L48

Does this help? It's true that this package (and Rotations) doesn't speak in the language of Lie groups, but we wanted to optimize many transformations not all of which have nice mathematical structure.

jc211 commented 5 years ago

I suppose the Rodrigues parameterization in Rotations.jl will get me through. Thanks for pointing the package out. That being said, I wonder if the way forward with regards to expressing nice mathematical transformations is through creating new packages to express SE3 and Sim3 just as you did with Rotations.jl

c42f commented 5 years ago

You could easily build a package which talks in the language of Lie Groups, and which uses the tools from Rotations and StaticArrays for the internal implementation. I'd be very interesting to know if there are concrete practical advantages to using a Lie Group / Lie Algebra formalism for this kind of optimization?

jc211 commented 5 years ago

For my purposes the Jacobians are already worked out in terms of the Lie algebras. The only thing I really need is a way to go from the algebra to the group. That itself is trivial. I suppose my thinking is that the Lie Group/Algebra formalism would be nice as most papers use it to express their minimization problems.

c42f commented 4 years ago

You may find https://github.com/RoboticExplorationLab/DifferentialRotations.jl/issues/1 interesting.