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

Recording Tool pose with respect to robot's frame in a text file

#1
I am successfully able to record joint angles of 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: 146)
#2
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()))




Users browsing this thread:
2 Guest(s)