Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic API #1

Closed
joansola opened this issue Apr 18, 2018 · 4 comments
Closed

Basic API #1

joansola opened this issue Apr 18, 2018 · 4 comments

Comments

@joansola
Copy link
Collaborator

This is a first attempt. Derived classes must implement all methods:

template <Size vector_size; Size manifold_size>
class manifold {
typedef Matrix<Scalar, vector_size, 1> VectorType;
typedef Matrix<Scalar, manifold_size, 1> ManifoldType;
typedef Matrix<Scalar, vector_size, vector_size> JacobianType;

// First, a bunch of static methods:

// lift and retract
static VectorType lift(ManifoldType);
static ManifoldType retract(VectorType);

// inverse and compose
static ManifoldType inverse(ManifoldType);
static ManifoldType compose(ManifoldType m1, ManifoldType m2);
static ManifoldType between(ManifoldType m1, ManifoldType m2);

// right plus and minus
static ManifoldType rplus(ManifoldType, VectorType);
static VectorType rminus(Manifoldtype, ManifoldType);

// left plus and minus
static ManifoldType lplus(VectorType, ManifoldType);
static VectorType lminus(Manifoldtype, ManifoldType);

// left and right Jacobians
static JacobianType Jr(VectorType);
static JacobianType Jr_inv(VectorType);
static JacobianType Jl(VectorType);
static JacobianType Jl_inv(VectorType);

// Basic Jacobians
static JacobianType inverse_jac(ManifoldType);
static JacobianType compose_jac_m1(ManifoldType m1, ManifoldType m2);
static JacobianType compose_jac_m2(ManifoldType m1, ManifoldType m2);
// Other Jacobians might be added

// Action of the manifold on vectors
static VectorType operator * (ManifoldType, VectorType)
// other operations might be added

// then actions applied on objects
ManifoldType inverse();
ManifoldType rplus(VectorType);
ManifoldType lplus(VectorType);
VectorType rminus(ManifoldType);
// etc, replicate most of the statics, but using the manifold object as the first input param
@joansola
Copy link
Collaborator Author

joansola commented Apr 18, 2018

It's more probably this (I'm not sure about CRTP):

template<typename ManifoldType, typename VectorType>
class manifold {
...
}

@joansola
Copy link
Collaborator Author

joansola commented Apr 19, 2018

Actually, this looks far more CRTP:

template<typename Derived>
class manifold {
typedef Derived::ManifoldType ManifoldType;
typedef Matrix<ManifoldType::Scalar, ManifoldType::VectorSize, 1> VectorType;
typedef Matrix<ManifoldType::Scalar, ManifoldType::VectorSize, ManifoldType::VectorSize> JacobianType;
...
}

you see my point...

@artivis
Copy link
Owner

artivis commented Apr 19, 2018

Thanks for this first feedback.

Let us put aside the Jacs at first because I'm not sure yet how to deal with their type (how to define it and forward it to the crtp base class).

I propose we first agree on the semantic, then the overall API and finally on the implementation.
For instance, in your comments, the result of a lift is of type VectorType. So far I have called it a Tangent...

@artivis
Copy link
Owner

artivis commented Dec 7, 2018

Closing this since the API is fairly stable now.

@artivis artivis closed this as completed Dec 7, 2018
artivis pushed a commit that referenced this issue Jul 13, 2021
artivis pushed a commit that referenced this issue Jun 29, 2024
Support Ceres both pre/post 2.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants