A method, apparatus, electronic device, and storage medium for teaching a robot.

CN118305773BActive Publication Date: 2026-09-01HANGZHOU HIKROBOT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410457901.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-16
Publication Date
2026-09-01
Estimated Expiration
2044-04-16

AI Technical Summary

Technical Problem

[0004]上述示教方式中确定机械臂对应的偏移量和示教位姿都是相对于机器人的基坐标系或者TCP坐标系的,而由于受安装、调试等因素影响,不同机器人的基坐标系均不同,不同机器人相对于TCP坐标系的示教位姿也不同,因此针对每个工作台,需要对每台机器人均进行示教,示教次数过多,机器人的部署效率很低

Benefits of technology

[0075]本申请实施例提供的方案中,电子设备可以控制机器人的机械臂运动到工作台上标识点的位置,并控制机械臂的末端工具点触工作台上的标识点,记录机械臂在机械臂坐标系下的第一坐标,其中,标识点为预先设置的与工作台上放置的目标工件的相对位姿不变;控制机械臂运动到目标工件对应的抓放位置,记录机械臂在机械臂坐标系下的第二坐标;基于第一坐标和第二坐标,计算目标工件在工件坐标系下的第三坐标,其中,工件坐标系为以标识点为原点建立的。由于第一坐标和第二坐标为机械臂坐标系下标识点和目标工件的坐标,并且工件坐标系为以标识点为原点建立的,因此可以基于第一坐标与第二坐标确定目标工件在工件坐标系下的第三坐标。由于第三坐标仅与标识点与目标工件之间的相对位姿有关,而与机械臂坐标系无关,因此可以实现示教位姿与机械臂坐标系的解耦。进而针对每个工作台,可以仅使用一台机器人进行示教,不需要每台机器人均进行示教,可以减少示教次数,提高机器人的部署效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118305773B_ABST
    Figure CN118305773B_ABST
Patent Text Reader

Abstract

This application provides a robot teaching method, apparatus, electronic device, and storage medium. The electronic device can control the robot's robotic arm to move to the position of a marker point on the worktable and control the end effector to touch the marker point, recording the first coordinates of the robotic arm in the robotic arm coordinate system; control the robotic arm to move to the gripping and releasing position corresponding to the target workpiece, recording the second coordinates of the robotic arm in the robotic arm coordinate system; and calculate the third coordinates of the target workpiece in the workpiece coordinate system based on the first and second coordinates. Since the first and second coordinates are the coordinates of the marker point and the target workpiece in the robotic arm coordinate system, the third coordinates of the target workpiece in the workpiece coordinate system can be determined based on the first and second coordinates. Since the third coordinate is independent of the robotic arm coordinate system, only one robot needs to be used for teaching, eliminating the need to teach each robot individually, thus reducing the number of teaching operations and improving robot deployment efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of robot teaching technology, and in particular to a robot teaching method, apparatus, electronic device, and storage medium. Background Technology

[0002] Robots have a wide range of applications. Examples include AGVs (Automated Guided Vehicles), AMRs (Autonomous Mobile Robots), RGVs (Rail Guided Vehicles), IGVs (Intelligent Guided Vehicles), and composite robots combining robotic arms and machine vision. These robots possess "hands, feet, eyes, and brains" and are widely used in warehousing and logistics, automated factories, and automated supermarkets. They can handle materials, load and unload goods, and sort materials.

[0003] Before a robot is officially put into use, it needs to be taught how to perform each action by controlling the position information of the robotic arm. This allows the robotic arm to know the position it needs to reach in order to accurately grasp the workpiece. Current teaching methods include: calculating the transformation matrix between the camera coordinate system and the robotic arm coordinate system; and calculating the offset of the robotic arm relative to the target workpiece based on the pixel coordinates of the workpiece within the camera's field of view and the aforementioned transformation matrix. Alternatively, a TCP (Tool Center Position) coordinate system can be established with a marker point on the worktable as the origin. The robot can then grasp the target workpiece, and the pose of the robotic arm in the TCP coordinate system can be recorded.

[0004] In the above teaching method, the offset and teaching pose of the robotic arm are determined relative to the robot's base coordinate system or TCP coordinate system. However, due to factors such as installation and debugging, different robots have different base coordinate systems and different teaching poses relative to the TCP coordinate system. Therefore, for each workbench, each robot needs to be taught. Too many teaching times result in very low robot deployment efficiency. Summary of the Invention

[0005] The purpose of this application is to provide a robot teaching method, apparatus, electronic device, and storage medium to improve robot deployment efficiency. The specific technical solution is as follows:

[0006] In a first aspect, embodiments of this application provide a method for teaching a robot, the method comprising:

[0007] Control the robot's robotic arm to move to the position of the marked point on the worktable, and control the end tool of the robotic arm to touch the marked point on the worktable. Record the first coordinate of the robotic arm in the robotic arm coordinate system, wherein the marked point is a pre-set point whose relative pose to the target workpiece placed on the worktable remains unchanged.

[0008] Control the robotic arm to move to the gripping and releasing position corresponding to the target workpiece, and record the second coordinates of the robotic arm in the robotic arm coordinate system;

[0009] Based on the first coordinate and the second coordinate, the third coordinate of the target workpiece in the workpiece coordinate system is calculated, wherein the workpiece coordinate system is established with the marker point as the origin.

[0010] Optionally, the step of controlling the end effector of the robotic arm to touch the marked point on the worktable includes:

[0011] The end effector of the robotic arm is controlled to touch a marked point on the worktable, and the end effector is perpendicular to the worktable.

[0012] Optionally, the step of controlling the robotic arm to move to the gripping / releasing position corresponding to the target workpiece and recording the second coordinates of the robotic arm in the robotic arm coordinate system includes:

[0013] When the robotic arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, the robotic arm is controlled to move to the position of the target workpiece on the worktable, and the end effector is controlled to grip and release the target workpiece. The second coordinate in the robotic arm coordinate system is recorded when the robotic arm grips and releases the target workpiece.

[0014] When the robot arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems, the robot arm is controlled to move to the position of the target workpiece on the worktable, and the end tool of the robot arm is controlled to be perpendicular to the surface of the worktable, and the center of the end tool and the center of the target workpiece are at the same point on the worktable. The second coordinate of the robot arm in the robot arm coordinate system is recorded.

[0015] Optionally, the robotic arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, where the first coordinate is represented by a first pose matrix and the second coordinate is represented by a second pose matrix.

[0016] The step of calculating the third coordinate of the target workpiece in the workpiece coordinate system based on the first coordinate and the second coordinate includes:

[0017] Based on the coordinate transformation relationship represented by the first pose matrix and the second pose matrix, the third coordinate of the target workpiece in the workpiece coordinate system is calculated.

[0018] Optionally, the step of calculating the third coordinates of the target workpiece in the workpiece coordinate system based on the coordinate transformation relationship represented by the first pose matrix and the second pose matrix includes:

[0019] Calculate the inverse of the first pose matrix, and use it as the transformation matrix from the robot arm coordinate system to the workpiece coordinate system;

[0020] Multiplying the transformation matrix by the second pose matrix yields the third coordinate of the target workpiece in the workpiece coordinate system.

[0021] Optionally, the robot arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems;

[0022] The step of calculating the third coordinate of the target workpiece in the workpiece coordinate system based on the first coordinate and the second coordinate includes:

[0023] Determine the angle between the workpiece coordinate system and the robot arm coordinate system, as well as the translation vector;

[0024] Based on the included angle and the translation vector, determine the transformation matrix from the robot arm coordinate system to the workpiece coordinate system;

[0025] Multiply the transformation matrix by the first coordinate and the second coordinate respectively to obtain the transformed first coordinate and the transformed second coordinate;

[0026] Calculate the coordinate offset of the transformed second coordinate and the transformed first coordinate, and use it as the third coordinate of the target workpiece in the workpiece coordinate system.

[0027] Optionally, the step of determining the angle between the workpiece coordinate system and the robot arm coordinate system includes:

[0028] Calculate the first angle between the workpiece coordinate system and the pixel coordinate system in the image captured by the robot's camera;

[0029] Based on the pre-determined calibration matrix between the robotic arm coordinate system and the pixel coordinate system, a second included angle between the robotic arm coordinate system and the pixel coordinate system is determined;

[0030] The angle between the workpiece coordinate system and the robot arm coordinate system is determined based on the first included angle and the second included angle.

[0031] Optionally, the step of determining the angle between the workpiece coordinate system and the robot arm coordinate system based on the first angle and the second angle includes:

[0032] Calculate the difference between the first included angle and the second included angle, and use it as the included angle between the workpiece coordinate system and the robot arm coordinate system.

[0033] Optionally, the number of worktables may be multiple;

[0034] After the step of calculating the third coordinate of the target workpiece in the workpiece coordinate system based on the first coordinate and the second coordinate, as the workpiece position information corresponding to the worktable, the method further includes:

[0035] The workbench is designated as the taught workbench;

[0036] Determine whether the number of taught workstations has reached the required number of workstations;

[0037] If the number of worktables is not reached, control the robot to move to the position of the untaught worktable, and return to the step of controlling the robot's robotic arm to move to the position of the marked point on the worktable, until the number of taught worktables reaches the required number of worktables.

[0038] Secondly, embodiments of this application provide a teaching device for a robot, the device comprising:

