I want to create a model to which I programmatically add frames. To give a bit of context, I will add frames to an object that indicate where it can be grasped by a given gripper.
Everything is up and running, however, I noticed that the frames I import do not have the right orientation. As the frames I add to a model are ‘features’ defined relative w.r.t. a ‘root feature’ I decided to investigate there. What I found was strange to me:
I create a root feature, and it seems that this root feature is located at the world origin. The values are greyed out and cannot be changed, but they are all zero as I would expect:
Comparing to the little world reference frame in the top left corner it indeed seems that the root feature has the same orientation as the world origin:
Now, If I run the following lines of Python code to get the quaternion value of the root feature orientation, I expect to get the quaternion [0, 0, 0, 1], corresponding to the unit rotation.
comp = getComponent() print('rx: ' + str(getComponent().comp.RootFeature.PositionMatrix.O.X)) print('ry: ' + str(getComponent().comp.RootFeature.PositionMatrix.O.Y)) print('rz: ' + str(getComponent().comp.RootFeature.PositionMatrix.O.Z)) print('rw: ' + str(getComponent().comp.RootFeature.PositionMatrix.O.W))
However, I get the following printed out in the terminal:
I tried to directly change the quaternion values through similar lines of Python code, but I could not bring the quaternion to the unit rotation.
The mismatch I see here in the root feature orientation corresponds to what I see propagated in the orientation of the frames I want to add to my model.
Can someone please help me understand this?
Robotics engineer @Flanders Make, Belgium