Skip to main content

Python 3 implementation of FABRIK (Forward And Backward Reaching Inverse Kinematics) algorithm.

Project description

pyfabrik

Badge showing number of total downloads from PyPI.

Badge showing number of monthly downloads from PyPI.

Badge showing that code has been formated with Black formatter.

Python 3 implementation of FABRIK (Forward And Backward Reaching Inverse Kinematics).

Installation

pip install pyfabrik

Usage

NOTE: API is still very unstable (until the 1.0 release). Suggestions are welcome.

import pyfabrik
from vectormath import Vector3

initial_joint_positions = [Vector3(0, 0, 0), Vector3(10, 0, 0), Vector3(20, 0, 0)]
tolerance = 0.01

# Initialize the Fabrik class (Fabrik, Fabrik2D or Fabrik3D)
fab = pyfabrik.Fabrik3D(initial_joint_positions, tolerance)

fab.move_to(Vector3(20, 0, 0))
fab.angles_deg # Holds [0.0, 0.0, 0.0]

fab.move_to(Vector3(60, 60, 0)) # Return 249 as number of iterations executed
fab.angles_deg # Holds [43.187653094161064, 3.622882738369357, 0.0]

Goal

Inverse kinematics example with human skeleton.

Roadmap

  • Basic 2D (flat chain)
  • Basic 3D (flat chain)
  • 3D testing sandbox
  • Basic 2D joint movement restrictions
  • Basic 3D joint movement restrictions
  • Complex chain support 2D
  • Complex chain support 3D

Contributing

All contributions are appreciated.

Read the paper paper.

FABRIKs homepage has links to other implementations.

License

MIT License

Copyright (c) 2020 Saša Savić

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

pyfabrik-0.4.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

pyfabrik-0.4.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file pyfabrik-0.4.0.tar.gz.

File metadata

  • Download URL: pyfabrik-0.4.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.9.16-200.fc33.x86_64

File hashes

Hashes for pyfabrik-0.4.0.tar.gz
Algorithm Hash digest
SHA256 3eaac67646b1b6f3648726d50b0a9cd31a5644bdfce65832e100542eb20b1b37
MD5 1ba95825c5e077cc18da1b2ef1146be8
BLAKE2b-256 68a40eb841babece334e059b5ee2db371e5e1dcf4659e92613503be827535616

See more details on using hashes here.

File details

Details for the file pyfabrik-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: pyfabrik-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.9.16-200.fc33.x86_64

File hashes

Hashes for pyfabrik-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1564e681c1fa9571ff1c6a8efdb5c73e311d0d6b25ea71a71576c6c1a787abe4
MD5 2de0714fe54468bda66b465cc28dd813
BLAKE2b-256 dc1b32331c615d9d8aca0e78b51b38deb4a8b169c9ddf7d2d07ae3349c3c417b

See more details on using hashes here.

Supported by

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