Skip to main content

TracIK Python Bindings

Project description

pytracik - Trac-IK bindings in Python

License: MIT PyPI version

📢 Now available on PyPI! Install with pip install pytracik — no need to build from source on Linux and macOS. See Installation for details.

Welcome to pytracik, a Python library that provides convenient and efficient bindings for the Trac-IK inverse kinematics solver. With support for Python 3.8+ and compatibility across both Windows and Linux environments. pytracik eliminates the need for ROS installation and simplifies the integration process.

✨ Differences from Original Repo:

  • 🚀 ROS-Free Integration: Say goodbye to the ROS requirement. pytracik allows you to effortlessly incorporate Trac-IK's advanced inverse kinematics solver into your Python projects. However, it still depends on the boost,eigen,orocos-kdl and nlopt libraries.
  • 💻 Cross-Platform Compatibility: Whether you're on Windows or Linux, pytracik ensures consistent functionality across environments.

🔗 Links

⚡ Quick Start

import os
import numpy as np
from trac_ik import TracIK

urdf_path = os.path.join(os.path.dirname(__file__), "urdf/yumi.urdf")

yumi_rgt_arm_iksolver = TracIK(base_link_name="yumi_body",
                             tip_link_name="yumi_link_7_r",
                             urdf_path=urdf_path, )
yumi_lft_arm_iksolver = TracIK(base_link_name="yumi_body",
                             tip_link_name="yumi_link_7_l",
                             urdf_path=urdf_path, )
seed_jnt = np.array([-0.34906585, -1.57079633, -2.0943951, 0.52359878, 0.,
                   0.6981317, 0.])
tgt_pos = np.array([.3, -.4, .1])
tgt_rotmat = np.array([[0.5, 0., 0.8660254],
                     [0., 1., 0.],
                     [-0.8660254, 0., 0.5]])
result = yumi_rgt_arm_iksolver.ik(tgt_pos, tgt_rotmat, seed_jnt_values=seed_jnt)
print(result)

Output:

[ 1.17331584 -1.99621953 -1.08811406 -0.18234367  0.66571608  1.26591
  0.18141696]

📦 Installation

🔧 System Prerequisites

pytracik is a C++ extension that compiles from source. You must install the following system libraries before installing the Python package:

Library Purpose
Boost (date_time, system, thread) General C++ utilities
Eigen3 Linear algebra
Orocos KDL Kinematics & dynamics
NLopt Numerical optimisation

🐧 Linux (Ubuntu / Debian)

sudo apt-get update
sudo apt-get install -y libboost-all-dev libeigen3-dev liborocos-kdl-dev libnlopt-dev libnlopt-cxx-dev

🍎 macOS (Homebrew)

brew install boost eigen orocos-kdl nlopt

🪟 Windows

Download the dependencies from official sources or use the pre-packaged zip from the project releases:

👉 Shortcut: Grab the pre-packaged zip: 📥 https://github.com/chenhaox/pytracik/releases/tag/dependency_files

Unzip it into the project root so that a dependency/ folder exists next to setup.py.

⚡ Install from PyPI (recommended)

Once the system prerequisites above are installed:

pip install pytracik

⚡ Install from GitHub

# pip
pip install "pytracik @ git+https://github.com/chenhaox/pytracik.git"

# uv
uv add "pytracik @ git+https://github.com/chenhaox/pytracik.git"

🛠️ Install from source

git clone https://github.com/chenhaox/pytracik.git
cd pytracik
pip install .

