Motion planning of multiple mobile robots in formations