Python inverse kinematics for your robot model based on Pinocchio.

Related tags

Deep Learning pink
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
This folder contains the python code of UR5E's advanced forward kinematics model.

This folder contains the python code of UR5E's advanced forward kinematics model. By entering the angle of the joint of UR5e, the detailed coordinates of up to 48 points around the robot arm can be calculated.

Qiang Wang 4 Sep 17, 2022
MohammadReza Sharifi 27 Dec 13, 2022
Guiding evolutionary strategies by (inaccurate) differentiable robot simulators @ NeurIPS, 4th Robot Learning Workshop

Guiding Evolutionary Strategies by Differentiable Robot Simulators In recent years, Evolutionary Strategies were actively explored in robotic tasks fo

Vladislav Kurenkov 4 Dec 14, 2021
Space robot - (Course Project) Using the space robot to capture the target satellite that is disabled and spinning, then stabilize and fix it up

Space robot - (Course Project) Using the space robot to capture the target satellite that is disabled and spinning, then stabilize and fix it up

Mingrui Yu 3 Jan 7, 2022
Code for PhySG: Inverse Rendering with Spherical Gaussians for Physics-based Relighting and Material Editing

PhySG: Inverse Rendering with Spherical Gaussians for Physics-based Relighting and Material Editing CVPR 2021. Project page: https://kai-46.github.io/

Kai Zhang 141 Dec 14, 2022
Predicting path with preference based on user demonstration using Maximum Entropy Deep Inverse Reinforcement Learning in a continuous environment

Preference-Planning-Deep-IRL Introduction Check my portfolio post Dependencies Gym stable-baselines3 PyTorch Usage Take Demonstration python3 record.

Tianyu Li 9 Oct 26, 2022
Code, Data and Demo for Paper: Controllable Generation from Pre-trained Language Models via Inverse Prompting

InversePrompting Paper: Controllable Generation from Pre-trained Language Models via Inverse Prompting Code: The code is provided in the "chinese_ip"

THUDM 101 Dec 16, 2022
Code for the paper "JANUS: Parallel Tempered Genetic Algorithm Guided by Deep Neural Networks for Inverse Molecular Design"

JANUS: Parallel Tempered Genetic Algorithm Guided by Deep Neural Networks for Inverse Molecular Design This repository contains code for the paper: JA

Aspuru-Guzik group repo 55 Nov 29, 2022
The official implementation of the research paper "DAG Amendment for Inverse Control of Parametric Shapes"

DAG Amendment for Inverse Control of Parametric Shapes This repository is the official Blender implementation of the paper "DAG Amendment for Inverse

Elie Michel 157 Dec 26, 2022
SNIPS: Solving Noisy Inverse Problems Stochastically

SNIPS: Solving Noisy Inverse Problems Stochastically This repo contains the official implementation for the paper SNIPS: Solving Noisy Inverse Problem

Bahjat Kawar 35 Nov 9, 2022
Pytorch implementation of forward and inverse Haar Wavelets 2D

Pytorch implementation of forward and inverse Haar Wavelets 2D

Sergei Belousov 9 Oct 30, 2022
Mitsuba 2: A Retargetable Forward and Inverse Renderer

Mitsuba Renderer 2 Documentation Mitsuba 2 is a research-oriented rendering system written in portable C++17. It consists of a small set of core libra

Mitsuba Physically Based Renderer 2k Jan 7, 2023
Implementation of the GVP-Transformer, which was used in the paper "Learning inverse folding from millions of predicted structures" for de novo protein design alongside Alphafold2

GVP Transformer (wip) Implementation of the GVP-Transformer, which was used in the paper Learning inverse folding from millions of predicted structure

Phil Wang 19 May 6, 2022
Code for "Modeling Indirect Illumination for Inverse Rendering", CVPR 2022

Modeling Indirect Illumination for Inverse Rendering Project Page | Paper | Data Preparation Set up the python environment conda create -n invrender p

ZJU3DV 116 Jan 3, 2023
PaddleRobotics is an open-source algorithm library for robots based on Paddle, including open-source parts such as human-robot interaction, complex motion control, environment perception, SLAM positioning, and navigation.

简体中文 | English PaddleRobotics paddleRobotics是基于paddle的机器人开源算法库集,包括人机交互、复杂运动控制、环境感知、slam定位导航等开源算法部分。 人机交互 主动多模交互技术TFVT-HRI 主动多模交互技术是通过视觉、语音、触摸传感器等输入机器人

null 185 Dec 26, 2022
Anomaly Detection Based on Hierarchical Clustering of Mobile Robot Data

We proposed a new approach to detect anomalies of mobile robot data. We investigate each data seperately with two clustering method hierarchical and k-means. There are two sub-method that we used for produce an anomaly score. Then, we merge these two score and produce merged anomaly score as a result.

Zekeriyya Demirci 1 Jan 9, 2022
Implementing yolov4 target detection and tracking based on nao robot

Implementing yolov4 target detection and tracking based on nao robot

null 6 Apr 19, 2022
Control-Robot-Arm-using-PS4-Controller - A Robotic Arm based on Raspberry Pi and Arduino that controlled by PS4 Controller

Control-Robot-Arm-using-PS4-Controller You can see all details about this Robot

MohammadReza Sharifi 5 Jan 1, 2022