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

Getting TCP from Robot Pose

#1
Hello,

I would like to go through the program instructions and get the TCP for the linear moves.  The hope is that the TCP coordinate will coincide with the point coordinates that were used in the curve follower project (that created the program).

When looping through the program instructions the API provides the target pose as a Mat - so I cannot use robodk.robolinkutils.getPoseWrt(item1, item2) because it is not an Item.

Can you please suggest how to get the TCP (knowing the tool information, of course) ?  

Thank you,
Henry
#2
The pose you get from the API Instruction call is the pose of the active tool (TCP) with respect to the active reference frame.

If you want to calculate the pose of the TCP with respect to the robot base you can do something like this:
Code:
tcp_wrt_base = robot.PoseFrame() * target_pose()

If you want to calculate the pose of the TCP with respect to the astation coordinate system you can do this:
Code:
tcp_wrt_stationabs = robot.Parent().PoseAbs() * robot.PoseFrame() * target_pose()
#3
Thank you Albert.

I am getting the expected results from the sample project (attached) but not from the "real" project.  So I need to go and figure out the error.  I suspect there is a inch vs. mm problem someplace.

As a side note, I noticed that the curve follower dialog is adding a retract point even when that option is not checked.  It is also duplicating the first curve point - there are two identical instructions.  This seems odd, but maybe there is a good reason for it.

Thanks again for the information.

Script Output.png   


Attached Files
.rdk   Curve Follow Project Test.rdk (Size: 2 MB / Downloads: 202)
.txt   Curve XYZIJK.csv.txt (Size: 45.5 KB / Downloads: 180)
#4
The duplicate point is expected because the curve follow project may add additional movements before and/or after changing the speed or certain program events. This duplicated points are usually filtered out autoamtically when generating the program.

RoboDK works in mm and all input distance or coordinate values are in mm (except otherwise stated).
  




Users browsing this thread:
1 Guest(s)