{"id":5366,"library":"pin","title":"Pinocchio","description":"Pinocchio is a C++ library with Python bindings for efficient computation of Rigid Body Dynamics (RBD) algorithms and their analytical derivatives. Primarily used in robotics, biomechanics, and computer graphics, it provides state-of-the-art algorithmic solutions for poly-articulated systems, including closed-loop mechanisms and frictional contact problems. It is actively developed by Inria and is currently at version 3.9.0.","status":"active","version":"3.9.0","language":"python","source_language":"en","source_url":"https://github.com/stack-of-tasks/pinocchio","tags":["robotics","rigid-body dynamics","control","simulation","biomechanics","kinematics","dynamics"],"install":[{"cmd":"pip install pin","lang":"bash","label":"PyPI (pip)"},{"cmd":"conda install pinocchio -c conda-forge","lang":"bash","label":"Conda"}],"dependencies":[{"reason":"Python bindings rely on Eigen for linear algebra, exposed via eigenpy.","package":"eigenpy","optional":false},{"reason":"Underlying C++ library uses Boost.","package":"boost","optional":false},{"reason":"Provides common robot URDF models for examples and prototyping.","package":"example-robot-data","optional":true},{"reason":"A common browser-based visualizer for Pinocchio.","package":"meshcat","optional":true}],"imports":[{"note":"The 'se3' alias was common in Pinocchio 2.x but is deprecated in 3.x; 'pin' is now the recommended alias.","wrong":"import pinocchio as se3","symbol":"pinocchio","correct":"import pinocchio as pin"}],"quickstart":{"code":"import pinocchio as pin\nimport numpy as np\n\n# Create a default model (e.g., a simple 6-DOF manipulator)\nmodel = pin.buildSampleModel()\n\n# Create a data structure for algorithm buffering\ndata = model.createData()\n\n# Generate a random configuration\nq = pin.randomConfiguration(model)\n\n# Compute forward kinematics\npin.forwardKinematics(model, data, q)\npin.updateFramePlacements(model, data)\n\n# Print the position of the end-effector frame (last frame in the model)\n# (Note: model.frames is a list of all frames, data.oMf[frame.id] is its placement)\nend_effector_frame_id = model.frames[-1].body\nend_effector_position = data.oMf[end_effector_frame_id].translation\n\nprint(f\"Model name: {model.name}\")\nprint(f\"Random configuration (q): {q.T}\")\nprint(f\"End-effector position: {end_effector_position.T}\")","lang":"python","description":"This quickstart code initializes a Pinocchio model (a simple 6-DOF manipulator), generates a random joint configuration, computes the forward kinematics, and then prints the position of the end-effector frame. This demonstrates basic model loading and kinematics computation."},"warnings":[{"fix":"Update C++ code to use `pinocchio::` namespace. In Python, use `import pinocchio as pin`.","message":"The top-level C++ namespace `se3` has been changed to `pinocchio` in Pinocchio 3.x. The Python import idiom `import pinocchio as se3` is now deprecated.","severity":"breaking","affected_versions":"3.0.0 and later"},{"fix":"Migrate collision-related code to use `Coal` equivalents. Check `pinocchio/multibody/coal.hpp` and associated APIs.","message":"The collision detection library dependency transitioned from `FCL` to `Coal`. Related headers (e.g., `pinocchio/multibody/fcl.hpp`) and macros (e.g., `PINOCCHIO_WITH_HPP_FCL`) have been deprecated or removed.","severity":"breaking","affected_versions":"3.x series"},{"fix":"Ensure that your system or build environment meets the minimum required versions for Eigen and Boost.","message":"Pinocchio 3.x requires minimum versions of its C++ dependencies: Eigen 3.4+ and Boost 1.74+. Building from source with older versions of these libraries will fail.","severity":"breaking","affected_versions":"3.x series"},{"fix":"Always use `pip install pin` for the Pinocchio rigid-body dynamics library.","message":"The official Python package for Pinocchio is distributed on PyPI under the name `pin`, not `pinocchio`. There is an unrelated, older package also named `pinocchio` on PyPI which can cause confusion and incorrect installations.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'3.9.0':65 'activ':56 'algorithm':18,38 'analyt':21 'art':37 'articul':43 'bind':9 'biomechan':27,73 'bodi':15,69 'c':5 'close':47 'closed-loop':46 'comput':12,29 'contact':52 'control':71 'current':62 'deriv':22 'develop':57 'dynam':16,70,75 'effici':11 'friction':51 'graphic':30 'includ':45 'inria':59 'kinemat':74 'librari':6 'loop':48 'mechan':49 'pinocchio':1,2 'poli':42 'poly-articul':41 'primarili':23 'problem':53 'provid':32 'python':8 'rbd':17 'rigid':14,68 'rigid-bodi':67 'robot':26,66 'simul':72 'solut':39 'state':34 'state-of-the-art':33 'system':44 'use':24 'version':64","created_at":"2026-04-14T01:30:44.878977+00:00","updated_at":"2026-04-16T18:48:20.980079+00:00","problems":[{"fix":"Install using `pip install pin`. If installed from other sources, verify and set `PYTHONPATH` and `LD_LIBRARY_PATH` to include the Pinocchio Python bindings and shared libraries, respectively.","cause":"The Python package for the Pinocchio rigid-body dynamics library is named `pin` on PyPI, not `pinocchio`. Alternatively, if installed from source or a package manager other than pip/conda, necessary environment variables like `PYTHONPATH` or `LD_LIBRARY_PATH` might be missing or incorrect.","error":"ModuleNotFoundError: No module named 'pinocchio'"},{"fix":"Set the `LD_LIBRARY_PATH` environment variable to include the directory containing `libpinocchio.so`. For example: `export LD_LIBRARY_PATH=/opt/openrobots/lib:$LD_LIBRARY_PATH` (adjust path as per your installation).","cause":"This typically occurs on Linux when the dynamic linker cannot find the Pinocchio shared libraries. This often happens with installations from source or specific package managers (like robotpkg) where `LD_LIBRARY_PATH` is not correctly configured.","error":"ImportError: libpinocchio.so.X.Y.Z: cannot open shared object file: No such file or directory"},{"fix":"Ensure that NumPy arrays passed to Pinocchio functions or assigned to Pinocchio data structures have the exact dimensions and types expected. For scalar inputs, sometimes explicitly creating a NumPy array of size 1 (e.g., `np.array([value])`) can resolve the issue.","cause":"This error often arises when attempting to assign a NumPy array to a Pinocchio internal vector/matrix type, and the dimensions or element count of the NumPy array do not precisely match the expected size of the Pinocchio object. This can occur with scalars, requiring them to be wrapped in a specific-sized array.","error":"RuntimeError: The number of elements does not fit with the vector type."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"4.1.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://stack-of-tasks.github.io/pinocchio/","github":"https://github.com/stack-of-tasks/pinocchio","docs":null,"changelog":"https://github.com/stack-of-tasks/pinocchio/blob/devel/CHANGELOG.md","pypi":"https://pypi.org/project/pin/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-28","install_tag":null}}