Method and apparatus for optimizing an automated scan path

By optimizing the hiding operation and collision adjustment of the 3D scanning path, the problem of error points in automated scanning was solved, the scanning efficiency and effect were improved, and the safety and efficiency of the scanning path were ensured.

CN119879727BActive Publication Date: 2025-12-16SCANTECH (HANGZHOU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411924393.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-12-16
Estimated Expiration
2044-12-24

AI Technical Summary

Technical Problem

In existing 3D scanning technologies, the scanning path generated based on automated path planning may contain error points, such as redundancy, unreachable points, and collision points, which affect scanning efficiency and results.

Method used

By acquiring each scan point of the initial scan path, hiding operations, collision adjustment, and filtering operations are performed to optimize the scan path. This includes determining the pose information of the scan points, the range of motion of the robotic arm, the size of the scanner, and the area of ​​the workpiece being measured to generate an optimized scan path.

Benefits of technology

It improves the efficiency and effectiveness of automated scanning, ensures the safety and efficiency of the scanning path, and avoids situations where the robotic arm cannot reach the target area or there are collisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119879727B_ABST
    Figure CN119879727B_ABST
Patent Text Reader

Abstract

The application discloses an optimization method of an automatic scanning path, and the method comprises the following steps: acquiring each scanning point of an initial scanning path, wherein the initial scanning path is used for scanning a workpiece to be measured by a scanning device, and the scanning device at least comprises a scanner and a mechanical arm; performing a hiding operation and a collision adjustment operation on each scanning point to obtain each target scanning point, wherein the hiding operation is determined based on pose information of the scanning point and a motion range of the mechanical arm, and the collision adjustment operation is determined based on the pose information of the scanning point, a size of the scanner and a test region of the workpiece to be measured; and determining a corresponding optimized scanning path based on each target scanning point. The application can optimize and adjust each scanning point on the initial scanning path, and improves the scanning efficiency and scanning effect of the automatic scanning.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of automatic scanning, in particular to a method and device for optimizing an automatic scanning path. BACKGROUND

[0002] Three-dimensional scanning technology is a high-tech that integrates light, machine, electricity and computer technology, and is mainly used for scanning the space shape, structure and color of an object to obtain the spatial coordinates of the object surface. By using three-dimensional scanning technology, a three-dimensional reconstruction of the object to be scanned can be performed to create a three-dimensional model of the actual object.

[0003] At present, three-dimensional scanning has been automated. Based on the scanning path generated by automatic path planning, the scanning points on the scanning path may have error points, which have a certain impact on the scanning efficiency and scanning effect. SUMMARY

[0004] The purpose of the present application is to provide a method and device for optimizing an automatic scanning path, which can optimize and adjust each scanning point on the initial scanning path and improve the scanning efficiency and scanning effect of automatic scanning.

[0005] In a first aspect, the present application provides a method for optimizing an automatic scanning path, which comprises:

[0006] obtaining each scanning point of an initial scanning path, wherein the initial scanning path is used for a scanning device to scan a measured workpiece, and the scanning device at least includes a scanner and a mechanical arm;

[0007] performing a hiding operation and a collision adjustment operation on each scanning point to obtain each target scanning point, wherein the hiding operation is determined based on the pose information of the scanning point and the motion range of the mechanical arm, and the collision adjustment operation is determined based on the pose information of the scanning point, the size of the scanner and the test region of the measured workpiece;

[0008] determining a corresponding optimized scanning path based on each target scanning point.

[0009] Further, the method further comprises:

[0010] performing a filtering operation on each scanning point to obtain each first scanning point, wherein the filtering operation is determined based on the pose information of the scanning point and the scanning region where the scanning point is located;

[0011] performing a hiding operation on each first scanning point to obtain a second scanning point, wherein the hiding operation is determined based on the pose information of the first scanning point and the motion range of the mechanical arm;

[0012] Perform a collision adjustment operation on each second scan point to obtain a target scan point, wherein the collision adjustment operation is determined based on the pose information of the second scan point, the size of the scanner, and the test region of the measured workpiece.

[0013] Further, the scan points of the initial scan path are obtained, including:

[0014] Discretize and grid the workpiece model of the measured workpiece to obtain the vertex coordinates of each triangular facet, and calculate the center point and normal vector of each triangular facet;

[0015] Select a sampling point from the center point of each triangular facet, cluster the sampling points based on the normal vectors to obtain an initial clustering result, divide the workpiece model into a plurality of initial regions based on the initial clustering result, and determine the normal vector of each initial region;

[0016] Based on the Euclidean distance algorithm and the normal vector of each initial region, cluster each initial region to obtain a plurality of final clustering results, determine a plurality of scan regions of the measured workpiece based on the plurality of final clustering results, and determine each scan point in each scan region.

[0017] Further, the pose information of the scan point includes a position point, a scan direction vector, a scan long edge direction vector, and a scan wide edge direction vector, and the scan direction vector is determined based on the cross product operation of the scan long edge direction vector and the scan wide edge direction vector, wherein the filtering operation is performed on each scan point, including:

[0018] Determine whether the straight line intersects the scan region where the scan point is located, by taking the position point of the scan point and the corresponding scan direction vector as a straight line;

[0019] If the straight line intersects the scan region, the scan point is retained, otherwise, the scan point is filtered out.

[0020] Further, the pose information of the scan point includes a position point, a scan direction vector, a scan long edge direction vector, and a scan wide edge direction vector, and the scan direction vector is determined based on the cross product operation of the scan long edge direction vector and the scan wide edge direction vector, wherein the filtering operation is performed on each scan point, including:

[0021] Construct a rectangle by taking the position point of the scan point as the center point, and taking the scan long edge direction vector and the scan wide edge direction vector of the scan point as the edges;

[0022] Determine the scan direction vectors of the four corner points of the rectangle by taking the scan direction vector of the scan point;

[0023] Respectively, take the four corner points and the center point and their corresponding scan direction vectors to form corresponding straight lines;

[0024] If any line intersects the scanning region where the scanning point is located, the scanning point is reserved, otherwise, the scanning point is filtered out.

[0025] Further, the pose information of the scanning point includes a position point, a scanning direction vector, a scanning long edge direction vector, and a scanning wide edge direction vector, the scanning direction vector is determined based on a cross multiplication operation of the scanning long edge direction vector and the scanning wide edge direction vector, wherein the hiding operation is performed on each scanning point, including:

[0026] Converting a coordinate system of the workpiece model where the position point of the scanning point is located into a coordinate system of the robot base to obtain a converted position coordinate of the scanning point;

[0027] Based on the current position relationship between the workpiece model and the robot, the motion range of the robot, and the converted position coordinate of the scanning point, it is determined whether the scanning point is within the motion range of the robot;

[0028] If the scanning point is not within the motion range of the robot, the scanning point is hidden in the current initial scanning path.

[0029] Further, the pose information of the scanning point includes a position point, a scanning direction vector, a scanning long edge direction vector, and a scanning wide edge direction vector, the scanning direction vector is determined based on a cross multiplication operation of the scanning long edge direction vector and the scanning wide edge direction vector, wherein the collision adjustment operation is performed on each scanning point, including:

[0030] Based on the position point of the scanning point, the position of the scanner corresponding to the scanning point is determined;

[0031] Based on the volume parameter of the scanner, the volume of the scanner is determined with the position of the scanner as the center;

[0032] It is determined whether the volume of the scanner intersects the measured workpiece and the surrounding environment region of the measured workpiece, if so, it is determined that the scanning point has a collision, and the collision adjustment is performed.

[0033] Further, it is determined whether the volume of the scanner intersects the measured workpiece and the surrounding environment region of the measured workpiece, if so, it is determined that the scanning point has a collision, and the collision adjustment is performed, including:

[0034] Obtain point cloud data of the measured workpiece and the surrounding environment region of the measured workpiece, and construct a binary tree based on the point cloud data;

[0035] The target radius is half of the length of the scanner, and the target radius is searched based on a binary tree. If the point cloud data of the measured workpiece and the surrounding environment area of the measured workpiece is searched within the range of the target radius, it is determined that the scanning point exists collision, and collision adjustment is performed. The collision adjustment is as follows: the scanning direction vector of the scanning point is rotated around the scanning long edge direction vector or the scanning wide edge direction vector to adjust the scanning direction of the scanner. If the scanning direction of the scanner is adjusted and the scanning point still exists collision, the scanning point is deleted.

[0036] Further, the method further comprises:

[0037] Based on each target scanning point on each initial scanning path, a plurality of optimized scanning paths are determined;

[0038] From the first optimized scanning path, each optimized scanning path is set with a path number, and the path numbers are 0, 1, 2, …, N in turn;

[0039] The plurality of optimized scanning paths are adjusted so that the scanning modes between the adjusted scanning paths are Z-shaped scanning. The adjustment includes:

[0040] If the path number of the optimized scanning path is even, the adjusted scanning path is generated according to the order from the first target scanning point to the last target scanning point on the optimized scanning path;

[0041] If the path number of the optimized scanning path is odd, the adjusted scanning path is generated according to the order from the last target scanning point to the first target scanning point on the optimized scanning path.

[0042] Further, the method further comprises:

[0043] If the ratio of the number of target scanning points to the number of scanning points is less than a preset threshold, a distance matrix between any two target scanning points is calculated;

[0044] The first target scanning point is determined as the initial scanning point on the to-be-generated scanning path, and the target scanning point with the minimum distance matrix between the target scanning points is determined as the second scanning point on the to-be-generated scanning path;

[0045] In this way, each scanning point on the to-be-generated scanning path is sequentially determined, and the corresponding optimized scanning path is generated based on the determined each scanning point.

[0046] In a second aspect, the application provides an automatic scanning path optimization device, which comprises:

[0047] acquire each scanning point of an initial scanning path, wherein the initial scanning path is used for scanning a workpiece by a scanning device, and the scanning device comprises at least a scanner and a mechanical arm;

[0048] adjust each scanning point by performing a hiding operation and a collision adjustment operation, to obtain each target scanning point, wherein the hiding operation is determined based on pose information of the scanning point and a motion range of the mechanical arm, and the collision adjustment operation is determined based on the pose information of the scanning point, a size of the scanner, and a test region of the workpiece;

[0049] generate an optimized scanning path based on each target scanning point.

[0050] In a third aspect, the present application provides a computer device, comprising a memory and a processor, the memory stores a computer program, and the processor is configured to execute the computer program to perform the steps of the method for optimizing an automated scanning path.

[0051] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the method for optimizing an automated scanning path.

[0052] The present application performs a hiding operation and a collision adjustment operation on each scanning point of an initial scanning path to obtain each target scanning point, and then determines an optimized scanning path. By optimizing the scanning points with errors, hiding the scanning points that cannot be reached by the mechanical arm, and adjusting the scanning points that have collisions, the present application can optimize and adjust each scanning point on the initial scanning path, optimize the scanning path, and improve the scanning efficiency and effect of the automated scanning, to ensure the safety and efficiency of the scanning path during actual scanning. BRIEF DESCRIPTION OF DRAWINGS

[0053] Figure 1 A first flowchart of the method for optimizing an automated scanning path provided by the embodiments of the present application;

[0054] Figure 2 A second flowchart of the method for optimizing an automated scanning path provided by the embodiments of the present application;

[0055] Figure 3 A third flowchart of the method for optimizing an automated scanning path provided by the embodiments of the present application;

[0056] Figure 4 A schematic diagram of each initial region of a workpiece model provided by the embodiments of the present application;

[0057] Figure 5A schematic diagram of each scanning area of a workpiece model provided by an embodiment of the present application;

[0058] Figure 6 A fourth flowchart of an optimization method of an automated scanning path provided by an embodiment of the present application;

[0059] Figure 7 A fifth flowchart of an optimization method of an automated scanning path provided by an embodiment of the present application;

[0060] Figure 8 A sixth flowchart of an optimization method of an automated scanning path provided by an embodiment of the present application;

[0061] Figure 9 A seventh flowchart of an optimization method of an automated scanning path provided by an embodiment of the present application;

[0062] Figure 10 A schematic diagram of a result after optimization of a scanning point provided by an embodiment of the present application;

[0063] Figure 11 A schematic diagram of multiple scanning paths provided by an embodiment of the present application;

[0064] Figure 12 An eighth flowchart of an optimization method of an automated scanning path provided by an embodiment of the present application;

[0065] Figure 13 A ninth flowchart of an optimization method of an automated scanning path provided by an embodiment of the present application;

[0066] Figure 14 A system block diagram of an optimization device of an automated scanning path provided by an embodiment of the present application;

[0067] Figure 15 A system block diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0068] The present application will be described in detail below with reference to the accompanying drawings. However, the embodiments do not limit the present application, and any changes in structure, method, or function made by those skilled in the art based on the embodiments are included in the scope of the present application.

[0069] The scanning path of the automatic three-dimensional scanning system is usually a scanning path planned in advance, which is usually a path generated based on automatic path planning. There may be error points such as redundant points, unreachable points, and collision points on the scanning points on the path, which have a certain impact on the scanning efficiency and scanning effect. The embodiments of the present application provide an optimization method of an automatic scanning path, which optimizes the error points on the initial generated automatic scanning path to improve the scanning efficiency and scanning effect of the automatic scanning.

[0070] The execution subject of the automatic scanning path optimization method in the embodiments of the present application can be an electronic device. The electronic device is in communication connection with the automatic three-dimensional scanning system. The electronic device performs optimization on each scanning point on the initial scanning path to obtain an optimized scanning path, and the scanning device in the automatic three-dimensional scanning system performs a scanning operation on the measured workpiece based on the optimized scanning path.

[0071] Illustratively, the electronic device can be a terminal or the like, including but not limited to a mobile terminal and a fixed terminal. For example, the mobile terminal includes but is not limited to a smart phone, a smart watch, a tablet computer, a notebook computer, a smart vehicle, a smart vehicle, etc., and the fixed terminal includes but is not limited to a desktop computer, a smart television, etc.

[0072] Illustratively, the electronic device can also be a server or the like. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms, but is not limited thereto.

[0073] Please refer to Figure 1 The embodiments of the present application provide an optimization method of an automatic scanning path, which includes steps S101-S103.

[0074] Step S101, obtaining each scanning point of an initial scanning path, wherein the initial scanning path is used for a scanning device to scan a measured workpiece, and the scanning device at least includes a scanner and a mechanical arm.

[0075] The initial scanning path can be a scanning path generated based on an automatic path planning algorithm. Based on the automatic path planning algorithm and the measured workpiece, the scanning direction, scanning mode, and the like can be determined, and then each scanning point can be determined. Based on the order of each scanning point, the initial scanning path can be determined. Each scanning point is a pose that the mechanical arm carrying the scanner needs to reach when performing three-dimensional scanning. Each scanning point is distributed at each position of the measured workpiece. The initial scanning path can be determined based on the settings of the path planning, the measured workpiece, and the like. The initial scanning path can be one path or multiple paths, which is not limited in the embodiments of the present application.

[0076] The automatic three-dimensional scanning system can be divided into a handheld three-dimensional scanning system, a tracking three-dimensional scanning system, and the like. The automatic three-dimensional scanning system includes a scanning device, a control device, a turntable, and a tracking device. The scanning device includes a scanner and a mechanical arm. The mechanical arm can be fixed on a base. The mechanical arm is used to carry the scanner for three-dimensional scanning. The scanner can be arranged at the end of the mechanical arm. The scanner can be a handheld three-dimensional scanner or a tracking scanner. The turntable is used to carry the measured workpiece. The scanning device scans the measured workpiece according to the planned scanning path under the control of the control device. The motion path of the mechanical arm is specifically the planned motion path of the end of the mechanical arm. Since the end of the mechanical arm carries the scanner, the motion path of the end of the mechanical arm can be equivalent to the scanning path of the scanner.

[0077] In step S102, the hiding operation and the collision adjustment operation are performed on each scanning point to obtain each target scanning point. The hiding operation is determined based on the pose information of the scanning point and the motion range of the mechanical arm. The collision adjustment operation is determined based on the pose information of the scanning point, the size of the scanner, and the test region of the measured workpiece.

[0078] The initial scanning path can have error points. Therefore, each scanning point needs to be adjusted and optimized, that is, the hiding operation and the collision adjustment operation are performed on each scanning point. The scanning points can be distributed at different positions of the measured workpiece. Some scanning points are not reachable by the mechanical arm during automatic scanning, that is, these scanning points are outside the reachable range of the mechanical arm. These scanning points are hidden, that is, based on the pose information of the scanning point and the motion range of the mechanical arm, it is determined which scanning points need to be hidden.

[0079] The scanning point is a pose that the mechanical arm carrying the scanner needs to reach when performing three-dimensional scanning, which can be understood as the position of the scanner. Considering the size of the scanner itself, there can be a possibility of collision between the scanner and the measured workpiece and the surrounding environment during scanning. Therefore, these scanning points need to be adjusted to avoid collision during actual scanning. Based on the pose information of the scanning point, the size of the scanner, and the test region of the measured workpiece, it is determined which scanning points need to be adjusted, and then the corresponding adjustment operation is performed.

[0080] It can be understood that there can be redundant points in the initial scanning path, and the redundant points need to be filtered out.

[0081] In step S103, the corresponding optimized scanning path is determined based on each target scanning point.

[0082] According to each target scanning point and the order between the scanning points, the corresponding optimized scanning path is generated.

[0083] In this embodiment, the points with errors in the initial scanning path are optimized, the scanning points unreachable by the mechanical arm are hidden, the scanning points with collisions are determined and adjusted to avoid collisions, so as to realize the optimization and adjustment of each scanning point in the initial scanning path, realize the optimization of the scanning path, and improve the scanning efficiency and scanning effect of the automatic scanning, so as to ensure the safety and efficiency of the scanning path in actual scanning.

[0084] In one embodiment, as shown in Figure 2 The method further includes the steps of:

[0085] In step S201, a filtering operation is performed on each scanning point to obtain each first scanning point, wherein the filtering operation is determined based on the pose information of the scanning point and the scanning region where the scanning point is located.

[0086] In step S202, a hiding operation is performed on each first scanning point to obtain a second scanning point, wherein the hiding operation is determined based on the pose information of the first scanning point and the movement range of the mechanical arm.

[0087] In step S203, a collision adjustment operation is performed on each second scanning point to obtain a target scanning point, wherein the collision adjustment operation is determined based on the pose information of the second scanning point, the size of the scanner, and the test region of the measured workpiece.

[0088] For each scanning point in the initial scanning path, there can be redundant scanning points, and the positions of these redundant scanning points can be outside the selected scanning region range. These scanning points need to be filtered out to improve the scanning efficiency. Based on the pose information of the scanning point and the scanning region where the scanning point is located, it is determined whether the scanning point is a redundant scanning point. The filtering operation is performed on the scanning points determined as redundant scanning points to obtain each first scanning point. The hiding operation is performed on each first scanning point to obtain a second scanning point. The collision adjustment operation is performed on each second scanning point to obtain a target scanning point. Then, the optimized scanning path is determined based on each target scanning point.

[0089] In this embodiment, the filtering of redundant points, the hiding of unreachable points and the adjustment of collision points are sequentially performed on each scanning point on the initial scanning path, which not only improves the optimization efficiency of each scanning point on the initial path, but also realizes the optimization of the scanning path, and further improves the scanning efficiency and scanning effect of the automatic scanning.

[0090] In one embodiment, before obtaining each scanning point on the initial scanning path, a coordinate system of the automated three-dimensional system is constructed. The coordinate change relationship between the scanner and the end of the robot arm is determined based on a hand-eye calibration algorithm. The coordinate change relationship between the measured workpiece and the base of the robot arm is determined based on environment calibration. The object of environment calibration can be the measured workpiece or a fixed object in the surrounding environment of the measured workpiece, for example, a fixed object is a turntable, a fixed frame, etc. Exemplarily, the robot arm coordinate system is divided into a robot arm base coordinate system and a robot arm end coordinate system, wherein the robot arm base coordinate system is established with, for example, the intersection of the base and the bottom end axis of the robot arm as the origin of the coordinate system, and the robot arm end coordinate system is established with the intersection of the scanner and the end axis of the robot arm as the origin of the coordinate system. The hand-eye calibration algorithm can be implemented using existing calibration algorithms, and the specific implementation process is not limited.

[0091] In one embodiment, as shown in Figure 3 obtaining each scanning point of the initial scanning path includes the steps of:

[0092] In step S301, the workpiece model of the measured workpiece is discretely meshed to obtain the vertex coordinates of each triangular facet, and the center point and normal vector of each triangular facet are calculated.

