Real-time intelligent controller of tool-handling for robotized manufacturing