Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Solve inverse kinematics for end effector link with fixed orientation #33


Hello Professor Hauser,

we are using Klampt to model and optimize a pick and place process using the provided tx90l.rob robot. Now we want to move the end effektor link to certain points given in cartesian coordinates. For that we tried to get the configuration out of the cartesian coordiantes x[0], x[1], x[2] by using the inverse kinematics solver:

link =
obj = ik.objective(link, local=[1, 0, 0], world=[x[0], x[1], x[2]])
solver = ik.solver(obj)
solver.setJointLimits(*robot.getJointLimits())  # reinstantiate joint limits

For our application the direction (downwards at all times) of the end effector link has to be fixed. Are there suitable constrains to add to the inverse kinematics solver to enforce this direction constraint ?
Thanks for your great work!
I'm looking forward to your answer.

  • replies 3
  • views 1.8K
  • likes 0
itsstoffi · Author

Thanks a lot for your hint!
In our script we loaded the TX90L.rob as world.robot(0).
We tried several different constraints to solve the problem, but did not suceed. In our Understanding the robot link 5 should move to the origin of the world coordiante system. Is that right ?
Unfortunately, in our case the robot does not reach the desired cartesian points (high residual of solver) and the orientation constraint does not enforce a fixed downwards orientation. Is there anything we didn't take into account in our Inverse Kinematics Optimization ?

Thanks a lot in advance!

Our Code:

#load TX90L robot
config_list = [[0.2,0.35,0.1],[0.25,0.35,0.1],[0.3,0.35,0.1],[0.35,0.25,0.1],[0.4,0.25,0]]
for i in range(3):
    link5 =
    obj = ik.objective(link5,local = [0,0,0], world = config_list[i])
    solver = ik.solver(obj) 
    res = solver.solve()
    solved = False
    if res:
        solved = True
    if not ik.solve_global(obj, iters= 100, tol=1e-3, numRestarts=100):
        print("IK failure!")
    newp = robot.getConfig()
    print("configs matrice:")

In my setup I have a robot arm where the end effector is always at a set angle. to achieve this I created an IK objective that looks like this:

obj2 = ik.objective(robotlink,R=so3.from_axis_angle(([0,1,0],(toolAngle*(math.pi/180)))),t=t)   # [0,1,0] choose axis | toolAngle is the angle in degrees being converted to radians

Hope this helps!