[0093] The workpiece model of the measured workpiece can be a computer-aided design (CAD) model based on the measured workpiece. The workpiece model is discretely meshed to obtain each triangular facet, each triangular facet is composed of three vertices, the coordinates of each vertex are determined, i.e. the coordinates of each vertex in three-dimensional space are determined, based on the coordinates of the three vertices, the center point of each triangular facet can be determined, for example, the center point can be obtained by calculating the average of the coordinates of the three vertices. Based on the three vertices of the triangular facet, any two edges of the triangular facet can be obtained, and the normal vector of the triangular facet can be obtained by calculating the cross product of the two edge vectors.

[0094] In step S302, a sampling point is selected from the center point of each triangular facet, respectively, and an initial clustering result is obtained by clustering according to the normal vector of each sampling point. Based on the initial clustering result, the workpiece model is segmented into a plurality of initial regions, and the normal vector of each initial region is determined.

[0095] The sampling points are selected from the center points of the respective triangular facets, and the number of sampling points can be set according to actual conditions. The workpiece model is divided into a plurality of initial regions according to the normal vectors of the respective sampling points, and the normal vector of each initial region is determined. The workpiece model is divided into a plurality of different initial regions based on the normal vectors of the sampling points, for example, the door is divided into the front, back, side, bottom and other regions, and each region is continuous and has a similar direction after the region division based on the center points and the normal vectors, so as to facilitate the generation of scanning points subsequently. As shown in the initial regions of the workpiece model division in Figure 4 the same color is one region.

[0096] Exemplarily, when the measured workpiece model is a CAD model, the CAD model surface corresponding to each triangular facet center point is inversely solved, and the CAD model surface is clustered and classified.

[0097] In step S303, the initial regions are clustered based on the Euclidean distance algorithm and the normal vector of each initial region to obtain a plurality of final clustering results, and a plurality of scanning regions of the measured workpiece are determined based on the plurality of final clustering results, and each scanning point in each scanning region is determined.

[0098] The Euclidean distance algorithm and the normal vector of each initial region are used to perform a clustering algorithm to cluster and subdivide each initial region, and the center points of the triangular facets in the initial region that differ greatly are classified into different categories according to the Euclidean distance. Exemplarily, for any initial region, the normal vector of the initial region is taken as the initial clustering center, the Euclidean distance between each sampling point in the initial region and the initial clustering center is calculated, and if the Euclidean distance satisfies the threshold value, the sampling point is classified into the initial clustering center, and if it does not satisfy, the initial region is further classified and divided based on the Euclidean distance algorithm, and the center points of the triangular facets of the initial region are clustered into a plurality of final clustering results, and each final clustering result can be determined as a scanning region. As shown in the scanning regions of the workpiece model division in Figure 5 the same color is one region.

[0099] Each scanning point in each scanning region is determined by an algorithm according to each final clustering result. Exemplarily, each scanning point is generated based on the surface, line and point features of the CAD model of the workpiece to be measured. Exemplarily, each scanning point is generated based on the direction bounding box of the CAD model of the workpiece to be measured. The direction bounding box is a geometric body used to describe the boundary of an object, which is defined as the smallest cuboid that contains the geometric object and is arbitrary in direction relative to the coordinate axis.

[0100] In this embodiment, the regions with similar normal vectors and spatial positions are classified into one category by clustering the workpiece model of the measured workpiece, i.e., each scanning region of the measured workpiece is obtained, and then each scanning point can be obtained.

[0101] In one embodiment, the pose information of the scanning point includes a position point, a scanning direction vector, a scanning long edge direction vector, and a scanning wide edge direction vector, and the scanning direction vector is determined based on a cross product operation of the scanning long edge direction vector and the scanning wide edge direction vector. The position point can be the three-dimensional coordinates of the scanning point. The scanner can be similar to a cuboid, the scanning long edge direction vector can be understood as the vector of the long edge direction of the scanner, the scanning wide edge direction vector can be understood as the vector of the wide edge direction of the scanner, the scanning direction vector can be understood as the vector of the high edge direction of the scanner, and the scanning long edge direction vector is crossed with the scanning wide edge direction vector to obtain the scanning direction vector.

[0102] In one embodiment, as shown in Figure 6 the filtering operation performed on each scanning point includes the steps of:

[0103] Step S601, a straight line is formed with the position point of the scanning point and the corresponding scanning direction vector, and it is judged whether the straight line intersects with the scanning region where the scanning point is located;

[0104] Step S602, if the straight line intersects with the scanning region, the scanning point is retained, otherwise, the scanning point is filtered out.

[0105] For each scanning point on the initial scanning path, there can be redundant scanning points, and the positions of these redundant scanning points can be outside the selected scanning region range, and these scanning points need to be filtered out.

[0106] For each scanning point, a straight line is formed with the position point of the scanning point and the corresponding scanning direction vector, and it is judged whether the straight line intersects with the scanning region where the scanning point is located. If the straight line intersects with the scanning region, it indicates that the scanning point is in the scanning region, and the scanning point is retained, otherwise, it indicates that the scanning point is outside the scanning region, and the scanning point is filtered out. Based on this embodiment, the redundant scanning points on the initial scanning path can be filtered out, so as to improve the efficiency and effect of automatic scanning.

[0107] In one embodiment, as shown in Figure 7 the filtering operation performed on each scanning point includes the steps of:

[0108] Step S701, a rectangle is constructed with the position point of the scanning point as the center point and the scanning long edge direction vector and the scanning wide edge direction vector of the scanning point as the edges;

[0109] Step S702, the scanning direction vector of the four corner points of the rectangle is determined according to the scanning direction vector of the scanning point;

[0110] Step S703, respectively, the four corner points and the center point and the corresponding scanning direction vector constitute a corresponding straight line;

[0111] Step S704, if any straight line intersects the scanning region where the scanning point is located, the scanning point is retained, otherwise, the scanning point is filtered out.

[0112] The technical solution of replacing the scanning range of the scanning point with the position point of the scanning point for filtering may cause a substantial reduction in the number of scanning points, thereby reducing the scanning effect. In the embodiment, a rectangle is constructed with the position point of the scanning point as the center point, and the scanning long edge direction vector and the scanning wide edge direction vector of the scanning point as the edges. The rectangle can be approximately the actual scanning range of the scanning point. The scanning direction vectors of the four corner points are parallel to the scanning direction vector of the center point. Respective straight lines are constituted by the four corner points and the center point of the rectangle and the corresponding scanning direction vectors. If any straight line intersects the scanning region where the scanning point is located, the scanning point is retained. The implementation can avoid the situation where a large number of redundant scanning points are filtered out. Not only can the redundant scanning points be filtered out, but the scanning effect can also be ensured.

[0113] In one embodiment, as shown in FIG. 8, the step of performing a hiding operation on each scanning point includes: Figure 8

[0114] Step S801, converting the coordinate system of the workpiece model where the position point of the scanning point is located into the coordinate system of the base of the robot arm, to obtain the converted position coordinates of the scanning point;

[0115] Step S802, judging whether the scanning point is within the motion range of the robot arm based on the current position relationship between the workpiece model and the robot arm, the motion range of the robot arm, and the converted position coordinates of the scanning point;

[0116] Step S803, if the scanning point is not within the motion range of the robot arm, hiding the scanning point in the current initial scanning path.

