Git Product home page Git Product logo

Comments (8)

joansola avatar joansola commented on June 16, 2024 1

For all immplementation issues, @artivis is the man :-) but yes, it seems that in the Tangent base class we could add this implementation, it would become immediately available to all Tangent classes.

from manif.

artivis avatar artivis commented on June 16, 2024 1

Hello there,

This feature is indeed missing and would be a nice addition. However I'm not sure what the syntax would be at the moment. Let me play with it a little and I'll come back with a proposal.

from manif.

joansola avatar joansola commented on June 16, 2024

We did not implement the Lie bracket in manif. But I agree this could be a valuable tool, and it should be easy.

@artivis ?

Regarding the formulas, if I am not wrong the Lie bracket can be computed as [a,b] = a^ b^ - b^ a^ for all matrix Lie groups. Then, for some groups perhaps there exist simplified forms. The result is an element of the Lie Algebra. In manif, this element could be represented back into the Cartesian tangent space:

[ a, b ]v = (a^ b^ - b^ a^)v

where v is the vee operator, so we would have the general implementation as

LieGroupTangent a, b;
LieGroupTangent ab_bracket = ( a.hat() * b.hat() - b.hat() * a.hat() ).vee();

I am not fully sure of what I wrote here. If you can confirm this, then this would be possibly added to manif.

from manif.

joansola avatar joansola commented on June 16, 2024

The infos above are confirmed here

https://math.stackexchange.com/questions/460079/is-the-lie-bracket-of-a-lie-algebra-of-a-matrix-lie-group-always-the-commutator

and here

"The standard Lie bracket for Lie algebras of matrix Lie groups is given by [A, B] = AB − BA."

which can be found here:

http://www.math.uchicago.edu/~may/VIGRE/VIGRE2010/REUPapers/Turzillo.pdf

from manif.

willat343 avatar willat343 commented on June 16, 2024

Yes @joansola that seems right to me. I didn't realise that before, and i can use ( a.hat() * b.hat() - b.hat() * a.hat() ).vee() in the meantime for my application. I've had a chance to skim a couple textbooks (e.g. Barfoot's State Estimation for Robotics) and I believe this applies for matrix lie groups.

For reference, Sophus implements this as a static function in each lie group class, taking A and B as arguments and returning the simplified form of [A, B] for that group. I don't see the general commutator implementation above, perhaps because they don't need it.

manif uses CRTP rather than virtual polymorphism, so i'm not sure off the top of my head what the best implementation would be. Something equivalent to the general commutator in lie_group_base.h (or tangent_base.h) and simplified implmentations in each derived class.

from manif.

willat343 avatar willat343 commented on June 16, 2024

One additional note is that it would be convenient to have a lie bracket function on the lie algebra elements themselves, which would avoid recomputation / unnecessary mapping to/from the tangent vector in my case. Perhaps this could be an overload, or a different function. For example:

LieGroupTangent lie_bracket(const LieGroupTangent::LieAlg& A, const LieGroupTangent::LieAlg& B) {
    return (A * B - B * A).vee();
}
LieGroupTangent lie_bracket(const LieGroupTangent& a, const LieGroupTangent& b) {
    return lie_bracket(a.hat(), b.hat());
}

Implementation of course will differ, but this is the idea.

from manif.

joansola avatar joansola commented on June 16, 2024

One key issue is: we do not have a class for the LieAlgebra space apart from the TangentBase::LieAlg type, and so the vee() operator is missing in manif. I wonder whether it can be added to the TangentBase class, with an API like so:

static TangentBase vee( TangentBase::LieAlg _v_hat)
{
   TangentBase v;
   // build v from _v_hat
   return v;
}

or even from the constructor, with someting like

TangentBase::TangentBase(TangentBase::LieAlg _v_hat)
{
   // build v from _v_hat
   coeffs() = v;
}

from manif.

willat343 avatar willat343 commented on June 16, 2024

An additional note is that the lie bracket also equals $[X, Y] = adj(X)Y = XY - YX$. where $adj$ is the small adjoint. See section 10.2.6 equation 10.37 of "Stochastic Models, Information Theory, and Lie Groups, Vol 2".

I thought I would point this out since the small adjoint operation is already defined in code, but it may not help at all.

from manif.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.