Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

SolveIK not working with TOOL

#1
I need to get the target joints of movement without moving the robot on simulation.

I can use the finction SolveIK like this:
  new_robot_joints = robot.SolveIK(joints, tool=tool)
  print("--->",new_robot_joints.tolist())

But when I try to get the joints with a tool I get error:
toolWeld  = RDK.Item('KH-TOURCH')
print("XXX-->",toolWeld.Pose())
new_robot_joints = robot.SolveIK(joints, tool=tool)
print("--->",new_robot_joints.tolist())

This is the error:
Traceback (most recent call last):
  File "D:\work\Design\Welding-Robot\Modular-Structures\kehui_simulation.py", line 468, in <module>
    new_robot_joints = robot.SolveIK(pose=joints, tool=tool)
  File "C:\RoboDK\Python\robolink\robolink.py", line 4606, in SolveIK
    pose = pose*invH(tool)
  File "C:\RoboDK\Python\robolink\robodk.py", line 353, in invH
    return matrix.invH()
AttributeError: 'Item' object has no attribute 'invH'


Question:
1/ Is there other a way to get the joints with tool?
2/ why I get this error although the tool is corret
#2
The tool you provide to the SolveIK function should be a pose (a 4x4 matrix as an object of type Mat).

Example:
Code:
new_robot_joints = robot.SolveIK(pose=robot.Pose(), joints=robot.Joints(), tool=robot.PoseTool(), frame=frame.PoseFrame())
#3
Thanks, it is working perfect.
  




Users browsing this thread:
1 Guest(s)