Code Monkey home page Code Monkey logo

ur_kinematics_solver's Introduction

UR_kinematics_solver

This python script provides analytical solutions of forward kinematics and inverse kinematics for Universal Robot UR3/5/10. Both UR format and ROS Pose format are supported in inverse kinematics.

Prerequisites

Python 2.7.12
numpy 1.11.0
ROS 16.04

Setup

Assign an indicator of your robot model to ROBOT at line 26 of kinematics.py:
UR10: 'UR10'
UR5: 'UR5'
UR3: 'UR3'

Examples

Forward Kinematics

You can use an arg o_unit='p' to get an output in ROS Pose format.

from kinematics import *

print "Unit: radian"
current_joint = [1.7499912646190512, -1.8984856736217983, -1.190571570471343, 0.21869218174224894, 2.9533489836072846, 0.45469538502275836]

print "SE(3) in numpy.array format"
print fwd_kin(current_joint)

print "SE(3) in ROS Pose format"
print fwd_kin(current_joint, o_unit='p')

Inverse Kinematics

You can use an arg o_unit='d' to get an output in degree unit.

from kinematics import *

print "Unit: radian"
desired_solution = [1.7499912644507227, -1.8984856734885085, -1.1905715707581692, 0.21869218099676013, 2.9534288849387984, 0.45469538414663446]

target_pose = [-0.062216135428015254, 0.7551066318135237, 0.8528777013335628, -1.3064880201804807, -1.078867334463253, 1.371140938984445]

print "Joint values in radian"
print inv_kin(target_pose, desired_solution)

print "Joint values in degree"
print inv_kin(target_pose, desired_solution, o_unit='d')

If your input is in degree unit ...

Just add an arg: i_unit='d'.

fwd_kin(current_joint, i_unit='d')
inv_kin(target_pose, desired_solution, i_unit='d')

Remarks

Both inputs of UR format [X, Y, Z, RX, RY, RZ] and ROS Pose format are supported in inv_kin().

Contribution

Please feel free to propose issues or contact me.

ur_kinematics_solver's People

Contributors

littleblakew 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.