Python inverse kinematics for your robot model based on Pinocchio.

Related tags

Deep Learningpink
Overview

Pink

build Documentation PyPI package Status

Python inverse kinematics for your robot model based on Pinocchio.

Upcoming changes

Pink's API is not stable. Expect the following upcoming changes:

  • Import task template from pymanoid
  • Reformulate task gains as time constants

Installation

First, install Pinocchio, for instance by pip install pin.

Then install Pink by:

pip install pin-pink

Usage

Under construction...

Example

Under construction...

History

Pink implements the same task-based inverse kinematics as pymanoid, but it is much simpler to install and runs faster thanks to Pinocchio. Its internal math is summarized in this note. If you find yourself needing to read that to use the library, it means the API has abstraction leakage, please open an issue :-)

Comments
  • pink installation on mac

    pink installation on mac

    Hello Stephan,

    Thank you for your effort in maintaining this nice repo!

    While using pink, I get the following two questions for you.

    1. I've installed pink on my mac which is intel OSX Monterey 12.5.1 and I am using anaconda virtual environment (python version 3.8). When I tried to run the upkie_crouching.py example, it kept complaining there is no module named pink.models. So, instead of running the script, I manually tried opening the python interpreter(python version 3.8) in the same anaconda environment and typed the code in upkie_crouching.py line by line, and it successfully imported all the modules. I don't know how this could be possible. Do you have anything in your mind?

    2. Other than the aforementioned software issue, I have another question regarding the inverse kinematics solver interface (API). I have a 7-DoF robotic manipulator which has a holonomic constraint (q_1 = q_2) so it has 6 active joints with one passive joint. Given any cartesian tasks, I would like to solve the inverse geometry problem to get the joint positions satisfying the holonomic constraint. In this case, I think one way to solve the problem is by setting the holonomic constraint as a task in the cost function and giving the larger task gain compared to the cartesian task. Another way to solve the problem is using projected jacobian (J_cartesian_task * N_holonomic_constraint) with N = I - JJ_pseudo_inverse. Do you think those two methods sound okay to obtain the solution that I want? If so, can you point out which API in pink I should use to set the holonomic constraint as a cost in the QP (I think I could try the latter one by myself)?

    Thank you, Seung Hyeon

    opened by shbang91 2
  • Display a TF tree using pinocchio model

    Display a TF tree using pinocchio model

    Dear Caron: I found this repo by using Pinocchio when I tried to learn more about Meshcat, and thanks a lot for your code, I get some inspiration for drawing a TF tree for a robot model. My understanding of this code in pink

    meshcat_shapes.frame(viewer["left_contact_target"], opacity=0.5)
    

    is that we will replace the old object with a new frame. My question is if we could just add the frame by using addGeometryObject?

    Thanks for your help! heaty

    opened by whtqh 1
  • Posture task doesn't work with continuous joints

    Posture task doesn't work with continuous joints

    Continuous joints have nq=2, whereas the posture task assumes nq=1 for revolute joints so that the tangent twist between two joint configurations is simply their difference. This will need to be generalized.

    • Example: see WIP_kinova_gen2_arm.py in the examples folder.
    • Related: https://github.com/stack-of-tasks/pinocchio/issues/1751
    • Related: https://github.com/stack-of-tasks/pinocchio/issues/794
    opened by stephane-caron 1
  • CVXOPT does not handle infinity

    CVXOPT does not handle infinity

    When there is no velocity bound on a joint, Pink currently sets inequality constraints as $-\infty < v_i < \infty$. But with CVXOPT this approach yields ValueError: domain error.

    Possible solutions:

    • Trim large values (might not generalize well)
    • Add some post-processing to remove redundant inequalities for CVXOPT specifically
    • Avoid such inequalities altogether
    opened by stephane-caron 0
  • Joint limits for planar joints

    Joint limits for planar joints

    The omnidirectional three-wheeled robot added by https://github.com/tasts-robots/pink/pull/14 does not work yet because of joint limits for its root planar joint.

    This issue will be fixed by https://github.com/tasts-robots/pink/pull/12.

    bug 
    opened by stephane-caron 0
  • Improve joint limit computations

    Improve joint limit computations

    Performance increase is 5x as of 3f2feae3396bbc847a843b34c9ce162f75e55596 (on Upkie model):

    In [1]: from pink.limits import compute_velocity_limits_2, compute_velocity_limits             
    
    In [2]: %timeit compute_velocity_limits(configuration, dt)                                     
    68.1 µs ± 5.7 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
    
    In [3]: %timeit compute_velocity_limits_2(configuration, dt)                                   
    13.4 µs ± 596 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)
    
    opened by stephane-caron 0
