Code Monkey home page Code Monkey logo

tinyik's Introduction

Tinyik

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

tinyik's People

Contributors

ricardodeazambuja avatar lanius avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.