Giter Club home page Giter Club logo

Comments (4)

mnissov avatar mnissov commented on May 27, 2024 1

Regarding your test, you should test the first one using right-plus and regular minus
and the second one using left-plus and regular minus

I realize now I wasn't consistent between text and code, in that I introduce the Lie theory derived Jacobian first but assign it to the function jacobian2. As a result, just to be sure, when you mention "first one" and "second one" here you're referring to

  • "first one": jacobian derived via Lie theory, i.e. first equation in above text: $(\mathcal{X}^{-1}\cdot v)^{\wedge}$
  • "second one": jacobian inspired by Groves textbooks, i.e. second equation in above text: $-\mathcal{X}^{-1}\cdot v^{\wedge}$

The second Jacobian that you present is probably different, although you do not provide details on how \psi participates in C.

I went back to the book to find this and I think you may be right. Groves defines the attitude error as

$$
\begin{aligned}
\delta C_\beta^\alpha &= \hat{C}\beta^\alpha C\alpha^\beta\
&= I_3 + \left[ \delta \psi_{\alpha\beta}^{\alpha}\times \right]\
\end{aligned}
$$

for the error $\delta C_{\beta}^{\alpha}$, estimate $\hat{C}_{\beta}^{\alpha}$, and true value $C$. Rearranging this for the perturbed estimate results in something more familiar:

$$
\hat{C}{\beta}^{\alpha} = (I_3 + \left[ \delta\psi{\alpha\beta}^{\alpha}\times \right]) C_{\beta}^{\alpha}
$$

so you're right, this corresponds to a global perturbation rather than a local I suppose.
The jacobian should then be

$$ \begin{aligned} J &= \lim_{\tau\rightarrow\infty} \frac{(\tau\oplus R)^{-1} \cdot v - R^{-1}\cdot v}{\tau}\\ &= \lim_{\tau\rightarrow\infty} \frac{(R^\top e^{-\tau^\wedge}) \cdot v - R^{\top}\cdot v}{\tau}\\ &= \lim_{\tau\rightarrow\infty} \frac{R^\top ( I_3 - \tau^\wedge ) \cdot v - R^{-1}\cdot v}{\tau}\\ &= R^\top v^\wedge \end{aligned} $$

In hindsight, I think I made a typo in transcribing the Jacobian, his error function was written $e = meas - h(x)$ so I think that's where the minus comes from. This would be convenient because then the plots make a lot of sense I think.

Note I tweaked the plot a bit to run N simulations of L length. Otherwise the same:

Figure_1

from manif.

joansola avatar joansola commented on May 27, 2024

Hello @mnissov Morten

Regarding our Jacobian, it is correct according to the definition of the right Jacobian. The proof is through the chain rule and all formulas in the paper, and is supported by extensive unit testing in manif (which tests ALL jacobians for exactness using the small-perturbation approximations similar to those you use above):

D(X.inv * v) / DX =
  = D(X.inv * v) / D(X.inv) * D(X.inv)/DX 
  = -X.tr * v_x * (-Ad_X) 
  = X.tr * v_x * X 
  = [X.tr * v]_x

This Jacobian needs to be interpreted as follows: when X is perturbed locally with tau, the action of X.tr*v gets also perturbed. The Jacobian is the limit of the quotient of perturbations, when tau goes to zero. The important point here is that tau is defined in the tangent space local to X.

The second Jacobian that you present is probably different, although you do not provide details on how \psi participates in C. If you happen to use psi=log(C1 * C2.inv) then \psi is a vector tangent to SO(3) at the identity, and not local to C. In such case, you get what we call the left Jacobian. I reckon this is the reason you observe this difference.

If this is the case, then both Jacobians are different.

Regarding your test, you should test the first one using right-plus and regular minus

  e = ((X (+) tau).inv * v) - (X.inv * v + J_1*tau)                (1)

and the second one using left-plus and regular minus

  e = ((tau (+) X).inv * v - (X.inv * v + J_2*tau)                 (2)

Since you are only evaluating with (1), you should find that our Jacobian performs well, and the other one does not. However, if you use random X, it may happen that in some occasions X is close to the identity, in which case both Jacobians will be practically the same. Then, it may happen that the second Jacobian performs better than the first, just by some random effect. The first Jacobian should however perform well in all cases using test (1).

Does this make sense?

from manif.

joansola avatar joansola commented on May 27, 2024

I realize now I wasn't consistent between text and code, in that I introduce the Lie theory derived Jacobian first but assign it to the function jacobian2. As a result, just to be sure, when you mention "first one" and "second one" here you're referring to

* "first one": jacobian derived via Lie theory, i.e. first equation in above text: (X−1⋅v)∧

* "second one": jacobian inspired by Groves textbooks, i.e. second equation in above text: −X−1⋅v∧

Correct, first one is Lie, second one is Groves

Figure_1

So manif uses right-Jacobians, therefore local perturbations, and Groves uses left-Jacobians, therefore global perturbations.

It seems then it all fits perfectly!

from manif.

mnissov avatar mnissov commented on May 27, 2024

yes! thanks so much for the help

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.