In this paper is intended to control the entire flexible line using two wheeled mobile robot and two robotic manipulators. The mechatronics manufacturing line has no possibility of automatic feed with pieces and no automatic pickup of the scrap pieces from the storage station. The robotic manipulators are used for charging the buffer of the flexible line as well as emptying the storage station. These tasks are achieved through several algorithms proposed in the present paper (accomplished in Matlab) using image processing with the help of two video cameras synchronized with the grippers of the two robotic manipulators. One of the robotic manipulator (Pioneer 5-DOF Arm), takes with the gripper the pieces stored, is mounted on a mobile robot (Pioneer P3-DX two driving wheels). The Pioneer P3-DX wheeled mobile robot transfer the pieces one by one to another wheeled mobile robot — PeopleBot used to transport the processed piece in the storeroom or at the first station of the flexible line. The second robotic manipulator (Cyton 1500 7-DOF Arm) is fixed and it is used to take the pieces from the PeopleBot mobile robot and to transfer them to the handling work station of the flexible line. PeopleBot mobile robot used to transport the pieces is controlled using new control techniques (trajectory tracking control) with the possibility of obstacle avoidance. Sliding-mode control method is used to control nonlinear processes (the mobile robots). The algorithms proposed in this paper were first tested in simulation and after were implemented in real time on existing mechatronic system, making it completely autonomous.