Nothing Special   »   [go: up one dir, main page]

CN118305773A - Teaching method and device of robot, electronic equipment and storage medium - Google Patents

Teaching method and device of robot, electronic equipment and storage medium Download PDF

Info

Publication number
CN118305773A
CN118305773A CN202410457901.7A CN202410457901A CN118305773A CN 118305773 A CN118305773 A CN 118305773A CN 202410457901 A CN202410457901 A CN 202410457901A CN 118305773 A CN118305773 A CN 118305773A
Authority
CN
China
Prior art keywords
coordinate
coordinate system
mechanical arm
workpiece
workbench
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410457901.7A
Other languages
Chinese (zh)
Inventor
朱松
皮富涛
尹昌顺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikrobot Co Ltd
Original Assignee
Hangzhou Hikrobot Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikrobot Co Ltd filed Critical Hangzhou Hikrobot Co Ltd
Priority to CN202410457901.7A priority Critical patent/CN118305773A/en
Publication of CN118305773A publication Critical patent/CN118305773A/en
Pending legal-status Critical Current

Links

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/0081Programme-controlled manipulators with master teach-in means
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1656Programme controls characterised by programming, planning systems for manipulators
    • B25J9/1664Programme controls characterised by programming, planning systems for manipulators characterised by motion, path, trajectory planning
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1679Programme controls characterised by the tasks executed

Landscapes

  • Engineering & Computer Science (AREA)
  • Robotics (AREA)
  • Mechanical Engineering (AREA)
  • Manipulator (AREA)
  • Numerical Control (AREA)

Abstract

The embodiment of the application provides a teaching method, a teaching device, electronic equipment and a storage medium of a robot, wherein the electronic equipment can control a mechanical arm of the robot to move to a position of a marking point on a workbench, control a terminal tool point to touch the marking point, and record a first coordinate of the mechanical arm under a mechanical arm coordinate system; controlling the mechanical arm to move to a grabbing and placing position corresponding to the target workpiece, and recording a second coordinate of the mechanical arm under a mechanical arm coordinate system; based on the first and second coordinates, a third coordinate of the target workpiece in the workpiece coordinate system is calculated. Since the first and second coordinates are the coordinates of the identification point and the target object in the robot arm coordinate system, the third coordinate of the target object in the object coordinate system can be determined based on the first and second coordinates. Because the third coordinate is irrelevant to the mechanical arm coordinate system, only one robot can be used for teaching, each robot is not required to teach, the teaching times can be reduced, and the deployment efficiency of the robots is improved.

Description