[0117] Based on the limited motion range of the robot arm, some scanning points on the initial scanning path may be located outside the reachable range of the robot arm, i.e., there are scanning points that are not reachable by the robot arm, which need to be hidden. The position coordinates of each scanning point on the initial scanning path are in the coordinate system of the workpiece model of the measured workpiece. Based on the environmental calibration, the coordinate change relationship between the measured workpiece and the base of the robot arm can be determined. Based on the coordinate change relationship, the coordinate system of the workpiece model where the position point of the scanning point is located is converted into the coordinate system of the base of the robot arm, to obtain the converted position coordinates of the scanning point, i.e., the position coordinates of the scanning point in the coordinate system of the base of the robot arm. ​

[0118] Based on the current position relationship between the workpiece model and the robot arm, the motion range of the robot arm, and the position coordinates of the scanning point after conversion, it is determined whether the scanning point is within the motion range of the robot arm. The motion range of the robot arm can be the reach range of the robot arm. The reach range can be obtained by the pose data of the end of the robot arm, and the joint parameters of each joint of the robot arm can be calculated by inverse kinematics. These joint references represent the physical positions of the joints. Based on the position coordinates of the scanning point after conversion, it is determined whether the scanning point is within the reach range of the robot arm. If the scanning point is not within the reach range of the robot arm, the scanning point is hidden in the current initial scanning path, and the optimization of the scanning point is realized, which can improve the scanning efficiency and scanning effect of the automatic scanning.

[0119] It should be noted that determining whether the scanning point is within the motion range of the robot arm is closely related to the current position of the measured workpiece and the motion range of the robot arm. Whether the scanning point is within the motion range of the robot arm can change with the position of the measured workpiece, resulting in different determination results. For example, assuming that the current position of the measured workpiece is a first position, for a certain scanning point, when the measured workpiece is in the first position, it is determined based on the above determination method that the scanning point is not within the motion range of the robot arm, and the scanning point is hidden in the first current initial scanning path. If the measured workpiece is in a second position, it is determined based on the above determination method that the scanning point is within the motion range of the robot arm, and the scanning point does not need to be hidden in the second current initial scanning path. Therefore, in the embodiment, the processing method for the scanning point not within the motion range of the robot arm is hiding, not filtering out.

[0120] In one embodiment, as shown in Figure 9 The step of performing collision adjustment operation on each scanning point includes:

[0121] Step S901, determining the position of the scanning instrument corresponding to the scanning point based on the position of the scanning point;

[0122] Step S902, determining the volume of the scanning instrument based on the volume parameter of the scanning instrument with the position of the scanning instrument as the center;

[0123] Step S903, determining whether the volume of the scanning instrument intersects with the measured workpiece and the surrounding environment region of the measured workpiece. If there is an intersection, it is determined that the scanning point has a collision, and collision adjustment is performed.

[0124] The scanning point can be understood as the position of the scanner. Considering the size of the scanner itself, there may be a possibility of collision between the scanner and the measured workpiece and the surrounding environment during scanning. These scanning points need to be adjusted to avoid collision during actual scanning. The position of the scanner corresponding to the scanning point is determined based on the position point of the scanning point. The position of the scanner can be extended from the position point of the scanning point along the scanning direction vector of the scanning point by a certain distance. The size of the distance can be set based on the actual situation. Taking the position of the scanner as the center, the volume of the scanner can be determined by approximating it as a sphere or a cuboid according to the volume parameters of the scanner. It is determined whether the volume of the scanner intersects with the measured workpiece and the surrounding environment area of the measured workpiece. If there is an intersection, it is determined that the scanning point has a collision, and collision adjustment is performed. The surrounding environment area of the measured workpiece can be a turntable, a placement rack of the measured workpiece, etc.

[0125] In one embodiment, determining whether the volume of the scanner intersects with the measured workpiece and the surrounding environment area of the measured workpiece, if there is an intersection, determining that the scanning point has a collision, and performing collision adjustment, comprises:

[0126] Obtaining point cloud data of the measured workpiece and the surrounding environment area of the measured workpiece, and constructing a binary tree based on the point cloud data.

[0127] Taking the position point of the scanner as the center and half of the length of the scanner as the target radius, searching the target radius based on the binary tree, if the point cloud data of the measured workpiece and the surrounding environment area of the measured workpiece is searched within the target radius, it is determined that the scanning point has a collision, and collision adjustment is performed. The collision adjustment is as follows: rotating the scanning direction vector or the scanning wide edge direction vector of the scanning point around the scanning long edge direction vector to adjust the scanning direction of the scanner. If the scanning direction of the scanner is adjusted and the scanning point still has a collision, the scanning point is deleted.

[0128] Obtaining point cloud data of the measured workpiece and the surrounding environment area of the measured workpiece, and constructing a binary tree based on the point cloud data. Exemplarily, the binary tree can be a KD tree (K-Dimensional Tree) structure. The KD tree is a spatial binary tree with nodes as point cloud space points. Taking half of the length of the scanner as the target radius, searching the target radius based on the KD tree structure, starting from the root node of the KD tree, and judging whether the point cloud data of the measured workpiece and the surrounding environment area of the measured workpiece is within the target radius according to the position coordinates of each scanning point, layer by layer and node by node. If it is within the target radius, it is determined that the corresponding scanning point has a collision and needs to be adjusted. Rotate the scanning direction vector of the scanning point around the scanning long edge direction vector or the scanning wide edge direction vector to adjust the scanning direction of the scanner and change the position of the scanner. If the scanning direction of the scanner is adjusted and the scanning point still has a collision, the scanning point is deleted.

[0129] The embodiment avoids the collision situation and improves the scanning efficiency and effect of the automatic scanning by judging whether each scanning point on the initial scanning path exists in the collision situation and adjusting the scanning point existing in the collision situation. Figure 10 The result schematic diagram of the scanning point optimization is shown in the technical scheme in the application, wherein the red points are each scanning point on the initial scanning path, and the green points are the final target scanning points after the optimization. Compared with each scanning point on the initial scanning path, a large number of redundant points are filtered out.

[0130] When the scanning area of the selected measured workpiece is large, a plurality of scanning paths are usually generated. Each scanning path is independent of each other, and the scanning mode between the paths is generally horizontal scanning, vertical scanning and zigzag scanning. Figure 11 The schematic diagram of the plurality of scanning paths is shown in the technical scheme in the application. The horizontal scanning can be understood as that all the scanning paths are scanned in the order from left to right or from right to left. The vertical scanning can be understood as that all the scanning paths are scanned in the order from top to bottom or from bottom to top. The zigzag scanning can be understood as that path 1 is scanned in the order from left to right, path 2 is scanned in the order from right to left, and path 3 is scanned in the order from left to right, and so on, which is similar to the zigzag. In order to avoid redundancy, the zigzag scanning mode is selected. Since each scanning point on the initial scanning path is sampled from the curved surface of the workpiece model and processed, the sampling order of the scanning points on each initial scanning path can be determined as horizontal or vertical from the beginning. The initial path scanning order can only be “horizontal scanning” or “vertical scanning”, and the order of the generated optimized scanning path does not necessarily satisfy the zigzag, and the generated optimized scanning path needs to be adjusted to satisfy the zigzag.

