A distributed approach to collision and deadlock avoidance in multi-robot systems