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
ReConsider is a re-ranking model that re-ranks the top-K (passage, answer-span) predictions of an Open-Domain QA Model like DPR (Karpukhin et al., 2020).

ReConsider ReConsider is a re-ranking model that re-ranks the top-K (passage, answer-span) predictions of an Open-Domain QA Model like DPR (Karpukhin

Facebook Research 47 Jul 26, 2022
Automatic voice-synthetised summaries of latest research papers on arXiv

PaperWhisperer PaperWhisperer is a Python application that keeps you up-to-date with research papers. How? It retrieves the latest articles from arXiv

Valerio Velardo 124 Dec 20, 2022
An unofficial PyTorch implementation of a federated learning algorithm, FedAvg.

Federated Averaging (FedAvg) in PyTorch An unofficial implementation of FederatedAveraging (or FedAvg) algorithm proposed in the paper Communication-E

Seok-Ju Hahn 123 Jan 06, 2023
CS5242_2021 - Neural Networks and Deep Learning, NUS CS5242, 2021

CS5242_2021 Neural Networks and Deep Learning, NUS CS5242, 2021 Cloud Machine #1 : Google Colab (Free GPU) Follow this Notebook installation : https:/

Xavier Bresson 165 Oct 25, 2022
Pytorch implementation of winner from VQA Chllange Workshop in CVPR'17

2017 VQA Challenge Winner (CVPR'17 Workshop) pytorch implementation of Tips and Tricks for Visual Question Answering: Learnings from the 2017 Challeng

Mark Dong 166 Dec 11, 2022
An implementation of EWC with PyTorch

EWC.pytorch An implementation of Elastic Weight Consolidation (EWC), proposed in James Kirkpatrick et al. Overcoming catastrophic forgetting in neural

Ryuichiro Hataya 166 Dec 22, 2022
The repository is for safe reinforcement learning baselines.

Safe-Reinforcement-Learning-Baseline The repository is for Safe Reinforcement Learning (RL) research, in which we investigate various safe RL baseline

172 Dec 19, 2022
[ICLR 2021] Heteroskedastic and Imbalanced Deep Learning with Adaptive Regularization

Heteroskedastic and Imbalanced Deep Learning with Adaptive Regularization Kaidi Cao, Yining Chen, Junwei Lu, Nikos Arechiga, Adrien Gaidon, Tengyu Ma

Kaidi Cao 29 Oct 20, 2022
Implementation of Monocular Direct Sparse Localization in a Prior 3D Surfel Map (DSL)

DSL Project page: https://sites.google.com/view/dsl-ram-lab/ Monocular Direct Sparse Localization in a Prior 3D Surfel Map Authors: Haoyang Ye, Huaiya

Haoyang Ye 93 Nov 30, 2022
GRaNDPapA: Generator of Rad Names from Decent Paper Acronyms

GRaNDPapA: Generator of Rad Names from Decent Paper Acronyms Trying to publish a new machine learning model and can't write a decent title for your pa

264 Nov 08, 2022
A Game-Theoretic Perspective on Risk-Sensitive Reinforcement Learning

Officile code repository for "A Game-Theoretic Perspective on Risk-Sensitive Reinforcement Learning"

Mathieu Godbout 1 Nov 19, 2021
Sound Source Localization for AI Grand Challenge 2021

Sound-Source-Localization Sound Source Localization study for AI Grand Challenge 2021 (sponsored by NC Soft Vision Lab) Preparation 1. Place the data-

sanghoon 19 Mar 29, 2022
PSPNet in Chainer

PSPNet This is an unofficial implementation of Pyramid Scene Parsing Network (PSPNet) in Chainer. Training Requirement Python 3.4.4+ Chainer 3.0.0b1+

Shunta Saito 76 Dec 12, 2022
DeepFaceLab fork which provides IPython Notebook to use DFL with Google Colab

DFL-Colab — DeepFaceLab fork for Google Colab This project provides you IPython Notebook to use DeepFaceLab with Google Colaboratory. You can create y

779 Jan 05, 2023
FAMIE is a comprehensive and efficient active learning (AL) toolkit for multilingual information extraction (IE)

FAMIE: A Fast Active Learning Framework for Multilingual Information Extraction

18 Sep 01, 2022
Code from Daniel Lemire, A Better Alternative to Piecewise Linear Time Series Segmentation

PiecewiseLinearTimeSeriesApproximation code from Daniel Lemire, A Better Alternative to Piecewise Linear Time Series Segmentation, SIAM Data Mining 20

Daniel Lemire 21 Oct 27, 2022
StyleGAN2-ADA - Official PyTorch implementation

Abstract: Training generative adversarial networks (GAN) using too little data typically leads to discriminator overfitting, causing training to diverge. We propose an adaptive discriminator augmenta

NVIDIA Research Projects 3.2k Dec 30, 2022
NeRD: Neural Reflectance Decomposition from Image Collections

NeRD: Neural Reflectance Decomposition from Image Collections Project Page | Video | Paper | Dataset Implementation for NeRD. A novel method which dec

Computergraphics (University of Tübingen) 195 Dec 29, 2022
An implementation of the Contrast Predictive Coding (CPC) method to train audio features in an unsupervised fashion.

CPC_audio This code implements the Contrast Predictive Coding algorithm on audio data, as described in the paper Unsupervised Pretraining Transfers we

Meta Research 283 Dec 30, 2022
PyTorch-lightning implementation of the ESFW module proposed in our paper Edge-Selective Feature Weaving for Point Cloud Matching

Edge-Selective Feature Weaving for Point Cloud Matching This repository contains a PyTorch-lightning implementation of the ESFW module proposed in our

5 Feb 14, 2022