IKFast libraries for UR3e, UR3 and UR5.
Inspired by https://github.com/andyzeng/ikfastpy
Easy to install and use:
- clone
- install dependencies
sudo apt-get install libblas-dev liblapack-dev
pip install --user numpy Cython
- install using pip
$ git clone https://github.com/cambel/ur_ikfast.git
$ cd ur_ikfast
$ pip install -e .
It takes a few minutes to compile the ikfast libraries.
from ur_ikfast import ur_kinematics
ur3e_arm = ur_kinematics.URKinematics('ur3e')
joint_angles = [-3.1, -1.6, 1.6, -1.6, -1.6, 0.] # in radians
print("joint angles", joint_angles)
pose_quat = ur3e_arm.forward(joint_angles)
pose_matrix = ur3e_arm.forward(joint_angles, 'matrix')
print("forward() quaternion \n", pose_quat)
print("forward() matrix \n", pose_matrix)
# print("inverse() all", ur3e_arm.inverse(pose_quat, True))
print("inverse() one from quat", ur3e_arm.inverse(pose_quat, False, q_guess=joint_angles))
print("inverse() one from matrix", ur3e_arm.inverse(pose_matrix, False, q_guess=joint_angles))
For a new robot just create the ikfast database (.cpp) following one of these tutorials: