Custom Variables

A handy macro can help define new variables which shows a Pose2 example with 3 degrees of freedom: $X, Y, \theta$. Note that we use Manifolds.jl as fundamental abstraction for numerical operations. Users can choose how to represent data, for example RoME.Pose2 is defined as a Manifolds.SpecialEuclidean(2), and the default data representation is (but doesn't have to be) Manifolds.identity_element(SpecialEuclidean(2)) – i.e. likely an Manifolds.ArrayPartition or Manifolds.ProductRepr (older).

@defVariable StructName manifolds<:ManifoldsBase.AbstractManifold

A macro to create a new variable with name StructName and manifolds. Note that the manifolds is an object and must be a subtype of ManifoldsBase.AbstractManifold. See documentation in Manifolds.jl on making your own.


DFG.@defVariable Pose2 SpecialEuclidean(2) ProductRepr([0;0.0],[1 0; 0 1.0])

The macro generates the necessary code for IncrementalInference to be able to use a new user defined variable – e.g.:

addVariable!(fg, :x0, MyVariable)

Since RoME.jl#244 the Caesar.jl system of packages fundamentally integrated with Manifolds.jl.