Comments (7)
For reference:
from manif.
And also:
where the strange derivatives in the 3rd row are precisely and respectively the left- and right- Jacobians of Y=f(X)
from manif.
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.
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.
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.
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.
@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)
- Links for c++ examples broken in documentation
- Motivation for the ESKF in the paper example HOT 6
- Support for objects which evolve on manifold but do not form group (Unit Sphere manifold, as an example) HOT 2
- Provide a way to check if group is compact or not at compile and run time. HOT 8
- se2_localization example displaying trajectory in xy HOT 3
- Feature request: Cotangent space HOT 2
- Question about left Jacobian trick in exp of SE(3). Is it just a special case? HOT 3
- Question about "A mciro lie theory..." and "Quaternion kinematics for the ESKF" HOT 2
- Question regarding Jacobian of inverse action HOT 4
- Lie Bracket operation HOT 8
- Paper / Cheat Sheet vs Code inconsistency HOT 2
- Broken with current Eigen3? HOT 7
- Global versus local tangent space HOT 2
- Parsing an Eigen::Isometry3d matrix HOT 5
- Support specifying C++ standard from CMake command line when compiling Python bindings HOT 2
- cc1plus(48849) malloc: *** mmap(size=2097152) failed (error code=12) HOT 2
- Minus operator of SE(3) in paper HOT 1
- Practical benefit of SE(3) / Sim(3) vs T(3) x SO(3) HOT 5
- cast from float to double HOT 4
- Confused by Ceres Jacobian Explanation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from manif.