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

#1

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 = robot.link(6)
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
solver.sampleInitial()
solver.solve()

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 2K
  • likes 0
#2
itsstoffi · Author
#3

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 = robot.link(5)
    obj = ik.objective(link5,local = [0,0,0], world = config_list[i])
    obj.setAxialRotConstraint([0,0,1],[0,0,0])
    print("RotationAxis")
    print(obj.getRotationAxis())
    solver = ik.solver(obj) 
    solver.setJointLimits(*robot.getJointLimits())
    solver.setMaxIters(100)
    solver.setTolerance(1e-3) 
    solver.sampleInitial()
    res = solver.solve()
    solved = False
    if res:
        solved = True
        break
    if not ik.solve_global(obj, iters= 100, tol=1e-3, numRestarts=100):
        print("IK failure!")
    newp = robot.getConfig()
    configs.append(newp)
    print("configs matrice:")
    print(configs)
    print("Residual:")
    print(ik.residual(obj))
    vis.add("link5",link5.getWorldPosition([0,0,0.5]))
    vis.add("obj",obj)
#4

Hi,
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!