# How to derive a pose quaternion from orientation vectors with tf2

I am trying to calculate the pose of an object using tf2.

I know the X', Y', Z' vectors defining the orientation of the object - ie. the principle axes of the target frame, expressed in the origin frame. I also know the position of the target frame. How can I calculate the pose / quaternion that rotates the origin frame to the target frame (so that I can publish a geometry_msg/Pose for the object)?

A quaternion is the orientation vector, that cannot be "calculated" from the position information, that itself is its own information about what the orientation is relative to the reference frame for the full SE3 pose. You have to know your own orientation.

In case LukeAI meant that he had

vectorsfor x', y', and z', as in the principle axes of the target frame, expressed in a reference frame, then the pose quaternion can be determined using standard conversions between rotation matrix notation and quaternion notation. But then position would still be missing... so I agree the question could use a bit more clarity@shonigmann that's exactly what I meant, editing for clarity

glad you figured it out!