[0039] The first coordinate recording module is used to control the robot's robotic arm to move to the position of the marked point on the worktable, and to control the end tool of the robotic arm to touch the marked point on the worktable, and to record the first coordinate of the robotic arm in the robotic arm coordinate system, wherein the marked point is a pre-set point whose relative pose to the target workpiece placed on the worktable remains unchanged.

[0040] The second coordinate recording module is used to control the robotic arm to move to the gripping and releasing position corresponding to the target workpiece and record the second coordinates of the robotic arm in the robotic arm coordinate system.

[0041] The third coordinate calculation module is used to calculate the third coordinate of the target workpiece in the workpiece coordinate system based on the first coordinate and the second coordinate, wherein the workpiece coordinate system is established with the marker point as the origin.

[0042] Optionally, the first coordinate recording module includes:

[0043] The first coordinate recording submodule is used to control the end effector of the robotic arm to touch the marked point on the worktable, and the end effector is perpendicular to the worktable.

[0044] Optionally, the second coordinate recording module includes:

[0045] The second coordinate recording submodule is used to control the position of the robotic arm to the target workpiece on the worktable when the robotic arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, and to control the end tool to grasp and release the target workpiece, and to record the second coordinates in the robotic arm coordinate system when the robotic arm grasps and releases the target workpiece.

[0046] The third coordinate recording submodule is used to control the robotic arm to move to the position of the target workpiece on the worktable when the robotic arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems, and to control the end tool of the robotic arm to be perpendicular to the surface of the worktable, and the center of the end tool and the center of the target workpiece are at the same point on the worktable, and to record the second coordinates of the robotic arm in the robotic arm coordinate system.

[0047] Optionally, the robotic arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, where the first coordinate is represented by a first pose matrix and the second coordinate is represented by a second pose matrix.

[0048] The third coordinate calculation module includes:

[0049] The first coordinate calculation submodule is used to calculate the third coordinate of the target workpiece in the workpiece coordinate system based on the coordinate transformation relationship represented by the first pose matrix and the second pose matrix.

[0050] Optionally, the first coordinate calculation submodule includes:

[0051] The inverse matrix calculation unit is used to calculate the inverse matrix of the first pose matrix, which serves as the transformation matrix from the robot arm coordinate system to the workpiece coordinate system.

[0052] The coordinate calculation unit is used to multiply the transformation matrix with the second pose matrix to obtain the third coordinate of the target workpiece in the workpiece coordinate system.

[0053] Optionally, the robot arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems;

[0054] The third coordinate calculation module includes:

[0055] The parameter determination submodule is used to determine the angle between the workpiece coordinate system and the robot arm coordinate system, as well as the translation vector.

[0056] The transformation matrix determination submodule is used to determine the transformation matrix from the robot arm coordinate system to the workpiece coordinate system based on the included angle and the translation vector.

[0057] The coordinate transformation submodule is used to multiply the transformation matrix by the first coordinate and the second coordinate respectively to obtain the transformed first coordinate and the transformed second coordinate;

[0058] The second coordinate calculation submodule is used to calculate the coordinate offset of the transformed second coordinate and the transformed first coordinate, as the third coordinate of the target workpiece in the workpiece coordinate system.

[0059] Optionally, the parameter determination submodule includes:

[0060] Angle calculation unit is used to calculate the first angle between the workpiece coordinate system and the pixel coordinate system in the image captured by the robot's camera;

[0061] The first included angle determination unit is used to determine the second included angle between the robotic arm coordinate system and the pixel coordinate system based on a pre-determined calibration matrix between the robotic arm coordinate system and the pixel coordinate system.

[0062] The second included angle determination unit is used to determine the included angle between the workpiece coordinate system and the robot arm coordinate system based on the first included angle and the second included angle.

[0063] Optionally, the second included angle determining unit includes:

[0064] Angle calculation subunit is used to calculate the difference between the first angle and the second angle, which is used as the angle between the workpiece coordinate system and the robot arm coordinate system.

[0065] Optionally, the number of worktables may be multiple;

[0066] The device further includes:

[0067] The workbench determination module is used to designate the workbench as a taught workbench;

[0068] The quantity determination module is used to determine whether the number of taught workbenches has reached the required number of workbenches;

[0069] The return module is used to control the robot to move to the position of the untaught workbench if the number of taught workbenches has not been reached, and return to the step of controlling the robot's robotic arm to move to the position of the marked point on the workbench, until the number of taught workbenches reaches the number of taught workbenches.

[0070] Thirdly, embodiments of this application provide an electronic device, including:

[0071] Memory, used to store computer programs;

[0072] When a processor executes a program stored in memory, it implements any of the methods described in the first aspect above.

[0073] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the methods described in the first aspect above.

[0074] Beneficial effects of the embodiments in this application:

[0075] In the solution provided in this application embodiment, the electronic device can control the robot's robotic arm to move to the position of the marker point on the worktable, and control the end effector of the robotic arm to touch the marker point on the worktable, recording the first coordinates of the robotic arm in the robotic arm coordinate system. Here, the marker point is a pre-set point whose relative pose to the target workpiece placed on the worktable remains unchanged. The electronic device then controls the robotic arm to move to the gripping / releasing position corresponding to the target workpiece, recording the second coordinates of the robotic arm in the robotic arm coordinate system. Based on the first and second coordinates, the third coordinates of the target workpiece in the workpiece coordinate system are calculated, where the workpiece coordinate system is established with the marker point as the origin. Since the first and second coordinates are the coordinates of the marker point and the target workpiece in the robotic arm coordinate system, and the workpiece coordinate system is established with the marker point as the origin, the third coordinates of the target workpiece in the workpiece coordinate system can be determined based on the first and second coordinates. Because the third coordinate is only related to the relative pose between the marker point and the target workpiece, and is independent of the robotic arm coordinate system, decoupling the teaching pose from the robotic arm coordinate system can be achieved. Furthermore, for each workstation, only one robot can be used for teaching, eliminating the need to teach each robot individually. This reduces the number of teaching sessions and improves robot deployment efficiency.

[0076] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description

[0077] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.

[0078] Figure 1 A flowchart illustrating a robot teaching method provided in an embodiment of this application;

[0079] Figure 2 Based on Figure 1 A schematic diagram of a robot loading and unloading in the embodiment shown;

[0080] Figure 3 Based on Figure 1 A schematic diagram of the coordinate system of the robotic arm in the embodiment shown;

[0081] Figure 4 Based on Figure 1 A physical diagram showing the end effector of the robotic arm in the illustrated embodiment moving to the target workpiece gripping and placing position;

[0082] Figure 5 Based on Figure 1 A schematic diagram of the end effector touch marker of the robotic arm in the embodiment shown;

[0083] Figure 6 Based on Figure 1 A schematic diagram of the end effector of a robotic arm in the embodiment shown, depicting the gripping and placing of a target workpiece.

[0084] Figure 7 Based on Figure 1 A schematic diagram showing the center point of the end effector of the robotic arm in the embodiment shown.

[0085] Figure 8 for Figure 1 A specific flowchart of step S103 in the illustrated embodiment;

[0086] Figure 9 Based on Figure 1 A schematic diagram of the target workpiece and marker points in the robot arm coordinate system of the embodiment shown;

[0087] Figure 10 for Figure 1 Another specific flowchart of step S103 in the illustrated embodiment;

[0088] Figure 11 Based on Figure 1 A schematic diagram illustrating the coordinate offset of the target workpiece from the marker point in the illustrated embodiment;

[0089] Figure 12 for Figure 10 A specific flowchart of step S1001 in the illustrated embodiment;

[0090] Figure 13 Based on Figure 1 A physical image of the robotic arm moving to the teaching and photographing position according to the embodiment shown;

[0091] Figure 14 Based on Figure 1 A schematic diagram of the workpiece coordinate system, pixel coordinate system, and robotic arm coordinate system in the illustrated embodiment;

[0092] Figure 15 Based on Figure 1The illustrated embodiment is a flowchart of a control robot teaching multiple workstations.

[0093] Figure 16 Based on Figure 1 A flowchart of a 3D teaching method according to the embodiment shown;

[0094] Figure 17 Based on Figure 1 A flowchart of a 2D teaching method according to the embodiment shown;

[0095] Figure 18 A schematic diagram of the structure of a robot teaching device provided in an embodiment of this application;

[0096] Figure 19 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0097] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.

[0098] To improve robot deployment efficiency, this application provides a robot teaching method, apparatus, electronic device, computer-readable storage medium, and computer program product. The robot teaching method provided in this application will be described first.

[0099] The robot teaching method provided in this application can be applied to any electronic device that needs to teach a robot, such as an automated control device, a central control device, a warehouse automation device, etc., without specific limitations. For clarity, it will be referred to as an electronic device herein.

[0100] like Figure 1 As shown, a method for teaching a robot includes:

[0101] S101, control the robot's robotic arm to move to the position of the marked point on the worktable, and control the end tool of the robotic arm to touch the marked point on the worktable, and record the first coordinate of the robotic arm in the robotic arm coordinate system;

[0102] Wherein, the marker point is a pre-set point whose relative position to the target workpiece placed on the workbench remains unchanged;

[0103] S102, control the robotic arm to move to the gripping and releasing position corresponding to the target workpiece, and record the second coordinates of the robotic arm in the robotic arm coordinate system;

[0104] S103, Based on the first coordinate and the second coordinate, calculate the third coordinate of the target workpiece in the workpiece coordinate system.