[0131] In one embodiment, as shown in the technical scheme in the application, the method further comprises the steps of: Figure 12

[0132] Step S1201, determining a plurality of optimized scanning paths based on each target scanning point on each initial scanning path;

[0133] Step S1202, starting from the first optimized scanning path, setting a path number for each optimized scanning path, and the path numbers are 0, 1, 2, …, N in turn;

[0134] Step S1203, adjusting the plurality of optimized scanning paths so that the scanning mode between each adjusted scanning path adopts the zigzag scanning, wherein the adjustment comprises:

[0135] Step S12031, if the path number of the optimized scanning path is even, generating the adjusted scanning path in the order from the first target scanning point to the last target scanning point on the optimized scanning path;

[0136] ​Step S12032, if the path number is an odd number of optimized scanning path, the adjusted scanning path is generated according to the order from the last target scanning point to the first target scanning point on the optimized scanning path.

[0137] In the embodiment of the present application, further path adjustment is made by optimizing the scanning path, which can save the scanning time of the automatic scanning and further improve the scanning efficiency of the automatic scanning.

[0138] In one embodiment, the scanning path can be further adjusted by reversing, reversing, exchanging, etc., to further improve the scanning efficiency of the automatic scanning. Reversing can mean reversing the scanning path by exchanging the starting point and the ending point of the scanning path. Reversing can mean reversing the scanning long edge direction and the scanning wide edge direction by rotating 180 degrees around the scanning direction. Exchange is to exchange the scanning order of the two scanning paths. The user may prefer to scan in the horizontal or vertical direction (reversing) during actual scanning, or to make the entire scanning process more continuous and smooth (reversing), or to prefer to scan a certain block of scanning area and change the scanning order of the corresponding path (exchange order). The above methods make the scanning more flexible and can customize the scanning scheme according to different scanning requirements.

[0139] In one embodiment, as shown in Figure 13 the method further comprises the steps of:

[0140] Step S1301, if the ratio of the number of target scanning points to the number of scanning points is less than a preset threshold value, a distance matrix between any two target scanning points is calculated;

[0141] Step S1302, taking the first target scanning point as the initial scanning point on the to-be-generated scanning path, and taking the target scanning point with the minimum distance matrix between the first target scanning point and the target scanning point among the remaining target scanning points as the second scanning point on the to-be-generated scanning path;

[0142] Step S1303, in this way, each scanning point on the to-be-generated scanning path is determined in turn, and the corresponding optimized scanning path is generated based on the determined each scanning point.

[0143] In the embodiment, when there are many redundant points on the initial scanning path, there may be only 1-2 points on each scanning path that are finally retained. If the zigzag scanning method is still used, there is still the defect of redundant paths. The scanning path generated based on the above method no longer strictly follows the zigzag scanning method, avoids the above situation, and can flexibly generate the scanning path.

[0144] Exemplarily, the threshold value can be set to 0.4.

[0145] Based on the same inventive concept, the embodiment of the present application also provides an automatic scanning path optimization device for implementing the above-mentioned automatic scanning path optimization method. The implementation scheme of the device for solving the problem is similar to the implementation scheme described in the above-mentioned method, so the specific limitations in the following automatic scanning path optimization device embodiment can be referred to the limitations of the automatic scanning path optimization method in the above, which will not be described here again.

[0146] As shown in Figure 14 the embodiment of the present application provides an automatic scanning path optimization device, which comprises:

[0147] The acquisition module 1401 is configured to acquire each scanning point of an initial scanning path, wherein the initial scanning path is used for scanning a workpiece to be measured by a scanning device, and the scanning device at least comprises a scanner and a mechanical arm;

[0148] The adjustment module 1402 is configured to perform a hiding operation and a collision adjustment operation on each scanning point to obtain each target scanning point, wherein the hiding operation is determined based on the pose information of the scanning point and the motion range of the mechanical arm, and the collision adjustment operation is determined based on the pose information of the scanning point, the size of the scanner and the test region of the workpiece to be measured;

[0149] The path generation module 1403 is configured to determine a corresponding optimized scanning path based on each target scanning point.

[0150] In the embodiment, the points with errors on the initial scanning path are optimized, the scanning points unreachable by the mechanical arm are hidden, the scanning points with collisions are determined and adjusted to avoid collisions, so that the optimization and adjustment of each scanning point on the initial scanning path can be realized, the optimization of the scanning path can be realized, and the scanning efficiency and scanning effect of the automatic scanning are improved to ensure the safety and efficiency of the scanning path in actual scanning.

[0151] Further, the adjustment module 1402 is specifically configured to:

[0152] perform a filtering operation on each scanning point to obtain each first scanning point, wherein the filtering operation is determined based on the pose information of the scanning point and the scanning region where the scanning point is located;

[0153] perform a hiding operation on each first scanning point to obtain a second scanning point, wherein the hiding operation is determined based on the pose information of the first scanning point and the motion range of the mechanical arm;

[0154] perform a collision adjustment operation on each second scanning point to obtain a target scanning point, wherein the collision adjustment operation is determined based on the pose information of the second scanning point, the size of the scanner and the test region of the workpiece to be measured.

[0155] Further, the acquisition module 1401 is specifically configured to:

[0156] Discretize the workpiece model of the workpiece to be measured to obtain vertex coordinates of each triangular facet, and calculate a center point and a normal vector of each triangular facet;

[0157] Select a sampling point from the center point of each triangular facet, cluster the sampling points according to the normal vectors of the sampling points to obtain an initial clustering result, divide the workpiece model into a plurality of initial regions based on the initial clustering result, and determine a normal vector of each initial region;

[0158] Based on the Euclidean distance algorithm and the normal vector of each initial region, cluster each initial region to obtain a plurality of final clustering results, determine a plurality of scanning regions of the workpiece to be measured based on the plurality of final clustering results, and determine each scanning point in each scanning region.

[0159] Further, the pose information of the scanning point includes a position point, a scanning direction vector, a scanning long edge direction vector, and a scanning wide edge direction vector, the scanning direction vector is determined based on a cross product operation of the scanning long edge direction vector and the scanning wide edge direction vector, and the adjusting module 1402 is specifically configured to:

[0160] Determine whether a straight line formed by the position point of the scanning point and the corresponding scanning direction vector intersects the scanning region where the scanning point is located;

[0161] If the straight line intersects the scanning region, the scanning point is retained, otherwise, the scanning point is filtered out.

[0162] Further, the pose information of the scanning point includes a position point, a scanning direction vector, a scanning long edge direction vector, and a scanning wide edge direction vector, the scanning direction vector is determined based on a cross product operation of the scanning long edge direction vector and the scanning wide edge direction vector, and the adjusting module 1402 is specifically configured to:

[0163] Construct a rectangle with the position point of the scanning point as the center point and the scanning long edge direction vector and the scanning wide edge direction vector of the scanning point as the edges;

