def vertex_to_json(v):
  """Converts a ROS vertex message into a JSON-serializable dictionary

  :param v: GlobalVertex message
  """
  p = v.t_vertex_world.position
  o = v.t_vertex_world.orientation
  return {
      'id': v.id,
      'T_vertex_world': {
          'position': [p.x, p.y, p.z],
          'orientation': [o.x, o.y, o.z, o.w]
      },
      'T_projected': [v.t_projected.x, v.t_projected.y, v.t_projected.theta],
      'neighbours': list(v.neighbours)
  }