Robot anti-collision method and device and robot control system
By building a bounding box in robot path planning and applying the separation axis theorem to detect collisions, the problems of high collision cost and low reliability of three-dimensional vision technology are solved, and a more economical and reliable anti-collision effect is achieved.
Patent Information
- Application Number
- CN202411763935.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-12-03
AI Technical Summary
In the prior art, the cost of anti-collision through three-dimensional vision technology is high, and the existence of blind spots in the three-dimensional vision sensor leads to low reliability in anti-collision.
By establishing the workpiece coordinate system, building the robot's workspace, and calculating the bounding box of the joint link and tool, the separation axis theorem is used to determine whether the bounding box has collided. If a collision occurs, the collision will be avoided during path planning.
There is no need to use three-dimensional vision technology, which reduces anti-collision costs and avoids the low reliability problems caused by blind spots of three-dimensional vision sensors.
Smart Images

Figure CN119610094A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of robot path planning, and in particular to a robot anti-collision method, device, computer program product and robot control system. Background Art
[0002] With the reduction of labor costs and the development of robotics and computer vision technology, the proportion of robots used in the production process will become higher and higher. Daily needs are no longer simply grabbing workpieces on conveyor belts. There are more and more deep frame grabbing projects. What's more, there will be some workpiece grabbing needs in relatively narrow spaces. The robot's degree of freedom in this scenario is not very large, which requires the robot to have obstacle avoidance and trajectory planning functions. The existing collision detection algorithm is developed using 3D vision, the system cost is high, the collision detection range is limited by the sensor's field of view, the algorithm has a large amount of data processing and high requirements on the hardware system, which is not conducive to rapid deployment. Summary of the invention
[0003] The main purpose of the present application is to provide a robot anti-collision method, device, computer program product and robot control system to at least solve the problem of high cost of anti-collision through three-dimensional vision technology in the prior art.
[0004] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a robot collision avoidance method is provided, comprising: establishing a workpiece coordinate system, and constructing a robot workspace in the workpiece coordinate system; obtaining a first posture of the tool end of the robot moving to the target point of the robot workspace; calculating a second posture according to the first posture and a first coordinate system transformation matrix, the second posture being the posture of the tool end in the robot base coordinate system, the first coordinate system transformation matrix being a matrix for coordinate conversion between the workpiece coordinate system and the robot base coordinate system; calculating a bounding box of each joint link and the tool of the robot in the robot base coordinate system according to the second posture, and obtaining a plurality of base coordinate bounding boxes, the bounding box being the minimum rectangular block that wraps a joint component, the joint component including the joint link and the tool; and using the separating axis theorem to determine whether a collision occurs between the joint components corresponding to a plurality of base coordinate bounding boxes.
[0005] Optionally, the bounding boxes of each of the joint links and the tool of the robot in the base coordinate system of the robot are calculated according to the second posture to obtain multiple base coordinate bounding boxes, including: obtaining the joint angle of each joint by inverse kinematics calculation according to the second posture; establishing the first joint link bounding box of each joint link according to the size of each joint link of the robot, the first joint link bounding box being the bounding box of the joint link in the joint coordinate system corresponding to the joint link; and obtaining the base coordinate bounding box of each joint link according to the joint angle of each joint and the first joint link bounding box.
[0006] Optionally, the bounding boxes of each of the joint links and the tool of the robot in the robot base coordinate system are calculated according to the second posture to obtain multiple base coordinate bounding boxes, including: obtaining a posture change matrix, the posture change matrix is a transformation matrix from the posture of the tool end to the posture of the tool coordinate system, and the tool coordinate system is a coordinate system with the tool center point as the origin; the second coordinate system transformation matrix is calculated according to the posture change matrix and the first coordinate system transformation matrix, the second coordinate system transformation matrix is a matrix for coordinate conversion between the tool coordinate system and the robot base coordinate system; the second joint link bounding box of each of the tools is established according to the size of the tool, the second joint link bounding box is the bounding box of the tool in the tool coordinate system; the base coordinate bounding box of each of the tools is calculated according to the second coordinate system transformation matrix and the second joint link bounding box.
[0007] Optionally, the separating axis theorem is used to determine whether a collision occurs between the joint parts corresponding to multiple base coordinate bounding boxes, including: obtaining a first base coordinate bounding box and a second base coordinate bounding box, the first base coordinate bounding box and the second base coordinate bounding box being any two base coordinate bounding boxes; calculating the normal vectors of each face of the first base coordinate bounding box and the normal vectors of each face of the second base coordinate bounding box to obtain multiple first normal vectors; calculating the normal vectors of all edge combinations to obtain multiple second normal vectors, the edge combination including an edge of the first base coordinate bounding box and an edge of the second base coordinate bounding box; calculating the projection points of all vertices of the first base coordinate bounding box on the first normal vector to obtain the projection of each edge of the first base coordinate bounding box on the first normal vector, calculating the projection points of all vertices of the second base coordinate bounding box on the first normal vector to obtain the projection of each edge of the second base coordinate bounding box on the first normal vector, calculating the projection points of all vertices of the first base coordinate bounding box on the second normal vector to obtain the projection of each edge of the first base coordinate bounding box on the second normal vector Projection, calculate the projection points of all vertices of the second base coordinate bounding box on the second normal vector, and obtain the projections of each edge of the second base coordinate bounding box on the second normal vector; when the projection of any edge of the first base coordinate bounding box on the first normal vector does not overlap with the projection of any edge of the second base coordinate bounding box on the first normal vector, determine that the first base coordinate bounding box and the second base coordinate bounding box do not overlap on the first normal vector; when the projection of any edge of the first base coordinate bounding box on the second normal vector does not overlap with the projection of any edge of the second base coordinate bounding box on the second normal vector, determine that the first base coordinate bounding box and the second base coordinate bounding box do not overlap on the second normal vector; when the first base coordinate bounding box and the second base coordinate bounding box do not overlap on all the first normal vectors and the first base coordinate bounding box and the second base coordinate bounding box do not overlap on all the second normal vectors, determine that the joint component corresponding to the first base coordinate bounding box and the joint component corresponding to the second base coordinate bounding box do not collide.
[0008] Optionally, after using the separating axis theorem to determine whether a collision occurs between the joint parts corresponding to a plurality of base coordinate bounding boxes, the method further comprises: when it is determined that any two base coordinate bounding boxes collide, marking the target point as an unreachable point.
[0009] Optionally, a workpiece coordinate system is established, and a robot workspace is constructed under the workpiece coordinate system, including: controlling the tool center of the robot to move to the first point, the second point and the third point of the work plane in sequence to obtain a first coordinate, a second coordinate and a third coordinate, wherein the first coordinate is the coordinate of the tool center in the robot base coordinate system when the tool center is located at the first point, the second coordinate is the coordinate of the tool center in the robot base coordinate system when the tool center is located at the second point, and the third coordinate is the coordinate of the tool center in the robot base coordinate system when the tool center is located at the third point, and the first point, the second point and the third point are not collinear; calculating a first plane vector according to the first coordinate and the second coordinate, and calculating a second plane vector according to the first coordinate and the third coordinate; calculating three unit orthogonal bases according to the first plane vector and the second plane vector; establishing the workpiece coordinate system according to the three unit orthogonal bases; and constructing the robot workspace in the workpiece coordinate system according to the length, width and height of the workspace.
[0010] Optionally, before calculating the second posture according to the first posture and the first coordinate system transformation matrix, the method further includes: calculating the first coordinate system transformation matrix according to the three unit orthogonal bases and the unit orthogonal base of the robot base coordinate system.
[0011] According to another aspect of the present application, a robot anti-collision device is provided, comprising: an establishing unit, used to establish a workpiece coordinate system and construct a robot workspace in the workpiece coordinate system; an acquiring unit, used to acquire a first posture of the tool end of the robot moving to a target point in the robot workspace; a first calculating unit, used to calculate a second posture according to the first posture and a first coordinate system transformation matrix, the second posture being the posture of the tool end in the robot base coordinate system, the first coordinate system transformation matrix being a matrix for coordinate conversion between the workpiece coordinate system and the robot base coordinate system; a second calculating unit, used to calculate the bounding boxes of each joint link and the tool of the robot in the robot base coordinate system according to the second posture, to obtain a plurality of base coordinate bounding boxes; a determining unit, used to determine whether a plurality of base coordinate bounding boxes collide by using the separating axis theorem.
[0012] According to another aspect of the present application, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, any one of the methods described above is implemented.
[0013] According to another aspect of the present application, a robot control system is provided, comprising: a robot, one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of the described methods.
[0014] By applying the technical solution of the present application, in the above robot anti-collision method, when the tool end of the robot moves to the target point of the robot workspace, by constructing the bounding box of the joint link and the robot's tool, and converting all the bounding boxes to the robot base coordinate system through coordinate conversion, multiple base coordinate bounding boxes are obtained, and the separating axis theorem can be used to determine whether the multiple base coordinate bounding boxes collide. If a collision occurs, it indicates that the movement of the tool end of the robot to the target point of the robot workspace will cause a collision between the joint link and the robot's tool, so that the collision can be avoided during path planning, and there is no need to use three-dimensional vision technology to prevent collision, which greatly reduces the cost and solves the problem of high cost of anti-collision through three-dimensional vision technology in the prior art. It also avoids the problem of low reliability of anti-collision due to the blind spots of three-dimensional vision sensors. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A hardware structure block diagram of a mobile terminal for executing a robot anti-collision method provided in an embodiment of the present application is shown;
[0016] Figure 2 A schematic diagram of a process flow of a robot anti-collision method provided according to an embodiment of the present application is shown;
[0017] Figure 3 A schematic diagram of a tool coordinate system, a joint coordinate system and a robot base coordinate system provided according to an embodiment of the present application is shown;
[0018] Figure 4 A schematic diagram of a workpiece coordinate system provided according to an embodiment of the present application is shown;
[0019] Figure 5 A structural block diagram of a robot anti-collision device provided according to an embodiment of the present application is shown.
[0020] The above drawings include the following reference numerals:
[0021] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION
[0022] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] As introduced in the background technology, the cost of collision avoidance through three-dimensional vision technology in the prior art is high. To solve this technical problem, the embodiments of the present application provide a robot collision avoidance method, device, computer program product and robot control system.
[0026] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0027] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a robot anti-collision method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0028] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the robot anti-collision method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific examples of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0029] In this embodiment, a robot collision avoidance method running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0030] Figure 2 FIG. 1 is a flow chart of a robot anti-collision method according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0031] Step S201, establishing a workpiece coordinate system, and constructing a robot workspace under the workpiece coordinate system;
[0032] Step S202, obtaining a first position of the tool end of the robot moving to a target point in the robot workspace;
[0033] Step S203, calculating a second posture according to the first posture and the first coordinate system transformation matrix, wherein the second posture is the posture of the tool end in the robot base coordinate system, and the first coordinate system transformation matrix is a matrix for coordinate conversion between the workpiece coordinate system and the robot base coordinate system;
[0034] Step S204, calculating the bounding boxes of each joint link and the tool of the robot in the robot base coordinate system according to the second posture, and obtaining a plurality of base coordinate bounding boxes, wherein the bounding boxes are the smallest cuboids enclosing the joint parts, and the joint parts include the joint links and the tools;
[0035] Step S205 , using the separating axis theorem to determine whether the joint components corresponding to the plurality of base coordinate bounding boxes collide with each other.
[0036] In the above robot anti-collision method, when the tool end of the robot moves to the target point in the robot workspace, a bounding box of the joint link and the robot's tool is constructed, and all bounding boxes are converted to the robot base coordinate system through coordinate conversion to obtain multiple base coordinate bounding boxes. The separating axis theorem can be used to determine whether the multiple base coordinate bounding boxes collide. If a collision occurs, it indicates that the movement of the tool end of the robot to the target point in the robot workspace will cause a collision between the joint link and the robot's tool, so the collision can be avoided during path planning. There is no need to use three-dimensional vision technology to prevent collisions, which greatly reduces costs and solves the problem of high cost of collision prevention using three-dimensional vision technology in the prior art. It also avoids the problem of low reliability of collision prevention caused by blind spots of three-dimensional vision sensors.
[0037] In order to facilitate the simulation of the joint link, in an optional implementation method, the above step S204 includes:
[0038] Step S2041, obtaining the joint angles of the above joints by using inverse kinematics calculation according to the above second posture;
[0039] Step S2042, establishing a first joint link bounding box of each joint link according to the size of each joint link of the robot, wherein the first joint link bounding box is a bounding box of the joint link in the joint coordinate system corresponding to the joint link;
[0040] Step S2043, calculating the base coordinate bounding box of each of the joint links according to the joint angles of each joint and the bounding boxes of each of the first joint links.
[0041] In the above implementation method, if Figure 3As shown, the rotation direction and size of the robot joints are obtained through the posture matrix and MDH parameter robot inverse kinematics solution. For a six-degree-of-freedom general robot, the values of the joint angles θ1~θ6 are obtained, and the coordinate system of each joint is established through forward kinematics. It is known that a represents the connecting rod length and d represents the connecting rod offset in the MDH parameters. Therefore, the circumscribed bounding box of the connecting rod in each joint coordinate system can be established, that is, the first joint connecting rod bounding box. The above-mentioned base coordinate bounding box of each joint connecting rod is calculated according to the joint angles of each joint and the above-mentioned first joint connecting rod bounding boxes.
[0042] In order to facilitate the simulation of the robot tool, in an optional implementation method, the above step S204 also includes:
[0043] Step S2044, obtaining a posture change matrix, wherein the posture change matrix is a transformation matrix from the posture of the tool end to the posture of the tool coordinate system, wherein the tool coordinate system is a coordinate system with the tool center point as the origin;
[0044] Step S2045, calculating a second coordinate system transformation matrix according to the posture change matrix and the first coordinate system transformation matrix, wherein the second coordinate system transformation matrix is a matrix for coordinate conversion between the tool coordinate system and the robot base coordinate system;
[0045] Step S2046, establishing a second joint link bounding box of each of the tools according to the size of the tools, wherein the second joint link bounding box is a bounding box of the tool in the tool coordinate system;
[0046] Step S2047, calculating the base coordinate bounding box of each of the above tools according to the above second coordinate system transformation matrix and the above second joint link bounding box.
[0047] In the above implementation method, if Figure 3 As shown, the dimensions of the measuring tool are [T a , T b , T c ], the eight corner points of the tool external bounding box (the second joint link bounding box) are expressed in the tool coordinate system as follows: Pc1 = [Ta / 2, T b / 2,0],Pc2=[-T a / 2,T b / 2,0],Pc3=[T a / 2, -T b / 2,0],Pc4=[-T a / 2, -T b / 2,0],Pc5=[Ta / 2,T b / 2,T c ],Pc6=[-T a / 2,Tb / 2,T c ],Pc7=[T a / 2, -T b / 2,T c ], Pc8 = [-T a / 2, -T b / 2,T c ], the rotation relationship R1 is obtained through the coordinate system conversion formula, the translation relationship O1 is the vector from point Ot to the origin, and the coordinate system transformation matrix is: [R, t] = [R1, O1], from which it can be known that the position of the robot tool center in the workpiece coordinate system is: [x n ,y n , z n ] T =[R, t] -1 [x b ,y b , z b ] T , where [x b ,y b , z b ] is the position of the robot tool center expressed in the base coordinate system, [x n ,y n , z n ] is the representation of the position in the workpiece coordinate system, and the target position of the robot tool is known: Among them, n x , n y , n z , o x , o y , o z , a x , a y , a z is the rotation matrix parameter, p x , p y , p z is a translation parameter used to describe the rotation and translation of the tool target pose expressed in the base coordinate system; and Ttar = Ttcp Ttool, where Ttcp is the pose of the tool center when the tool reaches the target position, and Ttool is the pose transformation matrix from the tool end to the tool center, then Ttcp = Ttar Ttool -1 , Pn=Ttcp·Pc, where Pn is the corner point of the circumscribed bounding box expressed in the base coordinate system, and Pc is the set of eight corner points (Pc1-Pc8) expressed in the TCP coordinate system.
[0048] In order to determine whether there is a collision, in an optional implementation method, the above step S205 includes:
[0049] Step S2051, obtaining a first base coordinate bounding box and a second base coordinate bounding box, wherein the first base coordinate bounding box and the second base coordinate bounding box are any two of the base coordinate bounding boxes;
[0050] Step S2052, calculating the normal vector of each face of the first base coordinate bounding box and the normal vector of each face of the second base coordinate bounding box to obtain a plurality of first normal vectors;
[0051] Step S2053, calculating normal vectors of all edge combinations to obtain multiple second normal vectors, wherein the edge combination includes an edge of the first base coordinate bounding box and an edge of the second base coordinate bounding box;
[0052] Step S2054, calculate the projection points of all vertices of the first base coordinate bounding box on the first normal vector, obtain the projections of each side of the first base coordinate bounding box on the first normal vector, calculate the projection points of all vertices of the second base coordinate bounding box on the first normal vector, obtain the projections of each side of the second base coordinate bounding box on the first normal vector, calculate the projection points of all vertices of the first base coordinate bounding box on the second normal vector, obtain the projections of each side of the first base coordinate bounding box on the second normal vector, calculate the projection points of all vertices of the second base coordinate bounding box on the second normal vector, obtain the projections of each side of the second base coordinate bounding box on the second normal vector;
[0053] Step S2055, when the projection of any edge of the first base coordinate bounding box on the first normal vector does not overlap with the projection of any edge of the second base coordinate bounding box on the first normal vector, determine that the first base coordinate bounding box and the second base coordinate bounding box do not overlap on the first normal vector; when the projection of any edge of the first base coordinate bounding box on the second normal vector does not overlap with the projection of any edge of the second base coordinate bounding box on the second normal vector, determine that the first base coordinate bounding box and the second base coordinate bounding box do not overlap on the second normal vector;
[0054] Step S2056, when the first base coordinate bounding box and the second base coordinate bounding box do not overlap on all the first normal vectors and the first base coordinate bounding box and the second base coordinate bounding box do not overlap on all the second normal vectors, determine that the joint component corresponding to the first base coordinate bounding box and the joint component corresponding to the second base coordinate bounding box do not collide.
[0055] In the above implementation method, the normal vectors of each face of the two cuboids are calculated respectively, and the normal vectors of the edges of A and B are calculated; for each face of cuboid A, its normal vector can be obtained by the cross product of the two edges on the face: nA = adge1×edge2, for each edge e of the cuboid A and the cube B a , e b , the normal vector can be calculated as: n AB =e a ×e b , for cuboids A and B, calculate the number of vertices in n A and n AB If the projections on the scene do not overlap, then A and B do not overlap. The separating axis theorem can be used to determine the relationship between the bounding boxes of each link of the entity and the bounding box of the scene. If it is determined that none of them intersect, it is considered that there will be no collision, otherwise it is considered that there will be a collision.
[0056] In order to prevent collision, in an optional implementation method, after using the separating axis theorem to determine whether the joint components corresponding to the plurality of base coordinate bounding boxes collide with each other, the method further includes:
[0057] Step S301: When it is determined that any two of the base coordinate bounding boxes collide, the target point is marked as an unreachable point.
[0058] In the above implementation method, if any two of the above base coordinate bounding boxes collide, it indicates that a collision will occur under the target point. In this case, the above target point is marked as an unreachable point, and all the unreachable points in the workspace are found to avoid the collision, or the collision is avoided by judging whether the target point is an unreachable point each time it moves.
[0059] In order to establish the workpiece coordinate system, in an optional implementation method, the above step S201 includes:
[0060] Step S2011, controlling the tool center of the robot to move to the first point, the second point and the third point of the working plane in sequence, obtaining a first coordinate, a second coordinate and a third coordinate, wherein the first coordinate is the coordinate of the tool center in the robot base coordinate system when the tool center is located at the first point, the second coordinate is the coordinate of the tool center in the robot base coordinate system when the tool center is located at the second point, and the third coordinate is the coordinate of the tool center in the robot base coordinate system when the tool center is located at the third point, and the first point, the second point and the third point are not collinear;
[0061] Step S2012, calculating a first plane vector according to the first coordinate and the second coordinate, and calculating a second plane vector according to the first coordinate and the third coordinate;
[0062] Step S2013, obtaining three unit orthogonal bases by calculation according to the first plane vector and the second plane vector;
[0063] Step S2014, establishing the workpiece coordinate system according to the three unit orthogonal bases;
[0064] Step S2015, constructing the robot workspace in the workpiece coordinate system according to the length, width and height of the workspace.
[0065] In the above implementation method, the robot workspace is constructed by using the robot trial teaching method. Assuming that the working plane required by the robot is xoy, Figure 4 As shown in (shaded plane), move the robot TCP to points Ot, p1, and p2 respectively and record the positions, where Ot is any corner point on the working plane, and p1 and p2 are any points on the edges adjacent to this corner point, such as Figure 4 As shown, further, taking Ot as the origin of the coordinate system, two direction vectors A1 and A2 with Ot as the common point are obtained by calculating the formula: A1 = p1-Ot, A2 = p2-Ot; further, a set of unit orthogonal bases with Ot as the origin is established, such as Figure 4 As shown, the calculation formula is: in, is a set of unit orthogonal bases based on the robot base coordinate system, such as Figure 3 As shown, the reference coordinate system of the robot's workspace has been established. The length, width and height of the robot's workspace are confirmed to be (a, b, d). Ot is the origin of the coordinate system. A cubic workspace with length, width and height (a, b, d) is established for the reference coordinate system.
[0066] In order to calculate the transformation matrix, in an optional implementation method, before calculating the second posture according to the first posture and the first coordinate system transformation matrix, the method further includes:
[0067] Step S401, calculating the first coordinate system transformation matrix according to the three unit orthogonal bases and the unit orthogonal base of the robot base coordinate system.
[0068] In the above implementation method, a set of unit orthogonal bases of the robot base coordinate system is known to be: e1 = (0, 0, 1), e2 = (0, 1, 0), e3 = (1, 0, 0), and the rotation relationship R1 is obtained by the coordinate system conversion formula. The translation relationship O1 is the vector from point Ot to the origin. The first coordinate system transformation matrix is: [R, t] = [R1, O1]. It can be known that the position of the robot tool center in the workpiece coordinate system is: [x n ,y n , z n ] T =[R, t] -1 [x b ,y b , z b ]T , where [x b ,y b , z b ] is the position of the robot tool center expressed in the base coordinate system, [x n ,y n , z n ] is the representation of this position in the workpiece coordinate system.
[0069] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0070] The embodiment of the present application also provides a robot anti-collision device. It should be noted that the robot anti-collision device of the embodiment of the present application can be used to execute the robot anti-collision method provided by the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0071] The following is an introduction to the robot anti-collision device provided in an embodiment of the present application.
[0072] Figure 5 is a structural block diagram of a robot anti-collision device according to an embodiment of the present application. Figure 5 As shown, the device comprises:
[0073] An establishing unit 10 is used to establish a workpiece coordinate system and construct a robot workspace under the workpiece coordinate system;
[0074] An acquisition unit 20 is used to acquire a first posture of the tool end of the robot moving to a target point in the robot workspace;
[0075] A first calculation unit 30 is used to calculate a second posture according to the first posture and the first coordinate system transformation matrix, wherein the second posture is the posture of the tool end in the robot base coordinate system, and the first coordinate system transformation matrix is a matrix for coordinate conversion between the workpiece coordinate system and the robot base coordinate system;
[0076] A second calculation unit 40 is used to calculate the bounding boxes of each joint link and the tool of the robot in the robot base coordinate system according to the second posture to obtain a plurality of base coordinate bounding boxes;
[0077] The determination unit 50 is used to determine whether a plurality of the base coordinate bounding boxes collide with each other by using the separating axis theorem.
[0078] In the above robot anti-collision device, when the tool end of the robot moves to the target point of the robot workspace, by constructing the bounding box of the joint link and the robot's tool, and converting all the bounding boxes to the robot base coordinate system through coordinate conversion, multiple base coordinate bounding boxes are obtained, and the separating axis theorem can be used to determine whether the multiple base coordinate bounding boxes collide. If a collision occurs, it indicates that the movement of the tool end of the robot to the target point of the robot workspace will cause a collision between the joint link and the robot's tool, so that the collision can be avoided during path planning, and there is no need to use three-dimensional vision technology to prevent collisions, which greatly reduces the cost and solves the problem of high cost of collision prevention through three-dimensional vision technology in the prior art. It also avoids the problem of low reliability of collision prevention caused by blind spots of three-dimensional vision sensors.
[0079] In order to facilitate the simulation of the joint link, in an optional implementation method, the first calculation unit includes:
[0080] A first calculation module, used for obtaining the joint angles of the joints by inverse kinematics calculation according to the second posture;
[0081] A first establishing module is used to establish a first joint link bounding box of each of the joint links according to the size of each of the joint links of the robot, wherein the first joint link bounding box is a bounding box of the joint link in a joint coordinate system corresponding to the joint link;
[0082] The second calculation module is used to calculate the base coordinate bounding box of each of the above-mentioned joint links according to the joint angles of each joint and the bounding boxes of each of the above-mentioned first joint links.
[0083] In the above implementation method, if Figure 3 As shown, the rotation direction and size of the robot joints are obtained through the posture matrix and MDH parameter robot inverse kinematics solution. For a six-degree-of-freedom general robot, the values of the joint angles θ1~θ6 are obtained, and the coordinate system of each joint is established through forward kinematics. It is known that a represents the connecting rod length and d represents the connecting rod offset in the MDH parameters. Therefore, the circumscribed bounding box of the connecting rod in each joint coordinate system can be established, that is, the first joint connecting rod bounding box. The above-mentioned base coordinate bounding box of each joint connecting rod is calculated according to the joint angles of each joint and the above-mentioned first joint connecting rod bounding boxes.
[0084] In order to facilitate the simulation of the robot tool, in an optional implementation method, the first calculation unit further includes:
[0085] A first acquisition module is used to acquire a posture change matrix, wherein the posture change matrix is a transformation matrix from the posture of the tool end to the posture of the tool coordinate system, wherein the tool coordinate system is a coordinate system with the tool center point as the origin;
[0086] A third calculation module, used for calculating a second coordinate system transformation matrix according to the posture change matrix and the first coordinate system transformation matrix, wherein the second coordinate system transformation matrix is a matrix for coordinate conversion between the tool coordinate system and the robot base coordinate system;
[0087] A second establishing module is used to establish a second joint link bounding box of each of the above tools according to the size of the above tools, wherein the second joint link bounding box is a bounding box of the above tool in the above tool coordinate system;
[0088] The fourth calculation module is used to calculate the base coordinate bounding box of each of the above tools according to the second coordinate system transformation matrix and the second joint link bounding box.
[0089] In the above implementation method, if Figure 3 As shown, the dimensions of the measuring tool are [T a , T b , T c ], the eight corner points of the tool external bounding box (the second joint link bounding box) are expressed in the tool coordinate system as follows: Pc1 = [Ta / 2, T b / 2,0],Pc2=[-T a / 2,T b / 2,0],Pc3=[T a / 2, -T b / 2,0],Pc4=[-T a / 2, -T b / 2,0],Pc5=[Ta / 2,T b / 2,T c ],Pc6=[-T a / 2,T b / 2,T c ],Pc7=[T a / 2, -T b / 2,T c ], Pc8 = [-T a / 2, -T b / 2,T c ], the rotation relationship R1 is obtained through the coordinate system conversion formula, the translation relationship O1 is the vector from point Ot to the origin, and the coordinate system transformation matrix is: [R, t] = [R1, O1], from which it can be known that the position of the robot tool center in the workpiece coordinate system is: [x n ,y n , z n ]T =[R, t] -1 [x b ,y b , z b ] T , where [x b ,y b , z b ] is the position of the robot tool center expressed in the base coordinate system, [x n ,y n , z n ] is the representation of the position in the workpiece coordinate system, and the target position of the robot tool is known: Among them, n x , n y , n z , o x , o y , o z , a x , a y , a z is the rotation matrix parameter, p x , p y , p z is a translation parameter used to describe the rotation and translation of the tool target pose expressed in the base coordinate system; and Ttar = Ttcp Ttool, where Ttcp is the pose of the tool center when the tool reaches the target position, and Ttool is the pose transformation matrix from the tool end to the tool center, then Ttcp = Ttar Ttool -1 , Pn = Ttcp·Pc, where Pn is the corner point of the circumscribed bounding box expressed in the base coordinate system, and Pc is the set of eight corner points (Pc1-Pc8) expressed in the TCP coordinate system.
[0090] In order to determine whether there is a collision, in an optional implementation method, the above-mentioned determination unit includes:
[0091] A second acquisition module is used to acquire a first base coordinate bounding box and a second base coordinate bounding box, where the first base coordinate bounding box and the second base coordinate bounding box are any two of the base coordinate bounding boxes;
[0092] A fifth calculation module, used to calculate the normal vectors of each face of the first base coordinate bounding box and the normal vectors of each face of the second base coordinate bounding box to obtain a plurality of first normal vectors;
[0093] a sixth calculation module, configured to calculate normal vectors of all edge combinations to obtain a plurality of second normal vectors, wherein the edge combination includes an edge of the first base coordinate bounding box and an edge of the second base coordinate bounding box;
[0094] A seventh calculation module, used for calculating the projection points of all vertices of the first base coordinate bounding box on the first normal vector, obtaining the projections of each side of the first base coordinate bounding box on the first normal vector, calculating the projection points of all vertices of the second base coordinate bounding box on the first normal vector, obtaining the projections of each side of the second base coordinate bounding box on the first normal vector, calculating the projection points of all vertices of the first base coordinate bounding box on the second normal vector, obtaining the projections of each side of the first base coordinate bounding box on the second normal vector, calculating the projection points of all vertices of the second base coordinate bounding box on the second normal vector, obtaining the projections of each side of the second base coordinate bounding box on the second normal vector;
[0095] A first determination module is used to determine that the first base coordinate bounding box and the second base coordinate bounding box do not overlap on the first normal vector if the projection of any edge of the first base coordinate bounding box on the first normal vector does not overlap with the projection of any edge of the second base coordinate bounding box on the first normal vector, and to determine that the first base coordinate bounding box and the second base coordinate bounding box do not overlap on the second normal vector if the projection of any edge of the first base coordinate bounding box on the second normal vector does not overlap with the projection of any edge of the second base coordinate bounding box on the second normal vector;
[0096] The second determination module is used to determine that the joint component corresponding to the first base coordinate bounding box and the joint component corresponding to the second base coordinate bounding box do not collide when the first base coordinate bounding box and the second base coordinate bounding box do not overlap on all the first normal vectors and the first base coordinate bounding box and the second base coordinate bounding box do not overlap on all the second normal vectors.
[0097] In the above implementation method, the normal vectors of each face of the two cuboids are calculated respectively, and the normal vectors of the edges of A and B are calculated; for each face of cuboid A, its normal vector can be obtained by the cross product of the two edges on the face: n A = adge1×edge2, for each edge e of the cuboid A and the cube B a , e b , the normal vector can be calculated as: n AB =e a ×e b , for cuboids A and B, calculate the number of vertices in n A and n AB If the projections on the scene do not overlap, then A and B do not overlap. The separating axis theorem can be used to determine the relationship between the bounding boxes of each link of the entity and the bounding box of the scene. If it is determined that none of them intersect, it is considered that there will be no collision, otherwise it is considered that there will be a collision.
[0098] In order to prevent collision, in an optional implementation method, the above device further includes:
[0099] The marking unit is used to mark the target point as an unreachable point after determining whether the joint parts corresponding to the plurality of base coordinate bounding boxes collide with each other by using the separating axis theorem and when it is determined that any two of the base coordinate bounding boxes collide with each other.
[0100] In the above implementation method, if any two of the above base coordinate bounding boxes collide, it indicates that a collision will occur under the target point. In this case, the above target point is marked as an unreachable point, and all the unreachable points in the workspace are found to avoid the collision, or the collision is avoided by judging whether the target point is an unreachable point each time it moves.
[0101] In order to establish the workpiece coordinate system, in an optional implementation method, the establishment unit includes:
[0102] a control module, for controlling the tool center of the robot to move to a first point, a second point and a third point of the working plane in sequence, to obtain a first coordinate, a second coordinate and a third coordinate, wherein the first coordinate is a coordinate of the tool center in a base coordinate system of the robot when the tool center is located at the first point, the second coordinate is a coordinate of the tool center in a base coordinate system of the robot when the tool center is located at the second point, and the third coordinate is a coordinate of the tool center in a base coordinate system of the robot when the tool center is located at the third point, and the first point, the second point and the third point are not collinear;
[0103] an eighth calculation module, configured to calculate a first plane vector according to the first coordinate and the second coordinate, and to calculate a second plane vector according to the first coordinate and the third coordinate;
[0104] A ninth calculation module, used for calculating three unit orthogonal bases according to the first plane vector and the second plane vector;
[0105] A third establishing module is used to establish the workpiece coordinate system according to the three unit orthogonal bases;
[0106] The fourth building module is used to build the robot workspace in the workpiece coordinate system according to the length, width and height of the workspace.
[0107] In the above implementation method, the robot workspace is constructed by using the robot trial teaching method. Assuming that the working plane required by the robot is xoy, Figure 4 As shown in (shaded plane), move the robot TCP to points Ot, p1, and p2 respectively and record the positions, where Ot is any corner point on the working plane, and p1 and p2 are any points on the edges adjacent to this corner point, such as Figure 4 As shown, further, taking Ot as the origin of the coordinate system, two direction vectors A1 and A2 with Ot as the common point are obtained by calculating the formula: A1 = p1-Ot, A2 = p2-Ot; further, a set of unit orthogonal bases with Ot as the origin is established, such as Figure 4 As shown, the calculation formula is: in, is a set of unit orthogonal bases based on the robot base coordinate system, such as Figure 3 As shown, the reference coordinate system of the robot's workspace has been established. The length, width and height of the robot's workspace are confirmed to be (a, b, d). Ot is the origin of the coordinate system. A cubic workspace with length, width and height (a, b, d) is established for the reference coordinate system.
[0108] In order to calculate the conversion matrix, in an optional implementation method, the above-mentioned device also includes:
[0109] The third calculation unit is used to calculate the first coordinate system transformation matrix according to the three unit orthogonal bases and the unit orthogonal base of the robot base coordinate system before calculating the second posture according to the first posture and the first coordinate system transformation matrix.
[0110] In the above implementation method, a set of unit orthogonal bases of the robot base coordinate system is known to be: e1 = (0, 0, 1), e2 = (0, 1, 0), e3 = (1, 0, 0), and the rotation relationship R1 is obtained by the coordinate system conversion formula. The translation relationship O1 is the vector from point Ot to the origin. The first coordinate system transformation matrix is: [R, t] = [R1, O1]. It can be known that the position of the robot tool center in the workpiece coordinate system is: [x n ,y n , z n ] T =[R, t] -1 [x b ,y b , z b ] T , where [x b ,y b , z b ] is the position of the robot tool center expressed in the base coordinate system, [x n ,y n , z n ] is the representation of the position in the workpiece coordinate system.
[0111] The robot anti-collision device includes a processor and a memory. The establishment unit, the acquisition unit, the first calculation unit, the second calculation unit and the determination unit are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The modules are all located in the same processor; or, the modules are located in different processors in any combination.
[0112] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the problem of high cost of collision prevention through three-dimensional vision technology in the prior art can be solved by adjusting kernel parameters.
[0113] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0114] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the robot anti-collision method.
[0115] Specifically, the robot anti-collision method includes:
[0116] Step S201, establishing a workpiece coordinate system, and constructing a robot workspace under the workpiece coordinate system;
[0117] Step S202, obtaining a first position of the tool end of the robot moving to a target point in the robot workspace;
[0118] Step S203, calculating a second posture according to the first posture and the first coordinate system transformation matrix, wherein the second posture is the posture of the tool end in the robot base coordinate system, and the first coordinate system transformation matrix is a matrix for coordinate conversion between the workpiece coordinate system and the robot base coordinate system;
[0119] Step S204, calculating the bounding boxes of each joint link and the tool of the robot in the robot base coordinate system according to the second posture, and obtaining a plurality of base coordinate bounding boxes, wherein the bounding boxes are the smallest cuboids enclosing the joint parts, and the joint parts include the joint links and the tools;
[0120] Step S205 , using the separating axis theorem to determine whether the joint components corresponding to the plurality of base coordinate bounding boxes collide with each other.
[0121] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the robot anti-collision method is executed when the program is run.
[0122] Specifically, the robot anti-collision method includes:
[0123] Step S201, establishing a workpiece coordinate system, and constructing a robot workspace under the workpiece coordinate system;
[0124] Step S202, obtaining a first position of the tool end of the robot moving to a target point in the robot workspace;
[0125] Step S203, calculating a second posture according to the first posture and the first coordinate system transformation matrix, wherein the second posture is the posture of the tool end in the robot base coordinate system, and the first coordinate system transformation matrix is a matrix for coordinate conversion between the workpiece coordinate system and the robot base coordinate system;
[0126] Step S204, calculating the bounding boxes of each joint link and the tool of the robot in the robot base coordinate system according to the second posture, and obtaining a plurality of base coordinate bounding boxes, wherein the bounding boxes are the smallest cuboids enclosing the joint parts, and the joint parts include the joint links and the tools;
[0127] Step S205 , using the separating axis theorem to determine whether the joint components corresponding to the plurality of base coordinate bounding boxes collide with each other.
[0128] An embodiment of the present invention provides a robot control system, the robot control system includes a robot, a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:
[0129] Step S201, establishing a workpiece coordinate system, and constructing a robot workspace under the workpiece coordinate system;
[0130] Step S202, obtaining a first position of the tool end of the robot moving to a target point in the robot workspace;
[0131] Step S203, calculating a second posture according to the first posture and the first coordinate system transformation matrix, wherein the second posture is the posture of the tool end in the robot base coordinate system, and the first coordinate system transformation matrix is a matrix for coordinate conversion between the workpiece coordinate system and the robot base coordinate system;
[0132] Step S204, calculating the bounding boxes of each joint link and the tool of the robot in the robot base coordinate system according to the second posture, and obtaining a plurality of base coordinate bounding boxes, wherein the bounding boxes are the smallest cuboids enclosing the joint parts, and the joint parts include the joint links and the tools;
[0133] Step S205 , using the separating axis theorem to determine whether the joint components corresponding to the plurality of base coordinate bounding boxes collide with each other.
[0134] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:
[0135] Step S201, establishing a workpiece coordinate system, and constructing a robot workspace under the workpiece coordinate system;
[0136] Step S202, obtaining a first position of the tool end of the robot moving to a target point in the robot workspace;
[0137] Step S203, calculating a second posture according to the first posture and the first coordinate system transformation matrix, wherein the second posture is the posture of the tool end in the robot base coordinate system, and the first coordinate system transformation matrix is a matrix for coordinate conversion between the workpiece coordinate system and the robot base coordinate system;
[0138] Step S204, calculating the bounding boxes of each joint link and the tool of the robot in the robot base coordinate system according to the second posture, and obtaining a plurality of base coordinate bounding boxes, wherein the bounding boxes are the smallest cuboids enclosing the joint parts, and the joint parts include the joint links and the tools;
[0139] Step S205 , using the separating axis theorem to determine whether the joint components corresponding to the plurality of base coordinate bounding boxes collide with each other.
[0140] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0141] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0142] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0143] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0144] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0145] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0146] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0147] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0148] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0149] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0150] 1) In the robot anti-collision method of the present application, when the tool end of the robot moves to the target point of the robot workspace, a plurality of base coordinate bounding boxes are obtained by constructing the bounding boxes of the joint link and the robot's tool, and converting all bounding boxes to the robot's base coordinate system through coordinate conversion. The separating axis theorem can be used to determine whether the plurality of base coordinate bounding boxes collide. If a collision occurs, it indicates that the movement of the tool end of the robot to the target point of the robot workspace will cause a collision between the joint link and the robot's tool, and the collision can be avoided during path planning. There is no need to use three-dimensional vision technology to prevent collision, which greatly reduces the cost and solves the problem of high cost of anti-collision by three-dimensional vision technology in the prior art. It also avoids the problem of low reliability of anti-collision due to the blind spots of three-dimensional vision sensors.
[0151] 2) In the robot anti-collision device of the present application, when the tool end of the robot moves to the target point of the robot workspace, by constructing the bounding box of the joint link and the robot's tool, and converting all the bounding boxes to the robot's base coordinate system through coordinate conversion, multiple base coordinate bounding boxes are obtained, and the separating axis theorem can be used to determine whether the multiple base coordinate bounding boxes collide. If a collision occurs, it indicates that the movement of the tool end of the robot to the target point of the robot workspace will cause a collision between the joint link and the robot's tool, so that the collision can be avoided during path planning, and there is no need to use three-dimensional vision technology to prevent collision, which greatly reduces the cost and solves the problem of high cost of anti-collision through three-dimensional vision technology in the prior art. It also avoids the problem of low reliability of anti-collision due to the blind spots of three-dimensional vision sensors.
[0152] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A robot anti-collision method, characterized in that: include: Establishing a workpiece coordinate system and constructing a robot workspace under the workpiece coordinate system; Acquire a first position of the tool end of the robot moving to a target point in the robot workspace; A second posture is calculated according to the first posture and the first coordinate system transformation matrix, wherein the second posture is the posture of the tool end in the robot base coordinate system, and the first coordinate system transformation matrix is the matrix for coordinate conversion between the workpiece coordinate system and the robot base coordinate system; Calculate the bounding box of each joint link and the tool of the robot in the robot base coordinate system according to the second posture to obtain a plurality of base coordinate bounding boxes, wherein the bounding box is a minimum cuboid enclosing a joint component, and the joint component includes the joint link and the tool; The separating axis theorem is used to determine whether the joint parts corresponding to the plurality of base coordinate bounding boxes collide with each other.
2. The method according to claim 1, characterized in that Calculating the bounding boxes of each of the joint links and the tool of the robot in the robot base coordinate system according to the second posture to obtain a plurality of base coordinate bounding boxes, including: Obtaining the joint angles of the joints by inverse kinematics calculation according to the second posture; Establishing a first joint link bounding box of each joint link according to the size of each joint link of the robot, wherein the first joint link bounding box is a bounding box of the joint link in a joint coordinate system corresponding to the joint link; The base coordinate bounding box of each joint link is calculated according to the joint angle of each joint and the bounding box of each first joint link.
3. The method according to claim 1, characterized in that Calculating the bounding boxes of each of the joint links and the tool of the robot in the robot base coordinate system according to the second posture to obtain a plurality of base coordinate bounding boxes, including: Obtaining a posture change matrix, wherein the posture change matrix is a transformation matrix from the posture of the tool end to the posture of a tool coordinate system, wherein the tool coordinate system is a coordinate system with the center point of the tool as the origin; A second coordinate system transformation matrix is calculated according to the posture change matrix and the first coordinate system transformation matrix, where the second coordinate system transformation matrix is a matrix for coordinate conversion between the tool coordinate system and the robot base coordinate system; Establishing a second joint link bounding box of each tool according to the size of the tool, wherein the second joint link bounding box is the bounding box of the tool in the tool coordinate system; The base coordinate bounding box of each of the tools is calculated according to the second coordinate system transformation matrix and the second joint link bounding box.
4. The method according to claim 1, characterized in that Adopting the separating axis theorem to determine whether the joint parts corresponding to the plurality of base coordinate bounding boxes collide with each other comprises: Acquire a first base coordinate bounding box and a second base coordinate bounding box, where the first base coordinate bounding box and the second base coordinate bounding box are any two of the base coordinate bounding boxes; Calculate the normal vector of each face of the first base coordinate bounding box and the normal vector of each face of the second base coordinate bounding box to obtain a plurality of first normal vectors; Calculate normal vectors of all edge combinations to obtain multiple second normal vectors, wherein the edge combination includes an edge of the first base coordinate bounding box and an edge of the second base coordinate bounding box; Calculate the projection points of all vertices of the first base coordinate bounding box on the first normal vector to obtain the projections of each side of the first base coordinate bounding box on the first normal vector, calculate the projection points of all vertices of the second base coordinate bounding box on the first normal vector to obtain the projections of each side of the second base coordinate bounding box on the first normal vector, calculate the projection points of all vertices of the first base coordinate bounding box on the second normal vector to obtain the projections of each side of the first base coordinate bounding box on the second normal vector, calculate the projection points of all vertices of the second base coordinate bounding box on the second normal vector to obtain the projections of each side of the second base coordinate bounding box on the second normal vector; In the case where the projection of any edge of the first base coordinate bounding box on the first normal vector does not overlap with the projection of any edge of the second base coordinate bounding box on the first normal vector, it is determined that the first base coordinate bounding box and the second base coordinate bounding box do not overlap on the first normal vector; in the case where the projection of any edge of the first base coordinate bounding box on the second normal vector does not overlap with the projection of any edge of the second base coordinate bounding box on the second normal vector, it is determined that the first base coordinate bounding box and the second base coordinate bounding box do not overlap on the second normal vector; When the first base coordinate bounding box and the second base coordinate bounding box do not overlap on all the first normal vectors and the first base coordinate bounding box and the second base coordinate bounding box do not overlap on all the second normal vectors, it is determined that the joint component corresponding to the first base coordinate bounding box and the joint component corresponding to the second base coordinate bounding box do not collide.
5. The method according to claim 1, characterized in that After using the separating axis theorem to determine whether a collision occurs between the joint components corresponding to the plurality of base coordinate bounding boxes, the method further includes: When it is determined that any two base coordinate bounding boxes collide, the target point is marked as an unreachable point.
6. The method according to any one of claims 1 to 5, characterized in that Establishing a workpiece coordinate system and constructing a robot workspace under the workpiece coordinate system, including: Control the tool center of the robot to move to the first point, the second point and the third point of the working plane in sequence to obtain a first coordinate, a second coordinate and a third coordinate, wherein the first coordinate is the coordinate of the tool center in the robot base coordinate system when the tool center is located at the first point, the second coordinate is the coordinate of the tool center in the robot base coordinate system when the tool center is located at the second point, and the third coordinate is the coordinate of the tool center in the robot base coordinate system when the tool center is located at the third point, and the first point, the second point and the third point are not collinear; A first plane vector is calculated according to the first coordinate and the second coordinate, and a second plane vector is calculated according to the first coordinate and the third coordinate; Calculate three unit orthogonal bases according to the first plane vector and the second plane vector; Establishing the workpiece coordinate system according to the three unit orthogonal bases; The robot workspace is constructed in the workpiece coordinate system according to the length, width and height of the workspace.
7. The method according to claim 6, characterized in that Before calculating the second posture according to the first posture and the first coordinate system transformation matrix, the method further includes: The first coordinate system transformation matrix is calculated based on the three unit orthogonal bases and the unit orthogonal base of the robot base coordinate system.
8. A robot anti-collision device, characterized in that: include: An establishing unit, used for establishing a workpiece coordinate system and constructing a robot workspace under the workpiece coordinate system; An acquisition unit, used for acquiring a first posture of a tool end of the robot moving to a target point in a working space of the robot; A first calculation unit, configured to calculate a second posture according to the first posture and a first coordinate system transformation matrix, wherein the second posture is the posture of the tool end in the robot base coordinate system, and the first coordinate system transformation matrix is a matrix for coordinate conversion between the workpiece coordinate system and the robot base coordinate system; A second calculation unit is used to calculate the bounding boxes of each joint link and the tool of the robot in the robot base coordinate system according to the second posture to obtain a plurality of base coordinate bounding boxes; A determination unit is used to determine whether a plurality of base coordinate bounding boxes collide by using the separating axis theorem.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. A robot control system, characterized in that: include: A robot, one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include instructions for executing the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Task space based self-collision avoidance control method for real-time movements of robot
CN104097205A
Simulation method and device of digital twin system of industrial robot
CN108724190A
Double-arm self-collision detecting method and computer readable storage medium
CN111360824A
Mechanical arm path planning method and device, electronic equipment and storage medium
CN113459109A
Collision detection method and system for anchor rod supporting robot based on directional bounding box
CN114211498A
Cited By
Implant surgery robot anti-collision control method and system and storage medium
CN120732544A