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.78k stars 375 forks source link

Add example to visualize floating base velocity #2143

Closed fabinsch closed 7 months ago

fabinsch commented 7 months ago

After several questions/discussions (e.g. #1657, #1357, #1137, #1122) about the conventions used for the velocity vector for different joints that can serve as a floating base, I started a small script to verify.

This script builds a simple robot that is just a box with dimensions x=0.8, y=0.4, z=0.2. The floating base can be set to either JointModelFreeFlyer, JointModelSphericalZYX or JointModelSpherical. It prints several properties of the mode, increments each velocity component by 1, calculates the resulting a, v_next, q_next via pin.aba and visualizes the integrated configuration q_next via MeshCat. This could be useful for people who want to try it out for themselves. Also, we could add more joints in the future to test them as well.