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

Create Targets from Quaternion

#2
It looks like you already have a 4x4 matrix in the text file you provided.

You can create this matrix (Mat) by directly providing the all components of your matrix using a list of lists in Python:
Code:
poselist = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]
pose = robomath.Mat(poselist)
if not pose.isHomogeneous():
print("Something is wrong: this pose is not homogeneous.")
print(pose)

The opposite of Pose_2_ABB would be a function that takes 7 values (xyz,q1,q2,q3,q4) and returns a pose (4x4 matrix). This function could look like this:
Code:
def ABB_2_Pose(xyzq1234):
xyz = xyzq1234[0:3]
q1234 = xyzq1234[3:7]
pose = quaternion_2_pose(q1234)
pose.setPos(xyz)
return pose


Messages In This Thread
Create Targets from Quaternion - by达斯汀•- 08-23-2022, 10:42 AM
RE: Create Targets from Quaternion - byAlbert- 08-23-2022, 12:50 PM
RE: Create Targets from Quaternion - byAlbert- 08-25-2022, 08:40 AM



Users browsing this thread:
1 Guest(s)