Releases(v0.6.0)
  • v0.6.0(Dec 1, 2022)

    This release makes the solver argument mandatory for all calls to solve_ik.

    Note that the project is still in beta, so don't expect proper deprecation paths / API-change preemptive warnings before it hits v1.0.0 :wink:

    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Sep 26, 2022)

    With this release, Pink handles more general joint types, including fixed or free flyer root joints, unbounded joints (called continuous in URDF), etc. New examples showcase this on both arms :mechanical_arm: and legged :mechanical_leg: robots.

    Banner for Pink v0.5.0

    Under the hood, this release also improves on various points of the QP formulation (joint limits, posture task, ...) so that it works nicely with more solvers (e.g. CVXOPT), beyond quadprog and OSQP which were the two main solvers so far.

    Added

    • Body task targets can be read directly from a robot configuration
    • Example: double pendulum
    • Example: Kinova Gen2 arm
    • Example: loading a custom URDF description
    • Example: visualization in MeshCat
    • Example: visualization in yourdfpy
    • Generalize configuration limits to any root joint
    • Handle descriptions that have no velocity limit
    • Handle general root joint in configuration limits
    • Handle general root joint in posture task
    • Handle unbounded velocity limits in QP formulation
    • Posture task targets can be read directly from a configuration
    • Simple rate limiter in pink.utils

    Changed

    • Raise an error when querying a body that doesn't exist
    • Transition from pink.models to robot_descriptions
    • Update reference posture in Upkie wheeled biped example
    • Warn when the backend QP solver is not explicitly selected

    Fixed

    • Unbounded velocities when the backend solver is CVXOPT
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Jun 21, 2022)

    This release brings documentation, full test coverage, and handles robot models installed from PyPI.

    Also, it indulges in a project icon :wink:

    Added

    • Coveralls for continuous coverage testing
    • Document differential inverse kinematics and task targets
    • Single-task test on task target translations mapped to IK output translations

    Changed

    • Argument to build_from_urdf functions is now the path to the URDF file
    • Bumped status to beta
    • Examples use the jvrc_description and upkie_description packages
    • Use jvrc_description and upkie_description packages from PyPI
    • Task is now an abstract base class

    Fixed

    • Unit tests for robot models
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Mar 30, 2022)

    This release adds proper handling of joint position and velocity limits.

    Added

    • Joint velocity limits
    • Configuration limits

    Changed

    • Bumped status to alpha
    • Configuration limit check now has a tolerance argument
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Mar 29, 2022)

    This pre-release adds the regularizing posture task and corresponding unit tests.

    Added

    • Check configuration limits against model
    • Mock configuration type for unit testing
    • Tangent member of a configuration
    • Unit test the body task

    Changed

    • Specify path when loading a model description
    • Switch to the Apache 2.0 license
    • build_jvrc_model is now build_from_urdf

    Fixed

    • Don't distribute robot models with the library
    • IK unit test that used robot instead of configuration
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Mar 17, 2022)

    This is a first working version of the library with a humanoid example that can be run and tweaked. Keep in mind that 0.x versions mean the library is still under active development, with the goal that 1.0 is the first stable version. So, this is still the very beginning :wink:

    Added

    • Body task
    • Humanoid example

    Changed

    • ConfiguredRobot(model, data) type is now Configuration(model, data, q)

    Fixed

    • Add floating base joint when loading JVRC model
    Source code(tar.gz)
    Source code(zip)
Owner
Stéphane Caron
Roboticist who enjoys teaching things to balance and walk.
Stéphane Caron
Implementation of EMNLP 2017 Paper "Natural Language Does Not Emerge 'Naturally' in Multi-Agent Dialog" using PyTorch and ParlAI

Language Emergence in Multi Agent Dialog Code for the Paper Natural Language Does Not Emerge 'Naturally' in Multi-Agent Dialog Satwik Kottur, José M.

Karan Desai 105 Nov 25, 2022
Official implementation of SynthTIGER (Synthetic Text Image GEneratoR) ICDAR 2021

🐯 SynthTIGER: Synthetic Text Image GEneratoR Official implementation of SynthTIGER | Paper | Datasets Moonbin Yim1, Yoonsik Kim1, Han-cheol Cho1, Sun

Clova AI Research 256 Jan 05, 2023
Audio Visual Emotion Recognition using TDA

Audio Visual Emotion Recognition using TDA RAVDESS database with two datasets analyzed: Video and Audio dataset: Audio-Dataset: https://www.kaggle.com

Combinatorial Image Analysis research group 3 May 11, 2022
PyTorch implementations of the paper: "DR.VIC: Decomposition and Reasoning for Video Individual Counting, CVPR, 2022"