[0105] The workpiece coordinate system is established with the marked point as the origin.

[0106] As can be seen, in this embodiment, the electronic device can control the robot's robotic arm to move to the position of the marker point on the worktable, and control the end effector of the robotic arm to touch the marker point on the worktable, recording the first coordinates of the robotic arm in the robotic arm coordinate system, wherein the marker point is a pre-set point whose relative pose to the target workpiece placed on the worktable remains unchanged; controlling the robotic arm to move to the gripping and releasing position corresponding to the target workpiece, recording the second coordinates of the robotic arm in the robotic arm coordinate system; and calculating the third coordinates of the target workpiece in the workpiece coordinate system based on the first and second coordinates, wherein the workpiece coordinate system is established with the marker point as the origin. Since the first and second coordinates are the coordinates of the marker point and the target workpiece in the robotic arm coordinate system, and the workpiece coordinate system is established with the marker point as the origin, the third coordinates of the target workpiece in the workpiece coordinate system can be determined based on the first and second coordinates. Since the third coordinate is only related to the relative pose between the marker point and the target workpiece, and is independent of the robotic arm coordinate system, the teaching pose and the robotic arm coordinate system can be decoupled. Furthermore, for each workstation, only one robot can be used for teaching, eliminating the need to teach each robot individually. This reduces the number of teaching sessions and improves robot deployment efficiency.

[0107] To determine the position of the target workpiece that the robot needs to grasp on the worktable, marker points can be set on the worktable before teaching the robot. The relative pose between the marker points and the target workpiece on the worktable remains unchanged. In this way, the robot can determine the position of the marker points using a camera, and then determine the position of the target workpiece based on the aforementioned relative pose. The robot's camera can be on the robotic arm or outside the robotic arm; no specific limitation is made here.

[0108] In one implementation, a marking area can be set on the workbench, and points within the marking area that reflect reference features can be used as marking points. The internal features of the marking area can be defined by affixing labels or printing / etching. For example, QR code labels or character labels can be affixed to the inside of the marking area, and the marking points can be corner points within the marking area; no specific limitation is made here. Furthermore, it is necessary to ensure that when the robot's robotic arm moves to the teaching and photographing position, the robot's camera can capture the reference features within the marking area, i.e., the features of the marking points.

[0109] A schematic diagram of robot loading and unloading can be shown as follows Figure 2 As shown, loading and unloading refers to the process of placing the target workpiece onto the processing position on the worktable and removing the processed target workpiece from the processing position. Robot 201 is located in front of worktable 202, and its robotic arm 203 is connected to an end effector 204 and a camera 205. The worktable 202 holds the target workpiece 206 and has a marking area 207, with marking points 208 located inside the marking area 207.

[0110] To determine the pose of the target workpiece and the marker point, and thus the relative pose between them, the electronic device can control the robot's arm to move to the position of the marker point on the worktable, and control the end effector of the arm to touch the marker point on the worktable, recording the first coordinate of the arm in the arm coordinate system, i.e., executing step S101. The arm coordinate system can be a base coordinate system, a geodetic coordinate system, a tool coordinate system, or a workpiece coordinate system, etc., and is not specifically limited here.

[0111] For example, a schematic diagram of the robotic arm coordinate system can be as follows: Figure 3 As shown, the robotic arm coordinate system is a three-dimensional coordinate system O-XYZ established with the mounting base 301 of the robotic arm 203 as the origin. A physical diagram showing the end effector of the robotic arm moving to the target workpiece gripping position can be shown as follows: Figure 4 As shown, the robotic arm, end effector, and marker point in the physical image correspond to those in the schematic diagram. The physical image is a photograph taken during laboratory testing and does not represent the actual shape of the target workpiece. The end effector 204 of the robotic arm 203 touches the center of the target workpiece 206. Electronic equipment can also control the end effector 204 of the robotic arm 203 to touch the marker point 208 to determine the relative pose between the target workpiece and the marker point.

[0112] In step S102, the electronic device can control the robotic arm to move to the gripping / releasing position corresponding to the target workpiece, and record the second coordinates of the robotic arm in the robotic arm coordinate system. The gripping / releasing position represents the location of the target workpiece in the robotic arm coordinate system.

[0113] Since the first coordinate of the marker point and the second coordinate of the target workpiece are in the same coordinate system, the electronic device can calculate the third coordinate of the target workpiece in the workpiece coordinate system based on the first and second coordinates, which is the relative pose between the target workpiece and the marker point, i.e., execute step S103. The workpiece coordinate system is established with the marker point as its origin.

[0114] The robot arm coordinate system and the workpiece coordinate system can be either three-dimensional or two-dimensional. In one case, both the robot arm coordinate system and the workpiece coordinate system are three-dimensional, in which case the relative pose described above is represented based on three coordinate components and three angles. In another case, both the robot arm coordinate system and the workpiece coordinate system are two-dimensional, in which case the relative pose described above is represented based on two coordinate components and two angles.

[0115] As can be seen, in this embodiment, since the first and second coordinates are the coordinates of the marker point and the target workpiece in the robot arm coordinate system, and the workpiece coordinate system is established with the marker point as the origin, the third coordinate of the target workpiece in the workpiece coordinate system can be determined based on the first and second coordinates. Since the third coordinate is only related to the relative pose between the marker point and the target workpiece, it is inherent information of the worktable and is independent of the robot arm coordinate system, thus decoupling the teaching pose from the robot arm coordinate system can be achieved. Furthermore, for each worktable, only one robot needs to be used for teaching, eliminating the need to teach each robot individually, reducing the number of teaching attempts, and improving robot deployment efficiency.

[0116] As one embodiment of this application, the step of controlling the end effector of the robotic arm to touch the marker on the worktable may include:

[0117] The end effector of the robotic arm is controlled to touch a marked point on the worktable, and the end effector is perpendicular to the worktable.

[0118] In one implementation, since the marker is located on the upper surface of the worktable, in order to accurately represent the coordinates of the marker based on the coordinates of the robotic arm, the electronic device can control the end tool of the robotic arm to touch the marker on the worktable, and the end tool is perpendicular to the worktable, that is, the axis of the end tool is perpendicular to the upper surface of the worktable.

[0119] Since the position of the end effector coincides with the position of the marker point, the first coordinate of the robotic arm in the robotic arm coordinate system can be used as the coordinate of the marker point in the robotic arm coordinate system. A schematic diagram of the end effector of the robotic arm touching the marker point can be shown below. Figure 5 As shown, the electronic device can control the end tool 204 of the robotic arm 203 to touch the marker point 208, and the end tool 204 is perpendicular to the worktable 202.

[0120] In another embodiment, the electronic device can also control the end effector of the robotic arm to touch the marked point on the worktable, and the end effector is at a certain angle to the worktable, and the angle is not necessarily 90 degrees. For example, it can be 30 degrees, 50 degrees, 80 degrees, etc., without being specifically limited here.

[0121] Since the marker point is located on the upper surface of the worktable, when the end effector is at a certain angle to the worktable, there is also a certain angle between the end effector and the marker point. In this case, the electronic device can calculate the transformation matrix corresponding to this angle, multiply the first coordinate of the robot arm in the robot arm coordinate system by the transformation matrix, and use the result of the multiplication as the coordinate of the marker point in the robot arm coordinate system.

[0122] As can be seen, in this embodiment, the electronic device can control the end effector of the robotic arm to touch a marker point on the worktable, and the end effector is perpendicular to the worktable. Since the marker point is located on the upper surface of the worktable, in order to more accurately represent the pose of the marker point, the electronic device can control the robotic arm to touch the marker point, and the end effector is perpendicular to the worktable. In this way, the first coordinate of the marker point in the robotic arm coordinate system can be accurately determined, thereby improving the repeatability accuracy of the robot's loading and unloading, and accurately teaching the robot.

[0123] As one embodiment of this application, the step of controlling the robotic arm to move to the gripping / releasing position corresponding to the target workpiece and recording the second coordinate of the robotic arm in the robotic arm coordinate system may include:

[0124] When the robotic arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, the robotic arm is controlled to move to the position of the target workpiece on the worktable, and the end effector is controlled to grip and release the target workpiece. The second coordinate in the robotic arm coordinate system is recorded when the robotic arm grips and releases the target workpiece.

[0125] When the robot arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems, the robot arm is controlled to move to the position of the target workpiece on the worktable, and the end tool of the robot arm is controlled to be perpendicular to the surface of the worktable, and the center of the end tool and the center of the target workpiece are at the same point on the worktable. The second coordinate of the robot arm in the robot arm coordinate system is recorded.

[0126] In one implementation, when both the robotic arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, since the end effector of the robotic arm and the target workpiece are positioned in the same three-dimensional coordinate system when the robotic arm grips and releases the target workpiece, the coordinates of the robotic arm can be used as the coordinates of the target workpiece. To accurately determine the position and orientation of the target workpiece in the three-dimensional coordinate system, the electronic device can control the robotic arm to move to the position of the target workpiece on the worktable and control the end effector to grip and release the target workpiece. The electronic device can record the second coordinate in the robotic arm coordinate system when the robotic arm grips and releases the target workpiece, and use this as the coordinates of the target workpiece in the robotic arm coordinate system.

