RAI 랩 인턴을 시작하면서 가장 먼저 한 작업은

N 자유도 매니퓰레이터의 URDF를 파싱하고 Kinematics를 푸는 라이브러리를 만드는 것이었습니다.

2달 동안 정말 힘들었지만 새로운 걸 알아가는 재미가 있어 버틸 수 있었습니다.

코딩실력이 부족해 많이 어설프지만 누군가 도움이 되었으면 하는 바램으로 구현하였습니다.

pykin

PyPI version MIT License

Python Interface for the Robot Kinematics Library pykin

This library has been created simply by referring to ikpy

Features

  • Pure python library
  • Support only URDF file
  • Compute Forward, Inverse Kinematics and Jacobian
  • There are two ways to find the IK solution, referring to the Introduction to Humanoid Robotics book.
  • Compute Collision checkinkg
  • Plot Robot Kinematic Chain and Robot Mesh (STL file)

Installation

Requirements

You need a python-fcl package to do object collision checking.

  • For Ubuntu, using apt

    sudo apt install liboctomap-dev

    sudo apt install libfcl-dev

  • For Mac, First, Download the source and build it.

    • octomap

      git clone https://github.com/OctoMap/octomap.git

      $ cd octomap
      $ mkdir build
      $ cd build
      $ cmake ..
      $ make
      $ make install
      
    • fcl

      git clone https://github.com/flexible-collision-library/fcl.git

      Since python-fcl uses version 0.5.0 of fcl, checkout with tag 0.5.0

      $ cd fcl
      $ git checkout 0.5.0
      $ mkdir build
      $ cd build
      $ cmake ..
      $ make
      $ make install
      

If the above installation is complete

pip install python-fcl

Install Pykin

pip install pykin

When git clone, use the –recurse-submodules option.

The download may take a long time due to the large urdf file size.

git clone --recurse-submodules https://github.com/jdj2261/pykin.git

Quick Start

Code

  • Robot Info

    You can see 4 example robot information.

    baxter, iiwa14, panda, and sawyer

  • Forward Kinematics
  • Jacobian
  • Inverse Kinematics
  • Self-Collision Check

Visualization

Code

  • urdf

    You can see visualization using matplotlib.

baxter sawyer iiwa14 panda
baxter sawyer iiwa14 panda
  • collision

    You can see collision defined in collision/geometry tags in urdf.

baxter sawyer
baxter baxter
  • mesh

    You can see mesh defined in visual/geometry tags in urdf.

baxter sawyer iiwa14 panda
baxter baxter baxter baxter
  • Animation

    You can see an animation that visualizes trajectory

    Please refer to here