Mechanical arm collision detection method, device, equipment and program product
By layering the motion space of the robotic arm and creating a collision module, the AABB collision detection method is adopted to solve the problem of low collision detection efficiency in multi-robotic arm collaborative work, and achieve high-efficiency collision detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HC BIOENG (CHENGDU) CO LTD
- Filing Date
- 2024-10-25
- Publication Date
- 2026-04-28
AI Technical Summary
Existing technologies struggle to perform efficient collision detection in automated equipment where multiple robotic arms work collaboratively, especially for robotic arms with complex shapes where the large amount of computational information results in low detection efficiency.
The motion space of the robotic arm is divided into layers, the layered space to which each motion module belongs is determined, corresponding collision modules are created, and collision detection is performed within the same layered space. The AABB collision detection method is used to reduce the amount of computational information.
This improves the efficiency of collision detection for robotic arms, avoids the computation of acquiring complete morphological features, reduces the amount of information, and enables rapid collision detection.
Smart Images

Figure CN121928607A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automation equipment technology, and in particular to a method, apparatus, equipment and program product for detecting collisions in a robotic arm. Background Technology
[0002] In automated equipment where multiple robotic arms work together, collision detection is required to predict whether a collision will occur between the moving robotic arms. If the detection results indicate that a collision is likely, the obstacle robotic arm can be moved to a safe position in advance to prevent the collision between the robotic arms.
[0003] Currently, collision detection methods for robotic arms typically involve acquiring the complete shape features of the robotic arm and performing collision detection in three-dimensional space. However, for robotic arms with complex shapes (such as those with multiple moving parts), acquiring their complete shape features is difficult and computationally intensive, making it impossible to perform collision detection analysis and obtain detection results in a timely and effective manner, resulting in low efficiency in robotic arm collision detection.
[0004] Therefore, improving the efficiency of collision detection in multi-robotic arm systems has become an urgent problem to be solved. Summary of the Invention
[0005] This application provides a method, apparatus, device, and program product for detecting collisions in robotic arms, which can improve the efficiency of collision detection in robotic arms.
[0006] In a first aspect, embodiments of this application provide a collision detection method for a robotic arm, the method comprising:
[0007] The motion space where the working robotic arm and the obstacle robotic arm may collide is divided into layers to obtain the layered result;
[0008] Based on the hierarchical results, the hierarchical spaces to which the multiple first motion modules of the working robotic arm and the multiple second motion modules of the obstacle robotic arm belong are determined respectively.
[0009] Create a first collision module for each first motion module, and create a second collision module for each second motion module.
[0010] Collision detection is performed on the first and second collision modules, which are located in the same layer space, to obtain the collision detection results of the working robot arm and the obstacle robot arm.
[0011] In one embodiment, a first collision module is created for each first motion module, and a second collision module is created for each second motion module, including: creating a first collision module for each first motion module based on its type, origin offset data, and projection information; and creating a second collision module for each second motion module based on its type, origin offset data, and projection information; wherein the type of the motion module represents the motion characteristics of the motion module.
[0012] In one embodiment, the method further includes: determining the type of each first motion module based on the motion characteristics of each first motion module, and acquiring the origin offset data and projection information of each first motion module; and determining the type of each second motion module based on the motion characteristics of each second motion module, and acquiring the origin offset data and projection information of each second motion module.
[0013] In one embodiment, collision detection is performed on a first collision module and a second collision module located in the same hierarchical space to obtain collision detection results for the working robot arm and the obstacle robot arm. This includes: determining, for the first collision module and the second collision module in the same hierarchical space, the first projection information corresponding to the first collision module and the first endpoint coordinates of the bounding box of the first collision module, as well as the second projection information corresponding to the second collision module and the second endpoint coordinates of the bounding box of the second collision module; and performing collision detection on the first collision module and the second collision module in the same hierarchical space based on the first projection information, the first endpoint coordinates, the second projection information, and the second endpoint coordinates to obtain collision detection results for the working robot arm and the obstacle robot arm.
[0014] In one embodiment, the first endpoint coordinates include a first abscissa and a first ordinate, and the second endpoint coordinates include a second abscissa and a second ordinate. Based on the first projection information, the first endpoint coordinates, the second projection information, and the second endpoint coordinates, collision detection is performed on the first collision module and the second collision module in the same layered space to obtain the collision detection results of the working robot arm and the obstacle robot arm. This includes: determining the length and width of the first collision module based on the first projection information, and determining the length and width of the second collision module based on the second projection information. If it is determined that the first abscissa is less than the sum of the second abscissa and the width of the second collision module, and the sum of the first abscissa and the width of the first collision module is less than the second abscissa, and the first ordinate is less than the sum of the second ordinate and the length of the second collision module, and the sum of the first ordinate and the length of the first collision module is less than the second ordinate, then it is determined that the working robot arm and the obstacle robot arm will collide.
[0015] In one embodiment, the method further includes: when the collision detection result indicates that the working robot arm and the obstacle robot arm will collide, determining the undetermined safe position of the obstacle robot arm based on the movement direction and working range of the working robot arm in the world coordinate system; performing a depth-first position search from the undetermined safe position to the avoidance direction of the avoidance area to obtain the target safe position; and controlling the obstacle robot arm to move to the target safe position.
[0016] In one embodiment, a depth-first location search is performed from the undetermined safe position to the avoidance direction of the avoidance area to obtain the target safe position. This includes: performing collision detection on the working robot arm and the obstacle robot arm at the undetermined safe position to obtain the collision detection result corresponding to the undetermined safe position; if the collision detection result corresponding to the undetermined safe position indicates that the working robot arm and the obstacle robot arm will not collide at the undetermined safe position, then the undetermined safe position is taken as the target safe position; if the collision detection result corresponding to the undetermined safe position indicates that the working robot arm and the obstacle robot arm will collide at the undetermined safe position, then the position traversal of the avoidance direction of the avoidance area is performed until a position where the working robot arm and the obstacle robot arm will not collide is found or the end point of the avoidance area is reached, and the position where the working robot arm and the obstacle robot arm will not collide or the end point of the avoidance area is taken as the target safe position.
[0017] Secondly, this application provides a robotic arm collision detection device, the device comprising:
[0018] The processing module is used to divide the motion space where the working robotic arm and the obstacle robotic arm may collide into layers, and obtain the layering results;
[0019] The determination module is used to determine the hierarchical space to which the multiple first motion modules of the working robot arm and the multiple second motion modules of the obstacle robot arm belong, based on the hierarchical results.
[0020] A creation module is used to create a first collision module corresponding to each first motion module, and to create a second collision module corresponding to each second motion module.
[0021] The detection module is used to perform collision detection on the first collision module and the second collision module, which are in the same layer space, to obtain the collision detection results of the working robot arm and the obstacle robot arm.
[0022] Thirdly, this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0023] The motion space where the working robotic arm and the obstacle robotic arm may collide is divided into layers to obtain the layered result;
[0024] Based on the hierarchical results, the hierarchical spaces to which the multiple first motion modules of the working robotic arm and the multiple second motion modules of the obstacle robotic arm belong are determined respectively.
[0025] Create a first collision module for each first motion module, and create a second collision module for each second motion module.
[0026] Collision detection is performed on the first and second collision modules, which are located in the same layer space, to obtain the collision detection results of the working robot arm and the obstacle robot arm.
[0027] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0028] The motion space where the working robotic arm and the obstacle robotic arm may collide is divided into layers to obtain the layered result;
[0029] Based on the hierarchical results, the hierarchical spaces to which the multiple first motion modules of the working robotic arm and the multiple second motion modules of the obstacle robotic arm belong are determined respectively.
[0030] Create a first collision module for each first motion module, and create a second collision module for each second motion module.
[0031] Collision detection is performed on the first and second collision modules, which are located in the same layer space, to obtain the collision detection results of the working robot arm and the obstacle robot arm.
[0032] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0033] The motion space where the working robotic arm and the obstacle robotic arm may collide is divided into layers to obtain the layered result;
[0034] Based on the hierarchical results, the hierarchical spaces to which the multiple first motion modules of the working robotic arm and the multiple second motion modules of the obstacle robotic arm belong are determined respectively.
[0035] Create a first collision module for each first motion module, and create a second collision module for each second motion module.
[0036] Collision detection is performed on the first and second collision modules, which are located in the same layer space, to obtain the collision detection results of the working robot arm and the obstacle robot arm.
[0037] The aforementioned robotic arm collision detection method, apparatus, equipment, storage medium, and program products allow a computer device to layer the motion spaces where collisions between the working robotic arm and the obstacle robotic arm may occur, obtaining layering results. Based on the layering results, the computer device determines the layered spaces to which multiple first motion modules of the working robotic arm and multiple second motion modules of the obstacle robotic arm belong, respectively. It then creates a first collision module corresponding to each first motion module and a second collision module corresponding to each second motion module. Collision detection is performed on the first and second collision modules within the same layered space to obtain the collision detection results for the working robotic arm and the obstacle robotic arm. Using this method, the computer device can perform collision detection on the collision modules corresponding to the motion modules of multiple robotic arms within the same layered space, obtaining collision detection results for multiple robotic arms. This avoids acquiring the complete morphological features of the robotic arm and reduces the amount of computational information, thereby improving the efficiency of robotic arm collision detection. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is a schematic diagram illustrating an application scenario of a robotic arm collision detection method provided in an embodiment of this application;
[0040] Figure 2 This is a schematic flowchart of a robotic arm collision detection method provided in an embodiment of this application;
[0041] Figure 3 This is a flowchart illustrating another robotic arm collision detection method provided in an embodiment of this application;
[0042] Figure 4A This is a schematic diagram of the internal horizontal projection of a multi-arm pipetting device provided in an embodiment of this application;
[0043] Figure 4B This is a schematic diagram of the internal vertical projection of a multi-arm pipetting device provided in an embodiment of this application;
[0044] Figure 5 This is a schematic diagram illustrating the process of creating a first collision module corresponding to a first motion module, as provided in an embodiment of this application.
[0045] Figure 6 This is a schematic diagram of a collision detection process provided in an embodiment of this application;
[0046] Figure 7 This is a schematic diagram of an AABB bounding box collision detection process provided in an embodiment of this application;
[0047] Figure 8 This is a flowchart illustrating another robotic arm collision detection method provided in the embodiments of this application;
[0048] Figure 9 This is a flowchart illustrating a method for determining the target safe position of a robotic arm that overcomes an obstacle, as provided in an embodiment of this application.
[0049] Figure 10 This is a schematic diagram of the structure of a robotic arm collision detection device provided in an embodiment of this application;
[0050] Figure 11 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0052] The application scenarios of the robotic arm collision detection method provided in the embodiments of this application are described below.
[0053] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario of a robotic arm collision detection method provided in an embodiment of this application. For example... Figure 1 As shown, it includes computer equipment 101 ( Figure 1 (The computer device 101 is used as an example of a terminal device) and a multi-robotic arm pipetting device 102 are shown. The multi-robotic arm pipetting device 102 may include a working robotic arm 1021 and an obstacle robotic arm 1022. Data can be transmitted between the computer device 101 and the multi-robotic arm pipetting device 102 via a network.
[0054] Specifically, within the working area of the multi-arm pipetting device 102, two or more robotic arms move individually or simultaneously to complete a preset sample processing task. Understandably, during collision detection, when the computer device 101 selects any one robotic arm as the working robotic arm 1021, the remaining one or more robotic arms are considered obstacle robotic arms 1022.
[0055] The computer device 101 can divide the motion space where the working robotic arm 1021 and the obstacle robotic arm 1022 may collide into layers to obtain a layering result; based on the layering result, it determines the layered space to which multiple first motion modules of the working robotic arm 1021 and multiple second motion modules of the obstacle robotic arm 1022 belong respectively; it creates a first collision module corresponding to each first motion module and a second collision module corresponding to each second motion module respectively; it performs collision detection on the first collision module and the second collision module in the same layered space to obtain the collision detection result of the working robotic arm 1021 and the obstacle robotic arm 1022.
[0056] Preferably, the motion space where the working robotic arm 1021 and the obstacle robotic arm 1022 may collide is determined based on the overlapping area of the motion spaces of any two robotic arms within the multi-arm pipetting device 102. Typically, the working robotic arm 1021 includes one or more first motion modules, and each layered space, divided based on the possible collision motion space, contains at least one complete first motion module of the working robotic arm 1021. Further, a first collision module corresponding to each first motion module and a second collision module corresponding to each second motion module are created respectively. Collision detection is performed on the first collision module in each layered space and the second collision module that is completely or partially contained in that layered space to obtain the collision detection result.
[0057] Using this method, computer equipment can perform collision detection on the collision modules corresponding to the motion modules of multiple robotic arms in the same layered space, and obtain the collision detection results of multiple robotic arms. In this way, it is possible to avoid obtaining the complete morphological features of the robotic arms and reduce the amount of computational information, thereby improving the efficiency of robotic arm collision detection.
[0058] Optionally, computer device 101 can be a terminal device or a server. The terminal device mentioned herein may include, but is not limited to, smartphones, tablets, laptops, desktop computers, smartwatches, smart TVs, and smart vehicle terminals. The server mentioned herein may be a standalone physical server, a server cluster consisting of multiple physical servers, or a distributed system.
[0059] Please see Figure 2 , Figure 2 This is a schematic flowchart illustrating a collision detection method for a robotic arm provided in an embodiment of this application. The method can be executed by a computer device (e.g., the computer device 201 described above). Figure 2 As shown, the collision detection method for the robotic arm may include, but is not limited to, the following steps:
[0060] S201. Divide the motion space where the working robotic arm and the obstacle robotic arm may collide into layers to obtain the layering result.
[0061] Optionally, the computer device can divide the motion space where the working robotic arm and the obstacle robotic arm may collide into layers to obtain a layered result. For example, in the multi-robotic arm pipetting device 102, the working robotic arm 1021 includes three independently movable first motion modules in the vertical direction. The motion space where the working robotic arm and the obstacle robotic arm may collide is divided into an upper layer, a middle layer, and a bottom layer, so that the three first motion modules of the working robotic arm 1021 are located in the upper layer, the middle layer, and the bottom layer, respectively, to obtain a layered result.
[0062] S202. Based on the hierarchical results, determine the hierarchical space to which the multiple first motion modules of the working robot arm and the multiple second motion modules of the obstacle robot arm belong respectively.
[0063] Optionally, the hierarchical space to which the multiple first motion modules and multiple second motion modules belong can be a top layer, a middle layer, or a bottom layer. Understandably, a second motion module may be entirely located in a certain hierarchical space, or it may be partially contained in that hierarchical space and simultaneously partially contained in another hierarchical space.
[0064] S203. Create a first collision module corresponding to each first motion module, and create a second collision module corresponding to each second motion module.
[0065] Among them, the motion module is a module in three-dimensional space, and the collision module is a module in two-dimensional space. The collision module corresponding to the motion module can be understood as the two-dimensional information representation of the motion module in three-dimensional space in two-dimensional space.
[0066] In one optional implementation, the computer device creates a first collision module corresponding to each first motion module and a second collision module corresponding to each second motion module, which may include: creating a first collision module corresponding to each first motion module based on the type, origin offset data, and projection information of each first motion module; and creating a second collision module corresponding to each second motion module based on the type, origin offset data, and projection information of each second motion module; wherein the type of the motion module represents the motion characteristics of the motion module.
[0067] S204. Perform collision detection on the first collision module and the second collision module, which are in the same layer space, to obtain the collision detection results of the working robot arm and the obstacle robot arm.
[0068] In one optional implementation, the computer device performs collision detection on the first collision module and the second collision module, which are in the same layered space, to obtain the collision detection results of the working robot arm and the obstacle robot arm. This may include: using the AABB collision detection method to perform collision detection on the first collision module and the second collision module, which are in the same layered space, to obtain the collision detection results of the working robot arm and the obstacle robot arm.
[0069] In this embodiment, the computer device can layer the motion space where collisions may occur between the working robotic arm and the obstacle robotic arm to obtain a layering result. Based on the layering result, the layering space to which multiple first motion modules of the working robotic arm and multiple second motion modules of the obstacle robotic arm belong is determined. A first collision module corresponding to each first motion module and a second collision module corresponding to each second motion module are created respectively. Collision detection is performed on the first and second collision modules in the same layering space to obtain the collision detection result of the working robotic arm and the obstacle robotic arm. Using this method, the computer device can perform collision detection on the collision modules corresponding to the motion modules of multiple robotic arms in the same layering space to obtain the collision detection result of multiple robotic arms. This avoids obtaining the complete morphological features of the robotic arm and reduces the amount of computational information, thereby improving the efficiency of robotic arm collision detection.
[0070] Please see Figure 3 , Figure 3 This is a flowchart illustrating another robotic arm collision detection method provided in an embodiment of this application. Figure 2 Compared to the robotic arm collision detection method shown, Figure 3 The method illustrated specifically describes how the computer device performs collision detection on the first and second collision modules located in the same layered space to obtain the collision detection results of the working robotic arm and the obstacle robotic arm. For example... Figure 3 As shown, the collision detection method for the robotic arm may include, but is not limited to, the following steps:
[0071] S301. Divide the motion space where the working robotic arm and the obstacle robotic arm may collide into layers to obtain the layering result.
[0072] In an optional implementation, the specific details of step S301 can be found in the description of step S201 above, such as... Figure 4A , Figure 4BAs shown, inside the multi-arm robotic device 102, the working robotic arm 1021 includes three independently movable first motion modules along the vertical direction: first motion module 1021-1, first motion module 1021-2, and first motion module 1021-3. The horizontal projection area of the working robotic arm 1021 in the motion space inside the multi-arm robotic device 102 is region AHKF, and the vertical projection area is region AHID. Similarly, the obstacle robotic arm 1022 includes three independently movable second motion modules along the vertical direction: second motion module 1022-1, second motion module 1022-2, and second motion module 1022-3. The horizontal projection area of the obstacle robotic arm 1022 in the motion space inside the multi-arm robotic device 102 is region GBEL, and the vertical projection area is region GBCJ.
[0073] Among them, the horizontal projection area of the overlapping area of the motion space of the working robotic arm 1021 and the obstacle robotic arm 1022 is region GHKL, and the vertical projection area is region GHIJ.
[0074] Based on the structure and motion patterns of the working robotic arm 1021 and the obstacle robotic arm 1022, the computer device 101 horizontally divides the overlapping area of the motion space of the working robotic arm 1021 and the obstacle robotic arm 1022 inside the multi-robotic arm device 102 into an upper layer, a middle layer, and a bottom layer.
[0075] Understandably, the layering results obtained by the computer device 101 may differ depending on the number, structure, and / or motion patterns of the working robotic arm 1021 and the obstacle robotic arm 1022, which will not be elaborated here.
[0076] S302. Based on the hierarchical results, determine the hierarchical space to which the multiple first motion modules of the working robot arm and the multiple second motion modules of the obstacle robot arm belong respectively.
[0077] In an optional implementation, the specific details of step S302 can be found in the description of step S202 above. Specifically, based on the spatial layering results of the motion space where the working robotic arm 1021 and the obstacle robotic arm 1022 may collide in step S301, such as... Figure 4B As shown, when the working robotic arm 1021 and the obstacle robotic arm 1022 are working, the first motion module 1021-1 and the second motion module 1022-1 are in the upper layer (top layer), the first motion module 1021-2 and the second motion module 1022-2 are in the middle layer (middle layer), and the first motion module 1021-3 and the second motion module 1022-3 are in the bottom layer (bottom layer). Further details will not be provided here.
[0078] S303. Based on the type, origin offset data and projection information of each first motion module, create a first collision module corresponding to the first motion module; and based on the type, origin offset data and projection information of each second motion module, create a second collision module corresponding to the second motion module; wherein, the type of motion module represents the motion characteristics of the motion module.
[0079] The following section uses the example of a computer device creating a first collision module corresponding to a first motion module to illustrate the process of a computer device creating a collision module corresponding to each motion module.
[0080] Please see Figure 5 , Figure 5 This is a schematic diagram illustrating the process of creating a first collision module corresponding to a first motion module, as provided in an embodiment of this application. Figure 5 As shown, the process by which a computer device creates a first collision module corresponding to a motion module may include, but is not limited to, the following steps:
[0081] (1) The computer device determines whether the first motion module belongs to the first type (denoted as XFixed type). If yes, then execute step (2); if no, then execute step (3).
[0082] (2) Determine the x-coordinate of the first collision module as the x-coordinate of the first motion module (denoted as x), and determine the y-coordinate of the first collision module as the sum of the y-coordinate of the first motion module (denoted as y) and the offset of the y-coordinate of the first motion module from the origin (denoted as left_top_y) (i.e., the y-coordinate of the first collision module is y+left_top_y). Also, determine the projection of the first collision module as (width, length), where width represents the maximum value of the x-coordinate of the first collision module in the projection direction (denoted as width), and length represents the maximum value of the y-coordinate of the first collision module in the projection direction (denoted as length).
[0083] (3) Determine whether the first motion module belongs to the second type (denoted as YFixed type). If yes, proceed to step (4); otherwise, proceed to step (5).
[0084] (4) The horizontal coordinate of the first collision module is determined to be the sum of the horizontal coordinate of the first motion module (denoted as x) and the offset of the horizontal coordinate of the first motion module from the origin (denoted as left_top_x) (i.e., the horizontal coordinate of the first collision module is x+left_top_x), the vertical coordinate of the first collision module is determined to be the vertical coordinate of the first motion module (denoted as y), and the projection of the first collision module is determined to be (width, length).
[0085] (5) Determine whether the first motion module belongs to the third type (denoted as Float type). If yes, proceed to step (6); otherwise, end.
[0086] (6) Determine the x-coordinate of the first collision module as the sum of the x-coordinate of the first motion module (denoted as x) and the offset of the x-coordinate of the first motion module relative to the origin (denoted as left_top_x) (i.e., the x-coordinate of the first collision module is x+left_top_x), determine the y-coordinate of the first collision module as the sum of the y-coordinate of the first motion module (denoted as y) and the offset of the y-coordinate of the first motion module relative to the origin (denoted as left_top_y) (i.e., the y-coordinate of the first collision module is y+left_top_y), and determine the projection of the first collision module as (width, length).
[0087] In an optional implementation, prior to step S303, the computer device may further determine the type of each first motion module based on the motion characteristics of each first motion module, and acquire the origin offset data and projection information of each first motion module; and, based on the motion characteristics of each second motion module, determine the type of each second motion module, and acquire the origin offset data and projection information of each second motion module. Understandably, the projection information of the first motion module includes horizontal projection information and / or vertical projection information; the projection information of the second motion module includes horizontal projection information and / or vertical projection information.
[0088] In this embodiment, the computer device determines the type of each first motion module based on the motion characteristics of each first motion module. This may include: if the motion characteristic of any first motion module is fixed in the x-direction, determining the type of the first motion module as a first type (denoted as XFixed type); if the motion characteristic of any first motion module is fixed in the y-direction, determining the type of the first motion module as a second type (denoted as YFixed type); and if the motion characteristic of any first motion module is not fixed in either the x-direction or the y-direction, determining the type of the first motion module as a third type (denoted as Float type).
[0089] In this embodiment, the computer device acquires the origin offset data and projection information of each first motion module, which may include: acquiring the origin offset data and projection information of each first motion module from a database. Optionally, before acquiring the origin offset data and projection information of each first motion module from the database, the computer device may also receive the origin offset data and projection information of each first motion module, which may be predefined; and store the origin offset data and projection information of each first motion module in the database. Thus, when creating the first collision module corresponding to the first motion module, the computer device can directly acquire the origin offset data and projection information of each first motion module from the database.
[0090] Optionally, the explanation regarding the computer device determining the type of each second motion module based on the motion characteristics of each second motion module can be found in the above explanation regarding determining the type of each first motion module based on the motion characteristics of each first motion module, and will not be repeated here. The explanation regarding the computer device acquiring the origin offset data and projection information of each second motion module can be found in the above description regarding acquiring the origin offset data and projection information of each first motion module, and will not be repeated here.
[0091] In an optional implementation, after step S303, the computer device may further determine the layered space corresponding to each first collision module and the layered space corresponding to each second collision module; wherein, the layered space corresponding to each first collision module is the same as the layered space to which the first motion module corresponding to the first collision module belongs, and the layered space corresponding to each second collision module is the same as the layered space to which the second motion module corresponding to the second collision module belongs; determine whether there is a second collision module in the layered space that is the same as the layered space corresponding to the target first collision module; the target first collision module is any one of the multiple first collision modules; if yes, then step S304 is executed; if no, then the multiple first collision modules corresponding to the working robot arm are traversed, and the steps of determining the layered space corresponding to each first collision module and the layered space corresponding to each second collision module are repeatedly executed until the multiple first collision modules corresponding to the working robot arm are traversed.
[0092] For example, please see Figure 6 , Figure 6 This is a schematic diagram of a collision detection process provided in an embodiment of this application. Figure 6As shown, the computer device can select one first collision module from multiple first collision modules of the working robot arm; determine whether there is a second collision module of the obstacle robot arm in the layered space to which the selected first collision module belongs; if it is determined that there is a second collision module of the obstacle robot arm in the layered space to which the selected first collision module belongs, then perform collision detection on the currently selected first collision module and the second collision module in the layered space to obtain the collision detection results of the working robot arm and the obstacle robot arm. Then, it is determined whether all the multiple first collision modules of the working robot arm have been traversed. If yes, the collision detection process ends. If no, the step of selecting one first collision module from multiple first collision modules of the working robot arm is repeated, that is, the undetected first collision modules are selected for the aforementioned collision detection steps. If it is determined that there is no second collision module of the obstacle robot arm in the layered space to which the selected first collision module belongs, the step of selecting one first collision module from multiple first collision modules of the working robot arm is repeated until each first collision module corresponding to the working robot arm is selected, and the collision detection process ends.
[0093] In one optional implementation, due to the structure and motion characteristics of the robotic arm, the probability and impact of collisions between the working robotic arm and the obstacle robotic arm differ in different layered spaces. Specifically, the probability of collisions in the upper layered space is higher than in the lower layered space. Furthermore, by avoiding collisions in the upper layered space, the probability of potential collisions in the lower layered space can be further reduced. In this implementation, when the computer device traverses multiple first collision modules of the working robotic arm, it can traverse in the order of "top layer - middle layer - bottom layer". If a first collision module with a potential collision is identified in a certain layered space and all first collision modules in the current layered space have been traversed, the next layered space is not traversed, and the process ends; and the process ends when all layered spaces have been traversed. Using the collision detection method in this implementation improves the efficiency of traversing multiple first collision modules of the working robotic arm.
[0094] S304. For the first collision module and the second collision module in the same hierarchical space, respectively determine the first projection information corresponding to the first collision module and the first endpoint coordinates of the bounding box of the first collision module, as well as the second projection information corresponding to the second collision module and the second endpoint coordinates of the bounding box of the second collision module.
[0095] In an alternative embodiment, if the second collision module is partially included in the hierarchical space where the first collision module is located, the first projection information corresponding to the first collision module, the first endpoint coordinates of the bounding box of the first collision module, the second projection information corresponding to the part of the second collision module in this hierarchical space, and the second endpoint coordinates of the bounding box of the second collision module are determined respectively. Details are not elaborated here.
[0096] S305. Based on the first projection information, the first endpoint coordinates, the second projection information, and the second endpoint coordinates, perform collision detection on the first collision module and the second collision module in the same hierarchical space to obtain the collision detection result of the working robotic arm and the obstacle robotic arm.
[0097] In an alternative embodiment, the first endpoint coordinates include a first abscissa and a first ordinate, and the second endpoint coordinates include a second abscissa and a second ordinate; the computer device performs collision detection on the first collision module and the second collision module in the same hierarchical space based on the first projection information, the first endpoint coordinates, the second projection information, and the second endpoint coordinates to obtain the collision detection result of the working robotic arm and the obstacle robotic arm, which may include: determining the length and width of the first collision module based on the first projection information, and determining the length and width of the second collision module based on the second projection information; determining that the working robotic arm and the obstacle robotic arm will collide when it is determined that the first abscissa is less than the sum of the second abscissa and the width of the second collision module, the sum of the first abscissa and the width of the first collision module is less than the second abscissa, the first ordinate is less than the sum of the second ordinate and the length of the second collision module, and the sum of the first ordinate and the length of the first collision module is less than the second ordinate.
[0098] Exemplarily, please refer to Figure 7 , Figure 7 which is a schematic process diagram of AABB bounding box collision detection provided by an embodiment of the present application. As Figure 7 shown, the computer device may first determine the length (denoted as m1.l) and width (denoted as m1.w) of the first collision module, the length (denoted as m2.l) and width (denoted as m2.w) of the second collision module, the first endpoint coordinates (m1.x, m1.y) of the bounding box of the first collision module, and the second endpoint coordinates (m2.x, m2.y) of the bounding box of the second collision module. Then, determine whether (m1.x < m2.x + m2.w) && (m1.x + m1.w < m2.x) && (m1.y < m2.y + m2.l) && (m1.y + m1.l < m2.y) is satisfied. If so, determine that the working robotic arm and the obstacle robotic arm will collide; if not, determine that the working robotic arm and the obstacle robotic arm will not collide.
[0099] In this embodiment, the computer device can layer the motion space where collisions may occur between the working robotic arm and the obstacle robotic arm to obtain a layering result. Based on the layering result, the layering space to which multiple first motion modules of the working robotic arm and multiple second motion modules of the obstacle robotic arm belong is determined. A first collision module corresponding to each first motion module and a second collision module corresponding to each second motion module are created respectively. Collision detection is performed on the first and second collision modules in the same layering space to obtain the collision detection result of the working robotic arm and the obstacle robotic arm. Using this method, the computer device can perform collision detection on the collision modules corresponding to the motion modules of multiple robotic arms in the same layering space to obtain the collision detection result of multiple robotic arms. This avoids obtaining the complete morphological features of the robotic arm and reduces the amount of computational information, thereby improving the efficiency of robotic arm collision detection.
[0100] Please see Figure 8 , Figure 8 This is a flowchart illustrating another robotic arm collision detection method provided in an embodiment of this application. Figure 3 Compared to the robotic arm collision detection method shown, Figure 8 The method described also illustrates how a computer device controls an obstacle-avoiding robotic arm based on collision detection results. For example... Figure 8 As shown, the collision detection method for the robotic arm may include, but is not limited to, the following steps:
[0101] S801. Divide the motion space where the working robotic arm and the obstacle robotic arm may collide into layers to obtain the layering result.
[0102] S802. Based on the hierarchical results, determine the hierarchical space to which the multiple first motion modules of the working robot arm and the multiple second motion modules of the obstacle robot arm belong respectively.
[0103] S803. Based on the type, origin offset data and projection information of each first motion module, create a first collision module corresponding to the first motion module; and based on the type, origin offset data and projection information of each second motion module, create a second collision module corresponding to the second motion module; wherein, the type of motion module represents the motion characteristics of the motion module.
[0104] S804. For the first collision module and the second collision module in the same hierarchical space, respectively determine the first projection information corresponding to the first collision module and the first endpoint coordinates of the bounding box of the first collision module, as well as the second projection information corresponding to the second collision module and the second endpoint coordinates of the bounding box of the second collision module.
[0105] S805. Based on the first projection information, the first endpoint coordinates, the second projection information, and the second endpoint coordinates, collision detection is performed on the first collision module and the second collision module in the same layered space to obtain the collision detection results of the working robot arm and the obstacle robot arm.
[0106] In an optional implementation, the relevant descriptions of steps S801 to S805 can be found in the descriptions of steps S301 to S305 above, and will not be repeated here.
[0107] S806. Based on the collision detection results, determine whether the working robot arm and the obstacle robot arm will collide. If yes, proceed to steps S807 to S809; otherwise, proceed to step S810.
[0108] In other words, if the collision detection result indicates that the working robotic arm and the obstacle robotic arm will collide, the computer device executes steps S807 and S809, that is, controls the obstacle robotic arm to automatically avoid the collision; if the collision detection result indicates that the working robotic arm and the obstacle robotic arm will not collide, the computer device executes step S810, that is, controls the working robotic arm to move to the target position. Automatic obstacle avoidance involves removing the obstacle robotic arm so that the working robotic arm can reach the target position.
[0109] S807. Based on the movement direction and working range of the working robot arm in the world coordinate system, determine the undetermined safe position of the obstacle robot arm.
[0110] Optionally, the undetermined safe position of the obstacle robot arm can be denoted as safepos.
[0111] In an optional implementation, prior to step S807, the computer device may further perform inverse calculations on the local coordinates of the robotic arm to obtain the target position (goal.x, goal.y) of the robotic arm in the world coordinate system; based on this target position and the initial position, the movement direction and working range of the robotic arm in the world coordinate system are determined. It is understood that the undetermined safe position of the obstacle robotic arm is determined based on the inverse calculation of the local coordinates of the robotic arm.
[0112] S808. Perform a depth-first location search from the undetermined safe location to the avoidance direction of the avoidance area to obtain the target safe location.
[0113] In one optional implementation, the computer device performs a depth-first location search from the undetermined safe position to the avoidance direction of the avoidance area to obtain the target safe position. This may include: performing collision detection on the working robot arm and the obstacle robot arm at the undetermined safe position to obtain the collision detection result corresponding to the undetermined safe position; if the collision detection result corresponding to the undetermined safe position indicates that the working robot arm and the obstacle robot arm will not collide at the undetermined safe position, then the undetermined safe position is taken as the target safe position; if the collision detection result corresponding to the undetermined safe position indicates that the working robot arm and the obstacle robot arm will collide at the undetermined safe position, then the position traversal of the avoidance direction of the avoidance area is performed until a position where the working robot arm and the obstacle robot arm will not collide is found or the end point of the avoidance area is reached, and the position where the working robot arm and the obstacle robot arm will not collide or the end point of the avoidance area is taken as the target safe position.
[0114] In this embodiment, when the collision detection result at the pending safe position indicates that the working robot arm and the obstacle robot arm will collide at the pending safe position, the computer device performs position traversal of the avoidance direction of the avoidance area until a position where the working robot arm and the obstacle robot arm will not collide is found or the avoidance area is traversed to its end. The avoidance area corresponding to the obstacle robot arm can also be determined.
[0115] Optionally, the avoidance zone can be a preset fixed area. It is understood that each robotic arm has a fixed position in the world coordinate system that does not interfere with the work of other robotic arms, and the area between this fixed position and the current position of that robotic arm is the avoidance zone.
[0116] For example, please see Figure 9 , Figure 9 This is a flowchart illustrating a method for determining the target safe position of a robotic arm over an obstacle, as provided in an embodiment of this application. Figure 9As shown, the computer device can start from the undetermined safe position `safepos` and perform collision detection on the working robot arm and the obstacle robot arm to obtain the collision detection result corresponding to the undetermined safe position. If the collision detection result corresponding to the undetermined safe position indicates that the working robot arm and the obstacle robot arm will not collide at the undetermined safe position, the undetermined safe position is taken as the target safe position (i.e., the avoidance position). If the collision detection result corresponding to the undetermined safe position indicates that the working robot arm and the obstacle robot arm will collide at the undetermined safe position, the undetermined safe position is marked as a visited position. Then, a fixed interval is accumulated in the avoidance direction of the avoidance area. By recursively visiting multiple positions in the avoidance direction of the avoidance area and repeating the steps of performing collision detection on the working robot arm and the obstacle robot arm to obtain the collision detection result corresponding to the undetermined safe position, the process continues until a position where the working robot arm and the obstacle robot arm will not collide or the end point of the avoidance area is found. The position where the working robot arm and the obstacle robot arm will not collide or the end point of the avoidance area is taken as the target safe position.
[0117] S809, Control the obstacle robotic arm to move to the target safe position.
[0118] This allows the working robotic arm to move without obstructions within the movement area, thereby avoiding collisions between the working robotic arm and the obstacle robotic arm.
[0119] S810: Control the robotic arm to move to the target position.
[0120] In this embodiment, the computer device performs collision detection on the collision modules corresponding to the motion modules of multiple robotic arms located in the same layered space, obtaining the collision detection results for multiple robotic arms. This avoids acquiring the complete morphological features of the robotic arms and reduces the amount of computational information, thereby improving the efficiency of robotic arm collision detection. Furthermore, the computer device utilizes a position depth-first search avoidance method to achieve real-time and rapid obstacle avoidance by the robotic arms, thereby improving the safety and reliability of multi-robotic arm operation.
[0121] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0122] Based on the same inventive concept, this application also provides a robotic arm collision detection device for implementing the robotic arm collision detection method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more embodiments of the robotic arm collision detection device provided below can be found in the limitations of the robotic arm collision detection method described above, and will not be repeated here.
[0123] Please see Figure 10 , Figure 10 This is a schematic diagram of the structure of a robotic arm collision detection device provided in an embodiment of this application. Figure 10 As shown, the collision detection device for the robotic arm may include, but is not limited to:
[0124] Processing module 1001 is used to divide the motion space where the working robotic arm and the obstacle robotic arm may collide into layers to obtain the layering result;
[0125] The determination module 1002 is used to determine the hierarchical space to which the multiple first motion modules of the working robot arm and the multiple second motion modules of the obstacle robot arm belong, based on the hierarchical results.
[0126] Create module 1003, which is used to create a first collision module corresponding to each first motion module, and to create a second collision module corresponding to each second motion module;
[0127] The detection module 1004 is used to perform collision detection on the first collision module and the second collision module, which are in the same layer space, to obtain the collision detection results of the working robot arm and the obstacle robot arm.
[0128] In one embodiment, when the creation module 1003 is used to create a first collision module corresponding to each first motion module and a second collision module corresponding to each second motion module, it is specifically used to: create a first collision module corresponding to each first motion module based on the type, origin offset data, and projection information of each first motion module; and create a second collision module corresponding to each second motion module based on the type, origin offset data, and projection information of each second motion module; wherein the type of motion module represents the motion characteristics of the motion module.
[0129] In one embodiment, the apparatus may further include a determination and acquisition module. This determination and acquisition module is used to determine the type of each first motion module based on the motion characteristics of each first motion module, and acquire the origin offset data and projection information of each first motion module; and, based on the motion characteristics of each second motion module, to determine the type of each second motion module, and acquire the origin offset data and projection information of each second motion module.
[0130] In one embodiment, when the detection module 1004 performs collision detection on the first collision module and the second collision module located in the same layered space to obtain the collision detection results of the working robot arm and the obstacle robot arm, it specifically performs the following steps: for the first collision module and the second collision module in the same layered space, it determines the first projection information corresponding to the first collision module and the first endpoint coordinates of the bounding box of the first collision module, as well as the second projection information corresponding to the second collision module and the second endpoint coordinates of the bounding box of the second collision module; based on the first projection information, the first endpoint coordinates, the second projection information, and the second endpoint coordinates, it performs collision detection on the first collision module and the second collision module in the same layered space to obtain the collision detection results of the working robot arm and the obstacle robot arm.
[0131] In one embodiment, the first endpoint coordinates include a first abscissa and a first ordinate, and the second endpoint coordinates include a second abscissa and a second ordinate. When the detection module 1004 performs collision detection on the first collision module and the second collision module in the same layered space based on the first projection information, the first endpoint coordinates, the second projection information, and the second endpoint coordinates to obtain the collision detection results of the working robot arm and the obstacle robot arm, it is specifically used to: determine the length and width of the first collision module based on the first projection information, and determine the length and width of the second collision module based on the second projection information; when it is determined that the working robot arm and the obstacle robot arm will collide if the first abscissa is less than the sum of the second abscissa and the width of the second collision module, and the sum of the first abscissa and the width of the first collision module is less than the second abscissa, and the first ordinate is less than the sum of the second ordinate and the length of the second collision module, and the sum of the first ordinate and the length of the first collision module is less than the second ordinate.
[0132] In one embodiment, the device may further include a search module and a control module. The determination module 1002 is further configured to determine the undetermined safe position of the obstacle robot arm based on the movement direction and working range of the working robot arm in the world coordinate system when the collision detection result indicates that a collision will occur between the working robot arm and the obstacle robot arm; the search module is configured to perform a depth-first position search from the undetermined safe position to the avoidance direction of the avoidance area to obtain the target safe position; and the control module is configured to control the obstacle robot arm to move to the target safe position.
[0133] In one embodiment, when the search module performs a depth-first position search from the undetermined safe position to the avoidance direction of the avoidance area to obtain the target safe position, it specifically performs the following: at the undetermined safe position, it performs collision detection on the working robot arm and the obstacle robot arm to obtain the collision detection result corresponding to the undetermined safe position; if the collision detection result corresponding to the undetermined safe position indicates that the working robot arm and the obstacle robot arm will not collide at the undetermined safe position, it takes the undetermined safe position as the target safe position; if the collision detection result corresponding to the undetermined safe position indicates that the working robot arm and the obstacle robot arm will collide at the undetermined safe position, it performs position traversal on the avoidance direction of the avoidance area until it finds a position where the working robot arm and the obstacle robot arm will not collide or traverses to the end point of the avoidance area, and takes the position where the working robot arm and the obstacle robot arm will not collide or the end point of the avoidance area as the target safe position.
[0134] Each module in the aforementioned robotic arm collision detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the terminal device in hardware form or independent of it, or stored in the memory of the terminal device in software form, so that the processor can call and execute the corresponding operations of each module.
[0135] In one exemplary embodiment, this application provides a computer device, which may be a terminal, and its internal structure diagram may be as follows. Figure 11As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a collision detection method for a robotic arm.
[0136] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0137] In one exemplary embodiment, this application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0138] The motion space where the working robotic arm and the obstacle robotic arm may collide is divided into layers to obtain the layered result;
[0139] Based on the hierarchical results, the hierarchical spaces to which the multiple first motion modules of the working robotic arm and the multiple second motion modules of the obstacle robotic arm belong are determined respectively.
[0140] Create a first collision module for each first motion module, and create a second collision module for each second motion module.
[0141] Collision detection is performed on the first and second collision modules, which are located in the same layer space, to obtain the collision detection results of the working robot arm and the obstacle robot arm.
[0142] In one embodiment, when the processor executes a computer program to create a first collision module corresponding to each first motion module and a second collision module corresponding to each second motion module, the specific steps are as follows: creating a first collision module corresponding to each first motion module based on the type, origin offset data, and projection information of each first motion module; and creating a second collision module corresponding to each second motion module based on the type, origin offset data, and projection information of each second motion module; wherein the type of the motion module represents the motion characteristics of the motion module.
[0143] In one embodiment, the processor executing the computer program further performs the following steps: determining the type of each first motion module based on the motion characteristics of each first motion module, and acquiring the origin offset data and projection information of each first motion module; and determining the type of each second motion module based on the motion characteristics of each second motion module, and acquiring the origin offset data and projection information of each second motion module.
[0144] In one embodiment, when the processor executes a computer program to perform collision detection on a first collision module and a second collision module located in the same hierarchical space, and obtains the collision detection results of the working robot arm and the obstacle robot arm, the following steps are specifically implemented: For the first collision module and the second collision module in the same hierarchical space, the first projection information corresponding to the first collision module and the first endpoint coordinates of the bounding box of the first collision module are determined respectively, as well as the second projection information corresponding to the second collision module and the second endpoint coordinates of the bounding box of the second collision module; Based on the first projection information, the first endpoint coordinates, the second projection information, and the second endpoint coordinates, collision detection is performed on the first collision module and the second collision module in the same hierarchical space to obtain the collision detection results of the working robot arm and the obstacle robot arm.
[0145] In one embodiment, the first endpoint coordinates include a first abscissa and a first ordinate, and the second endpoint coordinates include a second abscissa and a second ordinate. When the processor executes a computer program to perform collision detection on the first collision module and the second collision module in the same layered space based on the first projection information, the first endpoint coordinates, the second projection information, and the second endpoint coordinates, and obtains the collision detection results of the working robot arm and the obstacle robot arm, the following steps are specifically implemented: determining the length and width of the first collision module based on the first projection information, and determining the length and width of the second collision module based on the second projection information; determining that the working robot arm and the obstacle robot arm will collide when it is determined that the first abscissa is less than the sum of the second abscissa and the width of the second collision module, and the sum of the first abscissa and the width of the first collision module is less than the second abscissa, and the first ordinate is less than the sum of the second ordinate and the length of the second collision module, and the sum of the first ordinate and the length of the first collision module is less than the second ordinate.
[0146] In one embodiment, the processor executing the computer program further performs the following steps: when the collision detection result indicates that the working robot arm and the obstacle robot arm will collide, the processor determines the undetermined safe position of the obstacle robot arm based on the movement direction and working range of the working robot arm in the world coordinate system; the processor performs a depth-first position search from the undetermined safe position to the avoidance direction of the avoidance area to obtain the target safe position; and the processor controls the obstacle robot arm to move to the target safe position.
[0147] In one embodiment, when the processor executes a computer program to perform a depth-first location search from the undetermined safe position to the avoidance direction of the avoidance area to obtain the target safe position, the specific steps are as follows: At the undetermined safe position, collision detection is performed on the working robot arm and the obstacle robot arm to obtain the collision detection result corresponding to the undetermined safe position; if the collision detection result corresponding to the undetermined safe position indicates that the working robot arm and the obstacle robot arm will not collide at the undetermined safe position, the undetermined safe position is taken as the target safe position; if the collision detection result corresponding to the undetermined safe position indicates that the working robot arm and the obstacle robot arm will collide at the undetermined safe position, the position traversal of the avoidance direction of the avoidance area is performed until a position where the working robot arm and the obstacle robot arm will not collide is found or the end point of the avoidance area is reached, and the position where the working robot arm and the obstacle robot arm will not collide or the end point of the avoidance area is taken as the target safe position.
[0148] In one exemplary embodiment, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0149] The motion space where the working robotic arm and the obstacle robotic arm may collide is divided into layers to obtain the layered result;
[0150] Based on the hierarchical results, the hierarchical spaces to which the multiple first motion modules of the working robotic arm and the multiple second motion modules of the obstacle robotic arm belong are determined respectively.
[0151] Create a first collision module for each first motion module, and create a second collision module for each second motion module.
[0152] Collision detection is performed on the first and second collision modules, which are located in the same layer space, to obtain the collision detection results of the working robot arm and the obstacle robot arm.
[0153] In one embodiment, when a computer program is executed by a processor to create a first collision module corresponding to each first motion module and a second collision module corresponding to each second motion module, the following steps are specifically implemented: creating a first collision module corresponding to each first motion module based on the type, origin offset data, and projection information of each first motion module; and creating a second collision module corresponding to each second motion module based on the type, origin offset data, and projection information of each second motion module; wherein the type of the motion module represents the motion characteristics of the motion module.
[0154] In one embodiment, the computer program executed by the processor further performs the following steps: determining the type of each first motion module based on the motion characteristics of each first motion module, and acquiring the origin offset data and projection information of each first motion module; and determining the type of each second motion module based on the motion characteristics of each second motion module, and acquiring the origin offset data and projection information of each second motion module.
[0155] In one embodiment, when a computer program is executed by a processor to perform collision detection on a first collision module and a second collision module located in the same hierarchical space, and to obtain collision detection results for a working robotic arm and an obstacle robotic arm, the following steps are specifically implemented: For the first collision module and the second collision module in the same hierarchical space, the first projection information corresponding to the first collision module and the first endpoint coordinates of the bounding box of the first collision module are determined, as well as the second projection information corresponding to the second collision module and the second endpoint coordinates of the bounding box of the second collision module; Based on the first projection information, the first endpoint coordinates, the second projection information, and the second endpoint coordinates, collision detection is performed on the first collision module and the second collision module in the same hierarchical space to obtain collision detection results for a working robotic arm and an obstacle robotic arm.
[0156] In one embodiment, the first endpoint coordinates include a first abscissa and a first ordinate, and the second endpoint coordinates include a second abscissa and a second ordinate. When a computer program is executed by a processor to perform collision detection on a first collision module and a second collision module in the same layered space based on first projection information, first endpoint coordinates, second projection information, and second endpoint coordinates, and to obtain the collision detection results of the working robot arm and the obstacle robot arm, the following steps are specifically implemented: determining the length and width of the first collision module based on the first projection information, and determining the length and width of the second collision module based on the second projection information; and determining that the working robot arm and the obstacle robot arm will collide when it is determined that the first abscissa is less than the sum of the second abscissa and the width of the second collision module, and the sum of the first abscissa and the width of the first collision module is less than the second abscissa, and the first ordinate is less than the sum of the second ordinate and the length of the second collision module, and the sum of the first ordinate and the length of the first collision module is less than the second ordinate.
[0157] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: when the collision detection result indicates that the working robot arm and the obstacle robot arm will collide, it determines the undetermined safe position of the obstacle robot arm based on the movement direction and working range of the working robot arm in the world coordinate system; it performs a depth-first position search from the undetermined safe position to the avoidance direction of the avoidance area to obtain the target safe position; and it controls the obstacle robot arm to move to the target safe position.
[0158] In one embodiment, when a computer program is executed by a processor to perform a depth-first location search from a pending safe position to an avoidance area to obtain a target safe position, the following steps are specifically implemented: At the pending safe position, collision detection is performed on the working robot arm and the obstacle robot arm to obtain the collision detection result corresponding to the pending safe position; if the collision detection result indicates that the working robot arm and the obstacle robot arm will not collide at the pending safe position, the pending safe position is taken as the target safe position; if the collision detection result indicates that the working robot arm and the obstacle robot arm will collide at the pending safe position, the position traversal is performed along the avoidance direction of the avoidance area until a position where the working robot arm and the obstacle robot arm will not collide is found or the end point of the avoidance area is reached, and the position where the working robot arm and the obstacle robot arm will not collide or the end point of the avoidance area is taken as the target safe position.
[0159] In one exemplary embodiment, this application provides a computer program product including a computer program that, when executed by a processor, performs the following steps:
[0160] The motion space where the working robotic arm and the obstacle robotic arm may collide is divided into layers to obtain the layered result;
[0161] Based on the hierarchical results, the hierarchical spaces to which the multiple first motion modules of the working robotic arm and the multiple second motion modules of the obstacle robotic arm belong are determined respectively.
[0162] Create a first collision module for each first motion module, and create a second collision module for each second motion module.
[0163] Collision detection is performed on the first and second collision modules, which are located in the same layer space, to obtain the collision detection results of the working robot arm and the obstacle robot arm.
[0164] In one embodiment, when a computer program is executed by a processor to create a first collision module corresponding to each first motion module and a second collision module corresponding to each second motion module, the following steps are specifically implemented: creating a first collision module corresponding to each first motion module based on the type, origin offset data, and projection information of each first motion module; and creating a second collision module corresponding to each second motion module based on the type, origin offset data, and projection information of each second motion module; wherein the type of the motion module represents the motion characteristics of the motion module.
[0165] In one embodiment, the computer program executed by the processor further performs the following steps: determining the type of each first motion module based on the motion characteristics of each first motion module, and acquiring the origin offset data and projection information of each first motion module; and determining the type of each second motion module based on the motion characteristics of each second motion module, and acquiring the origin offset data and projection information of each second motion module.
[0166] In one embodiment, when a computer program is executed by a processor to perform collision detection on a first collision module and a second collision module located in the same hierarchical space, and to obtain collision detection results for a working robotic arm and an obstacle robotic arm, the following steps are specifically implemented: For the first collision module and the second collision module in the same hierarchical space, the first projection information corresponding to the first collision module and the first endpoint coordinates of the bounding box of the first collision module are determined, as well as the second projection information corresponding to the second collision module and the second endpoint coordinates of the bounding box of the second collision module; Based on the first projection information, the first endpoint coordinates, the second projection information, and the second endpoint coordinates, collision detection is performed on the first collision module and the second collision module in the same hierarchical space to obtain collision detection results for a working robotic arm and an obstacle robotic arm.
[0167] In one embodiment, the first endpoint coordinates include a first abscissa and a first ordinate, and the second endpoint coordinates include a second abscissa and a second ordinate. When a computer program is executed by a processor to perform collision detection on a first collision module and a second collision module in the same layered space based on first projection information, first endpoint coordinates, second projection information, and second endpoint coordinates, and to obtain the collision detection results of the working robot arm and the obstacle robot arm, the following steps are specifically implemented: determining the length and width of the first collision module based on the first projection information, and determining the length and width of the second collision module based on the second projection information; and determining that the working robot arm and the obstacle robot arm will collide when it is determined that the first abscissa is less than the sum of the second abscissa and the width of the second collision module, and the sum of the first abscissa and the width of the first collision module is less than the second abscissa, and the first ordinate is less than the sum of the second ordinate and the length of the second collision module, and the sum of the first ordinate and the length of the first collision module is less than the second ordinate.
[0168] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: when the collision detection result indicates that the working robot arm and the obstacle robot arm will collide, it determines the undetermined safe position of the obstacle robot arm based on the movement direction and working range of the working robot arm in the world coordinate system; it performs a depth-first position search from the undetermined safe position to the avoidance direction of the avoidance area to obtain the target safe position; and it controls the obstacle robot arm to move to the target safe position.
[0169] In one embodiment, when a computer program is executed by a processor to perform a depth-first location search from a pending safe position to an avoidance area to obtain a target safe position, the following steps are specifically implemented: At the pending safe position, collision detection is performed on the working robot arm and the obstacle robot arm to obtain the collision detection result corresponding to the pending safe position; if the collision detection result indicates that the working robot arm and the obstacle robot arm will not collide at the pending safe position, the pending safe position is taken as the target safe position; if the collision detection result indicates that the working robot arm and the obstacle robot arm will collide at the pending safe position, the position traversal is performed along the avoidance direction of the avoidance area until a position where the working robot arm and the obstacle robot arm will not collide is found or the end point of the avoidance area is reached, and the position where the working robot arm and the obstacle robot arm will not collide or the end point of the avoidance area is taken as the target safe position.
[0170] It should be noted that the data involved in this application (including but not limited to the motion type of the motion module, origin offset data, and projection information, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0171] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0172] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0173] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A collision detection method for a robotic arm, characterized in that, The method includes: The motion space where the working robotic arm and the obstacle robotic arm may collide is divided into layers to obtain the layered result; Based on the layering results, the layering spaces to which the multiple first motion modules of the working robotic arm and the multiple second motion modules of the obstacle robotic arm belong are determined respectively. Create a first collision module for each of the first motion modules, and create a second collision module for each of the second motion modules. Collision detection is performed on the first collision module and the second collision module, which are in the same layer space, to obtain the collision detection results of the working robot arm and the obstacle robot arm.
2. The method according to claim 1, characterized in that, Create a first collision module for each of the first motion modules, and create a second collision module for each of the second motion modules, including: Based on the type, origin offset data, and projection information of each first motion module, a first collision module corresponding to that first motion module is created; and, Based on the type, origin offset data and projection information of each second motion module, a second collision module corresponding to the second motion module is created. The type of motion module indicates the motion characteristics of that motion module.
3. The method according to claim 2, characterized in that, The method further includes: Based on the motion characteristics of each first motion module, the type of each first motion module is determined, and the origin offset data and projection information of each first motion module are obtained; and, Based on the motion characteristics of each second motion module, the type of each second motion module is determined, and the origin offset data and projection information of each second motion module are obtained.
4. The method according to claim 1, characterized in that, The collision detection of the first and second collision modules, which are located in the same layered space, to obtain the collision detection results of the working robotic arm and the obstacle robotic arm includes: For the first collision module and the second collision module in the same hierarchical space, the first projection information corresponding to the first collision module and the first endpoint coordinates of the bounding box of the first collision module are determined respectively, as well as the second projection information corresponding to the second collision module and the second endpoint coordinates of the bounding box of the second collision module. Based on the first projection information, the first endpoint coordinates, the second projection information, and the second endpoint coordinates, collision detection is performed on the first collision module and the second collision module in the same layered space to obtain the collision detection results of the working robot arm and the obstacle robot arm.
5. The method according to claim 4, characterized in that, The first endpoint coordinates include a first abscissa and a first ordinate, and the second endpoint coordinates include a second abscissa and a second ordinate; the step of performing collision detection on the first collision module and the second collision module in the same hierarchical space based on the first projection information, the first endpoint coordinates, the second projection information, and the second endpoint coordinates to obtain the collision detection results of the working robotic arm and the obstacle robotic arm includes: Based on the first projection information, the length and width of the first collision module are determined, and based on the second projection information, the length and width of the second collision module are determined. If the first horizontal coordinate is less than the sum of the second horizontal coordinate and the width of the second collision module, and the sum of the first horizontal coordinate and the width of the first collision module is less than the second horizontal coordinate, and the first vertical coordinate is less than the sum of the second vertical coordinate and the length of the second collision module, and the sum of the first vertical coordinate and the length of the first collision module is less than the second vertical coordinate, then it is determined that the working robot arm and the obstacle robot arm will collide.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: If the collision detection result indicates that the working robot arm and the obstacle robot arm will collide, the undetermined safe position of the obstacle robot arm is determined based on the movement direction and working range of the working robot arm in the world coordinate system. A depth-first location search is performed from the undetermined safe location to the avoidance direction of the avoidance area to obtain the target safe location; Control the obstacle robotic arm to move to the target safe position.
7. The method according to claim 6, characterized in that, The process of performing a depth-first location search from the undetermined safe location to the avoidance area in the avoidance direction to obtain the target safe location includes: At the undetermined safe position, collision detection is performed on the working robotic arm and the obstacle robotic arm to obtain the collision detection result corresponding to the undetermined safe position; If the collision detection result corresponding to the undetermined safe position indicates that the working robot arm and the obstacle robot arm will not collide at the undetermined safe position, the undetermined safe position will be taken as the target safe position. If the collision detection result corresponding to the undetermined safe position indicates that the working robot arm and the obstacle robot arm will collide at the undetermined safe position, the position traversal of the avoidance direction of the avoidance area is performed until a position where the working robot arm and the obstacle robot arm will not collide is found or the end point of the avoidance area is reached. The position where the working robot arm and the obstacle robot arm will not collide or the end point of the avoidance area is taken as the target safe position.
8. A collision detection device for a robotic arm, characterized in that, The device includes: The processing module is used to divide the motion space where the working robotic arm and the obstacle robotic arm may collide into layers, and obtain the layering results; A determining module is used to determine, based on the layering results, the layering spaces to which the plurality of first motion modules of the working robotic arm and the plurality of second motion modules of the obstacle robotic arm belong respectively; A creation module is used to create a first collision module corresponding to each of the first motion modules, and to create a second collision module corresponding to each of the second motion modules. The detection module is used to perform collision detection on the first collision module and the second collision module, which are in the same layer space, to obtain the collision detection results of the working robot arm and the obstacle robot arm.
9. A computer device, characterized in that, The method includes a memory for execution and a processor, the memory storing a computer program, and the processor executing the steps of the method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.