Skip to content

Error while using ikine_min() #314

@hamyyy

Description

@hamyyy

Description

Trying to use URDF.UR10.ikine_min() resulted in division by zero error.
UR10.reach is zero when it should be arount 1.6

Using DH.UR10.ikine_min() does not produce this error, however, the IK solver hangs and never exits the function. This may be another issue entirely.

Version information

pip3: 20.0.2
roboticstoolbox-python: 1.0.1 (installed via pip3)
spatialmath-python: 1.0.0 (automatically installed when rtb was installed)

To Reproduce

Steps to reproduce the behavior:

import roboticstoolbox as rtb
from spatialmath import SE3
from math import pi

robot = rtb.models.URDF.UR10()

startingQ = [-pi / 2, -pi / 2, -pi / 2, -pi / 2, pi / 2, 0] # elbow up position
desiredPose = SE3(0, 0.5, 0.5) * SE3.Ry(pi) # well within reach of robot

solution = robot.ikine_min(desiredPose, q0=startingQ, qlim=True) # error occurs here
print(solution.q)
Traceback (most recent call last):
  File "/home/USERNAME/script.py", line 12, in <module>
    solution = robot.ikine_min(desiredPose, q0=startingQ, qlim=True) # error occurs here
  File "/home/USERNAME/.local/lib/python3.8/site-packages/roboticstoolbox/robot/IK.py", line 752, in ikine_min
    wr = 1 / self.reach
ZeroDivisionError: division by zero

Error points to this line: (from git master)

Expected behavior

Inverse Kinematics is solved and produces joint angle values

Environment

Python: 3.8.10
Ubuntu: 20.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions