Conservative collision detection method for industrial robot path planning
By using the Morton code binary search algorithm and particle swarm algorithm optimized symbol distance field SDF and envelope sphere in industrial robot path planning, the problems of long path planning time and large storage overhead in the existing technology are solved, and efficient Collision detection and accurate path planning.
Patent Information
- Application Number
- CN202210276364.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2042-03-21
Smart Images

Figure CN114742944B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of industrial robot collision detection, and in particular relates to a conservative collision detection method for industrial robot path planning. Background Art
[0002] Industrial robot simulation can simulate every work and process in real operations and realize various interactions with them. It can study, simulate and evaluate many aspects such as design ideas, product potential performance, use efficiency and adaptability before industrial products are materialized. At present, it has been widely used in various fields of industry, from product design and development, product training and research to product sales and promotion. The application of simulation technology can effectively improve the development efficiency of enterprises, strengthen data collection, analysis and processing capabilities, reduce decision-making errors and reduce enterprise risks.
[0003] In order to avoid safety problems caused by collisions between robots and surrounding equipment during actual production operations, a collision detection function must be added to offline simulation to respond and provide feedback in real time to collision interference that occurs during the simulation process. Collision detection is indispensable in multiple stages such as production line layout, industrial robot path planning, and IO event simulation. It is an indispensable technical module in offline simulation. Accurate collision detection requires intersection calculation of all model patches in the scene, and the detection cost is high. In the robot path planning task, a large number of collision detections are required because all reachable path points need to be searched in the entire three-dimensional workspace. The use of accurate collision detection algorithms will greatly reduce the efficiency of path planning. In addition, the safety distance between the planned path obtained by the accurate collision detection algorithm and the surface of the production line model is short, resulting in insufficient reliability of the path, which is easy to cause false collisions in actual production operations.
[0004] Some SDF-based detection algorithms can be used for low-precision collision detection tasks, but the calculation speed of SDF on CPU is very slow, and the construction scheme on GPU is often more complicated, often sacrificing accuracy to improve construction efficiency. In addition, the detection accuracy of SDF-based collision detection algorithms is limited by the resolution of SDF. Increasing the resolution of SDF will significantly increase storage overhead while improving detection accuracy. Summary of the invention
[0005] The purpose of the present invention is to provide a conservative collision detection algorithm for industrial robot path planning, so as to solve the technical problems that the use of precise collision detection algorithms in existing path planning leads to too long planning time, and the general SDF-based approximate collision detection algorithm is difficult to meet the needs of large-scale scene planning tasks due to low SDF construction efficiency and high storage overhead.
[0006] In order to solve the above technical problems, the specific technical solution of the conservative collision detection method for industrial robot path planning of the present invention is as follows:
[0007] A conservative collision detection method for industrial robot path planning, characterized by comprising the following steps:
[0008] Step 1: Use a binary search algorithm based on Morton code to construct a linear hierarchical bounding volume for the surrounding devices. By calculating the Morton codes of all faces and sorting all faces, a binary search method is used to create a linear hierarchical bounding volume LBVH structure of the model to accelerate SDF calculation;
[0009] Step 2: Then, the peripheral device model is accelerated by GPU to build the signed distance field SDF in parallel.
[0010] The results are stored using a sparse grid structure;
[0011] The step 2 includes constructing a uniform grid within the model AABB boundary at a resolution of 1 / 64 of the model size for the peripheral device, offsetting all triangles on the model outward in the plane by a distance r, where r is the maximum radius of the envelope sphere, and then stretching by a distance r in two directions perpendicular to the triangles to construct a convex polyhedron; calculating in parallel the range covered by the convex polyhedron in the grid; subdividing all grid cells covered by the model triangular facets to generate a high-resolution grid, wherein each grid cell initiates a thread to calculate the shortest distance from the grid cell to the model surface; for the subdivided grid cells, starting from the center of the grid cell, emitting two rays in the x and y directions respectively, passing through the mesh cells and the model
[0012] The number of intersections of the model surface is used to determine whether the grid unit is located inside the model;
[0013] Step 3: Propose an envelope sphere generation algorithm based on particle swarm, collect points on the robot surface by uniform sampling; use particle swarm algorithm to optimize and generate the minimum envelope sphere set containing all sampling points;
[0014] Step 4: Implement conservative collision detection using SDF and envelope sphere.
[0015] Furthermore, the step 1 includes the following specific steps:
[0016] Establish LBVH tree structure: The input model contains n triangular patches. First, calculate the axis-aligned bounding box AABB of all patches as a whole. Use AABB as the boundary, convert the center coordinates of the patches to the range of 0 to 1, generate Morton code and perform cardinality sorting on all patches; create a leaf node for each primitive; each leaf node initiates a thread
[0017] Parallel computing, establishing tree connections through binary search;
[0018] AABB is used as the bounding box type of the LBVH tree node. The bounding box of the internal node of LBVH is constructed using a bottom-up strategy: starting from all leaf nodes, each triangle is assigned a thread to calculate the AABB of the triangle, and then all threads traverse the parent node upward, and the second thread to reach the parent node is retained to calculate the AABB of the parent node. The calculation method is to merge the AABBs of the two child nodes. The first thread to reach the parent node exits early, so that the number of threads is halved after each upward traversal. This traversal is continued until the bounding box construction of the entire LBVH is completed.
[0019] Furthermore, the step 2 SDF construction algorithm includes a first stage, in which the SDF space is divided into a uniform grid with a lower resolution. Each small cubic area in the grid is called a cell, and the size of the cell is calculated by the following formula:
[0020]
[0021] Where l, w, and h are the length, width, and height of the SDF boundary. The dimensions of the grid in three directions are calculated:
[0022]
[0023] The grid is stored in a one-dimensional array. Two blocks of memory with a size of gridsize = l'×w'×h' and an integer data type are allocated on the video memory: idBuffer is used to store the one-dimensional number of the cell in the grid; overlapBuffer stores whether the cell is covered. Each triangle initiates a thread, offsets the triangle outward by a distance r in the triangle plane, and then stretches it by a distance r in two directions perpendicular to the triangle to construct a convex polyhedron; the separating axis theorem is used to calculate all the cells covered by the convex polyhedron, and the values in the overlapBuffer corresponding to these cells are set to 1, and the uncovered cells are marked as 0; then the prefix sum of the overlapBuffer is calculated in parallel, and the covered cell numbers in the idBuffer are arranged at the front of the array according to the prefix sum, and the total number of covered cells is counted as overlapNum.
[0024] Furthermore, the step 2 SDF construction algorithm includes a second stage, in which the cells covered in the first stage need to be subdivided. The cubic area after the cell subdivision is called a subcell, and its size calculation formula is:
[0025]
[0026] A thread is initiated for each subcell to calculate the shortest distance from the center of the subcell cube to the model surface. The process uses the LBVH tree structure to accelerate the search. The specific process is as follows: the center of the subcell cube is used as the center of the sphere, and a sphere with an initial radius of R is constructed. The intersection test between the sphere and the LBVH tree is performed from top to bottom. If it intersects with the internal nodes, the child nodes are searched downward. When a leaf node is reached, it is determined whether the sphere and the triangle intersect. If so, the shortest distance from the center of the sphere to the triangle is calculated, and the minimum value of the shortest distances among all leaf nodes is taken as the shortest distance from the subcell to the model surface. If the sphere intersects with at least one triangle, the calculation is completed. Otherwise, the radius of the sphere is doubled and the intersection test with the LBVH is continued, and the above process is repeated.
[0027] When the shortest distance from the subcell center to the model surface is not zero, it is also necessary to determine the sign of the distance value. The ray method is used, that is, the subcell center is used as the starting point of the ray, and the ray is emitted in any direction. The number of intersections between the ray and the object surface is calculated. If the intersection is an odd number of times, the distance value is negative, otherwise it is positive. Two ray intersection tests are performed in the x and y directions. The distance value is considered to be negative only when the number of intersections in both directions is an odd number, otherwise it is positive. The calculation results are finally transmitted back from the GPU to the CPU and a sparse grid is used to store the values of all subcells. The sparse grid data structure uses VDB.
[0028] Furthermore, the step 3 includes obtaining a point set S on the surface of the robot model by uniform sampling, creating a particle swarm optimization algorithm model with the standard of eight envelope balls for each model, determining the optimization interval of the independent variable of the particle swarm algorithm by calculating the oriented bounding box (OBB) of the model, judging whether the envelope ball can completely contain all the sampling points in a GPU-accelerated manner, and adding the number of uncontained points as a penalty function to the optimization model, and finally running the particle swarm algorithm to obtain the optimized envelope ball, and deleting the invalid envelope ball.
[0029] Furthermore, the step 3 includes the following specific steps:
[0030] First, we need to determine the independent variables of the algorithm optimization. It is stipulated that the number of envelope balls for each joint shall not exceed 8. The set of all envelope balls is recorded as E. Each envelope ball contains four parameters (x, y, z, r) of the center coordinates and the radius of the ball, totaling 32 optimization parameters. The algorithm optimization goal is to minimize the sum of the volumes of all envelope balls. The sum of the cube of the radii of all envelope balls is used as the optimization objective function. Through the sampling method, a large number of points are sampled on the model surface with uniform density and recorded as set S. GPU parallel computing is used to determine whether the sampling point set S is completely included in the set E. Let the number of points in S outside E be k. Add this variable as a penalty term to the optimization function to obtain the final optimization function as follows:
[0031]
[0032] Where λ represents the penalty coefficient, which is defined by the user;
[0033] The range of the independent variable in the optimization function is determined by the following method: First, the OBB of the joint model is calculated, and the OBB is evenly divided into 8 sub-cubes along the three axes. The vector from the center of the OBB to the center of each sub-cube is denoted as d i , the modulus lengths of these vectors are equal, and their lengths are taken as the maximum value of the envelope sphere radius parameter R max , the parameters of each envelope ball (x i ,y i ,z i ,r i ) is calculated by the following formula:
[0034]
[0035] Where O i represents the center coordinate of OBB, u i ,v i ,w i Represents the parameters corresponding to the three components of the spherical center coordinates. In this way, the 32 parameters of the optimization function are determined as {u i ,v i ,w i ,r i},0≤i<8;
[0036] The method of obtaining sampling points from the robot joint model is uniform sampling. The sampling interval is set to w, and the sampling output point set is S. The sampling process is: first, all vertices on the model are added to S; then all triangles {v0, v1, v2} are traversed.
[0037] The sampling is done in a row-by-row scanning mode. The first scanning direction is d0=v1-v0, and the second scanning direction is d1=d0. ⊥ , d0 ⊥It means to rotate the vector d0 90 degrees counterclockwise in the triangle plane. Let the scan line be l and the initial state be l
[0038] Set it to the line where v0v1 is located, the algorithm starts, and the intersection points of l with the edges v0v2 and v1v2 are calculated and recorded as v beg and v end , on line segment v beg v end From point v beg Start by sampling points evenly with a spacing of w, add all sampling points to S; then extend l by d1
[0039] The direction is translated by a distance w, and the above process is repeated until l has no intersection with the edges v0v2 and v1v2 or the two intersections overlap;
[0040] The process of judging whether the point set S is included in the set E through GPU parallel computing is as follows: set the thread load parameter m, select parameter m=4, expand the point set S to a multiple of m, assign every m points to a thread to initiate the calculation, set the number of threads in a thread group to 1024, traverse m points in a single thread and count the number of points not included in the set E as n, use the shared memory on the GPU to perform parallel reduction within the thread group, calculate the number of points n' not included in the set E in a thread group, and finally the first thread in each thread group performs an atomic summation operation
[0041] Get the number of points k in all point sets that are not included in E;
[0042] After the envelope sphere is obtained based on particle swarm optimization, the sphere with zero radius is deleted, and finally the robot joint envelope sphere is obtained.
[0043] Furthermore, the step 4 includes the following specific steps:
[0044] SDF moves with the object when the object moves. Before the collision test, the envelope sphere is transformed into the coordinate system where the SDF is located. According to the relative position of the center of the envelope sphere and the boundary of the SDF, it is divided into three cases: when the center of the envelope sphere is outside the boundary of the SDF, there will be no collision; when the center of the envelope sphere is inside the boundary of the SDF, but the SDF value at the center does not exist, it means that the closest distance from the position to the model surface is greater than the maximum envelope sphere radius of the robot, so no collision occurs; when the center of the envelope sphere is inside the boundary of the SDF, and the absolute value of the SDF value at the center is less than or equal to the envelope sphere radius, it is considered that a collision occurs, otherwise it is considered that no collision occurs.
[0045] The conservative collision detection method for industrial robot path planning of the present invention has the following advantages: the present invention proposes a two-layer SDF parallel construction algorithm, by marking and subdividing the voxel grid of the model surface area, only calculating the distance field function value in the area, reducing the number of voxels that need to be calculated, thereby improving the calculation efficiency, and using sparse grids for storage to reduce memory overhead; by establishing an LBVH tree structure, all threads can independently access the LBVH and calculate the shortest distance, thereby improving the parallelism of the calculation; using a particle swarm optimization algorithm to calculate a tight envelope sphere instead of a robot joint to perform collision detection, a single detection only needs to query the distance field eight times at most, thereby improving the efficiency of collision detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 is an overall flow chart of the method of the present invention;
[0047] Figure 2 It is a schematic diagram of LBVH parallel construction of the present invention;
[0048] Figure 3 It is a schematic diagram of the SDF creation process of the present invention;
[0049] Figure 4 It is a schematic diagram of the envelope sphere optimization parameter range of the present invention;
[0050] Figure 5 It is a schematic diagram of the envelope sphere generation process of the present invention;
[0051] Figure 6 It is a schematic diagram of collision detection between SDF and envelope sphere of the present invention. DETAILED DESCRIPTION
[0052] In order to better understand the purpose, structure and function of the present invention, a conservative collision detection method for industrial robot path planning of the present invention is further described in detail below with reference to the accompanying drawings.
[0053] The present invention uses signed distance field (SDF) and envelope sphere to implement a conservative collision detection scheme. SDF is pre-calculated for objects such as peripheral devices and stored through sparse grids. A small number of envelope spheres are used to replace joint models for robots to participate in collision detection. During operation, the collision detection between the robot and peripheral devices can be converted into an intersection test of the envelope sphere and the signed distance field. The accuracy of the algorithm is determined by the resolution of the distance field and the radius of the envelope sphere.
[0054] like Figure 1 As shown, the conservative collision detection method for industrial robot path planning of the present invention comprises the following steps:
[0055] A linear hierarchical bounding volume is constructed using a binary search algorithm based on Morton codes. The purpose of constructing LBVH is to accelerate the parallel calculation of subsequent SDF. The LBVH tree structure is established as follows: the input model contains n triangular facets. First, the AABB of all facets is calculated. Using AABB as the boundary, the coordinates of the facet center are converted to the range of 0 to 1, and the Morton code is generated and all facets are sorted in radix. Each primitive creates a leaf node. Each leaf node initiates a thread parallel calculation, and the connection relationship of the tree is established through binary search. The calculation process is as follows: Figure 2 shown.
[0056] AABB is used as the bounding box type of the LBVH tree node. The bounding box of the internal node of LBVH is constructed using a bottom-up strategy: starting from all leaf nodes, each triangle is assigned a thread to calculate the AABB of the triangle, and then all threads traverse the parent node upward, and the second thread to reach the parent node is retained to calculate the AABB of the parent node. The calculation method is to merge the AABBs of the two child nodes. The first thread to reach the parent node exits early, so that the number of threads is halved after each upward traversal. This traversal is continued until the bounding box construction of the entire LBVH is completed.
[0057] A GPU-accelerated SDF construction algorithm is proposed. The SDF calculation is divided into two stages. In the first stage, the SDF space is divided into a uniform grid with a resolution of 1 / 64-1 / 100 of the model size. Each small cubic area in the grid is called a cell, and the size of the cell is calculated by the following formula:
[0058]
[0059] Where l, w, and h are the length, width, and height of the SDF boundary, and r is the maximum radius of the envelope sphere. The dimensions of the grid in three directions are calculated:
[0060]
[0061] The grid is stored in a one-dimensional array, and two blocks of memory with a size of gridsize = l'×w'×h' and an integer data type are allocated on the video memory: idBuffer is used to store the one-dimensional number of the cell in the grid; overlapBuffer stores whether the cell is covered. Each triangle initiates a thread, offsets the triangle outward by a distance r in the triangle plane, and then stretches it by a distance r in two directions perpendicular to the triangle to construct a convex polyhedron. The separating axis theorem is used to calculate all the cells covered by the convex polyhedron, and the values in the overlapBuffer corresponding to these cells are set to 1, and those that are not covered are marked as 0. Next, the prefix sum of the overlapBuffer is calculated in parallel, and the numbers of the covered cells in the idBuffer are arranged at the front of the array according to the prefix sum, and the total number of covered cells is counted as overlapNum.
[0062] In the second stage, the cells covered in the previous stage need to be subdivided. The cubic area after the cell subdivision is called a subcell, and its size calculation formula is:
[0063]
[0064] Initiate a thread for each subcell to calculate the shortest distance from the center of the subcell cube to the model surface. This process requires the use of the LBVH tree structure to accelerate the search. The specific process is: take the center of the subcell cube as the center of the sphere, construct a sphere with an initial radius of R, and perform an intersection test between the sphere and the LBVH tree from top to bottom. If it intersects with the internal nodes, search for child nodes downward. When reaching a leaf node, determine whether the sphere and the triangle intersect. If so, calculate the shortest distance from the center of the sphere to the triangle patch, and take the minimum value of the shortest distances among all leaf nodes as the shortest distance from the subcell to the model surface. If the sphere intersects with at least one triangle, the calculation is complete. Otherwise, double the radius of the sphere and continue to perform the intersection test with the LBVH, and repeat the above process.
[0065] When the shortest distance from the subcell center to the model surface is not zero, the sign of the distance value must be determined. The ray method can be used, that is, the subcell center is used as the starting point of the ray, and the ray is emitted in any direction to calculate the number of intersections between the ray and the object surface. If the intersection is an odd number of times, the sign of the distance value is negative, otherwise it is positive. Due to the rounding error of floating-point operations, the calculation result is not reliable in some cases when the ray method is used in only one direction. Therefore, two ray intersection tests are performed in the x and y directions. The sign of the distance value is negative only when the number of intersections in both directions is an odd number, otherwise it is positive. The calculation results are finally transmitted back from the GPU to the CPU and a sparse grid is used to store the values of all subcells. The sparse grid data structure uses VDB. The SDF calculation process is as follows Figure 3 shown.
[0066] An envelope sphere generation algorithm based on particle swarm is proposed. Envelope spheres refer to a number of spheres generated on the surface of the robot joint model. These spheres can completely contain all the primitives on the model. Therefore, these envelope spheres and SDF can be used for fast intersection judgment, thus avoiding complex intersection detection of all the primitives on the model. The principle of generating envelope spheres is to use the least number of spheres to completely envelop all the primitives on the model. This problem can be solved using the particle swarm optimization algorithm.
[0067] First, it is necessary to determine the independent variables of the algorithm optimization. It is stipulated that the number of envelope balls for each joint shall not exceed 8. The set of all envelope balls is recorded as E. Each envelope ball contains four parameters (x, y, z, r) of the center coordinates and the radius of the ball, totaling 32 optimization parameters. The algorithm optimization goal is to minimize the sum of the volumes of all envelope balls. The sum of the cubes of the radii of all envelope balls can be used as the optimization objective function. In addition, during the optimization process, it is necessary to ensure that the set E can always completely contain the joint model. Since the input robot joint is a triangular mesh model, the accurate inclusion test requires Boolean operations on the balls between the triangles and the envelope balls, and such computational overhead is unacceptable. Therefore, a large number of points can be sampled on the model surface with uniform density by sampling, recorded as set S, and GPU parallel computing is used to determine whether the sampling point set S is completely contained in the set E. Let the number of points in S that are outside E be k, and add this variable as a penalty term to the optimization function to obtain the final optimization function as follows:
[0068]
[0069] Where λ represents the penalty coefficient, which is defined by the user. The range of the independent variable in the optimization function can be determined by the following method: First, the OBB of the joint model is calculated, and the OBB is evenly divided into 8 sub-cubes along the three axes. The vector from the center of the OBB to the center of each sub-cube is denoted as d i , the modulus lengths of these vectors are equal, and their lengths are taken as the maximum value of the envelope sphere radius parameter Rmax The parameters of each envelope ball (x i ,y i ,z i ,r i ) can be calculated by the following formula:
[0070]
[0071] Where O i represents the center coordinate of OBB, u i ,v i ,w i Represents the parameters corresponding to the three components of the spherical center coordinates. In this way, the 32 parameters of the optimization function are determined as {u i ,v i ,w i ,r i},0≤i<8, Figure 4 It is a plane diagram of the envelope sphere parameter range.
[0072] The method of obtaining sampling points from the robot joint model is uniform sampling, setting the sampling interval to w, and the sampling output point set to S. The sampling process is described as follows: first, all vertices on the model are added to S; then all triangles {v0, v1, v2} are traversed, and sampling is performed in a row-by-row scanning manner. The first scanning direction is d0 = v1-v0, and the second direction is d1 = d0 ⊥ , d0 ⊥ It means rotating the vector d0 by 90 degrees counterclockwise in the triangle plane. Let the scan line be l, and the initial state l is set to the line where v0v1 is located. At the beginning of the algorithm, the intersection points of l with the edges v0v2 and v1v2 are calculated and recorded as v beg and v end , on line segment v beg v end From point v beg Start sampling points evenly with a spacing of w, and add all the sampled points to S. Then translate l along the direction d1 by a distance w, and repeat the above process until l has no intersection with the edges v0v2 and v1v2 or the two intersections overlap.
[0073] The process of judging whether the point set S is included in the set E through GPU parallel computing is as follows: set the thread load parameter m, the parameter m=4 selected in this paper, expand the point set S to a multiple of m, assign each m points to a thread to initiate the calculation, and set the number of threads in a thread group to 1024. In a single thread, traverse m points and count the number of points not included in the set E as n, use the shared memory on the GPU to perform parallel reduction within the thread group, calculate the number of points n' not included in the set E in a thread group, and finally the first thread in each thread group obtains the number of points k not included in E in all point sets through atomic summation.
[0074] After the envelope sphere is obtained based on the particle swarm algorithm optimization, the sphere with zero radius is deleted, and finally the robot joint envelope sphere construction effect is obtained as follows Figure 5 shown.
[0075] Conservative collision detection is implemented using SDF and envelope sphere. The collision detection between SDF and envelope sphere is relatively simple. SDF moves with the object when the object moves. Before the collision test, the envelope sphere is transformed to the coordinate system where the SDF is located. According to the relative position of the center of the envelope sphere and the boundary of the SDF, it is divided into three cases: Figure 6 It can be seen that when the center of the envelope sphere is outside the SDF boundary, no collision will occur; when the center of the envelope sphere is within the SDF boundary, but the SDF value at the center does not exist, it means that the closest distance from the model surface is greater than the maximum envelope sphere radius of the robot, so no collision occurs; when the center of the envelope sphere is within the SDF boundary, and the absolute value of the SDF value at the center is less than or equal to the envelope sphere radius, a collision is considered to have occurred, otherwise it is considered to have not collided.
[0076] It is to be understood that the present invention is described by some embodiments, and it is known to those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the scope of protection of the present invention.
Claims
1. A conservative collision detection method for industrial robot path planning, characterized in that: The steps include: Step 1: Use a binary search algorithm based on Morton code to construct a linear hierarchical bounding volume for the surrounding devices. By calculating the Morton codes of all faces and sorting all faces, a binary search method is used to create a linear hierarchical bounding volume LBVH structure of the model to accelerate SDF calculation; Step 2: Then, the peripheral device model is constructed in parallel by GPU acceleration. The calculation results are stored in a sparse grid structure. The step 2 includes constructing a uniform grid within the model AABB boundary at a resolution of 1 / 64 of the model size for the peripheral device, offsetting all triangles on the model outward in the plane by a distance r, where r is the maximum radius of the envelope sphere, and then stretching the distance r in two directions perpendicular to the triangles to construct a convex polyhedron; calculating the range covered by the convex polyhedron in the grid in parallel; subdividing all grid cells covered by the model triangular facets to generate a high-resolution grid, wherein each grid cell initiates a thread to calculate the shortest distance from the grid cell to the model surface; for the subdivided grid cells, starting from the center of the grid cell, emitting two rays in the x and y directions respectively, and judging whether the grid cell is located inside the model by the number of intersections with the model surface; Step 3: Propose an envelope sphere generation algorithm based on particle swarm, collect points on the robot surface by uniform sampling; use particle swarm algorithm to optimize and generate the minimum envelope sphere set containing all sampling points; Step 4: Implement conservative collision detection using SDF and envelope sphere.
2. The conservative collision detection method for industrial robot path planning according to claim 1, characterized in that: The step 1 comprises the following specific steps: Establish LBVH tree structure: The input model contains n triangular patches. First, calculate the axis-aligned bounding box AABB of all patches as a whole. Use AABB as the boundary, convert the patch center coordinates to the range of 0 to 1, generate Morton code and perform radix sorting on all patches. Create a leaf node for each primitive. Each leaf node initiates a thread for parallel computing and establishes the connection relationship of the tree through binary search; AABB is used as the bounding box type of the LBVH tree node. The bounding box of the internal node of LBVH is constructed using a bottom-up strategy: starting from all leaf nodes, each triangle is assigned a thread to calculate the AABB of the triangle, and then all threads traverse the parent node upward, and the second thread to reach the parent node is retained to calculate the AABB of the parent node. The calculation method is to merge the AABBs of the two child nodes. The first thread to reach the parent node exits early, so that the number of threads is halved after each upward traversal. This traversal is continued until the bounding box construction of the entire LBVH is completed.
3. The conservative collision detection method for industrial robot path planning according to claim 2, characterized in that: The step 2 SDF construction algorithm includes a first stage, in which the SDF space is divided into a uniform grid with a lower resolution. Each small cubic area in the grid is called a cell, and the size of the cell is calculated by the following formula: Where l, w, and h are the length, width, and height of the SDF boundary. The dimensions of the grid in three directions are calculated: The grid is stored in a one-dimensional array. Two blocks of memory with a size of gridsize = l'×w'×h' and an integer data type are allocated on the video memory: idBuffer is used to store the one-dimensional number of the cell in the grid; OverlapBuffer stores whether the cell is covered. Each triangle initiates a thread to offset the triangle outward by a distance r in the triangle plane, and then stretches the triangle by a distance r in two directions perpendicular to the triangle to construct a convex polyhedron. Use the separating axis theorem to calculate all the cells covered by the convex polyhedron, and set the values in the overlapBuffer corresponding to these cells to 1, and mark the uncovered cells as 0; then calculate the prefix sum of the overlapBuffer in parallel, and arrange the covered cell numbers in the idBuffer at the front of the array according to the prefix sum, and count the total number of covered cells as overlapNum.
4. The conservative collision detection method for industrial robot path planning according to claim 3, characterized in that: The step 2 SDF construction algorithm includes a second stage, which requires subdividing the cells covered in the first stage. The cubic area after the cell subdivision is called a subcell, and its size calculation formula is: A thread is initiated for each subcell to calculate the shortest distance from the center of the subcell cube to the model surface. The process uses the LBVH tree structure to accelerate the search. The specific process is: take the center of the subcell cube as the center of the sphere, construct a sphere with an initial radius of R, and perform an intersection test between the sphere and the LBVH tree from top to bottom. If it intersects with the internal nodes, search for child nodes downwards. When reaching a leaf node, determine whether the sphere and the triangle intersect. If so, calculate the shortest distance from the center of the sphere to the triangle patch, and take the minimum value of the shortest distances among all leaf nodes as the shortest distance from the subcell to the model surface. If the sphere intersects with at least one triangle, the calculation is completed, otherwise the radius of the sphere is doubled and the intersection test with the LBVH is continued. Repeat the above process; When the shortest distance from the subcell center to the model surface is not zero, it is also necessary to determine the sign of the distance value. The ray method is used, that is, the subcell center is used as the starting point of the ray, and the ray is emitted in any direction. The number of intersections between the ray and the object surface is calculated. If the intersection is an odd number of times, the distance value is negative, otherwise it is positive. Two ray intersection tests are performed in the x and y directions. The distance value is considered to be negative only when the number of intersections in both directions is an odd number, otherwise it is positive. The calculation results are finally transmitted back from the GPU to the CPU and a sparse grid is used to store the values of all subcells. The sparse grid data structure uses VDB.
5. The conservative collision detection method for industrial robot path planning according to claim 4, characterized in that: The step 3 includes obtaining a point set S on the surface of the robot model by uniform sampling, creating a particle swarm optimization algorithm model with the standard of eight envelope balls for each model, determining the optimization interval of the independent variable of the particle swarm algorithm by calculating the oriented bounding box (OBB) of the model, judging whether the envelope ball can completely contain all the sampling points in a GPU-accelerated manner, and adding the number of uncontained points as a penalty function to the optimization model, and finally running the particle swarm algorithm to obtain the optimized envelope ball, and deleting the invalid envelope ball.
6. The conservative collision detection method for industrial robot path planning according to claim 5, characterized in that: The step 3 comprises the following specific steps: First, we need to determine the independent variables of the algorithm optimization. It is stipulated that the number of envelope balls for each joint shall not exceed 8. The set of all envelope balls is recorded as E. Each envelope ball contains four parameters (x, y, z, r) of the center coordinates and the radius of the ball, totaling 32 optimization parameters. The algorithm optimization goal is to minimize the sum of the volumes of all envelope balls. The sum of the cube of the radii of all envelope balls is used as the optimization objective function. Through the sampling method, a large number of points are sampled on the model surface with uniform density and recorded as set S. GPU parallel computing is used to determine whether the sampling point set S is completely included in the set E. Let the number of points in S outside E be k. Add this variable as a penalty term to the optimization function to obtain the final optimization function as follows: Where λ represents the penalty coefficient, which is defined by the user; The range of the independent variable in the optimization function is determined by the following method: First, the OBB of the joint model is calculated, and the OBB is evenly divided into 8 sub-cubes along the three axes. The vector from the center of the OBB to the center of each sub-cube is denoted as d i , the modulus lengths of these vectors are equal, and their lengths are taken as the maximum value of the envelope sphere radius parameter R max , the parameters of each envelope ball (x i ,y i ,z i ,r i ) is calculated by the following formula: Where O i represents the center coordinate of OBB, u i ,v i ,w i Represents the parameters corresponding to the three components of the spherical center coordinates. In this way, the 32 parameters of the optimization function are determined as {u i ,v i ,w i ,r i }, 0≤i<8; The method of obtaining sampling points from the robot joint model is uniform sampling, the sampling interval is set to w, the sampling output point set is S, and the sampling process is: first, all vertices on the model are added to S; Then traverse all triangles {v0, v1, v2} and sample them row by row. The first direction of the scan is d0 = v1-v0, and the second direction is d1 = d0. ⊥ , d0 ⊥ It means rotating the vector d0 by 90 degrees counterclockwise in the triangle plane. Let the scan line be l. The initial state l is set to the line where v0v1 is located. The algorithm starts and calculates the intersection points of l with the edges v0v2 and v1v2, respectively, and records them as v beg and v end , on line segment v beg v end From point v beg Start sampling points evenly with intervals of w, and add all sampling points to S; Then translate l along the direction of d1 by a distance w, and repeat the above process until l has no intersection with the edges v0v2 and v1v2 or the two intersections overlap; The process of judging whether the point set S is included in the set E through GPU parallel computing is as follows: set the thread load parameter m, select parameter m=4, expand the point set S to a multiple of m, assign every m points to a thread to initiate computing, set the number of threads in a thread group to 1024, traverse m points in a single thread and count the number of points not included in the set E as n, use the shared memory on the GPU to perform parallel reduction within the thread group, calculate the number of points n' not included in the set E in a thread group, and finally, the first thread in each thread group obtains the number of points k not included in E in all point sets through atomic summation. After the envelope sphere is obtained based on particle swarm optimization, the sphere with zero radius is deleted, and finally the robot joint envelope sphere is obtained.
7. The conservative collision detection method for industrial robot path planning according to claim 4, characterized in that: The step 4 comprises the following specific steps: SDF moves with the object when the object moves. Before the collision test, the envelope sphere is transformed into the coordinate system where the SDF is located. According to the relative position of the center of the envelope sphere and the boundary of the SDF, it is divided into three cases: when the center of the envelope sphere is outside the boundary of the SDF, there will be no collision; when the center of the envelope sphere is inside the boundary of the SDF, but the SDF value at the center does not exist, it means that the closest distance from the position to the model surface is greater than the maximum envelope sphere radius of the robot, so no collision occurs; when the center of the envelope sphere is inside the boundary of the SDF, and the absolute value of the SDF value at the center is less than or equal to the envelope sphere radius, it is considered that a collision occurs, otherwise it is considered that no collision occurs.
Citation Information
Patent Citations
Quick self-collision detection method of space mechanical arm
CN111546377A
Industrial robot dynamic path planning method based on variable density search space
CN113203420A
Cited By
Method for detecting collision between bucket of intelligent shovel loading robot and walking mechanism and collision between bucket of intelligent shovel loading robot and mining truck
CN122176057A
Collision detection methods for the bucket and walking mechanism of intelligent loading robots and mining trucks.
CN122176057B