A field called swarm robotics is taking inspiration from ants, bees and even slime molds.