RoboDK Forum
Recording Tool pose with respect to robot's frame in a text file- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+--- Forum: RoboDK API (//www.sinclairbody.com/forum/Forum-RoboDK-API)
+--- Thread: Recording Tool pose with respect to robot's frame in a text file (/Thread-Recording-Tool-pose-with-respect-to-robot-s-frame-in-a-text-file)



Recording Tool pose with respect to robot's frame in a text file-aryanzayn-01-18-2022

我成功能够记录关节角的my robot's movement to a text file using the monitorjoint.py macro provided. But I would like to record the pose of my Tool with respect to my robot's reference frame. The script I used is attached

str(robot.Joints().tolist()) is replaced by str(robot.Pose().tolist())


When I run the following script, I get the following output for the first and second time stamp as example

0.0, -0.719945730144482, -2.918800016718072e-16, -0.6940303636345666, 0.0

0.05308723449707031, -0.719945730144482, -2.918800016718072e-16, -0.6940303636345666, 0.0

This does not look correct, I should be getting a 4x4 matrix?

Secondly, I require the tool pose to be given with respect to the robot's base reference frame and in the format XYZABC. How do I modify the code to do this?


.txt robotpose.txt(Size: 604 bytes / Downloads: 151)


RE: Recording Tool pose with respect to robot's frame in a text file-Albert-01-19-2022

A pose is a Mat object (Matrix) and you can print it as is to obtain the 4x4 matrix.

You can also convert it to Euler angles and use the XYZWPR instead.

Example:

Code:
# print the pose as a 4x4 matrix:
print(robot.Pose())

# print the pose as XYZWPR values:
print(pose_2_xyzrpw(robot.Pose()))