Movement of MobileRobots

How do I ensure that my mobile robots do not collide with each other or pass through each other? Is there a way for the mobile robots to detect collision and avoid incoming robots via different pathways ?