The coordination of an autonomous robotic swarm requires a control algorithm that is simple, scalable, robust and flexible. Biological systems show many kinds of behaviours, which enable organisms to act efficiently in a dynamic environment. By mimicking the trophallactic behaviour of honeybees (mouth-to-mouth feeding), we developed a communication scheme and a navigation algorithm for mobile robots. This allows a swarm of robots to perform collective decision-making based on individual robot navigation. In this article we present a novel feature of this algorithm: It allows a robotic swarm to react to the shape and to the orientation of areas of unsuitable terrain. We demonstrate that a robotic swarm using this new algorithm is able to make near-optimal route choices, i.e. whether to cross or to avoid an area with unsuitable terrain.