🪟 Windows: Manual Build with Visual Studio (advanced)

  1. Download Visual Studio (https://visualstudio.microsoft.com/downloads/). Here we use Visual Studio 2022 as an example. Install required components:

    • Desktop development with C++
    • C++ CMake tools for Windows
  2. Compile pytracik with Visual Studio following the instructions below. a. Create an C++ Empty project in Visual Studio.

    img.png

    b. Add the source files in src folder to the project.

    img_1.png

    c. Right click the project and select Properties.

    • Set the Configuration to Release and Platform to Active (x64)
    • In the Configuration Properites/General tab, set the Target Name to pytracik_bindings.
    • Set the Configuration Type to Dynamic Library (.dll).
    • Set C++ language standard to ISO C++17 Standard (/std:c++17).

    img_2.png

    d. In the Configuration Properites/Advanced tab, set Taget File Extension to .pyd. img_6.png

    e. In the C/C++ tab, add the include directories of 1. Boost, 2. Eigen3, 3. NLopt and 4. Orocos KDL 5. Python and 6. Pybind11 to Additional Include Directories.

    img_3.png

    f. In the Linker/General tab, add the library directories of 1. Boost, 2. NLopt 3. Orocos KDL and 4. Python to Additional Library Directories.

    img_4.png

    g. In the Linker/Input tab, add the library names of 1. Boost, 2. NLopt 3. Orocos KDL and 4. Python to Additional Dependencies.

    img_5.png

    h. Set the Solution Configuration to Release and Solution Platform to x64. Then build the project. The pytracik_bindings.pyd file will be generated in the Release folder. img_7.png

  3. Copy the pytracik_bindings.pyd file to the pytracik folder. Note: if the error ImportError: DLL load failed while importing pytracik: The specified module could not be found. occurs, please copy the nlopt.dll in the <NLopt installation path\bin> to the pytracik folder:

  4. Make installation (Optional):

    pip install -e .
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytracik-0.0.3.tar.gz (74.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pytracik-0.0.3-cp313-cp313-win_amd64.whl (512.8 kB view details)

Uploaded CPython 3.13Windows x86-64

pytracik-0.0.3-cp313-cp313-manylinux_2_34_x86_64.whl (998.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

pytracik-0.0.3-cp313-cp313-macosx_15_0_arm64.whl (5.6 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

pytracik-0.0.3-cp312-cp312-win_amd64.whl (512.8 kB view details)

Uploaded CPython 3.12Windows x86-64

pytracik-0.0.3-cp312-cp312-manylinux_2_34_x86_64.whl (998.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

pytracik-0.0.3-cp312-cp312-macosx_15_0_arm64.whl (5.6 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

pytracik-0.0.3-cp311-cp311-win_amd64.whl (510.6 kB view details)

Uploaded CPython 3.11Windows x86-64

pytracik-0.0.3-cp311-cp311-manylinux_2_34_x86_64.whl (995.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

pytracik-0.0.3-cp311-cp311-macosx_15_0_arm64.whl (5.4 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

pytracik-0.0.3-cp310-cp310-win_amd64.whl (509.9 kB view details)

Uploaded CPython 3.10Windows x86-64

pytracik-0.0.3-cp310-cp310-manylinux_2_34_x86_64.whl (994.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

pytracik-0.0.3-cp310-cp310-macosx_15_0_arm64.whl (4.4 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

pytracik-0.0.3-cp39-cp39-win_amd64.whl (512.2 kB view details)

Uploaded CPython 3.9Windows x86-64

pytracik-0.0.3-cp39-cp39-manylinux_2_34_x86_64.whl (994.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

File details

Details for the file pytracik-0.0.3.tar.gz.

File metadata

  • Download URL: pytracik-0.0.3.tar.gz
  • Upload date:
  • Size: 74.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytracik-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ed4ac2bc59c22c2e8b6793e65adc84059393d53285f0a76825eb5901cb001e09
MD5 0aaffea18c037a60d1ab674ca7cf924f
BLAKE2b-256 c330e14813249054ee0458347982cbe2f9a58eefc2fc7171ed9e2b01e816adb8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytracik-0.0.3.tar.gz:

Publisher: publish.yml on chenhaox/pytracik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytracik-0.0.3-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pytracik-0.0.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 512.8 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytracik-0.0.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 cab9550fba0806d5ef87b1cac32787be5e620ae49cedc6cbd0c971fbdeace80f
MD5 777271107f525076c1767303d6618b79
BLAKE2b-256 3e18f57633083b322675080551a113b57386b35bc8025bbfc19b649acc912e68

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytracik-0.0.3-cp313-cp313-win_amd64.whl:

Publisher: publish.yml on chenhaox/pytracik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytracik-0.0.3-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pytracik-0.0.3-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d56e81d69ffc94eb576854307b280ac0280248c2b67fd3df45d4027867234453
MD5 ddb770f5283ad82253394b3f2cb65abc
BLAKE2b-256 5482a8c734fe52061d7b16fa0d10d0ed4df57aa9982b390aaacaa8c05f54e44a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytracik-0.0.3-cp313-cp313-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on chenhaox/pytracik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytracik-0.0.3-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pytracik-0.0.3-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 766ea115400853a9bfe8aaadab17b5646ce43beff067d1822384efd5c2764899
MD5 754b7b378aca9a8d552a1f3b6617d082
BLAKE2b-256 27219b6abae852005bdd1252d6f763c01a45fa23adc02dffc7d72a9acfddcd5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytracik-0.0.3-cp313-cp313-macosx_15_0_arm64.whl:

Publisher: publish.yml on chenhaox/pytracik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytracik-0.0.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pytracik-0.0.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 512.8 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytracik-0.0.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 22d7374c235d5614f629629d67f954eec04e04221d34e13c3baf67ba6c812394
MD5 4ccbfaaedf3677a7d1dd772a79d1211e
BLAKE2b-256 7747e0e36886165f6b8df60dc193bb0051b26780c15620ee790127813979c278

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytracik-0.0.3-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on chenhaox/pytracik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytracik-0.0.3-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pytracik-0.0.3-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7c08ae092b140bec81dcc629b6357b66ec17ccf52d4e58673f92bbb0fd05ff97
MD5 3e670a86d184c99dfeb9cfb778573d1e
BLAKE2b-256 0a5c3df50a600aae33284dde78d20850f72ad607d0ccb6c6ae4c8ace2bc4c177

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytracik-0.0.3-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on chenhaox/pytracik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytracik-0.0.3-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pytracik-0.0.3-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4588f9a2bcf9139991e4d1f4e301f163846b39e2d1108f5347d65c3703fda14a
MD5 92b0f65f7fe1e7e89cb7f33ee3574100
BLAKE2b-256 ecdb5fdd6d58538d14c36d1f2ca1ec363ec676505ef72e1c184528413ffc0be5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytracik-0.0.3-cp312-cp312-macosx_15_0_arm64.whl:

Publisher: publish.yml on chenhaox/pytracik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytracik-0.0.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pytracik-0.0.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 510.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytracik-0.0.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e8e5eecb86755b6c1e486fd7ba90383388ffa79366bfeb50b09d1b62bf63cf4c
MD5 0a129939723de5182875cd995922722f
BLAKE2b-256 ed6e83a7e280476ecf866c9783573090c99e5342a417e74edbb3e438007de7dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytracik-0.0.3-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on chenhaox/pytracik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytracik-0.0.3-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pytracik-0.0.3-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 15465726d03f070fd24411d980fab1de65b90224cc0b4fd6d446737ca8330da9
MD5 58110213ca444198c59c66e6d544b1ba
BLAKE2b-256 1b00c2d7160e7247615c81bbb3991f465201c7ea506bc4b95351146eda957ff6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytracik-0.0.3-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on chenhaox/pytracik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytracik-0.0.3-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pytracik-0.0.3-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 aaa95e9b290a9057966676afb1172bf7776a1dbfa17c00bd2fc26738afe37528
MD5 3899d349376484b10d46557bf80f0edc
BLAKE2b-256 001dd6775446704c7157ff2369b9e8b3e0ec3e48ec79dc79a2af5dcbacb6e5c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytracik-0.0.3-cp311-cp311-macosx_15_0_arm64.whl:

Publisher: publish.yml on chenhaox/pytracik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytracik-0.0.3-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pytracik-0.0.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 509.9 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytracik-0.0.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a616417dfc5b8364b45eb1d6ed8a961d549b907bdb0e77032455d7113770ea90
MD5 47299cd8a47f272660bf542c9b573f6a
BLAKE2b-256 c69baaa2b891541e4114318801646e42f7d447ec735449120cca65a39a9e2240

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytracik-0.0.3-cp310-cp310-win_amd64.whl:

Publisher: publish.yml on chenhaox/pytracik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytracik-0.0.3-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pytracik-0.0.3-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 11f40a038e9b880d35b7080d842fc8d72e572115e507147c36cb2ca513511ee3
MD5 c29b07b74319ec5c3bda381e95e263c5
BLAKE2b-256 d67c17831f26c61ba15c3f7ba9c69fbdec89fb258f4788c2baea4635d8d89028

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytracik-0.0.3-cp310-cp310-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on chenhaox/pytracik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytracik-0.0.3-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pytracik-0.0.3-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d0d54eb212aade06f33cb0aab7c77039741808c2235fd7cdfa601faeb7db6267
MD5 b637d260497b2da56ca4205959544325
BLAKE2b-256 4242d7f139bd6eac06bc9f4f00b5b1fea12fde2a9d8a50f3a819eee3699b6af6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytracik-0.0.3-cp310-cp310-macosx_15_0_arm64.whl:

Publisher: publish.yml on chenhaox/pytracik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytracik-0.0.3-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pytracik-0.0.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 512.2 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytracik-0.0.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 7ac4b55a14f0ce60cceee3bde7a970556446c9c6f7fd29a3894c28f29dccbb27
MD5 d4b2a72fd861b391d6c8c9e8e5a9fdc8
BLAKE2b-256 b3ed6e109b9b9c843ae78d4996d9843859f8037bb7414b004f8c83e2898e8704

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytracik-0.0.3-cp39-cp39-win_amd64.whl:

Publisher: publish.yml on chenhaox/pytracik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytracik-0.0.3-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pytracik-0.0.3-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 17c21c3e80c70a6d8ac7d7d0cca52a9e1732d63f9fd74139b2b2e828872c3c29
MD5 f2c5673b59e03a4d0b0774d9d25eba92
BLAKE2b-256 13286dcf38141bf3c7195e8fb27855ff7a690a2b352e8dac6235eecbf0e4983a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytracik-0.0.3-cp39-cp39-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on chenhaox/pytracik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page