[0127] A schematic diagram of a robotic arm's end effector gripping and placing a target workpiece can be shown as follows: Figure 6 As shown, the electronic device can control the robotic arm 203 to move to the position of the target workpiece 206, and control the end tool 204 to grip and release the target workpiece 206, and record the second coordinate in the robotic arm coordinate system when the robotic arm 203 grips and releases the target workpiece 206.

[0128] When both the robotic arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems, since the end-effector of the robotic arm is perpendicular to the worktable surface, and the projection point of the end-effector's center onto the worktable coincides with the projection point of the target workpiece's center onto the worktable, the positions of the end-effector and the target workpiece in the robotic arm coordinate system are identical. Therefore, the coordinates of the robotic arm can be used as the coordinates of the target workpiece. To accurately determine the position of the target workpiece in the two-dimensional coordinate system, the electronic equipment can control the robotic arm to move to the position of the target workpiece on the worktable and control the end-effector of the robotic arm to be perpendicular to the worktable surface. In this way, the coordinates of the robotic arm can accurately represent the coordinates of a point on the worktable surface. Furthermore, the electronic equipment can control the projection points of the end-effector's center and the target workpiece's center onto the worktable to coincide, recording the second coordinates of the robotic arm in the robotic arm coordinate system.

[0129] A schematic diagram showing the point at which the end effector of the robotic arm and the target workpiece are aligned can be shown as follows: Figure 7 As shown, the electronic device can control the robotic arm 203 to move to the position of the target workpiece 206, and control the end tool 204 of the robotic arm 203 to be perpendicular to the table surface of the worktable 202, and the center of the end tool 204 and the center of the target workpiece 206 have the same projection point on the worktable 202, and record the second coordinate of the robotic arm 203 in the robotic arm coordinate system.

[0130] In another implementation, the electronic device can also control the robotic arm to move to the gripping position corresponding to the target workpiece, and control the robot's camera to capture an image of the robotic arm's end effector. By using a pre-calibrated transformation relationship between the camera's image coordinate system and the robotic arm's coordinate system, the coordinates of the robotic arm's end effector are transformed from the image coordinate system to the robotic arm's coordinate system, thus obtaining the robotic arm's second coordinates in the robotic arm's coordinate system.

[0131] As can be seen, in this embodiment, the electronic device can control the robotic arm to move to the position of the target workpiece on the worktable when both the robotic arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, and control the end-effector to grasp and release the target workpiece, recording the second coordinates of the robotic arm in the robotic arm coordinate system when grasping and releasing the target workpiece. Alternatively, when both the robotic arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems, the electronic device can control the robotic arm to move to the position of the target workpiece on the worktable, and control the end-effector of the robotic arm to be perpendicular to the surface of the worktable, with the center of the end-effector and the center of the target workpiece projecting onto the same point on the worktable, recording the second coordinates of the robotic arm in the robotic arm coordinate system. To ensure that the second coordinates accurately represent the coordinates of the target workpiece in the robotic arm coordinate system, the electronic device can control the end-effector to grasp and release the target workpiece and record the second coordinates of the robotic arm when the robotic arm coordinate system is three-dimensional; and control the center of the end-effector and the center of the target workpiece to project onto the same point on the worktable and record the second coordinates of the robotic arm when the robotic arm coordinate system is two-dimensional. In this way, the second coordinates can be accurately determined, thereby accurately teaching the robot.

[0132] As one embodiment of this application, the robotic arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, the first coordinate is represented by a first pose matrix, and the second coordinate is represented by a second pose matrix. In this case, the step of calculating the third coordinate of the target workpiece in the workpiece coordinate system based on the first coordinate and the second coordinate may include:

[0133] Based on the coordinate transformation relationship represented by the first pose matrix and the second pose matrix, the third coordinate of the target workpiece in the workpiece coordinate system is calculated.

[0134] The pose matrix is ​​a 4×4 homogeneous coordinate transformation matrix used to describe the relative pose relationship between two points in space. The pose matrix consists of a rotation matrix and a displacement vector. The rotation matrix reflects the robot arm's posture, and the displacement vector reflects its position. The rotation matrix is ​​a 3×3 orthogonal matrix representing the rotation from the reference coordinate system originating from the robot arm's end-effector to the reference coordinate system. The displacement vector is the relative position vector located at the robot arm's end-effector, typically described by three components: X, Y, and Z.

[0135] Since the first pose matrix reflects the position and orientation of the marker point in the robot arm coordinate system, and the marker point is the origin of the workpiece coordinate system, the first pose matrix can reflect the coordinate transformation relationship between the workpiece coordinate system and the robot arm coordinate system. Since the second pose matrix reflects the pose of the target workpiece in the robot arm coordinate system, the third coordinate of the target workpiece in the workpiece coordinate system can be calculated based on the coordinate transformation relationship represented by the first pose matrix and the second pose matrix.

[0136] In one implementation, the electronic device can directly record the first and second coordinates described by the pose matrix. Then, based on the recorded first and second pose matrices, the third coordinate of the target workpiece in the workpiece coordinate system is calculated.

[0137] In another implementation, the electronic device can record the first and second coordinates of the Euler angle description. The Euler angle description uses six quantities to represent the position and orientation of a spatial point, namely the XYZ and RZ-RY-RX Euler angles. The Euler angle type can be in the ZYX in-rotation order, or the XYZ fixed-angle out-rotation order, or other types of Euler angles, which are not specifically limited here.

[0138] Since using Euler angles to describe the relative pose of two points in space may encounter gimbal lock issues, the first and second coordinates can be converted from Euler angle descriptions to pose matrix descriptions before calculating the third coordinate. Specifically, in this embodiment, the conversion formula from Euler angles (α, β, γ) to the pose matrix R is as follows: Where α, β, and γ represent the angles of rotation about the X-axis, Y-axis, and Z-axis, respectively, i.e., Euler angles, R Z (γ), R Y (β), R X (α) represents the rotation matrix around the Z-axis, Y-axis, and X-axis, respectively.

[0139] As can be seen, in this embodiment, the electronic device can calculate the third coordinate of the target workpiece in the workpiece coordinate system based on the coordinate transformation relationship represented by the first pose matrix and the second pose matrix. Since the first pose matrix reflects the position and orientation of the marker point in the robot arm coordinate system, and the marker point is the origin of the workpiece coordinate system, the first pose matrix can reflect the coordinate transformation relationship between the workpiece coordinate system and the robot arm coordinate system. Therefore, based on the coordinate transformation relationship represented by the first pose matrix and the second pose matrix, the third coordinate of the target workpiece in the workpiece coordinate system can be calculated quickly and accurately.

[0140] As one implementation method of this application, such as Figure 8 As shown, the step of calculating the third coordinate of the target workpiece in the workpiece coordinate system based on the coordinate transformation relationship represented by the first pose matrix and the second pose matrix may include:

[0141] S801, Calculate the inverse matrix of the first pose matrix, and use it as the transformation matrix from the robot arm coordinate system to the workpiece coordinate system;

[0142] A schematic diagram of the target workpiece and the marker points in the robot arm coordinate system can be shown as follows: Figure 9 As shown, the pose of marker point 208 in the robot arm coordinate system O-XYZ is the first pose matrix, and the pose of target workpiece 206 in the robot arm coordinate system O-XYZ is the second pose matrix. The workpiece coordinate system O'-X'Y'Z' is established with marker point 208 as the origin.

[0143] Since the first pose matrix represents the pose of the marker point in the robot arm coordinate system, and the marker point is the origin of the workpiece coordinate system, the first pose matrix is ​​the transformation matrix from the workpiece coordinate system to the robot arm coordinate system. Furthermore, the electronic device can calculate the inverse matrix of the first pose matrix, which is the transformation matrix from the robot arm coordinate system to the workpiece coordinate system.

[0144] S802, multiply the transformation matrix with the second pose matrix to obtain the third coordinate of the target workpiece in the workpiece coordinate system.

[0145] Assume the transformation matrix from coordinate system B to coordinate system A is A T B The pose of point D in space in coordinate system C is: C P D The base coordinate system with the robotic arm as the origin is T. Base The workpiece coordinate system with the marker point as the origin is T. Mark If the target workpiece is Obj(Object, target), i.e., O, then we have: the first pose matrix P MWB = Base P M The second pose matrix P OWB = Base P O .

[0146] The transformation matrix from the robot arm coordinate system to the workpiece coordinate system is: Mark T Base ,Right now( Base P M ) -1 Then we have: the third coordinate of the target workpiece in the workpiece coordinate system Mark P O = Mark T Base Base P O =( Base P M ) -1Base P O =P MWB -1 P OWB The first pose matrix Second pose matrix The inverse of the first pose matrix can then be multiplied by the second pose matrix to obtain the third coordinate.

