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
Self-supervised learning (SSL) is a method of machine learning

Self-supervised learning (SSL) is a method of machine learning. It learns from unlabeled sample data. It can be regarded as an intermediate form between supervised and unsupervised learning.

Ashish Patel 4 May 26, 2022
Leveraging Two Types of Global Graph for Sequential Fashion Recommendation, ICMR 2021

This is the repo for the paper: Leveraging Two Types of Global Graph for Sequential Fashion Recommendation Requirements OS: Ubuntu 16.04 or higher ver

Yujuan Ding 10 Oct 10, 2022
EfficientNetV2 implementation using PyTorch

EfficientNetV2-S implementation using PyTorch Train Steps Configure imagenet path by changing data_dir in train.py python main.py --benchmark for mode

Jahongir Yunusov 86 Dec 29, 2022
🔥3D-RecGAN in Tensorflow (ICCV Workshops 2017)

3D Object Reconstruction from a Single Depth View with Adversarial Learning Bo Yang, Hongkai Wen, Sen Wang, Ronald Clark, Andrew Markham, Niki Trigoni

Bo Yang 125 Nov 26, 2022
This is the code for the paper "Jinkai Zheng, Xinchen Liu, Wu Liu, Lingxiao He, Chenggang Yan, Tao Mei: Gait Recognition in the Wild with Dense 3D Representations and A Benchmark. (CVPR 2022)"

Gait3D-Benchmark This is the code for the paper "Jinkai Zheng, Xinchen Liu, Wu Liu, Lingxiao He, Chenggang Yan, Tao Mei: Gait Recognition in the Wild

82 Jan 04, 2023
A framework for multi-step probabilistic time-series/demand forecasting models

JointDemandForecasting.py A framework for multi-step probabilistic time-series/demand forecasting models File stucture JointDemandForecasting contains

Stanford Intelligent Systems Laboratory 3 Sep 28, 2022
Data and code from COVID-19 machine learning paper

Machine learning approaches for localized lockdown, subnotification analysis and cases forecasting in São Paulo state counties during COVID-19 pandemi

Sara Malvar 4 Dec 22, 2022
Code for Mesh Convolution Using a Learned Kernel Basis

Mesh Convolution This repository contains the implementation (in PyTorch) of the paper FULLY CONVOLUTIONAL MESH AUTOENCODER USING EFFICIENT SPATIALLY

Yi_Zhou 35 Jan 03, 2023
An example showing how to use jax to train resnet50 on multi-node multi-GPU

jax-multi-gpu-resnet50-example This repo shows how to use jax for multi-node multi-GPU training. The example is adapted from the resnet50 example in d

Yangzihao Wang 20 Jul 04, 2022
Sematic-Segmantation - Semantic Segmentation on MIT ADE20K dataset in PyTorch

Semantic Segmentation on MIT ADE20K dataset in PyTorch This is a PyTorch impleme

Berat Eren Terzioğlu 4 Mar 22, 2022
PyTorch common framework to accelerate network implementation, training and validation

pytorch-framework PyTorch common framework to accelerate network implementation, training and validation. This framework is inspired by works from MML

Dongliang Cao 3 Dec 19, 2022
Inteligência artificial criada para realizar interação social com idosos.

IA SONIA 4.0 A SONIA foi inspirada no assistente mais famoso do mundo e muito bem conhecido JARVIS. Todo mundo algum dia ja sonhou em ter o seu própri

Vinícius Azevedo 2 Oct 21, 2021
Neural Lexicon Reader: Reduce Pronunciation Errors in End-to-end TTS by Leveraging External Textual Knowledge

Neural Lexicon Reader: Reduce Pronunciation Errors in End-to-end TTS by Leveraging External Textual Knowledge This is an implementation of the paper,

Mutian He 19 Oct 14, 2022
Label Hallucination for Few-Shot Classification

Label Hallucination for Few-Shot Classification This repo covers the implementation of the following paper: Label Hallucination for Few-Shot Classific

Yiren Jian 13 Nov 13, 2022
FFCV: Fast Forward Computer Vision (and other ML workloads!)

Fast Forward Computer Vision: train models at a fraction of the cost with accele

FFCV 2.3k Jan 03, 2023
Code release for the ICML 2021 paper "PixelTransformer: Sample Conditioned Signal Generation".

PixelTransformer Code release for the ICML 2021 paper "PixelTransformer: Sample Conditioned Signal Generation". Project Page Installation Please insta

Shubham Tulsiani 24 Dec 17, 2022
Pytorch implementation of "A simple neural network module for relational reasoning" (Relational Networks)

Pytorch implementation of Relational Networks - A simple neural network module for relational reasoning Implemented & tested on Sort-of-CLEVR task. So

Kim Heecheol 800 Dec 05, 2022
[CVPR 2021] "The Lottery Tickets Hypothesis for Supervised and Self-supervised Pre-training in Computer Vision Models" Tianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia Liu, Yang Zhang, Michael Carbin, Zhangyang Wang

The Lottery Tickets Hypothesis for Supervised and Self-supervised Pre-training in Computer Vision Models Codes for this paper The Lottery Tickets Hypo

VITA 59 Dec 28, 2022
Repository for the Bias Benchmark for QA dataset.

BBQ Repository for the Bias Benchmark for QA dataset. Authors: Alicia Parrish, Angelica Chen, Nikita Nangia, Vishakh Padmakumar, Jason Phang, Jana Tho

ML² AT CILVR 18 Nov 18, 2022
This tutorial repository is to introduce the functionality of KGTK to first-time users

Welcome to the KGTK notebook tutorial The goal of this tutorial repository is to introduce the functionality of KGTK to first-time users. The Knowledg

USC ISI I2 58 Dec 21, 2022