1.欧拉角转四元数
如:pos = Pose()
q = tf.transformations.quaternion_from_euler(0, 0, point.z)
pos.orientation = q
经测试,这样写是有问题的,正确的写法如下:
pos = Pose()
q = tf.transformations.quaternion_from_euler(0, 0, point.z)
pos.orientation.x = q[0]
pos.orientation.y = q[1]
pos.orientation.z = q[2]
pos.orientation.w = q[3]
2.四元数转欧拉角
(r, p, y) = tf.transformations.euler_from_quaternion([msg.orientation.x, msg.orientation.y, msg.orientation.z, msg.orientation.w])
self.fill_euler_msg(msg, r, p, y)
版权声明:本文为qq_36458461原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。