[0147] Among them, M ij M represents the element in the i-th row and j-th column of the first pose matrix. ij ′ represents the element in the i-th row and j-th column of the second pose matrix, where i = 1, 2, 3, and j = 1, 2, 3. (X M ,Y M Z M (X) represents the coordinates of the marker point in the robot arm's coordinate system. O ,Y O Z O ) represents the coordinates of the target workpiece in the robot arm coordinate system.

[0148] As can be seen, in this embodiment, the electronic device can calculate the inverse of the first pose matrix as the transformation matrix from the robot arm coordinate system to the workpiece coordinate system; multiplying the transformation matrix by the second pose matrix yields the third coordinate of the target workpiece in the workpiece coordinate system. Since the first pose matrix represents the pose of the marker point in the robot arm coordinate system, and the marker point is the origin of the workpiece coordinate system, the first pose matrix is ​​the transformation matrix from the workpiece coordinate system to the robot arm coordinate system. Furthermore, the electronic device can calculate the inverse of the first pose matrix, multiply it by the second pose matrix, and obtain the third coordinate of the target workpiece in the workpiece coordinate system. This allows for fast and accurate calculation of the third coordinate.

[0149] As one embodiment of this application, the above-mentioned robotic arm coordinate system and the above-mentioned workpiece coordinate system can be two-dimensional coordinate systems. In this case, such as Figure 10 As shown, the step of calculating the third coordinate of the target workpiece in the workpiece coordinate system based on the first coordinate and the second coordinate may include:

[0150] S1001, Determine the angle and translation vector between the workpiece coordinate system and the robot arm coordinate system;

[0151] If the transformation between two coordinate systems is a rigid body transformation, then the transformation matrix between the two coordinate systems can be determined based on the angle between them and the translation vector. Since the transformation between the workpiece coordinate system and the robot arm coordinate system is a rigid body transformation, in order to determine the transformation matrix from the robot arm coordinate system to the workpiece coordinate system, the electronic device can determine the angle between the workpiece coordinate system and the robot arm coordinate system and the translation vector. Specifically, assuming the coordinates of the marker point obtained by controlling the robotic arm during teaching are (X... MWB ,Y MWBIf the translation vector from the robotic arm coordinate system to the workpiece coordinate system with the marker point as the origin is the inverse vector of the marker point's coordinate vector, then T is the translation vector from the robotic arm coordinate system to the workpiece coordinate system with the marker point as the origin. x =-X MWB T y =-Y MWB .

[0152] In one implementation, the workpiece coordinate system is determined within the image captured by the robot's camera. The electronic device can then calculate the first angle θ1 between the workpiece coordinate system and the pixel coordinate system, and determine the second angle θ2 between the robot arm coordinate system and the pixel coordinate system based on a pre-determined calibration matrix between them. When one of the workpiece coordinate system and the robot arm coordinate system is a left-handed coordinate system and the other a right-handed coordinate system, the angle between them can be calculated as (θ1 - θ2).

[0153] S1002, Based on the included angle and the translation vector, determine the transformation matrix from the robot arm coordinate system to the workpiece coordinate system;

[0154] Determine the angle (θ1-θ2) between the workpiece coordinate system and the robot arm coordinate system, and the translation vector (T). x ,T y ) T Then, the electronic equipment can base its operation on the angle (θ1-θ2) between the workpiece coordinate system and the robotic arm coordinate system, as well as the translation vector (T). x ,T y ) T The transformation matrix from the robot arm coordinate system to the workpiece coordinate system is determined as follows:

[0155] S1003, Multiply the transformation matrix by the first coordinate and the second coordinate respectively to obtain the transformed first coordinate and the transformed second coordinate;

[0156] Since both the first and second coordinates are determined in the robot arm coordinate system, the electronic device can multiply the transformation matrix with the first and second coordinates respectively to obtain the transformed first and second coordinates in the workpiece coordinate system.

[0157] Assume the first coordinate is (X) MWB ,Y MWB ) T The second coordinate is (X OWB′ ,Y oWB′ ) T Then we have: the first coordinate after transformation The transformed second coordinate

[0158] S1004, calculate the coordinate offset of the transformed second coordinate and the transformed first coordinate, and use it as the third coordinate of the target workpiece in the workpiece coordinate system.

[0159] A schematic diagram of the coordinate offset between the target workpiece and the marker point in the workpiece coordinate system can be shown as follows: Figure 11 As shown, the horizontal and vertical offsets between the target workpiece 206 and the marker point 208 are dx and dy, respectively. Since the workpiece coordinate system O'-X'Y' is established with the marker point 208 as the origin, the horizontal and vertical offsets between the target workpiece 206 and the marker point 208 are the horizontal and vertical coordinates of the target workpiece in the workpiece coordinate system.

[0160] Therefore, the electronic device can calculate the coordinate offset of the transformed second coordinate and the transformed first coordinate, as the third coordinate of the target workpiece in the workpiece coordinate system. In other words, the third coordinate...

[0161] In another implementation, the electronic device can first calculate the coordinate offset between the first coordinate and the second coordinate in the robot arm coordinate system, and then multiply the coordinate offset by the transformation matrix from the robot arm coordinate system to the workpiece coordinate system. The result is the third coordinate of the target workpiece in the workpiece coordinate system.

[0162] As can be seen, in this embodiment, the electronic device can determine the angle and translation vector between the workpiece coordinate system and the robotic arm coordinate system; based on the angle and translation vector, it determines the transformation matrix from the robotic arm coordinate system to the workpiece coordinate system; it multiplies the transformation matrix by the first coordinate and the second coordinate respectively to obtain the transformed first coordinate and the transformed second coordinate; it calculates the coordinate offset of the transformed second coordinate and the transformed first coordinate as the third coordinate of the target workpiece in the workpiece coordinate system. Since the first coordinate and the second coordinate are both determined in the robotic arm coordinate system, the electronic device can multiply the transformation matrix by the first coordinate and the second coordinate respectively to obtain the transformed first coordinate and the transformed second coordinate in the workpiece coordinate system. Since the workpiece coordinate system is established with the target workpiece as the origin, the coordinate offset between the target workpiece and the marker point can be calculated as the third coordinate of the target workpiece in the workpiece coordinate system. In this way, the third coordinate can be determined quickly and accurately.

[0163] As one implementation method of this application, such as Figure 12 As shown, the step of determining the angle between the workpiece coordinate system and the robot arm coordinate system may include:

[0164] S1201, Calculate the first angle between the workpiece coordinate system and the pixel coordinate system in the image captured by the robot's camera;

[0165] A physical image of the robotic arm moving to the teaching and photographing position can be like... Figure 13 As shown, the electronic device can control the robotic arm 203 to move to the teaching and photographing position, and control the camera 205 to collect the pixel coordinates of the marker point 208. Since the image captured by the camera 205 contains the marker point 208, an orthogonal workpiece coordinate system can be established by selecting an edge in the image as the X-axis and taking the marker point 208 as the origin.

[0166] A schematic diagram of the workpiece coordinate system, pixel coordinate system, and robot arm coordinate system can be shown as follows: Figure 14 As shown, marker point 208 is located within the image, and the workpiece coordinate system O'-X'Y' is established with marker point 208 as the origin. To determine the pose of the target workpiece 206 in the workpiece coordinate system O'-X'Y', the electronic device needs to determine the transformation matrix from the robotic arm coordinate system O-X'Y' to the workpiece coordinate system O'-X'Y'. To determine the transformation matrix, the electronic device can calculate the first angle between the workpiece coordinate system O'-X'Y' and the pixel coordinate system O”-X”Y”.

[0167] S1202, Based on the pre-determined calibration matrix between the robotic arm coordinate system and the pixel coordinate system, determine the second included angle between the robotic arm coordinate system and the pixel coordinate system;

[0168] Before teaching the robot, a calibration matrix between the robotic arm coordinate system and the pixel coordinate system, i.e., the hand-eye calibration matrix, can be pre-determined. Based on this calibration matrix, the second included angle between the robotic arm coordinate system and the pixel coordinate system can then be determined.

[0169] S1203, Determine the angle between the workpiece coordinate system and the robot arm coordinate system based on the first included angle and the second included angle.

[0170] Since the first included angle and the second included angle are the angles between the pixel coordinate system and the workpiece coordinate system and the robot arm coordinate system, respectively, the electronic device can determine the angle between the workpiece coordinate system and the robot arm coordinate system based on the first included angle and the second included angle.

[0171] As can be seen, in this embodiment, the electronic device can calculate the first angle between the workpiece coordinate system and the pixel coordinate system in the image captured by the robot's camera; determine the second angle between the robot arm coordinate system and the pixel coordinate system based on a pre-determined calibration matrix between the robot arm coordinate system and the pixel coordinate system; and determine the angle between the workpiece coordinate system and the robot arm coordinate system based on the first angle and the second angle. Since the first angle and the second angle are the angles between the pixel coordinate system and the workpiece coordinate system and the robot arm coordinate system, respectively, the electronic device can determine the angle between the workpiece coordinate system and the robot arm coordinate system based on the first angle and the second angle. This allows for the rapid and accurate determination of the angle between the workpiece coordinate system and the robot arm coordinate system.

[0172] As one embodiment of this application, the step of determining the angle between the workpiece coordinate system and the robot arm coordinate system based on the first included angle and the second included angle may include:

[0173] Calculate the difference between the first included angle and the second included angle, and use it as the included angle between the workpiece coordinate system and the robot arm coordinate system.

[0174] When one of the robot arm coordinate system and the workpiece coordinate system is a left-handed coordinate system and the other is a right-handed coordinate system, the electronic device can calculate the difference between the first and second included angles as the included angle between the workpiece coordinate system and the robot arm coordinate system. For example, if the robot arm coordinate system is a left-handed coordinate system and the workpiece coordinate system is a right-handed coordinate system, with a first included angle of 45° and a second included angle of 15°, then the difference between the first and second included angles can be calculated to obtain an included angle of 30° between the workpiece coordinate system and the robot arm coordinate system.