Teaching method and device of robot, electronic equipment and storage medium
Technical Field
The present application relates to the field of robot teaching technologies, and in particular, to a teaching method and apparatus for a robot, an electronic device, and a storage medium.
Background
Robots are widely used, for example, AGVs (Automated Guided Vehicle, automatic guided vehicles), AMR (Autonomous Mobile Robot, autonomous mobile robots), RGVs (Rail Guided Vehicle, guided vehicles), IGVs (INTELLIGENT GUIDED VEHICLE, intelligent guided vehicles), robots with a combination of mechanical arms and machine vision, with "hands, feet, eyes, brain", and are widely used in the fields of warehouse logistics, automation factories, automated cargo supermarkets, etc. The material conveying device can convey materials, load and unload articles, sort materials and the like.
Before the robot is formally put into use, the position information of each action required to be executed by the mechanical arm needs to be controlled, so that the mechanical arm knows the position required to be reached, and the robot is accurately grabbed, namely taught. In the current teaching mode: and calculating a conversion matrix between the camera coordinate system and the mechanical arm coordinate system, and calculating the offset of the mechanical arm relative to the target workpiece according to the pixel coordinates of the workpiece in the camera view field and the conversion matrix. Or establishing a TCP (Tool Centre Position, tool center) coordinate system by taking the identification point on the workbench as an origin, controlling the robot to grasp the target workpiece, and recording the pose of the mechanical arm under the TCP coordinate system.
In the teaching mode, the offset and the teaching pose corresponding to the mechanical arm are determined relative to the base coordinate system or the TCP coordinate system of the robot, and the base coordinate systems of different robots are different due to the influence of factors such as installation and debugging, and the teaching poses of different robots relative to the TCP coordinate system are also different, so that teaching needs to be performed on each robot for each workbench, teaching times are excessive, and the deployment efficiency of the robots is very low.
Disclosure of Invention
The embodiment of the application aims to provide a teaching method and device of a robot, electronic equipment and a storage medium, so as to improve the deployment efficiency of the robot. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a teaching method for a robot, where the method includes:
Controlling a mechanical arm of a robot to move to the position of an identification point on a workbench, controlling a tail end tool point of the mechanical arm to touch the identification point on the workbench, and recording a first coordinate of the mechanical arm under a mechanical arm coordinate system, wherein the identification point is a preset relative pose unchanged from a target workpiece placed on the workbench;
Controlling the mechanical arm to move to a grabbing and placing position corresponding to the target workpiece, and recording a second coordinate of the mechanical arm under the mechanical arm coordinate system;
and calculating a third coordinate of the target workpiece under a workpiece coordinate system based on the first coordinate and the second coordinate, wherein the workpiece coordinate system is established by taking the identification point as an origin.
Optionally, the step of controlling the end tool of the mechanical arm to touch the mark point on the workbench includes:
And controlling an end tool of the mechanical arm to point on a mark point on the workbench, wherein the end tool is perpendicular to the workbench.
Optionally, the step of controlling the mechanical arm to move to a gripping position corresponding to the target workpiece and recording a second coordinate of the mechanical arm under the mechanical arm coordinate system includes:
Controlling the mechanical arm to move to the position of the target workpiece on the workbench under the condition that the mechanical arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, controlling the end tool to grasp and put the target workpiece, recording a second coordinate under the mechanical arm coordinate system when the mechanical arm grasps and put the target workpiece, or,
And under the condition that the mechanical arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems, controlling the mechanical arm to move to the position of the target workpiece on the workbench, controlling the tail end tool of the mechanical arm to be perpendicular to the table top of the workbench, enabling the center of the tail end tool and the projection point of the center of the target workpiece on the workbench to be in the same point, and recording the second coordinate of the mechanical arm under the mechanical arm coordinate system.
Optionally, the mechanical 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 a third coordinate of the target workpiece in a workpiece coordinate system based on the first coordinate and the second coordinate includes:
and calculating a third coordinate of the target workpiece under the workpiece coordinate system based on the coordinate conversion relation represented by the first pose matrix and the second pose matrix.
Optionally, the step of calculating a third coordinate of the target workpiece under the workpiece coordinate system based on the coordinate transformation relationship represented by the first pose matrix and the second pose matrix includes:
Calculating an inverse matrix of the first pose matrix as a conversion matrix from the mechanical arm coordinate system to the workpiece coordinate system;
Multiplying the transformation matrix with the second pose matrix to obtain a third coordinate of the target workpiece under the workpiece coordinate system.
Optionally, the mechanical arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems;
The step of calculating a third coordinate of the target workpiece in a workpiece coordinate system based on the first coordinate and the second coordinate includes:
determining an included angle between the workpiece coordinate system and the mechanical arm coordinate system and a translation vector;
Determining a conversion matrix from the mechanical arm coordinate system to the workpiece coordinate system based on the included angle and the translation vector;
Multiplying the conversion matrix with the first coordinate and the second coordinate respectively to obtain a converted first coordinate and a converted second coordinate;
And calculating the coordinate offset of the converted second coordinate and the converted first coordinate to be used as a third coordinate of the target workpiece under the workpiece coordinate system.
Optionally, the step of determining an included angle between the workpiece coordinate system and the mechanical arm coordinate system includes:
Calculating a first included angle between the workpiece coordinate system and a pixel coordinate system in an image shot by a camera of the robot;
Determining a second included angle between the mechanical arm coordinate system and the pixel coordinate system based on a predetermined calibration matrix between the mechanical arm coordinate system and the pixel coordinate system;
And determining an included angle between the workpiece coordinate system and the mechanical arm coordinate system according to the first included angle and the second included angle.
Optionally, the step of determining an included angle between the workpiece coordinate system and the mechanical arm coordinate system according to the first included angle and the second included angle includes:
And calculating a difference value between the first included angle and the second included angle to be used as an included angle between the workpiece coordinate system and the mechanical arm coordinate system.
Optionally, the number of the working tables is a plurality;
after the step of calculating, based on the first coordinate and the second coordinate, a third coordinate of the target workpiece in a workpiece coordinate system as workpiece position information corresponding to the workbench, the method further includes:
The workbench is used as a taught workbench;
Judging whether the number of the taught work tables reaches the number of the work tables or not;
And if the number of the work tables is not reached, controlling the robot to move to the position of the work table which is not taught, and returning to the step of executing the step of controlling the mechanical arm of the robot to move to the position of the identification point on the work table until the number of the taught work tables reaches the number of the work tables.
In a second aspect, an embodiment of the present application provides a teaching apparatus for a robot, including:
The first coordinate recording module is used for controlling the mechanical arm of the robot to move to the position of the identification point on the workbench, controlling the tail end tool point of the mechanical arm to touch the identification point on the workbench, and recording the first coordinate of the mechanical arm under the mechanical arm coordinate system, wherein the identification point is a preset relative pose unchanged from a target workpiece placed on the workbench;
The second coordinate recording module is used for controlling the mechanical arm to move to a grabbing and placing position corresponding to the target workpiece and recording a second coordinate of the mechanical arm under the mechanical arm coordinate system;
And the third coordinate calculation module is used for calculating the third coordinate of the target workpiece under a workpiece coordinate system based on the first coordinate and the second coordinate, wherein the workpiece coordinate system is established by taking the identification point as an origin.
Optionally, the first coordinate recording module includes:
and the first coordinate recording sub-module is used for controlling the tail end tool of the mechanical arm to touch the identification point on the workbench, and the tail end tool is perpendicular to the workbench.
Optionally, the second coordinate recording module includes:
The second coordinate recording sub-module is used for controlling the mechanical arm to move to the position of the target workpiece on the workbench and controlling the end tool to grasp and put the target workpiece under the condition that the mechanical arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, and recording the second coordinate under the mechanical arm coordinate system when the mechanical arm grasps and puts the target workpiece;
And the third coordinate recording sub-module is used for controlling the mechanical arm to move to the position of the target workpiece on the workbench under the condition that the mechanical arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems, controlling the tail end tool of the mechanical arm to be perpendicular to the table top of the workbench, enabling the center of the tail end tool and the projection point of the center of the target workpiece on the workbench to be co-located, and recording the second coordinate of the mechanical arm under the mechanical arm coordinate system.
Optionally, the mechanical 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:
And the first coordinate calculation sub-module is used for calculating a third coordinate of the target workpiece under the workpiece coordinate system based on the coordinate conversion relation represented by the first pose matrix and the second pose matrix.
Optionally, the first coordinate calculation sub-module includes:
An inverse matrix calculation unit, configured to calculate an inverse matrix of the first pose matrix as a transformation matrix from the robot arm coordinate system to the workpiece coordinate system;
And the coordinate calculation unit is used for multiplying the transformation matrix with the second pose matrix to obtain a third coordinate of the target workpiece under the workpiece coordinate system.
Optionally, the mechanical arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems;
The third coordinate calculation module includes:
The parameter determination submodule is used for determining an included angle between the workpiece coordinate system and the mechanical arm coordinate system and a translation vector;
A transformation matrix determining sub-module, configured to determine a transformation matrix from the robot coordinate system to the workpiece coordinate system based on the included angle and the translation vector;
the coordinate conversion sub-module is used for multiplying the conversion matrix with the first coordinate and the second coordinate respectively to obtain a converted first coordinate and a converted second coordinate;
And the second coordinate computing sub-module is used for computing the coordinate offset of the converted second coordinate and the converted first coordinate as a third coordinate of the target workpiece under the workpiece coordinate system.
Optionally, the parameter determining submodule includes:
an included angle calculating unit, configured to calculate a first included angle between the workpiece coordinate system and a pixel coordinate system in an image captured by a camera of the robot;
a first included angle determining unit, configured to determine a second included angle between the mechanical arm coordinate system and the pixel coordinate system based on a predetermined calibration matrix between the mechanical arm coordinate system and the pixel coordinate system;
and the second included angle determining unit is used for determining an included angle between the workpiece coordinate system and the mechanical arm coordinate system according to the first included angle and the second included angle.
Optionally, the second included angle determining unit includes:
and the included angle calculating subunit is used for calculating the difference value of the first included angle and the second included angle to be used as the included angle between the workpiece coordinate system and the mechanical arm coordinate system.
Optionally, the number of the working tables is a plurality;
the apparatus further comprises:
the workbench determining module is used for taking the workbench as a taught workbench;
the quantity judging module is used for judging whether the quantity of the taught work stations reaches the quantity of the work stations or not;
And the return module is used for controlling the robot to move to the position of the non-taught workbench if the number of the workbench is not reached, and returning to execute the step of controlling the mechanical arm of the robot to move to the position of the identification point on the workbench until the number of the taught workbench reaches the number of the workbench.
In a third aspect, an embodiment of the present application provides an electronic device, including:
a memory for storing a computer program;
A processor configured to implement the method according to any one of the first aspect when executing a program stored in the memory.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having a computer program stored therein, which when executed by a processor implements the method of any of the first aspects.
The embodiment of the application has the beneficial effects that:
In the scheme provided by the embodiment of the application, the electronic equipment can control the mechanical arm of the robot to move to the position of the identification point on the workbench, control the end tool of the mechanical arm to point the identification point on the workbench, and record the first coordinate of the mechanical arm under the mechanical arm coordinate system, wherein the identification point is a preset relative pose unchanged from a target workpiece placed on the workbench; controlling the mechanical arm to move to a grabbing and placing position corresponding to the target workpiece, and recording a second coordinate of the mechanical arm under a mechanical arm coordinate system; and calculating a third coordinate of the target workpiece under a workpiece coordinate system based on the first coordinate and the second coordinate, wherein the workpiece coordinate system is established by taking the identification point as an origin. Since the first coordinate and the second coordinate are the coordinates of the identification point and the target workpiece in the mechanical arm coordinate system, and the workpiece coordinate system is established with the identification point as the origin, the third coordinate of the target workpiece in the workpiece coordinate system can be determined based on the first coordinate and the second coordinate. The third coordinate is only related to the relative pose between the identification point and the target workpiece and is irrelevant to the mechanical arm coordinate system, so that decoupling of the teaching pose and the mechanical arm coordinate system can be realized. Furthermore, only one robot can be used for teaching aiming at each workbench, teaching is not required to be carried out for each robot, teaching times can be reduced, and the deployment efficiency of the robots is improved.
Of course, it is not necessary for any one product or method of practicing the application to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the application, and other embodiments may be obtained according to these drawings to those skilled in the art.
Fig. 1 is a flowchart of a teaching method of a robot according to an embodiment of the present application;
FIG. 2 is a schematic diagram of loading and unloading of a robot based on the embodiment shown in FIG. 1;
FIG. 3 is a schematic diagram of a robotic arm coordinate system based on the embodiment of FIG. 1;
FIG. 4 is a pictorial illustration of an end tool of the robotic arm moving to a target workpiece pick-and-place position, based on the embodiment of FIG. 1;
FIG. 5 is a schematic illustration of an end tool point touch marker point of the robotic arm based on the embodiment of FIG. 1;
FIG. 6 is a schematic illustration of an end tool of the robotic arm gripping a target workpiece based on the embodiment of FIG. 1;
FIG. 7 is a schematic illustration of the end tool of the robotic arm co-pointing with the center of the target workpiece based on the embodiment of FIG. 1;
FIG. 8 is a specific flowchart of step S103 in the embodiment shown in FIG. 1;
FIG. 9 is a schematic illustration of the target workpiece and the identification points in a robot coordinate system based on the embodiment of FIG. 1;
FIG. 10 is another specific flowchart of step S103 in the embodiment shown in FIG. 1;
FIG. 11 is a schematic diagram of the coordinate offset of the target workpiece to the identified point based on the embodiment of FIG. 1;
FIG. 12 is a flowchart showing a step S1001 in the embodiment shown in FIG. 10;
FIG. 13 is a physical diagram of the robotic arm moving to a teach photographing position based on the embodiment of FIG. 1;
FIG. 14 is a schematic view of a workpiece coordinate system, a pixel coordinate system, and a robot arm coordinate system based on the embodiment of FIG. 1;
FIG. 15 is a flow chart for teaching a plurality of work stations based on the control robot of the embodiment of FIG. 1;
FIG. 16 is a flow chart of a 3D teaching mode based on the embodiment shown in FIG. 1;
FIG. 17 is a flow chart of a 2D teaching mode based on the embodiment shown in FIG. 1;
Fig. 18 is a schematic structural diagram of a teaching device of a robot according to an embodiment of the present application;
fig. 19 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by the person skilled in the art based on the present application are included in the scope of protection of the present application.
In order to improve the deployment efficiency of the robot. The embodiment of the application provides a teaching method, a teaching device, electronic equipment, a computer readable storage medium and a computer program product of a robot. The teaching method of the robot provided by the embodiment of the application is first described below.
The teaching method of the robot provided by the embodiment of the application can be applied to any electronic equipment needing teaching of the robot, for example, the teaching method can be an automatic control equipment, a central control equipment, a warehouse automation equipment and the like, and is not particularly limited. For clarity of description, hereinafter referred to as an electronic device.
As shown in fig. 1, a teaching method of a robot, the method includes:
S101, controlling a mechanical arm of a robot to move to the position of an identification point on a workbench, controlling a tail end tool of the mechanical arm to touch the identification point on the workbench, and recording a first coordinate of the mechanical arm under a mechanical arm coordinate system;
the identification points are preset relative pose unchanged from a target workpiece placed on the workbench;
s102, controlling the mechanical arm to move to a grabbing and placing position corresponding to the target workpiece, and recording a second coordinate of the mechanical arm under the mechanical arm coordinate system;
S103, calculating third coordinates of the target workpiece under a workpiece coordinate system based on the first coordinates and the second coordinates.
The workpiece coordinate system is established by taking the identification point as an origin.
In the embodiment of the application, the electronic equipment can control the mechanical arm of the robot to move to the position of the identification point on the workbench, control the end tool of the mechanical arm to point contact the identification point on the workbench, and record the first coordinate of the mechanical arm under the mechanical arm coordinate system, wherein the identification point is a preset relative pose unchanged from a target workpiece placed on the workbench; controlling the mechanical arm to move to a grabbing and placing position corresponding to the target workpiece, and recording a second coordinate of the mechanical arm under a mechanical arm coordinate system; and calculating a third coordinate of the target workpiece under a workpiece coordinate system based on the first coordinate and the second coordinate, wherein the workpiece coordinate system is established by taking the identification point as an origin. Since the first coordinate and the second coordinate are the coordinates of the identification point and the target workpiece in the mechanical arm coordinate system, and the workpiece coordinate system is established with the identification point as the origin, the third coordinate of the target workpiece in the workpiece coordinate system can be determined based on the first coordinate and the second coordinate. The third coordinate is only related to the relative pose between the identification point and the target workpiece and is irrelevant to the mechanical arm coordinate system, so that decoupling of the teaching pose and the mechanical arm coordinate system can be realized. Furthermore, only one robot can be used for teaching aiming at each workbench, teaching is not required to be carried out for each robot, teaching times can be reduced, and the deployment efficiency of the robots is improved.
In order to determine the position of the target workpiece to be grasped and placed on the workbench by the robot, before teaching the robot, an identification point can be arranged on the workbench, and the relative pose between the identification point and the target workpiece placed on the workbench is unchanged. Thus, the robot can determine the position of the identification point through the camera, and further determine the position of the target workpiece based on the relative pose. The camera of the robot may be on the mechanical arm or may be outside the mechanical arm, which is not specifically limited herein.
In one embodiment, an identification area may be set on the table, and a point in the identification area that can reflect the reference feature may be used as the identification point. Wherein, the internal characteristics of the identification area can be set by means of attaching labels, printing and etching, and the like. For example, a two-dimensional code label or a character label may be attached to the inside of the identification area, and the identification point may be an angular point inside the identification area, which is not specifically limited herein. In addition, it is also necessary to ensure that the camera of the robot can capture the features of the interior of the identification area as a reference, i.e., the features of the identification points, when the mechanical arm of the robot moves to the teaching photographing position.
A schematic diagram of loading and unloading of the robot may be shown in fig. 2, where loading and unloading is a process of loading a target workpiece to a processing position on a workbench and removing the processed target workpiece from the processing position. The robot 201 is located in front of the table 202, and an end tool 204 and a camera 205 are connected to a robot arm 203 of the robot 201. The stage 202 has a target workpiece 206 placed thereon and is provided with an identification zone 207, and an identification point 208 is located inside the identification zone 207.
In order to determine the pose of the target workpiece and the identification point, and further determine the relative pose between the two, the electronic device may control the mechanical arm of the robot to move to the position of the identification point on the workbench, and control the end tool of the mechanical arm to touch the identification point on the workbench, record the first coordinate of the mechanical arm under the mechanical arm coordinate system, that is, execute step S101. The mechanical arm coordinate system may be a base coordinate system, a geodetic coordinate system, a tool coordinate system, or a workpiece coordinate system, and is not specifically limited herein.
For example, as shown in fig. 3, a schematic diagram of a robot arm coordinate system may be shown, where the robot arm coordinate system is a three-dimensional coordinate system O-XYZ established with the mounting base 301 of the robot arm 203 as an origin. A physical diagram of the movement of the end tool of the mechanical arm to the target workpiece grabbing and placing position can be shown in fig. 4, and the mechanical arm, the end tool and the identification points in the physical diagram correspond to those in the schematic diagram. The physical image is an image taken by a test in a laboratory, and does not represent the form of an actual target workpiece. The end tool 204 of the robotic arm 203 touches the center of the target workpiece 206. The electronic device may also control the end tool 204 of the robotic arm 203 to click the identification point 208 to determine the relative pose between the target workpiece and the identification point.
In step S102, the electronic device may control the mechanical arm to move to the pick-and-place position corresponding to the target workpiece, and record the second coordinate of the mechanical arm under the mechanical arm coordinate system. The grabbing and placing position is used for indicating the position of the target workpiece under the coordinate system of the mechanical arm.
Since the first coordinate of the identification point and the second coordinate of the target workpiece are in the same coordinate system, the electronic device may calculate the third coordinate of the target workpiece in the workpiece coordinate system, that is, the relative pose between the target workpiece and the identification point, based on the first coordinate and the second coordinate, that is, perform step S103. The workpiece coordinate system is established by taking the identification point as an origin.
The robot arm coordinate system and the workpiece coordinate system may be a three-dimensional coordinate system or a two-dimensional coordinate system. In one case, the robot arm coordinate system and the workpiece coordinate system are both three-dimensional coordinate systems, and the relative pose is represented based on three coordinate components and three angles. In another case, the robot arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems, and the relative pose is represented based on two coordinate components and two angles.
Therefore, in the embodiment of the application, since the first coordinate and the second coordinate are the coordinates of the identification point and the target workpiece in the mechanical arm coordinate system, and the workpiece coordinate system is established by taking the identification point as the origin, the third coordinate of the target workpiece in the workpiece coordinate system can be determined based on the first coordinate and the second coordinate. The third coordinate is only related to the relative pose between the identification point and the target workpiece and is the inherent information quantity of the workbench, and is irrelevant to the mechanical arm coordinate system, so that decoupling of the teaching pose and the mechanical arm coordinate system can be realized. Furthermore, only one robot can be used for teaching aiming at each workbench, teaching is not required to be carried out for each robot, teaching times can be reduced, and the deployment efficiency of the robots is improved.
As an implementation manner of the embodiment of the present application, the step of controlling the end tool of the mechanical arm to touch the mark point on the workbench may include:
And controlling an end tool of the mechanical arm to point on a mark point on the workbench, wherein the end tool is perpendicular to the workbench.
In one embodiment, since the marking point is located on the upper surface of the table, the electronic device may control the end tool of the robot arm to touch the marking point on the table in order to accurately represent the coordinates of the marking point based on the coordinates of the robot arm, and the end tool is perpendicular to the table, i.e., the axial direction of the end tool is perpendicular to the upper surface of the table.
Since the position of the end tool coincides with the position of the identification point, the first coordinate of the mechanical arm in the mechanical arm coordinate system can be used as the coordinate of the identification point in the mechanical arm coordinate system. A schematic diagram of the end tool point contact marker of the robotic arm may be shown in fig. 5, and the electronic device may control the end tool 204 of the robotic arm 203 to point contact the marker 208, with the end tool 204 perpendicular to the table 202.
In another embodiment, the electronic device may further control the end tool of the mechanical arm to touch the marking point on the workbench, where the end tool forms an angle with the workbench, and the angle may be other than 90 degrees, for example, may be 30 degrees, 50 degrees, 80 degrees, and the like, and is not limited herein.
Because the marking point is located on the upper surface of the workbench, when the end tool is at a certain angle with the workbench, the end tool is also at a certain angle with the marking point. In this case, the electronic device may calculate a transformation matrix corresponding to the angle, multiply the transformation matrix with a first coordinate of the robot arm in the robot arm coordinate system, and use a result obtained by the multiplication as a coordinate of the identification point in the robot arm coordinate system.
Therefore, in the embodiment of the application, the electronic device can control the end tool of the mechanical arm to touch the marking point on the workbench, and the end tool is perpendicular to the workbench. Because the marking point is located on the upper surface of the workbench, in order to more accurately represent the pose of the marking point, the electronic device can control the mechanical arm to point the marking point, and the end tool is perpendicular to the workbench. Therefore, the first coordinate of the identification point under the mechanical arm coordinate system can be accurately determined, the repeatability precision of feeding and discharging of the robot is further improved, and teaching is accurately conducted on the robot.
As an implementation manner of the embodiment of the present application, the step of controlling the mechanical arm to move to the gripping and placing position corresponding to the target workpiece and recording the second coordinate of the mechanical arm under the mechanical arm coordinate system may include:
Controlling the mechanical arm to move to the position of the target workpiece on the workbench under the condition that the mechanical arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, controlling the end tool to grasp and put the target workpiece, recording a second coordinate under the mechanical arm coordinate system when the mechanical arm grasps and put the target workpiece, or,
And under the condition that the mechanical arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems, controlling the mechanical arm to move to the position of the target workpiece on the workbench, controlling the tail end tool of the mechanical arm to be perpendicular to the table top of the workbench, enabling the center of the tail end tool and the projection point of the center of the target workpiece on the workbench to be in the same point, and recording the second coordinate of the mechanical arm under the mechanical arm coordinate system.
In one embodiment, in the case where the robot arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, since the end tool of the robot arm is the same as the position of the target workpiece in the three-dimensional coordinate system when the robot arm grips and releases the target workpiece, the coordinates of the robot arm can be regarded as the coordinates of the target workpiece. In order to accurately determine the position and the posture of the target workpiece in the three-dimensional coordinate system, the electronic device can control the mechanical arm to move to the position of the target workpiece on the workbench and control the end tool to grasp and release the target workpiece, namely control the end tool to grasp and release the target workpiece. The electronic device can record a second coordinate of the mechanical arm in the coordinate system of the mechanical arm when the mechanical arm grabs and releases the target workpiece, and the second coordinate is used as the coordinate of the target workpiece in the coordinate system of the mechanical arm.
A schematic diagram of the end tool of the robot arm for gripping and placing the target workpiece may be shown in fig. 6, where the electronic device may control the robot arm 203 to move to the position of the target workpiece 206, and control the end tool 204 to grip and placing the target workpiece 206, and record the second coordinate under the coordinate system of the robot arm when the robot arm 203 grips and places the target workpiece 206.
In the case where the arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems, when the end tool of the arm is perpendicular to the table surface of the table and the center of the end tool is co-located with the projection point of the center of the target workpiece on the table, the position of the end tool of the arm and the target workpiece in the arm coordinate system are coincident, and therefore the coordinates of the arm can be regarded as the coordinates of the target workpiece. In order to accurately determine the position of the target workpiece in the two-dimensional coordinate system, the electronic device may control the robotic arm to move to the position of the target workpiece on the table and control the end tool of the robotic arm to be perpendicular to the table top of the table. Thus, the coordinates of the mechanical arm can accurately represent the coordinates of a point on the table surface of the workbench. Furthermore, the electronic device can control the projection points of the center of the end tool and the center of the target workpiece on the workbench to be co-located, and record the second coordinate of the mechanical arm under the mechanical arm coordinate system.
A schematic diagram of the co-point of the end tool of the mechanical arm and the center of the target workpiece may be shown in fig. 7, where the electronic device may control the mechanical arm 203 to move to the position of the target workpiece 206, and control the end tool 204 of the mechanical arm 203 to be perpendicular to the table surface of the table 202, and the center of the end tool 204 and the projection point of the center of the target workpiece 206 on the table 202 are co-point, and record the second coordinate of the mechanical arm 203 under the coordinate system of the mechanical arm.
In another embodiment, the electronic device may further control the mechanical arm to move to a gripping position corresponding to the target workpiece, and control the camera of the robot to capture an image of the end tool of the mechanical arm. And converting the coordinates of the end tool of the mechanical arm from the image coordinate system to the mechanical arm coordinate system through the conversion relation between the pre-calibrated image coordinate system of the camera and the mechanical arm coordinate system, so as to obtain the second coordinates of the mechanical arm under the mechanical arm coordinate system.
Therefore, in the embodiment of the application, the electronic device can control the mechanical arm to move to the position of the target workpiece on the workbench and control the end tool to grasp and put the target workpiece under the condition that the mechanical arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, record the second coordinate of the mechanical arm under the mechanical arm coordinate system when the mechanical arm grasps and puts the target workpiece, or control the mechanical arm to move to the position of the target workpiece on the workbench and control the end tool of the mechanical arm to be perpendicular to the table surface of the workbench under the condition that the mechanical arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems, and record the second coordinate of the mechanical arm under the mechanical arm coordinate system when the center of the end tool and the projection point of the center of the target workpiece on the workbench are co-points. In order to enable the second coordinate to accurately represent the coordinate of the target workpiece under the mechanical arm coordinate system, the electronic equipment can control the end tool to grasp and put the target workpiece and record the second coordinate of the mechanical arm under the condition that the mechanical arm coordinate system is a three-dimensional coordinate system; and under the condition that the mechanical arm coordinate system is a two-dimensional coordinate system, controlling the center of the end tool to be co-located with a projection point of the center of the target workpiece on the workbench, and recording a second coordinate of the mechanical arm. Thus, the second coordinates can be accurately determined, and the teaching of the robot can be accurately performed.
As one implementation of the embodiment of the present application, the robot 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:
and calculating a third coordinate of the target workpiece under the workpiece coordinate system based on the coordinate conversion relation represented by the first pose matrix and the second pose matrix.
The pose matrix is a 4×4 homogeneous coordinate transformation matrix and is used for describing the relative pose relationship of two points in space. The pose matrix is composed of a rotation matrix and a displacement vector, wherein the rotation matrix reflects the pose of the mechanical arm, and the displacement vector reflects the position of the mechanical arm. The rotation matrix is a 3×3 orthogonal matrix, and represents a rotation from a coordinate system of the robot arm end reference point to a reference coordinate system. The displacement vector is a relative position vector at the end of the robot arm, typically described by XYZ three components.
The first pose matrix reflects the position and the gesture of the identification point under the mechanical arm coordinate system, and the identification point is the origin of the workpiece coordinate system, so that the first pose matrix can reflect the coordinate conversion relation between the workpiece coordinate system and the mechanical arm coordinate system. Because the second pose matrix reflects the pose of the target workpiece in the mechanical arm coordinate system, the third coordinate of the target workpiece in the workpiece coordinate system can be calculated based on the coordinate conversion relation represented by the first pose matrix and the second pose matrix.
In one embodiment, the electronic device may directly record the first and second coordinates of the pose matrix description. And further calculating a third coordinate of the target workpiece in the workpiece coordinate system based on the recorded first pose matrix and the second pose matrix.
In another embodiment, the electronic device may record first and second coordinates of euler angle descriptions, i.e., using six quantities to represent the position and pose of a spatial point, X-Y-Z and RZ-RY-RX euler angles, respectively. The euler angles may be in the order of Z-Y-X internal rotation, in the order of X-Y-Z fixed angle external rotation, or in other forms of euler angles, which are not specifically limited herein.
Since the relative pose relationship of two points in space may be encountered using euler angles to describe the gimbal problem, the first and second coordinates may be converted from euler angle descriptions to pose matrix descriptions before calculating the third coordinate. Specifically, in this embodiment, the conversion formula from the euler angles (α, β, γ) to the pose matrix R is: Wherein, alpha, beta and gamma respectively represent angles of rotation around the X axis, the Y axis and the Z axis, namely Euler angles, and R Z(γ)、RY(β)、RX (alpha) respectively represents rotation matrixes around the Z axis, the Y axis and the X axis.
Therefore, in the embodiment of the application, the electronic device can calculate the third coordinate of the target workpiece under the workpiece coordinate system based on the coordinate conversion relationship represented by the first pose matrix and the second pose matrix. The first pose matrix reflects the position and the gesture of the identification point under the mechanical arm coordinate system, and the identification point is the origin of the workpiece coordinate system, so that the first pose matrix can reflect the coordinate conversion relationship between the workpiece coordinate system and the mechanical arm coordinate system, and further, the third coordinate of the target workpiece under the workpiece coordinate system can be calculated based on the coordinate conversion relationship represented by the first pose matrix and the second pose matrix. In this way, the third coordinate can be calculated quickly and accurately.
As shown in fig. 8, 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:
S801, calculating an inverse matrix of the first pose matrix, and taking the inverse matrix as a conversion matrix from the mechanical arm coordinate system to the workpiece coordinate system;
A schematic diagram of the target workpiece and the identification point in the robot arm coordinate system may be shown in fig. 9, where the pose of the identification point 208 in the robot arm coordinate system O-XYZ is a first pose matrix, the pose of the target workpiece 206 in the robot arm coordinate system O-XYZ is a second pose matrix, and the workpiece coordinate system O '-X' Y 'Z' is established with the identification point 208 as the origin.
The first pose matrix is a conversion matrix from the workpiece coordinate system to the mechanical arm coordinate system because the first pose matrix is the pose of the identification point under the mechanical arm coordinate system and the identification point is the origin of the workpiece coordinate system. Furthermore, the electronic device may calculate an inverse matrix of the first pose matrix, where the inverse matrix is a transformation matrix from the robot coordinate system to the workpiece coordinate system.
S802, multiplying the transformation matrix by the second pose matrix to obtain a third coordinate of the target workpiece under the workpiece coordinate system.
Let the transformation matrix from coordinate system B to coordinate system a be ATB and the pose of the spatial midpoint D in coordinate system C be CPD. The base coordinate system with the mechanical arm as the origin is T Base, the Object coordinate system with the identification point as the origin is T Mark, the target Object is Obj (Object), i.e., O, and then there are: a first pose matrix P MWBBasePM and a second pose matrix P OWBBasePO.
The transformation matrix from the mechanical arm coordinate system to the workpiece coordinate system is MarkTBase, namely (BasePM)-1, there is a first pose matrix of the third coordinate MarkPOMarkTBase BasePO=(BasePM)-1BasePO=PMWB -1POWB. of the target workpiece in the workpiece coordinate systemSecond pose matrix Then the inverse of the first pose matrix may be multiplied by the second pose matrix to obtain a third coordinate
Where M ij represents an element of the ith row and jth column in the first pose matrix, M ij' represents an element of the ith row and jth column in the second pose matrix, i=1, 2,3, j=1, 2, 3. (X M,YM,ZM) is the coordinate of the identification point in the mechanical arm coordinate system, and (X O,YO,ZO) is the coordinate of the target workpiece in the mechanical arm coordinate system.
Therefore, in the embodiment of the application, the electronic equipment can calculate the inverse matrix of the first pose matrix as a conversion matrix from the mechanical arm coordinate system to the workpiece coordinate system; multiplying the transformation matrix with the second pose matrix to obtain a third coordinate of the target workpiece under the workpiece coordinate system. The first pose matrix is a conversion matrix from the workpiece coordinate system to the mechanical arm coordinate system because the first pose matrix is the pose of the identification point under the mechanical arm coordinate system and the identification point is the origin of the workpiece coordinate system. Furthermore, the electronic device may calculate an inverse of the first pose matrix, multiply the inverse of the first pose matrix with the second pose matrix, and obtain a third coordinate of the target workpiece in the workpiece coordinate system. In this way, the third coordinate can be calculated quickly and accurately.
As an implementation manner of the embodiment of the present application, the robot arm coordinate system and the object coordinate system may be two-dimensional coordinate systems. In this case, as shown in fig. 10, the above-mentioned 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:
s1001, determining an included angle between the workpiece coordinate system and the mechanical arm coordinate system and a translation vector;
If the transformation relationship between the two coordinate systems is a rigid body transformation, a transformation matrix between the two coordinate systems can be determined based on the angle between the two coordinate systems and the translation vector. Because the transformation relationship between the workpiece coordinate system and the mechanical arm coordinate system is rigid transformation, in order to determine the transformation matrix from the mechanical arm coordinate system to the workpiece coordinate system, the electronic equipment can determine the included angle between the workpiece coordinate system and the mechanical arm coordinate system and the translation vector Specifically, assuming that the coordinate of the identification point obtained by teaching the robot arm is (X MWB,YMWB), the translation vector of the robot arm coordinate system to the workpiece coordinate system with the identification point as the origin is the inverse vector of the coordinate vector of the identification point. I.e., T x=-XMWB,Ty=-YMWB.
As an embodiment, the object coordinate system is determined from an image captured by a camera of the robot. The electronic device may calculate a first angle θ 1 between the workpiece coordinate system and the pixel coordinate system and determine a second angle θ 2 between the robot arm coordinate system and the pixel coordinate system based on a predetermined calibration matrix between the robot arm coordinate system and the pixel coordinate system. Under the condition that one of the workpiece coordinate system and the mechanical arm coordinate system is a left-hand coordinate system and the other is a right-hand coordinate system, an included angle (theta 12) between the workpiece coordinate system and the mechanical arm coordinate system can be calculated.
S1002, determining a conversion matrix from the mechanical arm coordinate system to the workpiece coordinate system based on the included angle and the translation vector;
After determining the angle (θ 12) between the workpiece coordinate system and the robot arm coordinate system and the translation vector (T x,Ty)T), the electronic device may determine, based on the angle (θ 12) between the workpiece coordinate system and the robot arm coordinate system and the translation vector (T x,Ty)T, that the transformation matrix from the robot arm coordinate system to the workpiece coordinate system is
S1003, multiplying the conversion matrix by the first coordinate and the second coordinate respectively to obtain a converted first coordinate and a converted second coordinate;
Because the first coordinate and the second coordinate are determined under the mechanical arm coordinate system, the electronic device can multiply the conversion matrix with the first coordinate and the second coordinate respectively to obtain a converted first coordinate and a converted second coordinate under the workpiece coordinate system.
Assuming that the first coordinate is (X MWB,YMWB)T and the second coordinate is (X OWB′,YoWB′)T, then there is the converted first coordinateConverted second coordinates
S1004, calculating the coordinate offset of the converted second coordinate and the converted first coordinate as a third coordinate of the target workpiece under the workpiece coordinate system.
In the workpiece coordinate system, a schematic diagram of the coordinate offset of the target workpiece from the mark point may be shown in fig. 11, where the abscissa offset and the ordinate offset between the target workpiece 206 and the mark point 208 are dx and dy, respectively. Since the object coordinate system O ' -X ' Y ' is established with the identification point 208 as the origin, the abscissa and ordinate offsets between the target object 206 and the identification point 208 are the abscissa and ordinate of the target object in the object coordinate system.
Therefore, the electronic apparatus can calculate the coordinate shift amount of the converted second coordinate and the converted first coordinate as the third coordinate of the target workpiece in the workpiece coordinate system. That is, the third coordinate
In another embodiment, the electronic device may calculate the coordinate offset between the first coordinate and the second coordinate under the mechanical arm coordinate system, and multiply the coordinate offset with a transformation matrix from the mechanical arm coordinate system to the workpiece coordinate system, so as to obtain a result that is a third coordinate of the target workpiece under the workpiece coordinate system.
Therefore, in the embodiment of the application, the electronic equipment can determine the included angle between the coordinate system of the workpiece and the coordinate system of the mechanical arm and the translation vector; based on the included angle and the translation vector, determining a conversion matrix from the mechanical arm coordinate system to the workpiece coordinate system; multiplying the conversion matrix with the first coordinate and the second coordinate respectively to obtain a converted first coordinate and a converted second coordinate; and calculating the coordinate offset of the converted second coordinate and the converted first coordinate to be used as a third coordinate of the target workpiece under the workpiece coordinate system. Because the first coordinate and the second coordinate are determined under the mechanical arm coordinate system, the electronic device can multiply the conversion matrix with the first coordinate and the second coordinate respectively to obtain a converted first coordinate and a converted second coordinate under the workpiece coordinate system. Since the object coordinate system is established with the target object as the origin, the coordinate offset between the target object and the identification point can be calculated as the third coordinate of the target object in the object coordinate system. In this way, the third coordinate can be determined quickly and accurately.
As shown in fig. 12, the step of determining the included angle between the object coordinate system and the robot arm coordinate system may include:
S1201, calculating a first included angle between the workpiece coordinate system and the pixel coordinate system in an image shot by a camera of the robot;
One physical diagram of the movement of the mechanical arm to the teaching shooting position can be shown in fig. 13, and the electronic device can control the movement of the mechanical arm 203 to the teaching shooting position, and control the camera 205 to collect the pixel coordinates of the identification point 208. Since the image captured by the camera 205 includes the identification point 208, an edge can be selected as the X-axis in the image, and an orthogonal coordinate system can be established with the identification point 208 as the origin.
A schematic diagram of the workpiece coordinate system, the pixel coordinate system, and the robot arm coordinate system may be shown in fig. 14, where the identification point 208 is located in the image, and the workpiece coordinate system O ' -X ' Y ' is established with the identification point 208 as the origin. To determine the pose of the target workpiece 206 in the workpiece coordinate system O '-X' Y ', the electronics need to determine a transformation matrix of the robot arm coordinate system O-XY to the workpiece coordinate system O' -X 'Y'. To determine the transformation matrix, the electronics can calculate a first angle between the object coordinate system O ' -X ' Y ' and the pixel coordinate system O "-X" Y ".
S1202, determining a second included angle between the mechanical arm coordinate system and the pixel coordinate system based on a predetermined calibration matrix between the mechanical arm coordinate system and the pixel coordinate system;
Before teaching the robot, a calibration matrix between the robot arm coordinate system and the pixel coordinate system, i.e. a hand-eye calibration matrix, may be predetermined. In this way, a second included angle between the robot arm coordinate system and the pixel coordinate system can be determined based on the calibration matrix.
And S1203, determining an included angle between the workpiece coordinate system and the mechanical arm coordinate system according to the first included angle and the second included angle.
Because the first included angle and the second included angle are included angles between the pixel coordinate system and the workpiece coordinate system and between the pixel coordinate system and the mechanical arm coordinate system respectively, the electronic equipment can determine the included angle between the workpiece coordinate system and the mechanical arm coordinate system based on the first included angle and the second included angle.
Therefore, in the embodiment of the application, the electronic equipment can calculate the first included angle between the workpiece coordinate system and the pixel coordinate system in the image shot by the camera of the robot; determining a second included angle between the mechanical arm coordinate system and the pixel coordinate system based on a calibration matrix between the predetermined mechanical arm coordinate system and the pixel coordinate system; and determining an included angle between the workpiece coordinate system and the mechanical arm coordinate system according to the first included angle and the second included angle. Because the first included angle and the second included angle are included angles between the pixel coordinate system and the workpiece coordinate system and between the pixel coordinate system and the mechanical arm coordinate system respectively, the electronic equipment can determine the included angle between the workpiece coordinate system and the mechanical arm coordinate system based on the first included angle and the second included angle. Therefore, the included angle between the workpiece coordinate system and the mechanical arm coordinate system can be rapidly and accurately determined.
As an implementation manner of the embodiment of the present application, the step of determining an included angle between the workpiece coordinate system and the mechanical arm coordinate system according to the first included angle and the second included angle may include:
And calculating a difference value between the first included angle and the second included angle to be used as an included angle between the workpiece coordinate system and the mechanical arm coordinate system.
In the case that one of the mechanical arm coordinate system and the workpiece coordinate system is a left-hand coordinate system and the other is a right-hand coordinate system, the electronic device may calculate a difference between the first included angle and the second included angle as an included angle between the workpiece coordinate system and the mechanical arm coordinate system. For example, the mechanical arm coordinate system is a left-hand coordinate system, the workpiece coordinate system is a right-hand coordinate system, the first included angle is 45 degrees, the second included angle is 15 degrees, and then the difference between the first included angle and the second included angle can be calculated to obtain an included angle between the workpiece coordinate system and the mechanical arm coordinate system of 30 degrees.
Under the condition that the mechanical arm coordinate system and the workpiece coordinate system are both left-hand coordinate systems or both right-hand coordinate systems, the electronic equipment can calculate the sum of the first included angle and the second included angle to serve as the included angle between the workpiece coordinate system and the mechanical arm coordinate system. For example, the mechanical arm coordinate system and the workpiece coordinate system are both left-hand coordinate systems, the first included angle is 15 °, and the second included angle is 15 °, so that the sum of the first included angle and the second included angle can be calculated, and the included angle between the workpiece coordinate system and the mechanical arm coordinate system is 30 °.
Therefore, in the embodiment of the application, under the condition that the mechanical arm coordinate system and the workpiece coordinate system are both left-hand coordinate systems or both right-hand 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 mechanical arm coordinate system. In the case that one of the mechanical arm coordinate system and the workpiece coordinate system is a left-hand coordinate system and the other is a right-hand coordinate system, the electronic device may calculate a difference between the first included angle and the second included angle as an included angle between the workpiece coordinate system and the mechanical arm coordinate system. Therefore, the included angle between the workpiece coordinate system and the mechanical arm coordinate system can be calculated rapidly and accurately.
As an implementation manner of the embodiment of the present application, the number of the work tables may be plural. In this case, as shown in fig. 15, 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 table, the method may further include:
s1501, using the workbench as a taught workbench;
In the case where the number of work stations is plural, the electronic apparatus can control the robot to teach for each work station. After teaching the current workstation is completed, the electronic device may treat the current workstation as a taught workstation. For example, assuming that the number of tables is 10, namely, the tables 1 to 10, respectively, the electronic apparatus may use the table 1 as a taught table after the robot is controlled to complete the teaching with respect to the table 1.
S1502, judging whether the number of the taught work stations reaches the number of the work stations or not; if the number of the work stations is not reached, step S1503 is performed;
in order to control the robot to teach for all the tables, the electronic device may determine whether the number of taught tables reaches the number of tables. If the number of taught tables does not reach the number of tables, indicating that there are tables not taught, the electronic device may execute step S1503, i.e., control the robot to move to the position of the non-taught table, and return to execute step S101; if the number of taught tables reaches the number of tables, it is stated that all tables are taught to be complete.
In the example of the receiving step S1501, since the taught tables are table 1, the number of taught tables is 1. The electronic apparatus may perform step S1503, having taught that the number of stages does not reach the number of stages.
S1503, controlling the robot to move to the position of the non-taught workbench, and returning to the step of executing the step of controlling the mechanical arm of the robot to move to the position of the identification point on the workbench until the number of the taught workbench reaches the number of the workbench.
In the case where the number of taught tables does not reach the number of tables, in order to control the robot to complete teaching for the non-taught tables, the electronic apparatus may control the robot to move to the position of the non-taught tables, and return to execution step S101 until the number of taught tables reaches the number of tables. Thus, the workpiece position information of all the work tables can be acquired.
In the receiving step S1502, the non-taught table is the table 2-table 10, and the electronic apparatus can control the robot to move to the position of the table 2, and control the robot to complete teaching for the table 2 until the number of taught tables does not reach the number of tables.
Therefore, in the embodiment of the application, when the number of the work tables is a plurality of work tables, the electronic device can use the work tables as taught work tables; judging whether the number of the taught work tables reaches the number of the work tables or not; if the number of the work tables is not reached, the robot is controlled to move to the position where the work tables are not taught, and the step of controlling the mechanical arm of the robot to move to the position where the mark points on the work tables are located is performed until the number of the taught work tables reaches the number of the work tables. In order to control the robot to teach all the tables, the electronic device may use the current table as a taught table after the robot finishes teaching, and determine whether the number of taught tables reaches the number of tables. In the case of not reaching, the robot may be controlled to move to a position of the non-teaching table, and the robot may be controlled to teach the non-teaching table. Assuming that there are M work tables and N robots, each robot needs to be controlled to teach each work table by adopting the teaching mode of the related art at present. If one robot is taught to one table as one operation, the total number of times of teaching is MN. By adopting the teaching method provided by the embodiment of the application, the decoupling effect of the teaching pose and the mechanical arm coordinate system is realized, so that only one robot is required to teach all the work tables, each robot is not required to be controlled to teach each work table, and the total teaching times can be reduced to M. Therefore, the debugging deployment efficiency can be remarkably improved, and the practicability is stronger.
For example, a flowchart of a 3D (three-dimensional) teaching mode may be shown in fig. 16, and specifically includes the following steps:
S1601, optionally, a compound robot arrives at a preset position of the machine, the mechanical arm vertically teaches Mark points, and the coordinates P MWB at the moment are recorded; the mechanical arm moves to the position of the workpiece to be grasped and placed, and the coordinate P OWB at the moment is recorded;
In the case of multiple compound robots, the electronic device may optionally be a compound robot, and the compound robot is controlled to reach a predetermined position of an un-taught machine. Wherein the composite robot is the robot, the machine table is the workbench, and the preset position of the machine table is a position preset in front of the machine table.
The electronic device can control the mechanical arm of the compound robot to be perpendicular to Mark points for teaching, and records the coordinates P MWB of the mechanical arm under the mechanical arm coordinate system at the moment. The electronic device can control the mechanical arm to move to the position where the workpiece is to be grasped and placed, and records the coordinate P OWB of the mechanical arm under the coordinate system of the mechanical arm at the moment. Wherein the workpiece to be grasped is the target workpiece.
S1602, solving pose coordinates of a target workpiece in a three-dimensional coordinate system taking Mark points as references, and marking the pose coordinates as workpiece position information of a machine table; step S1601 is performed back until the workpiece position information of all the machines is obtained.
The electronic equipment can solve the pose coordinates of the target workpiece under a three-dimensional coordinate system taking Mark points as references based on P MWB and P OWB, and Mark the pose coordinates as workpiece position information of the machine table. After the composite robot is controlled to complete teaching of the machine, the electronic equipment can use the machine as a taught machine and judge whether the number of the taught machines reaches the total number of the machines. If the number of taught stations does not reach the total number of stations, the electronic device may return to step S1601 to control the compound robot to move to a predetermined position of the non-taught station and record the Mark point of the non-taught station and the coordinates of the position of the workpiece to be grasped. If the number of taught machines does not reach the total number of machines, that is, the workpiece position information of all the machines is obtained, the cycle is ended.
For another example, a flowchart of a 2D (2-dimensional) teaching mode may be as shown in fig. 17, and specifically includes the following steps:
S1701, optionally enabling a compound robot to reach a preset position of a machine table, enabling a mechanical arm to vertically teach Mark points, and recording coordinates P MWB at the moment; the mechanical arm moves to the position of the workpiece to be grasped and placed for vertical teaching, and the coordinate P OWB at the moment is recorded;
In the case of multiple compound robots, the electronic device may optionally be a compound robot, and the compound robot is controlled to reach a predetermined position of an un-taught machine. The electronic device can control the mechanical arm of the compound robot to be perpendicular to the Mark point for teaching, and records the coordinate P MWB of the mechanical arm under the mechanical arm coordinate system at the moment. The electronic equipment can control the mechanical arm to move to the position of the workpiece to be grabbed and placed, control the center of the tail end tool of the mechanical arm and the center of the workpiece to be grabbed and placed to be at the same point on the plane of the machine, and record the coordinate P OWB of the mechanical arm under the coordinate system of the mechanical arm at the moment.
S1702, the mechanical arm moves to a teaching photographing position, a camera photographs, a Mark point in an image is taken as an origin, one edge is selected as an X axis, and an orthogonal workpiece coordinate system is established;
The electronic equipment can control the mechanical arm to move to the teaching photographing position to acquire an image photographed by the camera. And taking a Mark point in the image as an origin, selecting one side in the image as an X axis, and establishing an orthogonal workpiece coordinate system, namely a workpiece coordinate system.
S1703, generating a rigid transformation matrix according to the included angle from the workpiece coordinate system to the mechanical arm coordinate system, and converting the mechanical arm teaching coordinate to the workpiece coordinate system;
The transformation relation between the workpiece coordinate system and the mechanical arm coordinate system is rigid transformation, and the electronic equipment can generate a rigid transformation matrix according to the included angle between the workpiece coordinate system and the mechanical arm coordinate system and the translation vector. The teaching coordinates P MWB and P OWB in the robot arm coordinate system are converted into the workpiece coordinate system.
S1704, solving two-dimensional coordinate offset of Mark teaching pose and target workpiece vertical teaching pose under a workpiece coordinate system, and recording the two-dimensional coordinate offset as workpiece position information of a machine; and returning to the step S1701 until the workpiece position information of all the machine stations is obtained.
The electronic equipment can solve the two-dimensional coordinate offset of the teaching pose of the Mark point and the vertical teaching pose of the target workpiece under the workpiece coordinate system, namely the two-dimensional coordinate offset between P MWB and P OWB under the workpiece coordinate system, and the two-dimensional coordinate offset is recorded as the workpiece position information of the machine. After the composite robot is controlled to complete teaching of the machine, the electronic equipment can use the machine as a taught machine and judge whether the number of the taught machines reaches the total number of the machines. If the number of taught machines does not reach the total number of machines, the electronic device may return to step S1701 to control the compound robot to move to a predetermined position of the non-taught machine, and record the Mark point of the non-taught machine and the coordinates of the position of the workpiece to be grasped. If the number of taught machines does not reach the total number of machines, that is, the workpiece position information of all the machines is obtained, the cycle is ended.
Therefore, the two decoupling methods of 3D and 2D provided by the embodiment of the application can be suitable for different scenes. In this way, the decoupling method can be selected according to the actual scene, so that the selection is more flexible.
As an implementation manner of the embodiment of the present application, the electronic device may further obtain, through the measuring tool, a coordinate offset between the identification point and the target workpiece, and further convert the offset into the workpiece coordinate system. For example, the measuring tool may be a ruler.
In the technical scheme of the application, related operations such as acquisition, storage, use, processing, transmission, provision, disclosure and the like of the personal information of the user are performed under the condition that the authorization of the user is obtained.
Corresponding to the teaching method of the robot, the embodiment of the application also provides a teaching device of the robot, and the teaching device of the robot provided by the embodiment of the application is described below.
As shown in fig. 18, a teaching apparatus of a robot, the apparatus comprising:
The first coordinate recording module 1801 is used for controlling a mechanical arm of the robot to move to a position of an identification point on a workbench, controlling a tool point at the tail end of the mechanical arm to touch the identification point on the workbench, and recording a first coordinate of the mechanical arm under a mechanical arm coordinate system, wherein the identification point is a preset relative pose unchanged from a target workpiece placed on the workbench;
a second coordinate recording module 1802, configured to control the mechanical arm to move to a gripping position corresponding to the target workpiece, and record a second coordinate of the mechanical arm under the mechanical arm coordinate system;
and a third coordinate calculating module 1803, configured to calculate, based on the first coordinate and the second coordinate, a third coordinate of the target workpiece in a workpiece coordinate system, where the workpiece coordinate system is established with the identification point as an origin.
In the embodiment of the application, the electronic equipment can control the mechanical arm of the robot to move to the position of the identification point on the workbench, control the end tool of the mechanical arm to point contact the identification point on the workbench, and record the first coordinate of the mechanical arm under the mechanical arm coordinate system, wherein the identification point is a preset relative pose unchanged from a target workpiece placed on the workbench; controlling the mechanical arm to move to a grabbing and placing position corresponding to the target workpiece, and recording a second coordinate of the mechanical arm under a mechanical arm coordinate system; and calculating a third coordinate of the target workpiece under a workpiece coordinate system based on the first coordinate and the second coordinate, wherein the workpiece coordinate system is established by taking the identification point as an origin. Since the first coordinate and the second coordinate are the coordinates of the identification point and the target workpiece in the mechanical arm coordinate system, and the workpiece coordinate system is established with the identification point as the origin, the third coordinate of the target workpiece in the workpiece coordinate system can be determined based on the first coordinate and the second coordinate. The third coordinate is only related to the relative pose between the identification point and the target workpiece and is irrelevant to the mechanical arm coordinate system, so that decoupling of the teaching pose and the mechanical arm coordinate system can be realized. Furthermore, only one robot can be used for teaching aiming at each workbench, teaching is not required to be carried out for each robot, teaching times can be reduced, and the deployment efficiency of the robots is improved.
As an implementation manner of the embodiment of the present application, the first coordinate recording module 1801 may include:
and the first coordinate recording sub-module is used for controlling the tail end tool of the mechanical arm to touch the identification point on the workbench, and the tail end tool is perpendicular to the workbench.
As an implementation manner of the embodiment of the present application, the second coordinate recording module 1802 may include:
The second coordinate recording sub-module is used for controlling the mechanical arm to move to the position of the target workpiece on the workbench and controlling the end tool to grasp and put the target workpiece under the condition that the mechanical arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, and recording the second coordinate under the mechanical arm coordinate system when the mechanical arm grasps and puts the target workpiece;
And the third coordinate recording sub-module is used for controlling the mechanical arm to move to the position of the target workpiece on the workbench under the condition that the mechanical arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems, controlling the tail end tool of the mechanical arm to be perpendicular to the table top of the workbench, enabling the center of the tail end tool and the projection point of the center of the target workpiece on the workbench to be co-located, and recording the second coordinate of the mechanical arm under the mechanical arm coordinate system.
As an implementation manner of the embodiment of the present application, the robot arm coordinate system and the workpiece coordinate system may be three-dimensional coordinate systems, the first coordinate may be represented by a first pose matrix, and the second coordinate may be represented by a second pose matrix;
the third coordinate calculating module 1803 may include:
And the first coordinate calculation sub-module is used for calculating a third coordinate of the target workpiece under the workpiece coordinate system based on the coordinate conversion relation represented by the first pose matrix and the second pose matrix.
As an implementation manner of the embodiment of the present application, the first coordinate calculation sub-module may include:
An inverse matrix calculation unit, configured to calculate an inverse matrix of the first pose matrix as a transformation matrix from the robot arm coordinate system to the workpiece coordinate system;
And the coordinate calculation unit is used for multiplying the transformation matrix with the second pose matrix to obtain a third coordinate of the target workpiece under the workpiece coordinate system.
As an implementation manner of the embodiment of the present application, the mechanical arm coordinate system and the workpiece coordinate system may be two-dimensional coordinate systems;
the third coordinate calculating module 1803 may include:
The parameter determination submodule is used for determining an included angle between the workpiece coordinate system and the mechanical arm coordinate system and a translation vector;
A transformation matrix determining sub-module, configured to determine a transformation matrix from the robot coordinate system to the workpiece coordinate system based on the included angle and the translation vector;
the coordinate conversion sub-module is used for multiplying the conversion matrix with the first coordinate and the second coordinate respectively to obtain a converted first coordinate and a converted second coordinate;
And the second coordinate computing sub-module is used for computing the coordinate offset of the converted second coordinate and the converted first coordinate as a third coordinate of the target workpiece under the workpiece coordinate system.
As an implementation manner of the embodiment of the present application, the above parameter determining sub-module may include:
an included angle calculating unit, configured to calculate a first included angle between the workpiece coordinate system and a pixel coordinate system in an image captured by a camera of the robot;
a first included angle determining unit, configured to determine a second included angle between the mechanical arm coordinate system and the pixel coordinate system based on a predetermined calibration matrix between the mechanical arm coordinate system and the pixel coordinate system;
and the second included angle determining unit is used for determining an included angle between the workpiece coordinate system and the mechanical arm coordinate system according to the first included angle and the second included angle.
As an implementation manner of the embodiment of the present application, the second included angle determining unit may include:
and the included angle calculating subunit is used for calculating the difference value of the first included angle and the second included angle to be used as the included angle between the workpiece coordinate system and the mechanical arm coordinate system.
As an implementation manner of the embodiment of the present application, the number of the above-mentioned work tables may be plural;
the apparatus may further include:
the workbench determining module is used for taking the workbench as a taught workbench;
the quantity judging module is used for judging whether the quantity of the taught work stations reaches the quantity of the work stations or not;
And the return module is used for controlling the robot to move to the position of the non-taught workbench if the number of the workbench is not reached, and returning to execute the step of controlling the mechanical arm of the robot to move to the position of the identification point on the workbench until the number of the taught workbench reaches the number of the workbench.
The embodiment of the application also provides an electronic device, as shown in fig. 19, including:
A memory 1901 for storing a computer program;
The processor 1902 is configured to implement the teaching method steps of the robot according to any of the above embodiments when executing the program stored in the memory 1901.
And the electronic device may further include a communication bus and/or a communication interface, where the processor 1902, the communication interface, and the memory 1901 communicate with each other via the communication bus.
In the embodiment of the application, the electronic equipment can control the mechanical arm of the robot to move to the position of the identification point on the workbench, control the end tool of the mechanical arm to point contact the identification point on the workbench, and record the first coordinate of the mechanical arm under the mechanical arm coordinate system, wherein the identification point is a preset relative pose unchanged from a target workpiece placed on the workbench; controlling the mechanical arm to move to a grabbing and placing position corresponding to the target workpiece, and recording a second coordinate of the mechanical arm under a mechanical arm coordinate system; and calculating a third coordinate of the target workpiece under a workpiece coordinate system based on the first coordinate and the second coordinate, wherein the workpiece coordinate system is established by taking the identification point as an origin. Since the first coordinate and the second coordinate are the coordinates of the identification point and the target workpiece in the mechanical arm coordinate system, and the workpiece coordinate system is established with the identification point as the origin, the third coordinate of the target workpiece in the workpiece coordinate system can be determined based on the first coordinate and the second coordinate. The third coordinate is only related to the relative pose between the identification point and the target workpiece and is irrelevant to the mechanical arm coordinate system, so that decoupling of the teaching pose and the mechanical arm coordinate system can be realized. Furthermore, only one robot can be used for teaching aiming at each workbench, teaching is not required to be carried out for each robot, teaching times can be reduced, and the deployment efficiency of the robots is improved.
The communication bus mentioned above for the electronic device may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but may also be a digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In yet another embodiment of the present application, there is also provided a computer-readable storage medium having stored therein a computer program which, when executed by a processor, implements the steps of the teaching method of any of the robots described above.
In yet another embodiment of the present application, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform the teaching method of any of the robots of the above embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a Solid state disk (Solid STATE DISK, SSD), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for an apparatus, a system, an electronic device, a computer readable storage medium, and a computer program product, the description is relatively simple, as it is substantially similar to the method embodiments, and relevant places are referred to in the section of the description of the method embodiments.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (13)