[0164] Determine the scanning direction vectors of four corner points of the rectangle based on the scanning direction vector of the scanning point;

[0165] Respectively, form corresponding straight lines with the four corner points and the center point and the corresponding scanning direction vectors;

[0166] If any straight line intersects the scanning region where the scanning point is located, the scanning point is retained, otherwise, the scanning point is filtered out.

[0167] Further, the pose information of the scanning point includes a position point, a scanning direction vector, a scanning long side direction vector, and a scanning wide side direction vector, the scanning direction vector is determined based on a cross multiplication operation of the scanning long side direction vector and the scanning wide side direction vector, and the adjusting module 1402 is specifically configured to:

[0168] convert a coordinate system of the workpiece model in which the position point of the scanning point is located into a coordinate system of the base of the robot arm to obtain a converted position coordinate of the scanning point;

[0169] determine whether the scanning point is within the motion range of the robot arm based on a current position relationship between the workpiece model and the robot arm, a motion range of the robot arm, and the converted position coordinate of the scanning point;

[0170] if the scanning point is not within the motion range of the robot arm, hide the scanning point in the current initial scanning path.

[0171] Further, the pose information of the scanning point includes a position point, a scanning direction vector, a scanning long side direction vector, and a scanning wide side direction vector, the scanning direction vector is determined based on a cross multiplication operation of the scanning long side direction vector and the scanning wide side direction vector, and the adjusting module 1402 is specifically configured to:

[0172] determine a position of the scanner corresponding to the scanning point based on the position point of the scanning point;

[0173] determine a volume of the scanner based on a volume parameter of the scanner with the position of the scanner as the center;

[0174] determine whether the volume of the scanner intersects with the measured workpiece and a surrounding environment region of the measured workpiece, and if so, determine that the scanning point has a collision and perform collision adjustment.

[0175] Further, the adjusting module 1402 is specifically configured to:

[0176] obtain point cloud data of the measured workpiece and the surrounding environment region of the measured workpiece, and construct a binary tree based on the point cloud data;

[0177] search for the target radius based on the binary tree with half of the length of the scanner as the target radius, and if the point cloud data of the measured workpiece and the surrounding environment region of the measured workpiece is searched within the range of the target radius, it is determined that the scanning point has a collision and collision adjustment is performed, wherein the collision adjustment is as follows: rotating the scanning direction vector of the scanning point around the scanning long side direction vector or the scanning wide side direction vector to adjust the scanning direction of the scanner, and if the scanning direction of the scanner is adjusted and the scanning point still has a collision, the scanning point is deleted.

[0178] Further, the path generation module 1403 is specifically configured to:

[0179] determine a plurality of optimized scanning paths corresponding to the plurality of target scanning points on the plurality of initial scanning paths respectively;

[0180] start from the first optimized scanning path, set a path number for each optimized scanning path, and the path numbers are 0, 1, 2, …, N in sequence;

[0181] adjust the plurality of optimized scanning paths so that the scanning modes between the adjusted scanning paths are Z-shaped scanning, wherein the adjusting comprises:

[0182] if the path number of the optimized scanning path is even, generate the adjusted scanning path according to the order from the first target scanning point to the last target scanning point on the optimized scanning path;

[0183] if the path number of the optimized scanning path is odd, generate the adjusted scanning path according to the order from the last target scanning point to the first target scanning point on the optimized scanning path.

[0184] Further, the path generation module 1403 is specifically configured to:

[0185] if the ratio of the number of target scanning points to the number of scanning points is less than a preset threshold, calculate the distance matrix between any two target scanning points;

[0186] take the first target scanning point as the initial scanning point on the to-be-generated scanning path, and in all the remaining target scanning points, take the target scanning point with the minimum distance matrix between the target scanning points as the second scanning point on the to-be-generated scanning path;

[0187] by analogy, sequentially determine each scanning point on the to-be-generated scanning path, and generate the corresponding optimized scanning path based on the determined each scanning point.

[0188] The embodiment of the application also provides a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement any one of the above-mentioned automatic scanning path optimization methods.

[0189] Figure 15 is a hardware structure schematic diagram of a computer device provided by the embodiment of the application. Figure 15 The computer device shown comprises a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, and the processor 1501, the communication interface 1502 and the memory 1503 complete mutual communication through the communication bus 1504. Among them, Figure 15The connection mode between the processor 1501, the communication interface 1502 and the memory 1503 shown is only exemplary, and in the implementation process, the processor 1501, the communication interface 1502 and the memory 1503 can also be connected in communication with each other in other connection modes other than the communication bus 1504.

[0190] The memory 1503 can be used to store a computer program, which can include instructions and data, to implement the steps of any of the above automatic scanning path optimization methods. In the embodiments of the present application, the memory 1503 can be various types of storage media, such as random access memory (RAM), read only memory (ROM), non-volatile RAM (NVRAM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), flash memory, optical storage, and registers, etc. The memory 1503 can include a hard disk and / or an internal memory.

[0191] The processor 1501 can be a general-purpose processor, which can be a processor that reads and executes a computer program (such as a computer program) stored in a memory (such as the memory 1503) to perform specific steps and / or operations, and the general-purpose processor can use data stored in the memory (such as the memory 1503) in the process of executing the steps and / or operations. The general-purpose processor can be, for example but not limited to, a central processing unit (CPU). In addition, the processor 1501 can also be a special-purpose processor, which can be a processor specially designed to perform specific steps and / or operations. The special-purpose processor can be, for example but not limited to, ASIC and FPGA, etc. In addition, the processor 1501 can also be a combination of multiple processors, such as a multi-core processor.

[0192] The communication interface 1502 can include input / output (I / O) interfaces, physical interfaces and logical interfaces for realizing the interconnection of devices within the network device, as well as interfaces for realizing the interconnection of the network device with other devices (such as network devices). The communication network can be Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc. The communication interface 1502 can be a module, a circuit, a transceiver or any device capable of communication.

[0193] In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware in the processor 1501 or the instructions in the form of software. The method disclosed in combination with the embodiments of the present application can be directly embodied as hardware processor execution completion, or executed by a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the art such as random access memory flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, register, etc. The storage medium is located in the memory 1503, and the processor 1501 reads the information in the memory 1503, and combines the hardware to complete the steps of the above method. To avoid repetition, it will not be described in detail here.

[0194] Although the preferred embodiments of the present application have been disclosed for illustrative purposes, those of ordinary skill in the art will realize that various modifications, additions and substitutions are possible without departing from the scope and spirit of the present application disclosed by the appended claims.

Claims