[0175] When both the robot arm coordinate system and the workpiece coordinate system are left-handed coordinate systems, or both are right-handed coordinate systems, the electronic device can calculate the sum of the first and second included angles as the angle between the workpiece coordinate system and the robot arm coordinate system. For example, if both the robot arm coordinate system and the workpiece coordinate system are left-handed coordinate systems, and the first included angle is 15° and the second included angle is 15°, then the sum of the first and second included angles can be calculated to obtain an angle of 30° between the workpiece coordinate system and the robot arm coordinate system.

[0176] As can be seen, in this embodiment of the application, when both the robot arm coordinate system and the workpiece coordinate system are left-handed coordinate systems, or both are right-handed coordinate systems, the electronic device can calculate the sum of the first included angle and the second included angle as the included angle between the workpiece coordinate system and the robot arm coordinate system. When one of the robot arm coordinate system and the workpiece coordinate system is a left-handed coordinate system and the other is a right-handed coordinate system, the electronic device can calculate the difference between the first included angle and the second included angle as the included angle between the workpiece coordinate system and the robot arm coordinate system. In this way, the included angle between the workpiece coordinate system and the robot arm coordinate system can be calculated quickly and accurately.

[0177] As one embodiment of this application, the number of the aforementioned workbenches can be multiple. In this case, such as Figure 15 As shown, after the step of calculating the third coordinate of the target workpiece in the workpiece coordinate system based on the first coordinate and the second coordinate, as the workpiece position information corresponding to the worktable, the above method may further include:

[0178] S1501, the workbench is designated as a taught workbench;

[0179] When there are multiple workstations, the electronic device can control the robot to teach each workstation. After teaching the current workstation, the electronic device can designate the current workstation as the taught workstation. For example, assuming there are 10 workstations, numbered 1 to 10, after the electronic device controls the robot to teach workstation 1, it can designate workstation 1 as the taught workstation.

[0180] S1502, determine whether the number of taught workstations has reached the number of workstations; if the number of workstations has not been reached, proceed to step S1503;

[0181] In order to control the robot to teach all workstations, the electronic device can determine whether the number of taught workstations has reached the required number of workstations. If the number of taught workstations has not reached the required number of workstations, it means that there are workstations that have not been taught. In this case, the electronic device can execute step S1503, that is, control the robot to move to the position of the untaught workstation and return to execute step S101. If the number of taught workstations has reached the required number of workstations, it means that all workstations have been taught.

[0182] Following the example in step S1501, since the taught workstation is workstation 1, the number of taught workstations is 1. Since the number of taught workstations has not reached the required number of workstations, the electronic device can proceed to step S1503.

[0183] S1503, control the robot to move to the position of the untaught workbench, return to the step of controlling the robot's robotic arm to move to the position of the marked point on the workbench, until the number of taught workbench is reached.

[0184] If the number of taught worktables is less than the total number of worktables, in order to control the robot to complete the teaching of the untaught worktables, the electronic equipment can control the robot to move to the position of the untaught worktable and return to execute step S101 until the number of taught worktables reaches the total number of worktables. In this way, the workpiece position information of all worktables can be obtained.

[0185] Following the example in step S1502, the untaught worktables are worktable 2-worktable 10. The electronic device can control the robot to move to the position of worktable 2 and control the robot to complete the teaching for worktable 2 until the number of taught worktables has not reached the number of worktables.

[0186] As can be seen, in this embodiment, when there are multiple workbenches, the electronic device can use each workbench as a taught workbench; it determines whether the number of taught workbenches has reached the required number of workbenches; if not, it controls the robot to move to the position of an untaught workbench and returns to execute the step of controlling the robot's robotic arm to move to the marked point on the workbench, until the number of taught workbenches reaches the required number of workbenches. To control the robot to teach all workbenches, the electronic device can, after the robot completes teaching, use the current workbench as a taught workbench and determine whether the number of taught workbenches has reached the required number of workbenches. If not, it can control the robot to move to the position of an untaught workbench and control the robot to teach that untaught workbench. Assuming there are M workbenches and N robots, using the current teaching method requires controlling each robot to teach each workbench. If teaching one robot to one workbench is considered one operation, then the total number of teaching operations is MN. The teaching method provided in this application decouples the teaching pose from the robotic arm coordinate system. Therefore, only one robot needs to be selected to teach all workstations, instead of controlling each robot to teach each workstation, reducing the total number of teaching iterations to M. This significantly improves debugging and deployment efficiency and enhances practicality.

[0187] For example, a flowchart of a 3D (3-dimensional) teaching method can be as follows: Figure 16 As shown, the specific steps include:

[0188] S1601, select any composite robot to reach the predetermined position on the machine, teach the robotic arm vertically to the Mark point, and record the coordinates P at this time. MWB The robotic arm moves to the position where the workpiece is to be gripped and placed, and the coordinates P at this time are recorded. OWB ;

[0189] When there are multiple composite robots, the electronic device can select any one of them and control it to move to a predetermined position on an untaught workbench. Here, the composite robot is the robot mentioned above, the workbench is the worktable mentioned above, and the predetermined position of the workbench is a position pre-set in front of the workbench.

[0190] Electronic devices can control the robotic arm of the composite robot to be perpendicular to the Mark point used for teaching, and record the coordinates P of the robotic arm in the robotic arm coordinate system at this time. MWB Electronic equipment can control the robotic arm to move to the position where the workpiece is to be grasped and placed, and record the coordinates P of the robotic arm in the robotic arm coordinate system at this time. OWB The workpiece to be picked up and placed is the aforementioned target workpiece.

[0191] S1602, solve for the pose coordinates of the target workpiece in the three-dimensional coordinate system with Mark point as the reference, and record them as the workpiece position information of the machine tool; return to execute step S1601 until the workpiece position information of all machine tools is obtained.

[0192] Electronic devices can be based on P MWB and P OWB The pose coordinates of the target workpiece in a 3D coordinate system with the Mark point as the reference are calculated, and these pose coordinates are recorded as the workpiece position information of the machine tool. After the composite robot completes the teaching of the machine tool, the electronic device can treat the machine tool as a taught machine tool and determine whether the number of taught machine tools has reached the total number of machine tools. If the number of taught machine tools has not reached the total number of machine tools, the electronic device can return to step S1601, that is, control the composite robot to move to the predetermined position of the untaught machine tool and record the Mark point of the untaught machine tool and the coordinates of the workpiece position to be gripped and placed. If the number of taught machine tools has not reached the total number of machine tools, that is, the workpiece position information of all machine tools has been obtained, the loop ends.

[0193] For example, a flowchart for a 2D (2-dimensional) teaching method can be as follows: Figure 17 As shown, the specific steps include:

[0194] S1701, select any composite robot to reach the predetermined position on the machine, teach the robotic arm vertically to the Mark point, and record the coordinates P at this time. MWB The robotic arm moves to the position where the workpiece to be gripped and placed is vertically taught, and the coordinates P at this point are recorded. OWB ;

[0195] When there are multiple hybrid robots, the electronic device can select any one of them and control it to reach a predetermined position on an untaught machine. The electronic device can control the hybrid robot's arm to be perpendicular to the teaching mark point and record the arm's coordinates P in the robot arm coordinate system at this moment. MWB The electronic device can control the robotic arm to move to the position where the workpiece is to be gripped and placed, and control the center of the end effector of the robotic arm to coincide with the center of the workpiece on the machine platform plane, and record the coordinates P of the robotic arm in the robotic arm coordinate system at this time. OWB .

[0196] S1702, the robotic arm moves to the teaching and photography position, the camera takes a picture, and an orthogonal workpiece coordinate system is established with the Mark point in the image as the origin and one side as the X-axis.

[0197] Electronic equipment can control the robotic arm to move to the teaching and imaging position to acquire the image captured by the camera. Using the Mark point in the image as the origin and selecting one edge in the image as the X-axis, an orthogonal workpiece coordinate system, i.e., the workpiece coordinate system, is established.

[0198] S1703, based on the angle between the workpiece coordinate system and the robot arm coordinate system, generate a rigid body transformation matrix to transform the robot arm teaching coordinates to the workpiece coordinate system;

[0199] The transformation relationship between the workpiece coordinate system and the robot arm coordinate system is a rigid body transformation. The electronic device can generate a rigid body transformation matrix based on the angle between the workpiece coordinate system and the robot arm coordinate system, as well as the translation vector. The taught coordinates P in the robot arm coordinate system are then... MWB and P OWB Transform to the workpiece coordinate system.

[0200] S1704, calculate the two-dimensional coordinate offset of the Mark teaching pose and the target workpiece vertical teaching pose in the workpiece coordinate system, and record it as the workpiece position information of the machine tool; return to execute step S1701 until the workpiece position information of all machine tools is obtained.

[0201] The electronic device can solve for the two-dimensional coordinate offset of the teaching pose of the Mark point and the perpendicular teaching pose of the target workpiece in the workpiece coordinate system, that is, P in the workpiece coordinate system. MWB and P OWBThe two-dimensional coordinate offset between the two points is recorded as the workpiece position information of the machine. After the composite robot completes the teaching of the machine, the electronic device can treat the machine as a taught machine and determine whether the number of taught machines has reached the total number of machines. If the number of taught machines has not reached the total number of machines, the electronic device can return to step S1701, that is, control the composite robot to move to the predetermined position of the untaught machine and record the Mark point of the untaught machine and the coordinates of the workpiece to be gripped and placed. If the number of taught machines has not reached the total number of machines, that is, the workpiece position information of all machines has been obtained, the loop ends.

