For centuries, humans have used pigeons to spy on their enemies and take photographs of secret locations.