Git Product home page Git Product logo

Comments (10)

andreadelprete avatar andreadelprete commented on July 20, 2024

Actually at the time of writing I didn't know Pinocchio had a built-in method to do that. I wonder whether they do something more than Cholesky. Maybe they exploit sparsity?

Anyway computing directly the product J M_inv, rather than computing M_inv and then multiplying times J, is in general faster, especially if J has less rows than columns.

from consim.

hammoudbilal avatar hammoudbilal commented on July 20, 2024

yes, they actually compute it by using a modified ABA. I will time both approaches before closing this issue

from consim.

hammoudbilal avatar hammoudbilal commented on July 20, 2024

here are some results to close this issue,
computation time:
-using pinocchio built in Minv: for a point mass time to compute M(6,6) is 1 us. For solo8 where M(14,14) it takes 6 us.
-using eigen inverse method: for a point mass time to compute M(6,6) is 2 us. For solo8 where M(14,14) it takes 6 us same as pinocchio.
accuracy:
using pinocchio built in method shows a closer match to the euler simulator, here is the base height from the sinusoid motion using TSID, first figure is using pinocchio's method, the second one is using Eigen::MatrixXd::inverse()

pinMinv

eigenMinv

for now I will keep using the pinocchio provided method

from consim.

andreadelprete avatar andreadelprete commented on July 20, 2024

It's really weird that you get significantly different results. I was expecting to see just different computation times, but same numerical results. What if you multiply M times its inverse? How close is the result to the identity matrix in the two cases?

from consim.

hammoudbilal avatar hammoudbilal commented on July 20, 2024

I will reopen it until I check this and post some results

from consim.

andreadelprete avatar andreadelprete commented on July 20, 2024

These results are a bit weird to me. It seems that both Euler and Exponential are rather independent of the time step, and they give different results regardless of how much you decrease the time step. In theory the two integration methods should converge to the ground truth as you decrease the time step, as it was the case for the point-mass simulation.

from consim.

hammoudbilal avatar hammoudbilal commented on July 20, 2024

I agree, I tried decreasing integration time step for both simulators as a sanity check, things start to diverge. I will write proper unit testing to explore this issue

from consim.

andreadelprete avatar andreadelprete commented on July 20, 2024

I've run some tests in Python comparing the approaches for computing the forward dynamics:

  • pin.crba + numpy.linalg.solve
  • pin.aba
  • pin.computeMinverse
  • pin.cholesky.decompose + pin.cholesky.computeMinv

The first two give exactly the same result. The last two do not work.
I've opened an issue to ask which approach should be the best: stack-of-tasks/pinocchio#1215

from consim.

andreadelprete avatar andreadelprete commented on July 20, 2024

I actually had a bug in my script. Now also pin.computeMinverse gives the same results as the first two methods (I haven't tested the pin.cholesky approach yet).

from consim.

andreadelprete avatar andreadelprete commented on July 20, 2024

I'm gonna close this issue and open a new one trying to make it clean

from consim.

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.