1. A method for optimizing an automated scanning path, characterized in that, The method includes: Obtain each scanning point of the initial scanning path, wherein the initial scanning path is used by the scanning device to scan the workpiece under test, and the scanning device includes at least a scanner and a robotic arm; A filtering operation is performed on each of the scan points to obtain each first scan point, wherein the filtering operation is determined based on the pose information of the scan point and the scan area where the scan point is located; A hiding operation is performed on each of the first scanning points to obtain a second scanning point, wherein the hiding operation is determined based on the pose information of the first scanning point and the range of motion of the robotic arm; Collision adjustment operations are performed on each of the second scanning points to obtain the target scanning point, wherein the collision adjustment operation is determined based on the pose information of the second scanning point, the size of the scanner, and the test area of ​​the workpiece being tested; Based on each target scanning point, a corresponding optimized scanning path is determined; The pose information of the scan points includes the position point, the scan direction vector, the long side scan direction vector, and the wide side scan direction vector. The scan direction vector is determined based on the cross product of the long side scan direction vector and the wide side scan direction vector. The filtering operation performed on each scan point includes: A rectangle is constructed with the location of the scan point as the center point and the long and wide side direction vectors of the scan point as the sides. The scanning direction vectors of the four corner points of the rectangle are determined using the scanning direction vector of the scanning point; Each of the four corner points and the center point is connected to its corresponding scanning direction vector to form a straight line. If any straight line intersects the scanning area where the scan point is located, the scan point is retained; otherwise, the scan point is filtered out.

2. The method for optimizing the automated scanning path according to claim 1, characterized in that, The process of obtaining each scan point of the initial scan path includes: The workpiece model of the workpiece to be measured is discretized into a mesh to obtain the vertex coordinates of each triangular facet, and the center point and normal vector of each triangular facet are calculated. Sampling points are selected from the center point of each triangular facet, and clustering is performed based on the normal vector of each sampling point to obtain an initial clustering result. Based on the initial clustering result, the workpiece model is divided into multiple initial regions, and the normal vector of each initial region is determined. Based on the Euclidean distance algorithm and the normal vector of each initial region, clustering is performed on each initial region to obtain multiple final clustering results. Based on the multiple final clustering results, multiple scanning regions of the workpiece under test are determined, and each scanning point within each scanning region is determined.

3. The method for optimizing the automated scanning path according to claim 1, characterized in that, The pose information of the scan point includes the position point, the scan direction vector, the scan long side direction vector, and the scan wide side direction vector. The scan direction vector is determined based on the cross product operation of the scan long side direction vector and the scan wide side direction vector. The step of performing a hiding operation on each of the scan points includes: The coordinate system of the workpiece model where the scanning point is located is converted into the coordinate system of the robot arm base to obtain the converted position coordinates of the scanning point; Based on the current positional relationship between the workpiece model and the robotic arm, the range of motion of the robotic arm, and the converted position coordinates of the scanning point, it is determined whether the scanning point is within the range of motion of the robotic arm. If the scan point is not within the range of motion of the robotic arm, then the scan point is hidden in the current initial scan path.

4. The method for optimizing the automated scanning path according to claim 1, characterized in that, The pose information of the scan points includes a position point, a scan direction vector, a long scan direction vector, and a wide scan direction vector. The scan direction vector is determined based on the cross product of the long scan direction vector and the wide scan direction vector. The collision adjustment operation performed on each of the scan points includes: The location of the scanner corresponding to the scan point is determined based on the location of the scan point; The volume of the scanner is determined based on its volume parameters, with the scanner's location as the center. Determine whether the volume of the scanner intersects with the workpiece being measured and the surrounding environment. If they intersect, it is determined that there is a collision at the scanning point, and collision adjustment is performed.

5. The method for optimizing the automated scanning path according to claim 4, characterized in that, The step of determining whether the volume of the scanner intersects with the workpiece being measured and its surrounding environment, and if so, determining that a collision exists at the scanning point and performing collision adjustment, includes: Obtain point cloud data of the workpiece under test and the surrounding environment area of ​​the workpiece under test, and construct a binary tree using the point cloud data; Using half the length of the scanner as the target radius, a search for the target radius is performed based on the binary tree. If point cloud data of the workpiece and its surrounding environment are found within the target radius, it is determined that the scan point has a collision, and collision adjustment is performed. The collision adjustment is as follows: the scanning direction vector of the scan point is rotated around the long side direction vector or the wide side direction vector to adjust the scanning direction of the scanner. If the scan point still has a collision after adjusting the scanning direction of the scanner, the scan point is deleted.

6. The method for optimizing the automated scanning path according to claim 1, characterized in that, The method further includes: Based on each target scan point on each initial scan path, determine multiple corresponding optimized scan paths; Starting with the first optimized scan path, assign a path number to each optimized scan path, with the path numbers being 0, 1, 2, ..., N; Multiple optimized scan paths are adjusted to employ a zigzag scanning pattern between the adjusted scan paths. The adjustments include: If the optimized scan path has an even path number, the adjusted scan path is generated according to the order from the first target scan point to the last target scan point on the optimized scan path. If the optimized scan path has an odd number, the adjusted scan path is generated according to the order from the last target scan point to the first target scan point on the optimized scan path.

7. The method for optimizing the automated scanning path according to claim 1, characterized in that, The method includes: If the ratio of the number of target scan points to the number of scan points is less than a preset threshold, calculate the distance matrix between any two target scan points; The first target scan point is taken as the initial scan point on the scan path to be generated. Among all the remaining target scan points, the target scan point with the smallest distance matrix between it and the target scan point is determined as the second scan point on the scan path to be generated. By analogy, each scan point on the scan path to be generated is determined in turn, and the corresponding optimized scan path is generated based on each determined scan point.

8. An automated scanning path optimization device, characterized in that, The device: An acquisition module is used to acquire each scanning point of an initial scanning path, wherein the initial scanning path is used by the scanning device to scan the workpiece under test, and the scanning device includes at least a scanner and a robotic arm; An adjustment module is used to perform a filtering operation on each of the scanning points to obtain each first scanning point, wherein the filtering operation is determined based on the pose information of the scanning point and the scanning area where the scanning point is located; to perform a hiding operation on each of the first scanning points to obtain a second scanning point, wherein the hiding operation is determined based on the pose information of the first scanning point and the movement range of the robotic arm; and to perform a collision adjustment operation on each of the second scanning points to obtain a target scanning point, wherein the collision adjustment operation is determined based on the pose information of the second scanning point, the size of the scanner, and the test area of ​​the workpiece being tested. The path generation module is used to determine the corresponding optimized scanning path based on each target scanning point; Specifically, the adjustment module is used for: The pose information of the scanning point includes the position point, the scanning direction vector, the scanning long side direction vector, and the scanning wide side direction vector. The scanning direction vector is determined based on the cross product operation of the scanning long side direction vector and the scanning wide side direction vector. A rectangle is constructed with the location of the scan point as the center point and the long and wide side direction vectors of the scan point as the sides. The scanning direction vectors of the four corner points of the rectangle are determined using the scanning direction vector of the scanning point; Each of the four corner points and the center point is connected to its corresponding scanning direction vector to form a straight line. If any straight line intersects the scanning area where the scan point is located, the scan point is retained; otherwise, the scan point is filtered out.

9. A computer device, comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the steps of the automated scan path optimization method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the automated scanning path optimization method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Multi-resolution self-adapting marking method in 3DGIS

    CN101477562A

  • Scanning path adjusting method and device, automatic scanning system and computer equipment

    CN114739405A