1. A method of teaching a robot, the method comprising:
Controlling a mechanical arm of a robot to move to the position of an identification point on a workbench, controlling a tail end tool point of the mechanical arm to touch the identification point on the workbench, and recording a first coordinate of the mechanical arm under a mechanical arm coordinate system, wherein the identification point is a preset relative pose unchanged from a target workpiece placed on the workbench;
Controlling the mechanical arm to move to a grabbing and placing position corresponding to the target workpiece, and recording a second coordinate of the mechanical arm under the mechanical arm coordinate system;
and calculating a third coordinate of the target workpiece under a workpiece coordinate system based on the first coordinate and the second coordinate, wherein the workpiece coordinate system is established by taking the identification point as an origin.
2. The method of claim 1, wherein the step of controlling the end tool of the robotic arm to touch a marker point on the table comprises:
And controlling an end tool of the mechanical arm to point on a mark point on the workbench, wherein the end tool is perpendicular to the workbench.
3. The method of claim 1, wherein the step of controlling the robotic arm to move to a pick-and-place position corresponding to the target workpiece, and recording a second coordinate of the robotic arm in the robotic arm coordinate system, comprises:
Controlling the mechanical arm to move to the position of the target workpiece on the workbench under the condition that the mechanical arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, controlling the end tool to grasp and put the target workpiece, recording a second coordinate under the mechanical arm coordinate system when the mechanical arm grasps and put the target workpiece, or,
And under the condition that the mechanical arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems, controlling the mechanical arm to move to the position of the target workpiece on the workbench, controlling the tail end tool of the mechanical arm to be perpendicular to the table top of the workbench, enabling the center of the tail end tool and the projection point of the center of the target workpiece on the workbench to be in the same point, and recording the second coordinate of the mechanical arm under the mechanical arm coordinate system.
4. The method of claim 1, wherein the robotic arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, the first coordinate being represented by a first pose matrix and the second coordinate being represented by a second pose matrix;
The step of calculating a third coordinate of the target workpiece in a workpiece coordinate system based on the first coordinate and the second coordinate includes:
and calculating a third coordinate of the target workpiece under the workpiece coordinate system based on the coordinate conversion relation represented by the first pose matrix and the second pose matrix.
5. The method of claim 4, wherein the step of calculating a third coordinate of the target workpiece in the workpiece coordinate system based on the coordinate transformation relationship characterized by the first pose matrix and the second pose matrix comprises:
Calculating an inverse matrix of the first pose matrix as a conversion matrix from the mechanical arm coordinate system to the workpiece coordinate system;
Multiplying the transformation matrix with the second pose matrix to obtain a third coordinate of the target workpiece under the workpiece coordinate system.
6. The method of claim 1, wherein the robotic arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems;
The step of calculating a third coordinate of the target workpiece in a workpiece coordinate system based on the first coordinate and the second coordinate includes:
determining an included angle between the workpiece coordinate system and the mechanical arm coordinate system and a translation vector;
Determining a conversion matrix from the mechanical arm coordinate system to the workpiece coordinate system based on the included angle and the translation vector;
Multiplying the conversion matrix with the first coordinate and the second coordinate respectively to obtain a converted first coordinate and a converted second coordinate;
And calculating the coordinate offset of the converted second coordinate and the converted first coordinate to be used as a third coordinate of the target workpiece under the workpiece coordinate system.
7. The method of claim 6, wherein the step of determining an angle between the workpiece coordinate system and the robot arm coordinate system comprises:
Calculating a first included angle between the workpiece coordinate system and a pixel coordinate system in an image shot by a camera of the robot;
Determining a second included angle between the mechanical arm coordinate system and the pixel coordinate system based on a predetermined calibration matrix between the mechanical arm coordinate system and the pixel coordinate system;
And determining an included angle between the workpiece coordinate system and the mechanical arm coordinate system according to the first included angle and the second included angle.
8. The method of claim 7, wherein the step of determining an angle between the workpiece coordinate system and the robot arm coordinate system based on the first angle and the second angle comprises:
And calculating a difference value between the first included angle and the second included angle to be used as an included angle between the workpiece coordinate system and the mechanical arm coordinate system.
9. The method of any one of claims 1-8, wherein the number of stations is a plurality;
after the step of calculating, based on the first coordinate and the second coordinate, a third coordinate of the target workpiece in a workpiece coordinate system as workpiece position information corresponding to the workbench, the method further includes:
The workbench is used as a taught workbench;
Judging whether the number of the taught work tables reaches the number of the work tables or not;
And if the number of the work tables is not reached, controlling the robot to move to the position of the work table which is not taught, and returning to the step of executing the step of controlling the mechanical arm of the robot to move to the position of the identification point on the work table until the number of the taught work tables reaches the number of the work tables.
10. A teaching device for a robot, the device comprising:
The first coordinate recording module is used for controlling the mechanical arm of the robot to move to the position of the identification point on the workbench, controlling the tail end tool point of the mechanical arm to touch the identification point on the workbench, and recording the first coordinate of the mechanical arm under the mechanical arm coordinate system, wherein the identification point is a preset relative pose unchanged from a target workpiece placed on the workbench;
The second coordinate recording module is used for controlling the mechanical arm to move to a grabbing and placing position corresponding to the target workpiece and recording a second coordinate of the mechanical arm under the mechanical arm coordinate system;
And the third coordinate calculation module is used for calculating the third coordinate of the target workpiece under a workpiece coordinate system based on the first coordinate and the second coordinate, wherein the workpiece coordinate system is established by taking the identification point as an origin.
11. The apparatus of claim 10, wherein the first coordinate recording module comprises:
the first coordinate recording sub-module is used for controlling the tail end tool of the mechanical arm to touch the identification point on the workbench, and the tail end tool is perpendicular to the workbench;
the second coordinate recording module comprises:
The second coordinate recording sub-module is used for controlling the mechanical arm to move to the position of the target workpiece on the workbench and controlling the end tool to grasp and put the target workpiece under the condition that the mechanical arm coordinate system and the workpiece coordinate system are three-dimensional coordinate systems, and recording the second coordinate under the mechanical arm coordinate system when the mechanical arm grasps and puts the target workpiece;
A third coordinate recording sub-module, configured to control the mechanical arm to move to a position of a target workpiece on the workbench and control an end tool of the mechanical arm to be perpendicular to a table surface of the workbench, and co-point a center of the end tool and a projection point of a center of the target workpiece on the workbench, where the projection point is a two-dimensional coordinate system of the mechanical arm coordinate system, and record a second coordinate of the mechanical arm under the mechanical arm coordinate system;
The mechanical 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 computing sub-module is used for computing a third coordinate of the target workpiece under the workpiece coordinate system based on the coordinate conversion relation represented by the first pose matrix and the second pose matrix;
the first coordinate calculation sub-module includes:
An inverse matrix calculation unit, configured to calculate an inverse matrix of the first pose matrix as a transformation matrix from the robot arm coordinate system to the workpiece coordinate system;
The coordinate calculation unit is used for multiplying the transformation matrix with the second pose matrix to obtain a third coordinate of the target workpiece under the workpiece coordinate system;
the mechanical arm coordinate system and the workpiece coordinate system are two-dimensional coordinate systems;
The third coordinate calculation module includes:
The parameter determination submodule is used for determining an included angle between the workpiece coordinate system and the mechanical arm coordinate system and a translation vector;
A transformation matrix determining sub-module, configured to determine a transformation matrix from the robot coordinate system to the workpiece coordinate system based on the included angle and the translation vector;
the coordinate conversion sub-module is used for multiplying the conversion matrix with the first coordinate and the second coordinate respectively to obtain a converted first coordinate and a converted second coordinate;
a second coordinate calculation sub-module, configured to calculate a coordinate offset of the converted second coordinate and the converted first coordinate, as a third coordinate of the target workpiece in the workpiece coordinate system;
The parameter determination submodule includes:
an included angle calculating unit, configured to calculate a first included angle between the workpiece coordinate system and a pixel coordinate system in an image captured by a camera of the robot;
a first included angle determining unit, configured to determine a second included angle between the mechanical arm coordinate system and the pixel coordinate system based on a predetermined calibration matrix between the mechanical arm coordinate system and the pixel coordinate system;
The second included angle determining unit is used for determining an included angle between the workpiece coordinate system and the mechanical arm coordinate system according to the first included angle and the second included angle;
the second included angle determining unit includes:
an included angle calculating subunit, configured to calculate a difference value between the first included angle and the second included angle, as an included angle between the workpiece coordinate system and the mechanical arm coordinate system;
the number of the working tables is a plurality;
the apparatus further comprises:
the workbench determining module is used for taking the workbench as a taught workbench;
the quantity judging module is used for judging whether the quantity of the taught work stations reaches the quantity of the work stations or not;
And the return module is used for controlling the robot to move to the position of the non-taught workbench if the number of the workbench is not reached, and returning to execute the step of controlling the mechanical arm of the robot to move to the position of the identification point on the workbench until the number of the taught workbench reaches the number of the workbench.
12. An electronic device, comprising:
a memory for storing a computer program;
A processor for implementing the method of any of claims 1-9 when executing a program stored on a memory.
13. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-9.
CN202410457901.7A 2024-04-16 2024-04-16 Teaching method and device of robot, electronic equipment and storage medium Pending CN118305773A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410457901.7A CN118305773A (en) 2024-04-16 2024-04-16 Teaching method and device of robot, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410457901.7A CN118305773A (en) 2024-04-16 2024-04-16 Teaching method and device of robot, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN118305773A true CN118305773A (en) 2024-07-09

