In a companion paper we have presented a practical formation motion control scheme for robotic swarms based on single view depth estimation. In this paper we adapt this control scheme to the cases where there are obstacles to be avoided in the region of interest. First, a set of distributed control laws for the agents, to be incorporated with depth (distance) estimation scheme, are introduced to move the formation from an arbitrary initial position to an arbitrary final position without deforming the formation shape or having a collision with an obstacle. Then, we present simulation results on formation control using the proposed control scheme for both obstacle free and with obstacle cases. We later discuss certain practical issues regarding the proposed scheme. The robots do not have any global positioning sensors, and they do not communicate with each other. The performance of the overall system as well as the effects of delay and quantization in estimation of distance are analyzed via simulations. © 2008 IEEE.