DRNet for Video Indvidual Counting (CVPR 2022) Introduction This is the official PyTorch implementation of paper: DR.VIC: Decomposition and Reasoning

tao han 35 Nov 22, 2022
Implementation of Basic Machine Learning Algorithms on small datasets using Scikit Learn.

Basic Machine Learning Algorithms All the basic Machine Learning Algorithms are implemented in Python using libraries Acknowledgements Machine Learnin

Piyal Banik 47 Oct 16, 2022
Reducing Information Bottleneck for Weakly Supervised Semantic Segmentation (NeurIPS 2021)

Reducing Information Bottleneck for Weakly Supervised Semantic Segmentation (NeurIPS 2021) The implementation of Reducing Infromation Bottleneck for W

Jungbeom Lee 81 Dec 16, 2022
Torch code for our CVPR 2018 paper "Residual Dense Network for Image Super-Resolution" (Spotlight)

Residual Dense Network for Image Super-Resolution This repository is for RDN introduced in the following paper Yulun Zhang, Yapeng Tian, Yu Kong, Bine

Yulun Zhang 494 Dec 30, 2022
Paddle implementation for "Highly Efficient Knowledge Graph Embedding Learning with Closed-Form Orthogonal Procrustes Analysis" (NAACL 2021)

ProcrustEs-KGE Paddle implementation for Highly Efficient Knowledge Graph Embedding Learning with Orthogonal Procrustes Analysis 🙈 A more detailed re

Lincedo Lab 4 Jun 09, 2021
Source Code for Simulations in the Publication "Can the brain use waves to solve planning problems?"

Code for Simulations in the Publication Can the brain use waves to solve planning problems? Installing Required Python Packages Please use Python vers

EMD Group 2 Jul 01, 2022
:fire: 2D and 3D Face alignment library build using pytorch

Face Recognition Detect facial landmarks from Python using the world's most accurate face alignment network, capable of detecting points in both 2D an

Adrian Bulat 6k Dec 31, 2022
Bayesian algorithm execution (BAX)

Bayesian Algorithm Execution (BAX) Code for the paper: Bayesian Algorithm Execution: Estimating Computable Properties of Black-box Functions Using Mut

Willie Neiswanger 38 Dec 08, 2022
Compositional and Parameter-Efficient Representations for Large Knowledge Graphs

NodePiece - Compositional and Parameter-Efficient Representations for Large Knowledge Graphs NodePiece is a "tokenizer" for reducing entity vocabulary

Michael Galkin 107 Jan 04, 2023
Solver for Large-Scale Rank-One Semidefinite Relaxations

STRIDE: spectrahedral proximal gradient descent along vertices A Solver for Large-Scale Rank-One Semidefinite Relaxations About STRIDE is designed for

48 Dec 20, 2022
Pocsploit is a lightweight, flexible and novel open source poc verification framework

Pocsploit is a lightweight, flexible and novel open source poc verification framework

cckuailong 208 Dec 24, 2022
From a body shape, infer the anatomic skeleton.

OSSO: Obtaining Skeletal Shape from Outside (CVPR 2022) This repository contains the official implementation of the skeleton inference from: OSSO: Obt

Marilyn Keller 166 Dec 28, 2022
docTR by Mindee (Document Text Recognition) - a seamless, high-performing & accessible library for OCR-related tasks powered by Deep Learning.

docTR by Mindee (Document Text Recognition) - a seamless, high-performing & accessible library for OCR-related tasks powered by Deep Learning.

Mindee 1.5k Jan 01, 2023
The Multi-Mission Maximum Likelihood framework (3ML)

PyPi Conda The Multi-Mission Maximum Likelihood framework (3ML) A framework for multi-wavelength/multi-messenger analysis for astronomy/astrophysics.

The Multi-Mission Maximum Likelihood (3ML) 62 Dec 30, 2022
Dataset and Source code of paper 'Enhancing Keyphrase Extraction from Academic Articles with their Reference Information'.

Enhancing Keyphrase Extraction from Academic Articles with their Reference Information Overview Dataset and code for paper "Enhancing Keyphrase Extrac

15 Nov 24, 2022
Implementation for our ICCV2021 paper: Internal Video Inpainting by Implicit Long-range Propagation

Implicit Internal Video Inpainting Implementation for our ICCV2021 paper: Internal Video Inpainting by Implicit Long-range Propagation paper | project

202 Dec 30, 2022
Non-Homogeneous Poisson Process Intensity Modeling and Estimation using Measure Transport

Non-Homogeneous Poisson Process Intensity Modeling and Estimation using Measure Transport This GitHub page provides code for reproducing the results i

Andrew Zammit Mangion 1 Nov 08, 2021