This paper describes a control proposal aimed at the formation of heterogeneous robots in environments with several obstacles. The formation of robots is composed of mobile robots with differential traction and a quadcopter, the dynamic model of each robot is used. The proposed controller is a cascade control scheme where the external loop contains a null-space-based control for path tracking and obstacle avoidance, and the internal controller is a dynamic PID type controller for speed tracking of each robot. The proposed control allows to have 2 tasks: i) form control and ii) posture control. Additionally, an obstacle avoidance strategy based on potential fictitious fields has been implemented. Obstacle avoidance can be located within one of the control tasks. The stability of the controllers is analyzed based on Lyapunov, and simulation tests are presented to verify the good performance of the proposed controllers.