Researchers have developed an algorithm that can analyze the brainwaves of pilots and convert them into flight commands.