def quaternion_to_angle(q):
"""Convert a quaternion _message_ into an angle in radians.
The angle represents the yaw.
This is not just the z component of the quaternion."""
x, y, z, w = q.x, q.y, q.z, q.w
roll, pitch, yaw = tf.transformations.euler_from_quaternion((x, y, z, w))
return yaw
评论列表
文章目录