With the development of robot technology, automatic assembly technology based on industrial robots has been greatly applied. Considering the high-precision automatic grasping of heterogeneous products, robot grasping detection technology is put forward. Although the current method of using camera is relatively mature, it is greatly affected by the ambient light and the surface material of the object, resulting in the limited versatility. Since the 3D structured light method based on the laser scanning galvanometer has the characteristics of high speed and high accuracy, strong environmental adaptability and weak influence by the surface material of the object, the structured light equipment using laser scanning galvanometer was installed at the end of the robot to realize the grasping detection of the products. Through hand eye calibration, point cloud acquisition, point cloud processing, point cloud matching and other links, the point cloud collection and accurate matching of local features are realized. The experiment shows that the grasping detection accuracy is less than 0.32mm. It can not only achieve accurate grasping of different products, but also has the characteristics of strong adaptability to surface materials, environmental lighting, and high accuracy.