This paper presents an overview of a robot operating system based architecture for human-industrial robot interactions using peripheral optical sensors for real-time object detection and collision avoidance with an industrial robot in the virtual world of the Gazebo simulator. Machine vision plays a huge role in production automation, and develop a system based on Kuka KR3 industrial robot for detecting and tracking a human and other objects in a working area using optical sensors. The ability to work in low light and crowded conditions, as well as the ability to reconstruct a method of execution of a task, while maintaining control of a robot. This work considers several optical sensors and a comparative analysis.