Achllle / dual_quaternions_ros

Dual Quaternion conversions from/to ROS messages
MIT License
31 stars 7 forks source link

Clarify transforming points vs similarity transform #29

Closed Achllle closed 4 years ago

Achllle commented 5 years ago

The code of transform_point is as follows:

        # dq_point = DualQuaternion.identity()
        # dq_point.q_d = np.quaternion(0., point_xyz[0], point_xyz[1], point_xyz[2])
        # transformed_dq = (self * dq_point) * (self.conjugate())
        # return [transformed_dq.q_d.x, transformed_dq.q_d.y, transformed_dq.q_d.z]

        # this works, but not mathematically elegant (?)
        dq_point = DualQuaternion.from_translation_vector(point_xyz)
        transformed_dq = self * dq_point

        return transformed_dq.translation

Seems like I was confused writing this down. The commented out code describes a similarity transform, which is used to relate transformation between frames, not points. I would educate but let the user do the similarity transform if they need it.