decargroup / navlie

A state estimation package for Lie groups!
https://decargroup.github.io/navlie/
MIT License
159 stars 13 forks source link

Add a composition operation to Lie group states #63

Closed vkorotkine closed 1 year ago

vkorotkine commented 2 years ago

Consider the problem of compounding two pose transformations, T_ab and T_bc to get T_ac. This corresponds to the \circle sign in the micro lie paper. The way to do this in pynav currently is to do matrix multiplication ad-hoc in the script. However, this becomes tedious e.g. for quaternions, or more complicated groups with their own defined composition (e.g. The Geometry of Navigation Problems by Barrau and Bonnabel).

This issue is to add a "compose" method to the state class, which could work similarly to the minus operator. For the pose transformation example we would do T_ac = T_ab.compose(T_bc)

CharlesCossette commented 2 years ago

Yea, micro Lie theory calls it "composition" but i think most textbooks refer to this as the group-defining "group operation". Nevertheless, yea, we could add this to the MatrixLieGroupState base class and it will be inherited by all the Lie group states. We should also think about adding this to CompositeState which performs the pair-wise dot operation on all substates. Mimicking the liegroups package from UTIAS i personally would do

T_ac = T_ab.dot(T_bc)

also mirrors numpy at the same time, which is appropriate since it is actually matrix multiplication under the hood

CharlesCossette commented 1 year ago

Whoever does this, while you're doing it, might as well add also add two additional static methods: identity() and random() to MatrixLieGroupState