Pinocchio使用资料
1. 基本组成

Pinocchio is a modeling library
- Not an application
- Not a solver
- Some key features directly available
它做不到的事情:
- Inverse dynamics: TSID
- Planning and contact planning: HPP
- Optimal control: Crocodyl
- Optimal estimation, reinforcement learning, inverse
kinematics, contact simulation …
2. paper
Pinocchio is written in C++, with a full template-based C++ API, for efficiency purposes. All the functionalities are available in C++. Extension of the library should be preferably in C++.
However, C++ efficiency comes with a higher work cost, especially for newcomers. For this reason, all the interface is exposed in Python. We tried to build the Python API as much as possible as a mirror of the C++ interface. The greatest difference is that the C++ interface is proposed using Eigen objects for matrices and vectors, that are exposed as NumPy matrices in Python.
When working with Pinocchio, we often suggest to first prototype your ideas in Python. Both the auto-typing and the scripting make it much faster to develop. Once you are happy with your prototype, then translate it in C++ while binding the API to have a mirror in Python that you can use to extend your idea.
提升效率的原因:
- 充分利用几何描述的稀疏性
- 充分利用静态多态性
Pinocchio 支持通过与 CppADCodeGen 库结合,动态生成代码。CppADCodeGen 是基于 CppAD(一个支持自动微分的库)构建的,它可以在运行时生成高效的代码并用于机器人模型的具体计算。
- 动态代码生成的机制:Pinocchio 在某些计算场景下并不是直接使用预先编写的代码,而是通过运行时生成新的代码。具体来说,它会使用模板化技术和自动微分来生成一些特定的数学表达式或梯度计算公式。这些生成的代码会针对特定机器人的需求进行优化,并且可以在运行时就被直接执行。
- 优势:通过这种动态编译的方式,Pinocchio 能够根据机器人模型和任务的变化,生成更合适的代码。这不仅提升了性能,还可以减少不必要的计算量。与其每次都运行一个通用的代码逻辑,不如根据不同的情况和需求,生成专门的代码,从而提高效率。
3. DEMO启动
use Pinocchio to verify the dynamics of kuka iiwa7:
1 | from __future__ import division |
- 标题: Pinocchio使用资料
- 作者: Porcovsky
- 创建于 : 2025-06-15 21:36:45
- 更新于 : 2025-06-15 21:50:51
- 链接: https://pocro.github.io/2025/06/15/Pinocchio使用资料/
- 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。