Formation flying for UAVs and satellites using a mesh network architecture