stack-of-tasks / pinocchio

A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
http://stack-of-tasks.github.io/pinocchio/
BSD 2-Clause "Simplified" License
1.82k stars 382 forks source link

python impulse model #906

Closed ddliu365 closed 4 years ago

ddliu365 commented 4 years ago

I am working on a project of impulse model, how to use impulse model in python with Pinocchio?

jcarpent commented 4 years ago

Dear @ddliugit,

Without more details, it is hard for Pinocchio's support team to provide guidance. You may have a look at the tutorials of Pinocchio which seems to a good starting point: https://gepettoweb.laas.fr/doc/stack-of-tasks/pinocchio/master/doxygen-html/md_doc_d-practical-exercises_1-directgeom.html

ddliu365 commented 4 years ago

I thought you implemented the impulse dynamics in rigid body dynamics algorithms. Where can I find the relevant Pinocchio code in that section?

I want to calculate the following model:

Mv+ - Jc^TA = Mv- Jcv+ = -eJcv-

e is the restitution coefficient that considers compression /expansion

jcarpent commented 4 years ago

You can find the relevant details here: https://gepettoweb.laas.fr/doc/stack-of-tasks/pinocchio/master/doxygen-html/namespacepinocchio.html#a3b3ac8f8d2b0bb7ec4aeea811d5d1800

The code in Python follows the same signature as in C++.

ddliu365 commented 4 years ago

Thanks. Really appreciate your help.

jcarpent commented 4 years ago

@ddliugit Your welcome.

gabrielebndn commented 4 years ago

The code in Python follows the same signature as in C++.

@jcarpent not exactly. For the curent version, v2.1.8, Python is using the convention of setting q=None in order to employ the variant with no arguments. , which was removed and replaced by a signature more similar to C++ by #902 (a non-backward-compatible change, by choice).

If you want to avoid that some people start employing the removed signature, I suggest a new release

ddliu365 commented 4 years ago

@jcarpent can you help release a new version for install on Mac? I need q for calculation.

jcarpent commented 4 years ago

Could do that indeed.

jcarpent commented 4 years ago

@ddliugit How do you install it on OSX?

ddliu365 commented 4 years ago

brew install pinocchio

ddliu365 commented 4 years ago

can you update homebrew formula to link to new release

current on Mac, it is still 2. 1. 8

jcarpent commented 4 years ago

Done!

ddliu365 commented 4 years ago

Thanks! It works!

BTW, when will you test Pinocchio on Mac Catalina?

jcarpent commented 4 years ago

It should work already. You just need to do brew install pinocchio --build-from-source

ddliu365 commented 4 years ago

That's good news! I will test it after installing Catalina.