(q)
return heading
Returns the heading of a rotation q, specified as a quaternion.

  The heading represents the rotational component of q along the vertical
  axis (z axis).

  Args:
    q: A quaternion that the heading is to be computed from.

  Returns:
    An angle representing the rotation about the z axis.
Returns the heading of a rotation q, specified as a quaternion.
Returns the heading of a rotation q specified as a quaternion .
def calc_heading(q):
  """Returns the heading of a rotation q, specified as a quaternion.

  The heading represents the rotational component of q along the vertical
  axis (z axis).

  Args:
    q: A quaternion that the heading is to be computed from.

  Returns:
    An angle representing the rotation about the z axis.

  """
  ref_dir = np.array([1, 0, 0])
  rot_dir = pose3d.QuaternionRotatePoint(ref_dir, q)
  heading = np.arctan2(rot_dir[1], rot_dir[0])
  return heading
def calc_heading ( q ) : ref_dir = np . array ( [ 1 , 0 , 0 ] ) rot_dir = pose3d . QuaternionRotatePoint ( ref_dir , q ) heading = np . arctan2 ( rot_dir [ 1 ] , rot_dir [ 0 ] ) return heading