[0202] As can be seen, the 3D and 2D decoupling methods provided in this application can be adapted to different scenarios. This allows for more flexible selection of the decoupling method based on the actual situation.

[0203] As one embodiment of this application, the electronic device can also obtain the coordinate offset between the marker point and the target workpiece using a measuring tool, and then convert the offset to the workpiece coordinate system. For example, the measuring tool can be a ruler.

[0204] In the technical solution of this application, the operations of obtaining, storing, using, processing, transmitting, providing and disclosing user personal information are all carried out with the user's authorization.

[0205] Corresponding to the above-described robot teaching method, this application also provides a robot teaching device. The robot teaching device provided in this application embodiment will be described below.

[0206] like Figure 18 As shown, a teaching device for a robot includes:

[0207] The first coordinate recording module 1801 is used to control the robot's robotic arm to move to the position of the marked point on the worktable, and to control the end tool of the robotic arm to touch the marked point on the worktable, and to record the first coordinate of the robotic arm in the robotic arm coordinate system, wherein the marked point is a pre-set point whose relative pose to the target workpiece placed on the worktable remains unchanged.

[0208] The second coordinate recording module 1802 is used to control the robotic arm to move to the gripping and releasing position corresponding to the target workpiece and record the second coordinates of the robotic arm in the robotic arm coordinate system.

[0209] The third coordinate calculation module 1803 is used to calculate the third coordinate of the target workpiece in the workpiece coordinate system based on the first coordinate and the second coordinate, wherein the workpiece coordinate system is established with the marker point as the origin.

[0210] As can be seen, in this embodiment, the electronic device can control the robot's robotic arm to move to the position of the marker point on the worktable, and control the end effector of the robotic arm to touch the marker point on the worktable, recording the first coordinates of the robotic arm in the robotic arm coordinate system, wherein the marker point is a pre-set point whose relative pose to the target workpiece placed on the worktable remains unchanged; controlling the robotic arm to move to the gripping and releasing position corresponding to the target workpiece, recording the second coordinates of the robotic arm in the robotic arm coordinate system; and calculating the third coordinates of the target workpiece in the workpiece coordinate system based on the first and second coordinates, wherein the workpiece coordinate system is established with the marker point as the origin. Since the first and second coordinates are the coordinates of the marker point and the target workpiece in the robotic arm coordinate system, and the workpiece coordinate system is established with the marker point as the origin, the third coordinates of the target workpiece in the workpiece coordinate system can be determined based on the first and second coordinates. Since the third coordinate is only related to the relative pose between the marker point and the target workpiece, and is independent of the robotic arm coordinate system, the teaching pose and the robotic arm coordinate system can be decoupled. Furthermore, for each workstation, only one robot can be used for teaching, eliminating the need to teach each robot individually. This reduces the number of teaching sessions and improves robot deployment efficiency.

[0211] As one embodiment of this application, the first coordinate recording module 1801 described above may include:

[0212] The first coordinate recording submodule is used to control the end effector of the robotic arm to touch the marked point on the worktable, and the end effector is perpendicular to the worktable.

[0213] As one embodiment of this application, the second coordinate recording module 1802 described above may include:

[0214] The second coordinate recording submodule is used to control the position of the robotic arm to the target workpiece on the worktable when the robotic arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, and to control the end tool to grasp and release the target workpiece, and to record the second coordinates in the robotic arm coordinate system when the robotic arm grasps and releases the target workpiece.

[0215] The third coordinate recording submodule is used to control the robotic arm to move to the position of the target workpiece on the worktable when the robotic arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems, and to control the end tool of the robotic arm to be perpendicular to the surface of the worktable, and the center of the end tool and the center of the target workpiece are at the same point on the worktable, and to record the second coordinates of the robotic arm in the robotic arm coordinate system.

[0216] As one embodiment of this application, the above-mentioned robotic arm coordinate system and the above-mentioned workpiece coordinate system can be three-dimensional coordinate systems, the above-mentioned first coordinate can be represented by a first pose matrix, and the above-mentioned second coordinate can be represented by a second pose matrix.

[0217] The aforementioned third coordinate calculation module 1803 may include:

[0218] The first coordinate calculation submodule is used to calculate the third coordinate of the target workpiece in the workpiece coordinate system based on the coordinate transformation relationship represented by the first pose matrix and the second pose matrix.

[0219] As one embodiment of this application, the first coordinate calculation submodule described above may include:

[0220] The inverse matrix calculation unit is used to calculate the inverse matrix of the first pose matrix, which serves as the transformation matrix from the robot arm coordinate system to the workpiece coordinate system.

[0221] The coordinate calculation unit is used to multiply the transformation matrix with the second pose matrix to obtain the third coordinate of the target workpiece in the workpiece coordinate system.

[0222] As one embodiment of this application, the above-mentioned robotic arm coordinate system and the workpiece coordinate system can be two-dimensional coordinate systems;

[0223] The aforementioned third coordinate calculation module 1803 may include:

[0224] The parameter determination submodule is used to determine the angle between the workpiece coordinate system and the robot arm coordinate system, as well as the translation vector.

[0225] The transformation matrix determination submodule is used to determine the transformation matrix from the robot arm coordinate system to the workpiece coordinate system based on the included angle and the translation vector.

[0226] The coordinate transformation submodule is used to multiply the transformation matrix by the first coordinate and the second coordinate respectively to obtain the transformed first coordinate and the transformed second coordinate;

[0227] The second coordinate calculation submodule is used to calculate the coordinate offset of the transformed second coordinate and the transformed first coordinate, as the third coordinate of the target workpiece in the workpiece coordinate system.

[0228] As one embodiment of this application, the above parameter determination submodule may include:

[0229] Angle calculation unit is used to calculate the first angle between the workpiece coordinate system and the pixel coordinate system in the image captured by the robot's camera;

[0230] The first included angle determination unit is used to determine the second included angle between the robotic arm coordinate system and the pixel coordinate system based on a pre-determined calibration matrix between the robotic arm coordinate system and the pixel coordinate system.

[0231] The second included angle determination unit is used to determine the included angle between the workpiece coordinate system and the robot arm coordinate system based on the first included angle and the second included angle.

[0232] As one embodiment of this application, the second included angle determining unit may include:

[0233] Angle calculation subunit is used to calculate the difference between the first angle and the second angle, which is used as the angle between the workpiece coordinate system and the robot arm coordinate system.

[0234] As one embodiment of this application, the number of the above-mentioned workbenches can be multiple;

[0235] The above-mentioned device may further include:

[0236] The workbench determination module is used to designate the workbench as a taught workbench;

[0237] The quantity determination module is used to determine whether the number of taught workbenches has reached the required number of workbenches;

[0238] The return module is used to control the robot to move to the position of the untaught workbench if the number of taught workbenches has not been reached, and return to the step of controlling the robot's robotic arm to move to the position of the marked point on the workbench, until the number of taught workbenches reaches the number of taught workbenches.

[0239] This application also provides an electronic device, such as... Figure 19 As shown, it includes:

[0240] Memory 1901 is used to store computer programs;

[0241] The processor 1902, when executing the program stored in the memory 1901, implements the robot teaching method steps described in any of the above embodiments.

[0242] Furthermore, the aforementioned electronic device may also include a communication bus and / or a communication interface, with the processor 1902, the communication interface, and the memory 1901 communicating with each other via the communication bus.

[0243] As can be seen, in this embodiment, the electronic device can control the robot's robotic arm to move to the position of the marker point on the worktable, and control the end effector of the robotic arm to touch the marker point on the worktable, recording the first coordinates of the robotic arm in the robotic arm coordinate system, wherein the marker point is a pre-set point whose relative pose to the target workpiece placed on the worktable remains unchanged; controlling the robotic arm to move to the gripping and releasing position corresponding to the target workpiece, recording the second coordinates of the robotic arm in the robotic arm coordinate system; and calculating the third coordinates of the target workpiece in the workpiece coordinate system based on the first and second coordinates, wherein the workpiece coordinate system is established with the marker point as the origin. Since the first and second coordinates are the coordinates of the marker point and the target workpiece in the robotic arm coordinate system, and the workpiece coordinate system is established with the marker point as the origin, the third coordinates of the target workpiece in the workpiece coordinate system can be determined based on the first and second coordinates. Since the third coordinate is only related to the relative pose between the marker point and the target workpiece, and is independent of the robotic arm coordinate system, the teaching pose and the robotic arm coordinate system can be decoupled. Furthermore, for each workstation, only one robot can be used for teaching, eliminating the need to teach each robot individually. This reduces the number of teaching sessions and improves robot deployment efficiency.

[0244] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0245] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0246] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0247] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0248] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described robot teaching methods.

[0249] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute the teaching method of any of the robots described in the above embodiments.

[0250] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a solid-state drive (SSD), etc.

[0251] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0252] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for apparatuses, systems, electronic devices, computer-readable storage media, and computer program products, since they are basically similar to the method embodiments, the descriptions are relatively simple, and relevant parts can be referred to the descriptions of the method embodiments.

