Giter Club home page Giter Club logo

Comments (7)

joansola avatar joansola commented on May 13, 2024 1

For reference:

image

from manif.

joansola avatar joansola commented on May 13, 2024

And also:

image

where the strange derivatives in the 3rd row are precisely and respectively the left- and right- Jacobians of Y=f(X)

from manif.

artivis avatar artivis commented on May 13, 2024

API-wise, another solution could be to rely on different types. In the futur I would like to introduce the Jacobian traits (on branch jacobian_traits) which allows for a semantically nicer notation e.g.:

manif::Jacobian<SE3, SE3> J_Y_X;          // == Eigen::Matrix<double, 6, 6>
manif::Jacobian<SE3, Vector3> J_X_v       // == Eigen::Matrix<double, 6, 3>
manif::Jacobian<Vector3, Vector3> J_vb_va // == Eigen::Matrix<double, 3, 3>

We could go all the way down and create a class Jacobian<LHS, RHS, Type> by inheriting from Eigen::Matrix. The template parameter Type here is an option to either specify left or right Jacobian with default to right.
It would lead to something like

manif::Jacobian<SE3, SE3> right_J_inv_x;
manif::Jacobian<SE3, SE3, manif::Left> left_J_inv_x;
...
X.inverse(right_J_inv_x);
X.inverse(left_J_inv_x);

This implies some heavy modifications but after a quick look I would say it is feasible.

from manif.

joansola avatar joansola commented on May 13, 2024

Wow this looks neat!

However, I wonder if it is a good idea to have the left/right thing kind of hidden inside of the matrix template definition. I mean it can be confusing for example for finding bugs once the code is done, because the trace for left/right is perhaps up in some typedef or variable declaration, far from the actual function calls. What do you think?

from manif.

artivis avatar artivis commented on May 13, 2024

Late answer...
First I think that my last proposal is best in terms of design and overall 'look'. The alternatives are much less practical or plain ugly (as you pointed).
We could introduce some compile-time sanity checks such that the following would result in a compilation error:
right_J_inv_x * left_J_inv_x ==> Error: You are mixing right and left Jacobians.
Those checks could be in turned off with a compilation flag if someone wants to.

from manif.

artivis avatar artivis commented on May 13, 2024

Pasting from #132 (comment)

Left vs right Jacobians, #116. Thanks for bringing this up, this is indeed an important discussion. Personally, I have set the development of the control-toolbox set up such that it exclusively uses local perturbations, right plus and minus and right Jacobians. Our main argument why we go down that path is because we are using a family of solvers based on (local) sequential linear-quadratic programming, see e.g. here or here , which are expressed in a differential formulation in their most natural and wide-spread form. Personally, I have made a number of experiments where I compared "global" and "local" formulations. In practice, the "local" formulation does lead to a few advantages, which is why we have almost exculsively adopted that variant.

from manif.

artivis avatar artivis commented on May 13, 2024

@joansola I've been revisiting this topic and the conclusion is that the designed I proposed a while back (see below) is basically not doable without giving up the use of Eigen::Ref for jacobians arguments, which I believe is something we must keep.

Not doable:

manif::Jacobian<SE3, SE3> right_J_inv_x;
manif::Jacobian<SE3, SE3, manif::Left> left_J_inv_x;
...
X.inverse(right_J_inv_x);
X.inverse(left_J_inv_x);

So back to api design discussion... I really don't know what's best here;

  • In the CMAKE step
  • As a runtime function manif::options::setRightJacobians() or whatsoever
  • As a flag in the function calls, e.g. X.inverse(J, manif::LEFT_JAC)
  • other?

Unfortunately the most practical solution is likely the argument flag X.inverse(J, manif::LEFT_JAC).

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.