A tiny inverse kinematics solver
Project description
Tinyik is a simple and naive inverse kinematics solver.
It defines an actuator as a set of links and revolute joints from an origin. Here is an example of a robot arm that consists of two joints that rotate around z-axis and two links of 1.0 length along x-axis:
>>> import tinyik
>>> arm = tinyik.Actuator(['z', [1., 0., 0.], 'z', [1., 0., 0.]])
Since the joint angles are zero by default, the end-effector position is at (2.0, 0, 0):
>>> arm.angles
array([ 0., 0.])
>>> arm.ee
array([ 2., 0., 0.])
Sets the joint angles to 30 and 60 degrees to calculate a new position of the end-effector:
>>> import numpy as np
>>> arm.angles = [np.pi / 6, np.pi / 3] # or np.deg2rad([30, 60])
>>> arm.ee
array([ 0.8660254, 1.5 , 0. ])
Sets a position of the end-effector to calculate the joint angles:
>>> arm.ee = [2 / np.sqrt(2), 2 / np.sqrt(2), 0.]
>>> arm.angles
array([ 7.85398147e-01, 3.23715739e-08])
>>> np.round(np.rad2deg(arm.angles))
array([ 45., 0.])
Installation
$ pip install tinyik
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tinyik-1.0.0.zip
(8.1 kB
view hashes)
Built Distribution
Close
Hashes for tinyik-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 515c86f2982e71265b35f09980e6ee40703f83609e9ce6a8c737c25161480184 |
|
MD5 | 640d43611a6a311207fc75e419267635 |
|
BLAKE2b-256 | c8cd6938e4d6bbbdeec1caf8bf3fb3f4b374b6f99933890c35c3b8d04f766fd9 |