[0253] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. A method for teaching a robot, characterized in that, The method includes: Control the robot's robotic arm to move to the position of the marked point on the worktable, and control the end tool of the robotic arm to touch the marked point on the worktable. Record the first coordinate of the robotic arm in the robotic arm coordinate system, wherein the marked point is a pre-set point whose relative pose to the target workpiece placed on the worktable remains unchanged. Control the robotic arm to move to the gripping and releasing position corresponding to the target workpiece, and record the second coordinates of the robotic arm in the robotic arm coordinate system; Based on the first coordinate and the second coordinate, the third coordinate of the target workpiece in the workpiece coordinate system is calculated. The workpiece coordinate system is established with the marker point as the origin. The third coordinate is only related to the relative pose between the marker point and the target workpiece and is independent of the robot arm coordinate system. When it is necessary to grasp and place the target workpiece on the worktable, the third coordinate can be invoked by any robot deployed on the worktable so that after the robot determines the position of the marker point on the worktable through the camera, it determines the position of the target workpiece on the worktable based on the third coordinate.

2. The method according to claim 1, characterized in that, The step of controlling the end effector of the robotic arm to touch the marked point on the worktable includes: The end effector of the robotic arm is controlled to touch a marked point on the worktable, and the end effector is perpendicular to the worktable.

3. The method according to claim 1, characterized in that, The step of controlling the robotic arm to move to the gripping / releasing position corresponding to the target workpiece and recording the second coordinates of the robotic arm in the robotic arm coordinate system includes: When the robotic arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, the robotic arm is controlled to move to the position of the target workpiece on the worktable, and the end effector is controlled to grip and release the target workpiece. The second coordinate in the robotic arm coordinate system is recorded when the robotic arm grips and releases the target workpiece. When the robot arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems, the robot arm is controlled to move to the position of the target workpiece on the worktable, and the end tool of the robot arm is controlled to be perpendicular to the surface of the worktable, and the center of the end tool and the center of the target workpiece are at the same point on the worktable. The second coordinate of the robot arm in the robot arm coordinate system is recorded.

4. The method according to claim 1, characterized in that, The robotic arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems. The first coordinate is represented by a first pose matrix, and the second coordinate is represented by a second pose matrix. The step of calculating the third coordinate of the target workpiece in the workpiece coordinate system based on the first coordinate and the second coordinate includes: Based on the coordinate transformation relationship represented by the first pose matrix and the second pose matrix, the third coordinate of the target workpiece in the workpiece coordinate system is calculated.

5. The method according to claim 4, characterized in that, The step of calculating the third coordinates of the target workpiece in the workpiece coordinate system based on the coordinate transformation relationship represented by the first pose matrix and the second pose matrix includes: Calculate the inverse of the first pose matrix, and use it as the transformation matrix from the robot arm coordinate system to the workpiece coordinate system; Multiplying the transformation matrix by the second pose matrix yields the third coordinate of the target workpiece in the workpiece coordinate system.

6. The method according to claim 1, characterized in that, The coordinate system of the robotic arm and the coordinate system of the workpiece are two-dimensional coordinate systems. The step of calculating the third coordinate of the target workpiece in the workpiece coordinate system based on the first coordinate and the second coordinate includes: Determine the angle between the workpiece coordinate system and the robot arm coordinate system, as well as the translation vector; Based on the included angle and the translation vector, determine the transformation matrix from the robot arm coordinate system to the workpiece coordinate system; Multiply the transformation matrix by the first coordinate and the second coordinate respectively to obtain the transformed first coordinate and the transformed second coordinate; Calculate the coordinate offset of the transformed second coordinate and the transformed first coordinate, and use it as the third coordinate of the target workpiece in the workpiece coordinate system.

7. The method according to claim 6, characterized in that, The step of determining the angle between the workpiece coordinate system and the robot arm coordinate system includes: Calculate the first angle between the workpiece coordinate system and the pixel coordinate system in the image captured by the robot's camera; Based on the pre-determined calibration matrix between the robotic arm coordinate system and the pixel coordinate system, a second included angle between the robotic arm coordinate system and the pixel coordinate system is determined; The angle between the workpiece coordinate system and the robot arm coordinate system is determined based on the first included angle and the second included angle.

8. The method according to claim 7, characterized in that, The step of determining the angle between the workpiece coordinate system and the robot arm coordinate system based on the first included angle and the second included angle includes: Calculate the difference between the first included angle and the second included angle, and use it as the included angle between the workpiece coordinate system and the robot arm coordinate system.

9. The method according to any one of claims 1-8, characterized in that, The number of workbenches is multiple; After the step of calculating the third coordinate of the target workpiece in the workpiece coordinate system based on the first coordinate and the second coordinate, as the workpiece position information corresponding to the worktable, the method further includes: The workbench is designated as the taught workbench; Determine whether the number of taught workstations has reached the required number of workstations; If the number of worktables is not reached, control the robot to move to the position of the untaught worktable, and return to the step of controlling the robot's robotic arm to move to the position of the marked point on the worktable, until the number of taught worktables reaches the required number of worktables.

10. A teaching device for a robot, characterized in that, The device includes: The first coordinate recording module is used to control the robot's robotic arm to move to the position of the marked point on the worktable, and to control the end tool of the robotic arm to touch the marked point on the worktable, and to record the first coordinate of the robotic arm in the robotic arm coordinate system, wherein the marked point is a pre-set point whose relative pose to the target workpiece placed on the worktable remains unchanged. The second coordinate recording module is used to control the robotic arm to move to the gripping and releasing position corresponding to the target workpiece and record the second coordinates of the robotic arm in the robotic arm coordinate system. The third coordinate calculation module is used to calculate the third coordinate of the target workpiece in the workpiece coordinate system based on the first coordinate and the second coordinate. The workpiece coordinate system is established with the marker point as the origin. The third coordinate is only related to the relative pose between the marker point and the target workpiece and is independent of the robot arm coordinate system. When it is necessary to grasp and place the target workpiece on the worktable, the third coordinate can be invoked by any robot deployed on the worktable, so that after the robot determines the position of the marker point on the worktable through the camera, it determines the position of the target workpiece on the worktable based on the third coordinate.

11. The apparatus according to claim 10, characterized in that, The first coordinate recording module includes: The first coordinate recording submodule is used to control the end effector of the robotic arm to touch the marked point on the worktable, and the end effector is perpendicular to the worktable; The second coordinate recording module includes: The second coordinate recording submodule is used to control the position of the robotic arm to the target workpiece on the worktable when the robotic arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, and to control the end tool to grasp and release the target workpiece, and to record the second coordinates in the robotic arm coordinate system when the robotic arm grasps and releases the target workpiece. The third coordinate recording submodule is used to control the robotic arm to move to the position of the target workpiece on the worktable when the robotic arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems, and to control the end tool of the robotic arm to be perpendicular to the surface of the worktable, and the center of the end tool and the center of the target workpiece are at the same point on the worktable, and to record the second coordinates of the robotic arm in the robotic arm coordinate system. The robotic arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems. The first coordinate is represented by a first pose matrix, and the second coordinate is represented by a second pose matrix. The third coordinate calculation module includes: The first coordinate calculation submodule is used to calculate the third coordinate of the target workpiece in the workpiece coordinate system based on the coordinate transformation relationship represented by the first pose matrix and the second pose matrix. The first coordinate calculation submodule includes: The inverse matrix calculation unit is used to calculate the inverse matrix of the first pose matrix, which serves as the transformation matrix from the robot arm coordinate system to the workpiece coordinate system. The coordinate calculation unit is used to multiply the transformation matrix with the second pose matrix to obtain the third coordinate of the target workpiece in the workpiece coordinate system; The coordinate system of the robotic arm and the coordinate system of the workpiece are two-dimensional coordinate systems. The third coordinate calculation module includes: The parameter determination submodule is used to determine the angle between the workpiece coordinate system and the robot arm coordinate system, as well as the translation vector. The transformation matrix determination submodule is used to determine the transformation matrix from the robot arm coordinate system to the workpiece coordinate system based on the included angle and the translation vector. The coordinate transformation submodule is used to multiply the transformation matrix by the first coordinate and the second coordinate respectively to obtain the transformed first coordinate and the transformed second coordinate; The second coordinate calculation submodule is used to calculate the coordinate offset of the transformed second coordinate and the transformed first coordinate, as the third coordinate of the target workpiece in the workpiece coordinate system; The parameter determination submodule includes: Angle calculation unit is used to calculate the first angle between the workpiece coordinate system and the pixel coordinate system in the image captured by the robot's camera; The first included angle determination unit is used to determine the second included angle between the robotic arm coordinate system and the pixel coordinate system based on a pre-determined calibration matrix between the robotic arm coordinate system and the pixel coordinate system. The second included angle determination unit is used to determine the included angle between the workpiece coordinate system and the robot arm coordinate system based on the first included angle and the second included angle. The second included angle determining unit includes: Angle calculation subunit is used to calculate the difference between the first angle and the second angle, which is used as the angle between the workpiece coordinate system and the robot arm coordinate system; The number of workbenches is multiple; The device further includes: The workbench determination module is used to designate the workbench as a taught workbench; The quantity determination module is used to determine whether the number of taught workbenches has reached the required number of workbenches; The return module is used to control the robot to move to the position of the untaught workbench if the number of taught workbenches has not been reached, and return to the step of controlling the robot's robotic arm to move to the position of the marked point on the workbench, until the number of taught workbenches reaches the number of taught workbenches.

12. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-9.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-9.

Citation Information

Patent Citations

  • Quick teaching system and teaching method of industrial robot

    CN109514533A