Family

ID=91726848

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410457901.7A Pending CN118305773A (en) 2024-04-16 2024-04-16 Teaching method and device of robot, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN118305773A (en)

Similar Documents

Publication Publication Date Title
JP7292829B2 (en) Systems and methods for combining machine vision coordinate spaces in a guided assembly environment
CN109159114B (en) High-precision method for hand-eye calibration of SCARA manipulator fixed camera vision system
CN114012731B (en) Hand-eye calibration method and device, computer equipment and storage medium
US20200298411A1 (en) Method for the orientation of an industrial robot, and industrial robot
CN108712946B (en) Goods placement method, device and system, electronic equipment and readable storage medium
US20050273199A1 (en) Robot system
Wong et al. Moving object prediction and grasping system of robot manipulator
CN109955244A (en) Grabbing control method and device based on visual servo and robot
CN106886165A (en) A kind of manipulator crawl and method of operating based on simulator
CN114505864B (en) Hand-eye calibration method, device, equipment and storage medium
CN113752260B (en) Material taking positioning correction method and device
CN114119767A (en) Workpiece grabbing method and device based on camera calibration and control system
CN114549655A (en) Positioning method, grasping system, storage medium, and program product for an article
CN118305773A (en) Teaching method and device of robot, electronic equipment and storage medium
CN117301052A (en) Pose conversion method, device, equipment and storage medium
WO2023217047A1 (en) Positioning method and apparatus, and electronic device and readable storage medium
CN112338922A (en) Five-axis mechanical arm grabbing and placing method and related device
CN114677429B (en) Positioning method and device of manipulator, computer equipment and storage medium
CN115464641A (en) Material taking and material taking position determination model establishing method and device and electronic equipment
CN109615658B (en) Method and device for taking articles by robot, computer equipment and storage medium
CN111470244B (en) Control method and control device for robot system
Kotthauser et al. Vision-based autonomous robot control for pick and place operations
CN118305790A (en) Robot vision positioning method, calibration method, device, equipment and medium
CN116619395B (en) Control method of mechanical arm, mobile robot and storage medium
Kozyr et al. Algorithm for Determining Target Point of Manipulator for Grasping an Object Using Combined Sensing Means

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination