Ensemble control of robots has attracted much attention in engineering, and this is due to the need to control the arrangement and group movement of multi-robot systems in land, air, and sea applications. Multi-robot systems are growing in the industry today, such as security work, factory transportation, and construction. Multi-robot systems are used to collaborate with robots and perform joint missions. Also, in practice, many of the control methods proposed for dynamic systems may not be feasible because the intended model may be inaccurate or the system may be subject to model uncertainties. In this paper, a group of wheeled robots is controlled with a novel global input algorithm in the presence of uncertainties and environmental obstacles. In the following, the ensemble control of robots in the presence of obstacles is discussed using virtual potential functions. These potentials are defined in such a way that in equilibrium, the goal can be achieved. In this article, an algorithm for leading a group of robots among the obstacles is presented.