CN118342520A - Mechanical arm calibration method and device, intelligent equipment and storage medium - Google Patents
Mechanical arm calibration method and device, intelligent equipment and storage medium Download PDFInfo
- Publication number
- CN118342520A CN118342520A CN202410774213.3A CN202410774213A CN118342520A CN 118342520 A CN118342520 A CN 118342520A CN 202410774213 A CN202410774213 A CN 202410774213A CN 118342520 A CN118342520 A CN 118342520A
- Authority
- CN
- China
- Prior art keywords
- image
- positions
- calibration
- mechanical arm
- rotating
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 52
- 238000006243 chemical reaction Methods 0.000 claims abstract description 41
- 238000004590 computer program Methods 0.000 claims description 26
- 238000012937 correction Methods 0.000 claims description 15
- 238000012935 Averaging Methods 0.000 claims description 4
- 239000011159 matrix material Substances 0.000 description 44
- 238000013519 translation Methods 0.000 description 36
- 230000009466 transformation Effects 0.000 description 35
- 238000010586 diagram Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 238000004519 manufacturing process Methods 0.000 description 4
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 2
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 2
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 2
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 2
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 2
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 2
- 239000012636 effector Substances 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- OKTJSMMVPCPJKN-UHFFFAOYSA-N Carbon Chemical compound [C] OKTJSMMVPCPJKN-UHFFFAOYSA-N 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 229910021389 graphene Inorganic materials 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
Classifications
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B25—HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
- B25J—MANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
- B25J9/00—Programme-controlled manipulators
- B25J9/16—Programme controls
- B25J9/1679—Programme controls characterised by the tasks executed
- B25J9/1692—Calibration of manipulator
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B25—HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
- B25J—MANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
- B25J19/00—Accessories fitted to manipulators, e.g. for monitoring, for viewing; Safety devices combined with or specially adapted for use in connection with manipulators
- B25J19/0095—Means or methods for testing manipulators
Landscapes
- Engineering & Computer Science (AREA)
- Robotics (AREA)
- Mechanical Engineering (AREA)
- Manipulator (AREA)
Abstract
Description
技术领域Technical Field
本申请涉及人工智能技术领域,特别是涉及一种机械臂标定方法、装置、智能设备和存储介质。The present application relates to the field of artificial intelligence technology, and in particular to a robot arm calibration method, apparatus, intelligent device and storage medium.
背景技术Background technique
随着人工智能技术的发展,机械臂被应用于越来越多的领域,例如,自动化生产领域、工作制造领域、医疗领域和智能家居领域等,机械臂的使用提高了智能设备的自动化程度,为智能设备执行更复杂、更智能化的任务奠定了基础。With the development of artificial intelligence technology, robotic arms are being used in more and more fields, such as automated production, work manufacturing, medical and smart home fields. The use of robotic arms has improved the automation level of smart devices and laid the foundation for smart devices to perform more complex and intelligent tasks.
传统技术中,在使用机械臂的过程中,使用九点标定方法确定标定参数值,然后根据标定参数值确定待操作对象对应的操作位置,导致操作位置的准确性较低。In the conventional technology, when using a robotic arm, a nine-point calibration method is used to determine calibration parameter values, and then the operation position corresponding to the object to be operated is determined according to the calibration parameter values, resulting in low accuracy of the operation position.
发明内容Summary of the invention
基于此,有必要针对上述技术问题,提供一种能够提高操作位置准确性的机械臂标定方法、装置、智能设备和计算机可读存储介质。Based on this, it is necessary to provide a robotic arm calibration method, apparatus, intelligent device and computer-readable storage medium that can improve the accuracy of the operating position in response to the above technical problems.
第一方面,本申请提供了一种机械臂标定方法。所述方法包括:In a first aspect, the present application provides a robotic arm calibration method. The method comprises:
基于多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值和偏移误差;所述移动末端位置为机械臂移动后,机械臂末端位于基坐标系中的位置,所述移动图像位置为机械臂移动后,标定物位于拍摄图像中的位置;所述旋转末端位置为机械臂旋转后,机械臂末端位于基坐标系中的位置,所述旋转图像位置为机械臂旋转后,所述标定物位于拍摄图像中的位置;Based on multiple sets of moving end positions and moving image positions, and multiple sets of rotating end positions and rotating image positions, the calibration parameter values and offset errors are determined; the moving end position is the position of the end of the robotic arm in the base coordinate system after the robotic arm moves, and the moving image position is the position of the calibration object in the captured image after the robotic arm moves; the rotating end position is the position of the end of the robotic arm in the base coordinate system after the robotic arm rotates, and the rotating image position is the position of the calibration object in the captured image after the robotic arm rotates;
获取待操作对象的目标图像位置,基于所述目标图像位置和所述标定参数值,确定所述待操作对象对应的转换位置;Acquire a target image position of the object to be operated, and determine a conversion position corresponding to the object to be operated based on the target image position and the calibration parameter value;
基于所述转换位置和所述偏移误差,得到所述待操作对象对应的目标操作位置。Based on the conversion position and the offset error, a target operation position corresponding to the object to be operated is obtained.
第二方面,本申请还提供了一种机械臂标定装置。所述装置包括:In a second aspect, the present application also provides a robot arm calibration device. The device comprises:
确定模块,用于基于多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值和偏移误差;所述移动末端位置为机械臂移动后,机械臂末端位于基坐标系中的位置,所述移动图像位置为机械臂移动后,标定物位于拍摄图像中的位置;所述旋转末端位置为机械臂旋转后,机械臂末端位于基坐标系中的位置,所述旋转图像位置为机械臂旋转后,所述标定物位于拍摄图像中的位置;A determination module, used to determine the calibration parameter value and the offset error based on multiple sets of mobile end positions and mobile image positions, and multiple sets of rotational end positions and rotational image positions; the mobile end position is the position of the end of the robotic arm in the base coordinate system after the robotic arm moves, and the mobile image position is the position of the calibration object in the captured image after the robotic arm moves; the rotational end position is the position of the end of the robotic arm in the base coordinate system after the robotic arm rotates, and the rotational image position is the position of the calibration object in the captured image after the robotic arm rotates;
获取模块,用于获取待操作对象的目标图像位置,基于所述目标图像位置和所述标定参数值,确定所述待操作对象对应的转换位置;An acquisition module, used for acquiring a target image position of an object to be operated, and determining a conversion position corresponding to the object to be operated based on the target image position and the calibration parameter value;
修正模块,用于基于所述转换位置和所述偏移误差,得到所述待操作对象对应的目标操作位置。A correction module is used to obtain a target operation position corresponding to the object to be operated based on the conversion position and the offset error.
第三方面,本申请还提供了一种智能设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现第一方面中任一项所述方法的步骤。In a third aspect, the present application further provides an intelligent device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the methods described in the first aspect when executing the computer program.
第四方面,本申请还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现第一方面中任一项所述方法的步骤。In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any one of the methods described in the first aspect.
第五方面,本申请还提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现第一方面中任一项所述方法的步骤。In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect.
上述机械臂标定方法、装置、智能设备、存储介质和计算机程序产品,基于多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值和偏移误差;移动末端位置为机械臂移动后,机械臂末端位于基坐标系中的位置,移动图像位置为机械臂移动后,标定物位于拍摄图像中的位置;旋转末端位置为机械臂旋转后,机械臂末端位于基坐标系中的位置,旋转图像位置为机械臂旋转后,标定物位于拍摄图像中的位置;获取待操作对象的目标图像位置,基于目标图像位置和标定参数值,确定待操作对象对应的转换位置;基于转换位置和偏移误差,得到待操作对象对应的目标操作位置。在确定待操作对象的目标操作位置之前,通过多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值和偏移误差,相比于仅通过多组移动末端位置和移动图像位置确定标定参数值,使用多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值,结合了机械臂进行移动的多组数据和机械臂进行旋转的多组数据,从而提高了标定参数值的准确性;在确定待操作对象的目标操作位置的过程中,使用准确性较高的标定参数值确定待操作对象对应的转换位置,提高了转换位置的准确性,再使用确定的偏移误差对转换位置进行修正,得到待操作对象对应的目标操作位置,从而进一步提高了操作位置的准确性。The above-mentioned robot arm calibration method, device, intelligent device, storage medium and computer program product determine the calibration parameter value and offset error based on multiple sets of moving end positions and moving image positions, as well as multiple sets of rotating end positions and rotating image positions; the moving end position is the position of the robot arm end in the base coordinate system after the robot arm moves, and the moving image position is the position of the calibration object in the captured image after the robot arm moves; the rotating end position is the position of the robot arm end in the base coordinate system after the robot arm rotates, and the rotating image position is the position of the calibration object in the captured image after the robot arm rotates; the target image position of the object to be operated is obtained, and the conversion position corresponding to the object to be operated is determined based on the target image position and the calibration parameter value; based on the conversion position and the offset error, the target operation position corresponding to the object to be operated is obtained. Before determining the target operation position of the object to be operated, calibration parameter values and offset errors are determined through multiple sets of mobile end positions and mobile image positions, as well as multiple sets of rotational end positions and rotational image positions. Compared with determining the calibration parameter values only through multiple sets of mobile end positions and mobile image positions, multiple sets of mobile end positions and mobile image positions, as well as multiple sets of rotational end positions and rotational image positions are used to determine the calibration parameter values, and multiple sets of data of the movement of the robotic arm and multiple sets of data of the rotation of the robotic arm are combined, thereby improving the accuracy of the calibration parameter values; in the process of determining the target operation position of the object to be operated, the calibration parameter values with higher accuracy are used to determine the conversion position corresponding to the object to be operated, thereby improving the accuracy of the conversion position, and then the determined offset error is used to correct the conversion position to obtain the target operation position corresponding to the object to be operated, thereby further improving the accuracy of the operation position.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
图1为一个实施例中机械臂标定方法的流程示意图;FIG1 is a schematic diagram of a flow chart of a robot arm calibration method in one embodiment;
图2为一个实施例中标定参数值和偏移误差确定步骤的流程示意图;FIG2 is a schematic flow chart of steps for determining calibration parameter values and offset errors in one embodiment;
图3为一个实施例中偏移误差确定步骤的流程示意图;FIG3 is a schematic flow chart of an offset error determination step in one embodiment;
图4为另一个实施例中标定参数值和偏移误差确定步骤的流程示意图;FIG4 is a flow chart of steps for determining calibration parameter values and offset errors in another embodiment;
图5为另一个实施例偏移误差确定步骤的流程示意图;FIG5 is a schematic flow chart of an offset error determination step according to another embodiment;
图6为一个实施例中平面转换关系确定及使用步骤的流程示意图;FIG6 is a schematic flow diagram of the steps of determining and using a plane transformation relationship in one embodiment;
图7为一个实施例机械臂标定装置的结构框图;FIG7 is a block diagram of a mechanical arm calibration device according to an embodiment;
图8为一个实施例中智能设备的内部结构图。FIG. 8 is a diagram showing the internal structure of a smart device in one embodiment.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
在一个实施例中,如图1所示,提供了一种机械臂标定方法,以该方法应用于智能设备为例进行说明,智能设备可以但不限于是各种智能机器人、家庭智能设备、教育和科研智能设备、智能制造设备和环境检测和维护智能设备等,智能机器人可以为工业机器人、服务机器人、医疗机器人和农业机器人等。智能设备包括机械臂和相机,可以分为眼在手上和眼在手外两种情况,眼在手上是指相机(眼)直接安装在机械臂(手)的末端,眼在手外是指相机安装在机械臂之外的某个位置,相机可能是固定在工作场景的其他位置,例如,相机固定在生产线上的支架上或者天花板上。智能设备控制机械臂对待操作对象进行操作之前,需要确定待操作对象对应的操作位置,然后控制机械臂按照操作对象对应的操作位置,对待操作对象进行操作。本实施例中,机械臂标定方法包括步骤102至步骤106,其中:In one embodiment, as shown in FIG1 , a robot arm calibration method is provided, and the method is applied to an intelligent device as an example for explanation. The intelligent device may be, but is not limited to, various intelligent robots, household intelligent devices, education and scientific research intelligent devices, intelligent manufacturing equipment, and environmental detection and maintenance intelligent devices, etc. The intelligent robot may be an industrial robot, a service robot, a medical robot, and an agricultural robot, etc. The intelligent device includes a robot arm and a camera, which can be divided into two cases: eyes on the hand and eyes outside the hand. The eyes on the hand refer to the camera (eye) being directly installed at the end of the robot arm (hand), and the eyes outside the hand refer to the camera being installed at a certain position outside the robot arm. The camera may be fixed at other positions in the work scene, for example, the camera is fixed on a bracket or ceiling on a production line. Before the intelligent device controls the robot arm to operate the object to be operated, it is necessary to determine the operation position corresponding to the object to be operated, and then control the robot arm to operate the object to be operated according to the operation position corresponding to the operation object. In this embodiment, the robot arm calibration method includes steps 102 to 106, wherein:
步骤102,基于多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值和偏移误差;移动末端位置为机械臂移动后,机械臂末端位于基坐标系中的位置,移动图像位置为机械臂移动后,标定物位于拍摄图像中的位置;旋转末端位置为机械臂旋转后,机械臂末端位于基坐标系中的位置,旋转图像位置为机械臂旋转后,标定物位于拍摄图像中的位置。Step 102, based on multiple sets of moving end positions and moving image positions, and multiple sets of rotating end positions and rotating image positions, determine the calibration parameter values and offset errors; the moving end position is the position of the end of the robotic arm in the base coordinate system after the robotic arm moves, and the moving image position is the position of the calibration object in the captured image after the robotic arm moves; the rotating end position is the position of the end of the robotic arm in the base coordinate system after the robotic arm rotates, and the rotating image position is the position of the calibration object in the captured image after the robotic arm rotates.
其中,移动末端位置是指机械臂移动后,机械臂末端位于基坐标系中的位置。移动末端位置可以用二维坐标表示。基坐标系是指机械臂基坐标系,基坐标系一般以机械臂的固定点为坐标原点。移动图像位置是指机械臂移动后,标定物位于拍摄图像中的位置,可以理解为,标定物在相机所拍摄的拍摄图像中的位置坐标,移动图像位置可以用像素点的二维坐标表示。旋转末端位置是指机械臂旋转后,机械臂末端位于基坐标系中的位置。旋转图像位置是指机械臂旋转后,标定物位于拍摄图像中的位置。多组移动末端位置和移动图像位置可以为至少9组移动末端位置和移动图像位置,多组旋转末端位置和旋转图像位置可以为至少5组旋转末端位置和旋转图像位置。Among them, the mobile end position refers to the position of the end of the robot arm in the base coordinate system after the robot arm moves. The mobile end position can be expressed in two-dimensional coordinates. The base coordinate system refers to the base coordinate system of the robot arm, and the base coordinate system generally takes the fixed point of the robot arm as the coordinate origin. The mobile image position refers to the position of the calibration object in the captured image after the robot arm moves. It can be understood that the position coordinates of the calibration object in the captured image taken by the camera, and the mobile image position can be expressed in two-dimensional coordinates of pixel points. The rotation end position refers to the position of the end of the robot arm in the base coordinate system after the robot arm rotates. The rotation image position refers to the position of the calibration object in the captured image after the robot arm rotates. The multiple sets of mobile end positions and mobile image positions can be at least 9 sets of mobile end positions and mobile image positions, and the multiple sets of rotation end positions and rotation image positions can be at least 5 sets of rotation end positions and rotation image positions.
标定参数值是指用于对待操作对象的目标图像位置进行转换的参数,可以理解为,标定参数值为确定待操作对象的操作位置的转换参数。在机械臂的高度固定的情况下,标定参数值包括旋转平移矩阵;在机械臂的高度可变的情况下,标定参数值包括旋转平移矩阵和投影畸变矩阵;旋转平移矩阵表征相机和机械臂末端之间的几何关系,投影畸变矩阵表征拍摄图像的透视投影和镜头畸变的影响。偏移误差是指用于对初始操作位置进行修正的数值,可以理解为,根据待操作对象对应的目标图像位置和标定参数值,确定待操作对象的初始操作位置,使用偏移误差对初始操作位置进行修正,即可得到待操作对象的目标操作位置。The calibration parameter value refers to the parameter used to transform the target image position of the object to be operated. It can be understood that the calibration parameter value is a conversion parameter for determining the operating position of the object to be operated. When the height of the robotic arm is fixed, the calibration parameter value includes a rotation and translation matrix; when the height of the robotic arm is variable, the calibration parameter value includes a rotation and translation matrix and a projection distortion matrix; the rotation and translation matrix represents the geometric relationship between the camera and the end of the robotic arm, and the projection distortion matrix represents the perspective projection of the captured image and the influence of lens distortion. The offset error refers to the value used to correct the initial operating position. It can be understood that the initial operating position of the object to be operated is determined according to the target image position corresponding to the object to be operated and the calibration parameter value, and the initial operating position is corrected using the offset error to obtain the target operating position of the object to be operated.
示例性地,在智能设备需要进行手眼标定的情况下,智能设备控制机械臂在具有标定物的标定平面上移动,针对每一次移动,智能设备获取一组移动末端位置和移动图像位置,在经过多次移动之后,得到多组移动末端位置和移动图像位置;智能设备控制机械臂进行多次旋转,针对每一旋转,智能设备获取一组旋转末端位置和旋转图像位置,在经过多次移动之后,得到多组旋转末端位置和旋转图像位置。智能设备基于多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值;再基于多组旋转末端位置和旋转图像位置,以及标定参数值,确定偏移误差。智能设备需要进行手眼标定的情况,可以为确定待操作对象的目标操作位置之前,即智能设备在确定待操作对象的目标操作位置之前,先进行手眼标定;或者,智能设备需要进行手眼标定的情况,也可以为每隔预设时间段,即智能设备每隔预设时间段进行一次手眼标定。Exemplarily, in the case where the smart device needs to perform hand-eye calibration, the smart device controls the mechanical arm to move on the calibration plane with the calibration object, and for each movement, the smart device obtains a set of mobile terminal positions and mobile image positions, and after multiple movements, multiple sets of mobile terminal positions and mobile image positions are obtained; the smart device controls the mechanical arm to rotate multiple times, and for each rotation, the smart device obtains a set of rotation terminal positions and rotation image positions, and after multiple movements, multiple sets of rotation terminal positions and rotation image positions are obtained. The smart device determines the calibration parameter value based on the multiple sets of mobile terminal positions and mobile image positions, and the multiple sets of rotation terminal positions and rotation image positions; and then determines the offset error based on the multiple sets of rotation terminal positions and rotation image positions, and the calibration parameter value. In the case where the smart device needs to perform hand-eye calibration, it can be before determining the target operation position of the object to be operated, that is, before the smart device determines the target operation position of the object to be operated, the hand-eye calibration is performed first; or, in the case where the smart device needs to perform hand-eye calibration, it can also be every preset time period, that is, the smart device performs hand-eye calibration every preset time period.
步骤104,获取待操作对象的目标图像位置,基于目标图像位置和标定参数值,确定待操作对象对应的转换位置。Step 104 , obtaining the target image position of the object to be operated, and determining the conversion position corresponding to the object to be operated based on the target image position and the calibration parameter value.
其中,待操作对象是指需要机械臂进行操作的对象,待操作对象位于机械臂的操作平面中。目标图像位置是指待操作对象在相机所拍摄的拍摄图像中的位置坐标。转换位置是指根据标定参数值对目标图像位置进行转换得到的位置坐标。The object to be operated refers to the object that needs to be operated by the robot arm, and the object to be operated is located in the operation plane of the robot arm. The target image position refers to the position coordinates of the object to be operated in the image taken by the camera. The converted position refers to the position coordinates obtained by converting the target image position according to the calibration parameter value.
示例性地,智能设备确定标定参数值和偏移误差之后,当需要控制机械臂对待操作对象进行操作时,智能设备通过机械臂对应的相机,获取操作平面中待操作对象的目标图像位置;在标定参数值包括旋转平移矩阵的情况下,获取投影畸变矩阵,将目标图像位置、标定参数值和投影畸变矩阵之间的乘积,确定为待操作对象对应的转换位置;在标定参数值包括旋转平移矩阵和投影畸变矩阵的情况下,将目标图像位置和标定参数值之间的乘积,确定为待操作对象对应的转换位置。Exemplarily, after the smart device determines the calibration parameter value and the offset error, when it is necessary to control the robotic arm to operate the object to be operated, the smart device obtains the target image position of the object to be operated in the operation plane through the camera corresponding to the robotic arm; when the calibration parameter value includes a rotation and translation matrix, the projection distortion matrix is obtained, and the product of the target image position, the calibration parameter value and the projection distortion matrix is determined as the transformation position corresponding to the object to be operated; when the calibration parameter value includes a rotation and translation matrix and a projection distortion matrix, the product of the target image position and the calibration parameter value is determined as the transformation position corresponding to the object to be operated.
步骤106,基于转换位置和偏移误差,得到待操作对象对应的目标操作位置。Step 106: Obtain a target operation position corresponding to the object to be operated based on the conversion position and the offset error.
示例性地,在机械臂的工作平面与标定平面在同一平面的情况下,智能设备将待操作对象对应的转换位置加上偏移误差,得到待操作对象对应的目标操作位置;在机械臂的工作平面与标定平面不在同一平面的情况下,智能设备将待操作对象对应的转换位置加上偏移误差,得到待操作对象对应的初始操作位置,基于初始操作位置,确定待操作对象对应的目标操作位置。Exemplarily, when the working plane of the robotic arm and the calibration plane are in the same plane, the intelligent device adds the offset error to the conversion position corresponding to the object to be operated to obtain the target operation position corresponding to the object to be operated; when the working plane of the robotic arm and the calibration plane are not in the same plane, the intelligent device adds the offset error to the conversion position corresponding to the object to be operated to obtain the initial operation position corresponding to the object to be operated, and determines the target operation position corresponding to the object to be operated based on the initial operation position.
上述机械臂标定方法,在确定待操作对象的目标操作位置之前,通过多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值和偏移误差,相比于仅通过多组移动末端位置和移动图像位置确定标定参数值,使用多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值,结合了机械臂进行移动的多组数据和机械臂进行旋转的多组数据,从而提高了标定参数值的准确性;在确定待操作对象的目标操作位置的过程中,使用准确性较高的标定参数值确定待操作对象对应的转换位置,提高了转换位置的准确性,再使用确定的偏移误差对转换位置进行修正,得到待操作对象对应的目标操作位置,从而进一步提高了操作位置的准确性。The above-mentioned robot arm calibration method determines the calibration parameter value and the offset error through multiple sets of moving end positions and moving image positions, and multiple sets of rotating end positions and rotating image positions, before determining the target operation position of the object to be operated. Compared with determining the calibration parameter value only through multiple sets of moving end positions and moving image positions, multiple sets of moving end positions and moving image positions, and multiple sets of rotating end positions and rotating image positions are used to determine the calibration parameter value, and multiple sets of data of the robot arm movement and multiple sets of data of the robot arm rotation are combined, thereby improving the accuracy of the calibration parameter value; in the process of determining the target operation position of the object to be operated, the calibration parameter value with higher accuracy is used to determine the conversion position corresponding to the object to be operated, thereby improving the accuracy of the conversion position, and then the determined offset error is used to correct the conversion position to obtain the target operation position corresponding to the object to be operated, thereby further improving the accuracy of the operation position.
在一个实施例中,如图2所示,在拍摄装置位于机械臂上的情况下,基于多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值和偏移误差,包括:In one embodiment, as shown in FIG2 , when the camera is located on a robotic arm, the calibration parameter values and the offset errors are determined based on multiple sets of moving end positions and moving image positions, and multiple sets of rotating end positions and rotating image positions, including:
步骤202,对多组移动末端位置进行平均,得到平均位置。Step 202, averaging multiple groups of mobile terminal positions to obtain an average position.
其中,平均位置是指多组移动末端位置进行平均,得到的位置坐标。The average position refers to the position coordinates obtained by averaging multiple groups of mobile terminal positions.
示例性地,在拍摄装置位于机械臂上的情况下,即眼在手上的情况,智能设备对多组移动末端位置进行平均,得到平均位置。Exemplarily, when the camera is located on a robotic arm, that is, when the eye is on the hand, the smart device averages multiple groups of mobile terminal positions to obtain an average position.
步骤204,确定移动末端位置与平均位置之间的移动差异位置,以及旋转末端位置与平均位置之间的旋转差异位置。Step 204, determining the movement difference position between the movement end position and the average position, and the rotation difference position between the rotation end position and the average position.
其中,移动差异位置是指移动末端位置减去平均位置,得到的位置坐标。旋转差异位置是指旋转末端位置减去平均位置,得到的位置坐标。The moving difference position refers to the position coordinate obtained by subtracting the average position from the moving end position, and the rotation difference position refers to the position coordinate obtained by subtracting the average position from the rotation end position.
示例性地,智能设备对于每个移动末端位置,移动末端位置减去平均位置,得到的移动差异位置;针对每个旋转差异位置,将旋转差异位置减去平均位置,得到的旋转差异位置。Exemplarily, for each mobile terminal position, the smart device subtracts the average position from the mobile terminal position to obtain a mobile difference position; and for each rotational difference position, the smart device subtracts the average position from the rotational difference position to obtain a rotational difference position.
步骤206,基于多组移动差异位置和移动图像位置,以及多组旋转差异位置和旋转图像位置,确定标定参数值。Step 206 : determining calibration parameter values based on the multiple sets of movement difference positions and movement image positions, and the multiple sets of rotation difference positions and rotation image positions.
示例性地,智能设备对多组移动差异位置和移动图像位置,以及多组旋转差异位置和旋转图像位置进行直线拟合,得到标定参数值。Exemplarily, the smart device performs straight-line fitting on multiple sets of movement difference positions and movement image positions, and multiple sets of rotation difference positions and rotation image positions to obtain calibration parameter values.
在一个实施例中,智能设备对多组移动差异位置和移动图像位置,以及多组旋转差异位置和旋转图像位置进行直线拟合,得到标定参数值,直线拟合的方法包括但不限于为最小二乘法、鲁棒回归、正则化回归和贝叶斯回归等,直线拟合的公式如下所示:In one embodiment, the smart device performs straight-line fitting on multiple sets of movement difference positions and movement image positions, and multiple sets of rotation difference positions and rotation image positions to obtain calibration parameter values. The straight-line fitting method includes but is not limited to least squares method, robust regression, regularized regression, Bayesian regression, etc. The straight-line fitting formula is as follows:
公式(1) Formula 1)
其中,为平均位置,为平均位置中的X轴坐标值,为平均位置中的Y轴坐标值;为第n个移动末端位置或者旋转末端位置;为第n个移动图像位置或者旋转图像位置;为旋转平移矩阵;P为投影畸变矩阵。in, is the average position, is the X-axis coordinate value in the average position, is the Y-axis coordinate value in the average position; is the nth moving end position or rotation end position; is the nth moving image position or rotating image position; is the rotation and translation matrix; P is the projection distortion matrix.
步骤208,基于标定参数值和平均位置,确定偏移误差。Step 208, determining the offset error based on the calibration parameter value and the average position.
示例性地,智能设备基于第一组旋转末端位置和旋转图像位置、标定参数值和平均位置,确定偏移误差;第一组旋转末端位置和旋转图像位置对应的旋转角度为零,即机械臂第一次旋转时,机械臂的旋转角度为零,机械臂末端位于基坐标系中的位置为旋转末端位置,标定物位于拍摄图像中的位置为旋转图像位置。Exemplarily, the intelligent device determines the offset error based on the first set of rotational end positions and rotational image positions, the calibration parameter values and the average position; the rotation angle corresponding to the first set of rotational end positions and rotational image positions is zero, that is, when the robotic arm rotates for the first time, the rotation angle of the robotic arm is zero, the position of the robotic arm end in the base coordinate system is the rotational end position, and the position of the calibration object in the captured image is the rotational image position.
本实施例中,在拍摄装置位于机械臂上的情况下,即眼在手上的情况,通过多组移动差异位置和移动图像位置,以及多组旋转差异位置和旋转图像位置,确定标定参数值,相比于仅通过多组移动末端位置和移动图像位置确定标定参数值,使用多组移动差异位置和移动图像位置,以及多组旋转差异位置和旋转图像位置,确定标定参数值,结合了机械臂进行移动的多组数据和机械臂进行旋转的多组数据,从而提高了标定参数值的准确性;然后在标定参数值的基础上确定偏移误差,为后续对初始操作位置进行修正提供了基础数据。In the present embodiment, when the photographing device is located on the robotic arm, that is, when the eye is on the hand, calibration parameter values are determined by multiple sets of moving difference positions and moving image positions, as well as multiple sets of rotational difference positions and rotated image positions. Compared with determining the calibration parameter values only by multiple sets of moving end positions and moving image positions, multiple sets of moving difference positions and moving image positions, as well as multiple sets of rotational difference positions and rotated image positions are used to determine the calibration parameter values, which combines multiple sets of data of the movement of the robotic arm and multiple sets of data of the rotation of the robotic arm, thereby improving the accuracy of the calibration parameter values; then, the offset error is determined based on the calibration parameter value, providing basic data for subsequent correction of the initial operation position.
在一个实施例中,如图3所示,基于标定参数值和平均位置,确定偏移误差,包括:In one embodiment, as shown in FIG3 , based on the calibration parameter value and the average position, determining the offset error includes:
步骤302,针对每个旋转图像位置,基于旋转图像位置和标定参数值,得到旋转图像位置在末端坐标系下对应的第一图像位置。Step 302 : for each rotated image position, based on the rotated image position and the calibration parameter value, obtain the first image position corresponding to the rotated image position in the terminal coordinate system.
其中,末端坐标系是指机械臂末端执行器的坐标系,末端坐标系通常以机械臂末端执行器的中心为坐标原点。The end coordinate system refers to the coordinate system of the end effector of the robot arm, and the end coordinate system usually takes the center of the end effector of the robot arm as the coordinate origin.
示例性地,针对每个旋转图像位置,智能设备将旋转图像位置乘以标定参数值,得到旋转图像位置在末端坐标系下对应的第一图像位置。Exemplarily, for each rotated image position, the smart device multiplies the rotated image position by the calibration parameter value to obtain a first image position corresponding to the rotated image position in the terminal coordinate system.
步骤304,对多个第一图像位置进行曲线拟合,得到拟合圆心位置。Step 304: Perform curve fitting on the multiple first image positions to obtain the fitting circle center position.
其中,曲线拟合是指将多个点拟合成一个圆的过程。拟合圆心位置是指通过曲线拟合所得到的圆的圆心的位置坐标。The curve fitting refers to the process of fitting multiple points into a circle. The fitting center position refers to the position coordinates of the center of the circle obtained by the curve fitting.
示例性地,智能设备对多个第一图像位置进行曲线拟合,得到拟合圆,将拟合圆的中心点的位置坐标,确定为拟合圆心位置。Exemplarily, the smart device performs curve fitting on the multiple first image positions to obtain a fitting circle, and determines the position coordinates of the center point of the fitting circle as the center position of the fitting circle.
步骤306,基于一组旋转末端位置和旋转图像位置、拟合圆心位置和平均位置,确定偏移误差。Step 306 , determining an offset error based on a set of rotation end positions and rotation image positions, a fitting circle center position and an average position.
示例性地,智能设备确定旋转末端位置与平均位置之间的第一差异值,以及与旋转末端位置位于同一组的旋转图像位置与拟合圆心位置之间的第二差异值,将第一差异值加上第二差异值,得到偏移误差。Exemplarily, the smart device determines a first difference value between the rotation end position and the average position, and a second difference value between the rotation image position in the same group as the rotation end position and the fitting circle center position, and adds the first difference value to the second difference value to obtain an offset error.
在一个实施例中,偏移误差diff如下所示:In one embodiment, the offset error diff is as follows:
公式(2) Formula (2)
其中,P旋转末端位置是指旋转末端位置的坐标,P旋转图像位置是指旋转图像位置的坐标,P旋转末端位置和P旋转图像位置是一组旋转末端位置和旋转图像位置,一般使用第一组旋转末端位置和旋转图像位置,第一组旋转末端位置和旋转图像位置对应的机械臂的旋转角度为零;P平均位置是指对多组移动末端位置进行平均,得到平均位置的坐标;P拟合圆心位置是指对多个第一图像位置进行曲线拟合,得到拟合圆心位置的坐标。Among them, Protational end position refers to the coordinates of the rotational end position, Protational image position refers to the coordinates of the rotational image position, Protational end position and Protational image position are a group of rotational end positions and rotational image positions, and generally the first group of rotational end positions and rotational image positions are used, and the rotation angle of the robotic arm corresponding to the first group of rotational end positions and rotational image positions is zero; Paverage position refers to averaging multiple groups of mobile end positions to obtain the coordinates of the average position; Pfitted circle center position refers to curve fitting of multiple first image positions to obtain the coordinates of the fitted circle center position.
本实施例中,在拍摄装置位于机械臂上的情况下,即眼在手上的情况,若直接使用上述步骤202至206确定的标定参数值计算待操作对象的目标操作位置,计算得到的目标操作位置与实际操作位置偏移两个距离,其一为旋转图像位置到机械臂旋转中心位置之间的距离,其二为机械臂旋转中线位置到平均位置之间的距离,通过上述步骤302和步骤304确定的拟合圆心位置即为机械臂旋转中心位置,通过一组旋转末端位置和旋转图像位置、拟合圆心位置和平均位置确定偏移误差,为后续对初始操作位置进行修正提供了基础数据。In this embodiment, when the camera is located on the robotic arm, that is, when the eye is on the hand, if the calibration parameter values determined in the above steps 202 to 206 are directly used to calculate the target operation position of the object to be operated, the calculated target operation position is offset from the actual operation position by two distances, one of which is the distance from the rotated image position to the rotation center position of the robotic arm, and the other is the distance from the rotation midline position of the robotic arm to the average position. The fitted center position determined by the above steps 302 and 304 is the rotation center position of the robotic arm. The offset error is determined by a set of rotation end positions and rotation image positions, the fitted center position and the average position, which provides basic data for subsequent correction of the initial operation position.
在一个实施例中,如图4所示,在拍摄装置位于机械臂外的情况下,基于多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值和偏移误差,包括:In one embodiment, as shown in FIG4 , when the camera is located outside the robot arm, the calibration parameter value and the offset error are determined based on multiple sets of mobile end positions and mobile image positions, and multiple sets of rotation end positions and rotation image positions, including:
步骤402,基于多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值。Step 402 : determining calibration parameter values based on multiple sets of moving end positions and moving image positions, and multiple sets of rotating end positions and rotating image positions.
示例性地,在拍摄装置位于机械臂外的情况下,即眼在手外的情况下,智能设备对多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,进行直线拟合,得到标定参数值。直线拟合的方法包括但不限于为最小二乘法、鲁棒回归、正则化回归和贝叶斯回归等。For example, when the camera is outside the robot arm, that is, the eye is outside the hand, the smart device performs linear fitting on multiple sets of mobile end positions and mobile image positions, and multiple sets of rotation end positions and rotation image positions to obtain calibration parameter values. The linear fitting method includes but is not limited to least squares method, robust regression, regularized regression, Bayesian regression, etc.
在一个实施例中,直线拟合的公式如下所示:In one embodiment, the straight line fitting formula is as follows:
公式(3) Formula (3)
其中,为第n个移动末端位置或者旋转末端位置;为第n个移动图像位置或者旋转图像位置;为旋转平移矩阵;P为投影畸变矩阵。in, is the nth moving end position or rotation end position; is the nth moving image position or rotating image position; is the rotation and translation matrix; P is the projection distortion matrix.
步骤404,针对每个旋转图像位置,基于旋转图像位置和标定参数值,得到旋转图像位置在基坐标系下对应的第二图像位置。Step 404 : for each rotated image position, based on the rotated image position and the calibration parameter value, obtain a second image position corresponding to the rotated image position in the base coordinate system.
示例性地,针对每个旋转图像位置,智能设备将旋转图像位置乘以标定参数值,得到旋转图像位置在基坐标系下对应的第二图像位置。Exemplarily, for each rotated image position, the smart device multiplies the rotated image position by the calibration parameter value to obtain a second image position corresponding to the rotated image position in the base coordinate system.
步骤406,对多个第二图像位置进行曲线拟合,得到拟合圆心位置和拟合半径。Step 406: Perform curve fitting on the multiple second image positions to obtain the fitting circle center position and fitting radius.
其中,拟合圆心位置是指对多个第二图像位置进行曲线拟合所得到的拟合圆的圆心位置。拟合半径是指对多个第二图像位置进行曲线拟合所得到的拟合圆的半径。The center position of the fitting circle refers to the center position of the fitting circle obtained by performing curve fitting on the multiple second image positions. The fitting radius refers to the radius of the fitting circle obtained by performing curve fitting on the multiple second image positions.
示例性地,智能设备对多个第二图像位置进行曲线拟合,得到拟合圆,将拟合圆的圆心的位置坐标确定为拟合圆心位置,将拟合圆的半径确定为拟合半径。Exemplarily, the smart device performs curve fitting on the multiple second image positions to obtain a fitting circle, determines the position coordinates of the center of the fitting circle as the fitting center position, and determines the radius of the fitting circle as the fitting radius.
步骤408,基于一组旋转末端位置和旋转图像位置、拟合圆心位置和拟合半径,确定偏移误差。Step 408 , determining an offset error based on a set of rotation end positions and rotation image positions, a fitting circle center position, and a fitting radius.
示例性地,智能设备对一组旋转末端位置和旋转图像位置、拟合圆心位置和拟合半径进行运算,得到偏移误差。Exemplarily, the smart device calculates a set of rotation end positions and rotation image positions, a fitting circle center position and a fitting radius to obtain an offset error.
本实施例中,在拍摄装置位于机械臂外的情况下,即眼在手外的情况下,通过多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值,相比于仅通过多组移动末端位置和移动图像位置确定标定参数值,使用多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值,结合了机械臂进行移动的多组数据和机械臂进行旋转的多组数据,从而提高了标定参数值的准确性;然后在标定参数值的基础上确定偏移误差,为后续对初始操作位置进行修正提供了基础数据。In the present embodiment, when the photographing device is located outside the robotic arm, that is, when the eye is outside the hand, the calibration parameter value is determined by multiple sets of moving end positions and moving image positions, as well as multiple sets of rotating end positions and rotating image positions. Compared with determining the calibration parameter value only by multiple sets of moving end positions and moving image positions, the calibration parameter value is determined by using multiple sets of moving end positions and moving image positions, as well as multiple sets of rotating end positions and rotating image positions, which combines multiple sets of data of the movement of the robotic arm and multiple sets of data of the rotation of the robotic arm, thereby improving the accuracy of the calibration parameter value; then, the offset error is determined based on the calibration parameter value, providing basic data for subsequent correction of the initial operation position.
在一个实施例中,如图5所示,基于一组旋转末端位置和旋转图像位置、拟合圆心位置和拟合半径,确定偏移误差,包括:In one embodiment, as shown in FIG5 , based on a set of rotation end positions and rotation image positions, a fitting center position and a fitting radius, determining the offset error includes:
步骤502,基于旋转末端位置和拟合圆心位置,确定旋转末端位置和拟合圆心位置所在直线的倾斜角度。Step 502: Based on the rotation end position and the fitting circle center position, determine the inclination angle of the straight line where the rotation end position and the fitting circle center position are located.
其中,倾斜角度是指旋转末端位置和拟合圆心位置所在直线与Y轴正方向之间的夹角。The tilt angle refers to the angle between the straight line where the rotation end position and the fitting circle center position are located and the positive direction of the Y axis.
示例性地,智能设备确定旋转末端位置的X轴坐标值与拟合圆心位置的X轴坐标值之间的X轴差异值,确定旋转末端位置的Y轴坐标值与拟合圆心位置的Y轴坐标值之间的Y轴差异值,确定X轴差异值和Y轴差异值之间的差异比值,对差异比值进行反正切运算,得到旋转末端位置和拟合圆心位置所在直线的倾斜角度。Exemplarily, the smart device determines the X-axis difference value between the X-axis coordinate value of the rotation end position and the X-axis coordinate value of the fitting center position, determines the Y-axis difference value between the Y-axis coordinate value of the rotation end position and the Y-axis coordinate value of the fitting center position, determines the difference ratio between the X-axis difference value and the Y-axis difference value, performs an inverse tangent operation on the difference ratio, and obtains the inclination angle of the straight line where the rotation end position and the fitting center position are located.
在一个实施例中,倾斜角度如下所示:In one embodiment, the tilt angle As follows:
公式(4) Formula (4)
其中,(x1,y1)为旋转末端位置,一般使用第一组旋转末端位置和旋转图像位置,第一组旋转末端位置和旋转图像位置对应的机械臂的旋转角度为零;(xcircle,ycircle)为拟合圆心位置。Among them, (x 1 ,y 1 ) is the rotation end position. Generally, the first set of rotation end position and rotation image position are used. The rotation angle of the robot arm corresponding to the first set of rotation end position and rotation image position is zero; (x circle ,y circle ) is the fitting circle center position.
步骤504,基于倾斜角度的正弦值、倾斜角度的余弦值和拟合半径,得到偏移误差。Step 504: Obtain an offset error based on the sine value of the tilt angle, the cosine value of the tilt angle, and the fitting radius.
示例性地,智能设备将倾斜角度的正弦值乘以拟合半径,得到正弦误差,将倾斜角度的余弦值乘以拟合半径,得到余弦误差,基于正弦误差和余弦误差,得到偏移误差。Exemplarily, the smart device multiplies the sine value of the tilt angle by the fitting radius to obtain a sine error, multiplies the cosine value of the tilt angle by the fitting radius to obtain a cosine error, and obtains an offset error based on the sine error and the cosine error.
在一个实施例中,偏移误差diff如下所示:In one embodiment, the offset error diff is as follows:
公式(5) Formula (5)
其中,circle_r为拟合半径;为倾斜角度的余弦值;为倾斜角度的正弦值。Among them, circle_r is the fitting radius; is the cosine of the tilt angle; is the sine of the tilt angle.
本实施例中,在拍摄装置位于机械臂外的情况下,即眼在手外的情况下,通过一组旋转末端位置和旋转图像位置、拟合圆心位置和拟合半径,确定偏移误差,为后续对初始操作位置进行修正提供了基础数据。In this embodiment, when the camera is located outside the robotic arm, that is, the eye is outside the hand, the offset error is determined through a set of rotation end positions and rotation image positions, fitting circle center positions and fitting radius, providing basic data for subsequent correction of the initial operation position.
在一个实施例中,如图6所示,在标定物位于标定平面,且标定平面和工作平面位于不同的平面的情况下,在基于转换位置和偏移误差,得到待操作对象对应的目标操作位置之前,以及基于转换位置和偏移误差,得到待操作对象对应的目标操作位置,包括:In one embodiment, as shown in FIG6 , when the calibration object is located on the calibration plane, and the calibration plane and the working plane are located on different planes, before obtaining the target operation position corresponding to the object to be operated based on the conversion position and the offset error, and obtaining the target operation position corresponding to the object to be operated based on the conversion position and the offset error, includes:
步骤602,获取多组修正末端位置和修正图像位置;修正末端位置为机械臂移动到位于工作平面的修正标定物后,机械臂末端位于基坐标系中的位置;修正图像位置为修正标定物位于拍摄图像中的位置。Step 602, obtain multiple sets of corrected end positions and corrected image positions; the corrected end position is the position of the end of the robotic arm in the base coordinate system after the robotic arm moves to the corrected calibration object located on the working plane; the corrected image position is the position of the corrected calibration object in the captured image.
其中,修正末端位置是指机械臂移动到位于工作平面的修正标定物后,机械臂末端位于基坐标系中的位置。标定平面是指标定物所位于的平面,可以理解为,用于确定标定参数值的平面。工作平面是指机械臂执行操作的平面,可以理解为,机械臂的工作平面。修正标定物是指用于确定标定平面和工作平面之间的平面转换关系,位于工作平面上的标定物。修正图像位置是指修正标定物位于拍摄图像中的位置。Among them, the correction end position refers to the position of the end of the manipulator in the base coordinate system after the manipulator moves to the correction calibration object located on the working plane. The calibration plane refers to the plane where the calibration object is located, which can be understood as the plane used to determine the calibration parameter value. The working plane refers to the plane on which the manipulator performs operations, which can be understood as the working plane of the manipulator. The correction calibration object refers to the calibration object located on the working plane used to determine the plane transformation relationship between the calibration plane and the working plane. The correction image position refers to the position of the correction calibration object in the captured image.
示例性地,在标定物位于标定平面,且标定平面和工作平面位于不同的平面的情况下,智能设备在确定标定参数值之后,以及在确定待操作对象对应的目标操作位置之前,智能对象控制机械臂移动到位于工作平面的修正标定物,得到一组修正末端位置和修正图像位置,在进行多次移动之后,得到多组修正末端位置和修正图像位置。Exemplarily, when the calibration object is located on the calibration plane, and the calibration plane and the working plane are located on different planes, after the intelligent device determines the calibration parameter value and before determining the target operation position corresponding to the object to be operated, the intelligent object controls the robotic arm to move to the corrected calibration object located on the working plane, and obtains a set of corrected end positions and corrected image positions. After multiple movements, multiple sets of corrected end positions and corrected image positions are obtained.
步骤604,基于修正图像位置和标定参数值,确定修正图像位置对应的修正转换位置。Step 604: Determine a corrected conversion position corresponding to the corrected image position based on the corrected image position and the calibration parameter value.
示例性地,针对每一个修正图像位置,智能设备将修正图像位置乘以标定参数值,得到修正图像位置对应的修正转换位置。Exemplarily, for each corrected image position, the smart device multiplies the corrected image position by the calibration parameter value to obtain a corrected transformation position corresponding to the corrected image position.
步骤606,基于多组修正末端位置和修正转换位置,确定标定平面和工作平面之间的平面转换关系。Step 606: Determine a plane transformation relationship between the calibration plane and the working plane based on the multiple sets of corrected end positions and corrected transformation positions.
其中,平面转换关系是指将位于标定平面的位置坐标转换到工作平面的转换参数值。平面转换关系中包括缩放矩阵和平移矩阵;缩放矩阵可以包括第一缩放参数值和第二缩放参数值,第一缩放参数值表征在X轴的缩放倍数,第二缩放参数值表征在Y轴的缩放倍数;平移矩阵可以包括第一平移参数值和第二平移参数值,第一平移参数值表征在X轴的平移距离,第二平移参数值表征在Y轴的平移距离。Among them, the plane transformation relationship refers to the transformation parameter value of transforming the position coordinates located on the calibration plane to the working plane. The plane transformation relationship includes a scaling matrix and a translation matrix; the scaling matrix may include a first scaling parameter value and a second scaling parameter value, the first scaling parameter value represents the scaling factor on the X axis, and the second scaling parameter value represents the scaling factor on the Y axis; the translation matrix may include a first translation parameter value and a second translation parameter value, the first translation parameter value represents the translation distance on the X axis, and the second translation parameter value represents the translation distance on the Y axis.
示例性地,智能设备对多组修正末端位置和修正转换位置进行拟合,得到标定平面和工作平面之间的平面转换关系。Exemplarily, the intelligent device fits multiple sets of corrected end positions and corrected transformation positions to obtain a plane transformation relationship between the calibration plane and the working plane.
在一个实施例中,对多组修正末端位置和修正转换位置进行拟合的拟合公式如下所示:In one embodiment, the fitting formula for fitting multiple sets of corrected end positions and corrected conversion positions is as follows:
公式(6) Formula (6)
其中,为第n个修正转换位置;为第n个修正末端位置;scale_x为X轴对应的缩放倍数,即第一缩放参数;scale_y为Y轴对应的缩放倍数,即第二缩放参数;original_x为X轴的平移距离,即第一平移参数;origin_y为Y轴的平移距离,即第二平移参数。in, Transform position for the nth correction; is the nth corrected end position; scale_x is the scaling factor corresponding to the X axis, i.e. the first scaling parameter; scale_y is the scaling factor corresponding to the Y axis, i.e. the second scaling parameter; original_x is the translation distance of the X axis, i.e. the first translation parameter; origin_y is the translation distance of the Y axis, i.e. the second translation parameter.
步骤608,基于转换位置和偏移误差,得到待操作对象对应的初始操作位置。Step 608: Based on the conversion position and the offset error, an initial operation position corresponding to the object to be operated is obtained.
示例性地,智能设备将待操作对象对应的转换位置加上偏移误差,得到待操作对象对应的初始操作位置。Exemplarily, the smart device adds an offset error to the conversion position corresponding to the object to be operated to obtain an initial operation position corresponding to the object to be operated.
步骤610,基于初始操作位置和平面转换关系,得到待操作对象对应的目标操作位置。Step 610: Based on the initial operation position and the plane transformation relationship, a target operation position corresponding to the object to be operated is obtained.
示例性地,智能设备将初始操作位置减去平面转换关系中的平移矩阵,得到平移差异位置,将平移差异位置乘以平面转换关系中的缩放矩阵,得到待操作对象对应的目标操作位置。Exemplarily, the smart device subtracts the translation matrix in the plane transformation relationship from the initial operation position to obtain a translation difference position, and multiplies the translation difference position by the scaling matrix in the plane transformation relationship to obtain a target operation position corresponding to the object to be operated.
本实施例中,在标定物位于标定平面,且标定平面和工作平面位于不同的平面的情况下,根据多组修正末端位置和修正转换位置,确定标定平面和工作平面之间的平面转换关系,然后使用平面转换关系将位于标定平面的初始操作位置,转到为位于操作平面的目标操作位置,从而确保目标操作位置位于机械臂的工作平面,提高了目标操作位置的准确性。In this embodiment, when the calibration object is located on the calibration plane, and the calibration plane and the working plane are located on different planes, the plane transformation relationship between the calibration plane and the working plane is determined according to multiple sets of corrected end positions and corrected transformation positions, and then the plane transformation relationship is used to transform the initial operation position located on the calibration plane to the target operation position located on the operating plane, thereby ensuring that the target operation position is located on the working plane of the robot arm, thereby improving the accuracy of the target operation position.
在一个示例性地实施例中,提供了一种待操作对象的机械臂标定方法,分为眼在手上和眼在手外两种情况,分别为:In an exemplary embodiment, a method for calibrating a robotic arm of an object to be operated is provided, which is divided into two cases: eyes on the hand and eyes outside the hand, respectively:
一、眼在手上1. Eyes on the Hands
需要对点,且标定平面和操作平面位于同一平面的情况下,包括以下步骤:If alignment is required and the calibration plane and the operation plane are on the same plane, the following steps are included:
1、移动机械臂对应上标定物,记录下标定物在基坐标系下的移动末端位置(x,y);1. Move the robotic arm to the corresponding calibration object and record the moving end position (x, y) of the calibration object in the base coordinate system;
2、移动机械臂,确保标定物在相机的视野中,记录当前的机械臂末端在基坐标系下的移动末端位置(xn,yn)和对应的移动图像位置(ximagen,yimagen),重复九次上述步骤,得到九组移动末端位置(xn,yn)和移动图像位置(ximagen,yimagen);2. Move the robotic arm to ensure that the calibration object is in the field of view of the camera, record the current mobile end position ( xn , yn ) and the corresponding mobile image position ( ximagen , yimagen ) of the robotic arm in the base coordinate system, repeat the above steps nine times to obtain nine sets of mobile end positions ( xn , yn ) and mobile image positions ( ximagen , yimagen );
3、基于九组移动末端位置(xn,yn)和移动图像位置(ximagen,yimagen),对公式(7)进行拟合,得到旋转平移矩阵和投影畸变矩阵P。3. Based on the nine sets of mobile terminal positions ( xn , yn ) and mobile image positions ( ximagen , yimagen ), fit formula (7) to obtain the rotation and translation matrix And the projection distortion matrix P.
公式(7) Formula (7)
4、获取待操作对象对应的目标末端位置和目标图像位置,将目标图像位置乘以旋转平移矩阵和投影畸变矩阵,得到待操作对象在末端坐标系下的转换位置,将转换位置加上目标末端位置,得到待操作对象在基坐标系下的目标操作位置。4. Obtain the target terminal position and target image position corresponding to the object to be operated, multiply the target image position by the rotation translation matrix and the projection distortion matrix to obtain the transformed position of the object to be operated in the terminal coordinate system, add the transformed position to the target terminal position to obtain the target operation position of the object to be operated in the base coordinate system.
不需要对点,且标定平面和操作平面位于同一平面的情况下,包括以下步骤:If alignment is not required and the calibration plane and the operation plane are on the same plane, the following steps are included:
1、移动机械臂,确保标定物在相机的视野中,记录当前的机械臂末端在基坐标系下的移动末端位置(xn,yn)和对应的移动图像位置(ximagen,yimagen),重复九次上述步骤,得到九组移动末端位置(xn,yn)和移动图像位置(ximagen,yimagen);1. Move the robotic arm to ensure that the calibration object is in the field of view of the camera, record the current mobile end position ( xn , yn ) of the robotic arm in the base coordinate system and the corresponding mobile image position ( ximagen , yimagen ), repeat the above steps nine times to obtain nine sets of mobile end positions ( xn , yn ) and mobile image positions ( ximagen , yimagen );
2、旋转机械臂,确保标定物在相机的视野中,记录当前的机械臂末端在基坐标系下的旋转末端位置(xm,ym)和对应的旋转图像位置(ximagem,yimagem),重复五次上述步骤,得到五组旋转末端位置(xm,ym)和旋转图像位置(ximagem,yimagem);第一次机械臂旋转的角度为零;2. Rotate the robotic arm to ensure that the calibration object is in the field of view of the camera, record the current rotation end position (x m , y m ) and the corresponding rotation image position (ximage m , yimage m ) of the robotic arm end in the base coordinate system, repeat the above steps five times to obtain five sets of rotation end positions (x m , y m ) and rotation image positions (ximage m , yimage m ); the angle of the first rotation of the robotic arm is zero;
3、对多组移动末端位置进行平均,得到平均位置;3. Average the positions of multiple mobile terminals to get the average position ;
4、基于平均位置、九组移动末端位置(xn,yn)和移动图像位置(ximagen,yimagen),以及五组旋转末端位置(xm,ym)和旋转图像位置(ximagem,yimagem),对公式(1)进行拟合,得到旋转平移矩阵和投影畸变矩阵P;4. Based on average position , nine sets of moving end positions ( xn , yn ) and moving image positions ( ximagen , yimagen ), and five sets of rotating end positions ( xm , ym ) and rotating image positions ( ximagem , yimagem ), fit formula (1) and obtain the rotation and translation matrix and the projection distortion matrix P;
5、针对每个旋转图像位置,智能设备将旋转图像位置乘以标定参数值,得到旋转图像位置在末端坐标系下对应的第一图像位置;对五个第一图像位置进行曲线拟合,得到拟合圆,将拟合圆的中心点的位置坐标,确定为拟合圆心位置;将使用第一组旋转末端位置和旋转图像位置、拟合圆心位置和平均位置代入公式(2),得到偏移误差;5. For each rotation image position, the intelligent device multiplies the rotation image position by the calibration parameter value to obtain the first image position corresponding to the rotation image position in the terminal coordinate system; curve fitting is performed on the five first image positions to obtain a fitting circle, and the position coordinates of the center point of the fitting circle are determined as the fitting circle center position; the first set of rotation terminal positions and rotation image positions, fitting circle center positions and average positions are substituted into formula (2) to obtain the offset error;
6、获取待操作对象对应的目标图像位置,将目标图像位置乘以旋转平移矩阵和投影畸变矩阵,得到待操作对象在末端坐标系下的转换位置,将转换位置加上偏移误差,得到待操作对象在基坐标系下的目标操作位置。6. Obtain the target image position corresponding to the object to be operated, multiply the target image position by the rotation and translation matrix and the projection distortion matrix to obtain the transformed position of the object to be operated in the terminal coordinate system, add the offset error to the transformed position, and obtain the target operation position of the object to be operated in the base coordinate system.
二、眼在手外2. Eyes outside the hands
需要对点,且标定平面和操作平面位于同一平面的情况下,包括以下步骤:If alignment is required and the calibration plane and the operation plane are on the same plane, the following steps are included:
1、在标定平面放置九个标定物,移动机械臂对应上一个目标标定物,记录目标标定物在基坐标系下的移动末端位置(x,y),以及九个标定物分别对应的移动图像位置(ximagen,yimagen);1. Place nine calibration objects on the calibration plane, move the robotic arm to correspond to the previous target calibration object, record the moving end position (x, y) of the target calibration object in the base coordinate system, and the moving image positions (ximage n , yimage n ) corresponding to the nine calibration objects respectively;
2、基于移动末端位置(x,y)和九个移动图像位置(ximagen,yimagen),对公式(8)进行拟合,得到旋转平移矩阵和投影畸变矩阵P。2. Based on the mobile terminal position (x, y) and the nine mobile image positions (ximage n , yimage n ), fit formula (8) to obtain the rotation and translation matrix And the projection distortion matrix P.
公式(8) Formula (8)
3、获取待操作对象对应的目标图像位置,将目标图像位置乘以旋转平移矩阵和投影畸变矩阵,得到待操作对象在基坐标系下的目标操作位置。3. Obtain the target image position corresponding to the object to be operated, multiply the target image position by the rotation and translation matrix and the projection distortion matrix to obtain the target operation position of the object to be operated in the base coordinate system.
不需要对点,且标定平面和操作平面位于同一平面的情况下,包括以下步骤:If alignment is not required and the calibration plane and the operation plane are on the same plane, the following steps are included:
1、移动机械臂,确保标定物在相机的视野中,记录当前的机械臂末端在基坐标系下的移动末端位置(xn,yn)和对应的移动图像位置(ximagen,yimagen),重复九次上述步骤,得到九组移动末端位置(xn,yn)和移动图像位置(ximagen,yimagen);1. Move the robotic arm to ensure that the calibration object is in the field of view of the camera, record the current mobile end position ( xn , yn ) of the robotic arm in the base coordinate system and the corresponding mobile image position ( ximagen , yimagen ), repeat the above steps nine times to obtain nine sets of mobile end positions ( xn , yn ) and mobile image positions ( ximagen , yimagen );
2、旋转机械臂,确保标定物在相机的视野中,记录当前的机械臂末端在基坐标系下的旋转末端位置(xm,ym)和对应的旋转图像位置(ximagem,yimagem),重复五次上述步骤,得到五组旋转末端位置(xm,ym)和旋转图像位置(ximagem,yimagem);第一次机械臂旋转的角度为零;2. Rotate the robotic arm to ensure that the calibration object is in the field of view of the camera, record the current rotation end position (x m , y m ) and the corresponding rotation image position (ximage m , yimage m ) of the robotic arm end in the base coordinate system, repeat the above steps five times to obtain five sets of rotation end positions (x m , y m ) and rotation image positions (ximage m , yimage m ); the angle of the first rotation of the robotic arm is zero;
3、基于九组移动末端位置(xn,yn)和移动图像位置(ximagen,yimagen),以及五组旋转末端位置(xm,ym)和旋转图像位置(ximagem,yimagem),对公式(8)进行拟合,得到旋转平移矩阵和投影畸变矩阵P。3. Based on nine sets of moving end positions ( xn , yn ) and moving image positions ( ximagen , yimagen ), and five sets of rotating end positions ( xm , ym ) and rotating image positions ( ximagem , yimagem ), formula (8) is fitted to obtain the rotation and translation matrix And the projection distortion matrix P.
4、针对每个旋转图像位置,将旋转图像位置乘以标定参数值,得到旋转图像位置在基坐标系下对应的第二图像位置;对多个第二图像位置进行曲线拟合,得到拟合圆,将拟合圆的圆心的位置坐标确定为拟合圆心位置,将拟合圆的半径确定为拟合半径;4. For each rotated image position, multiply the rotated image position by the calibration parameter value to obtain the second image position corresponding to the rotated image position in the base coordinate system; perform curve fitting on the multiple second image positions to obtain a fitting circle, determine the position coordinate of the center of the fitting circle as the fitting center position, and determine the radius of the fitting circle as the fitting radius;
5、将第一个旋转末端位置和拟合圆心位置代入公式(4),得到旋转末端位置和拟合圆心位置所在直线的倾斜角度;将拟合半径和倾斜角度代入公式(5),得到偏移误差;5. Substitute the first rotation end position and the fitting center position into formula (4) to obtain the inclination angle of the straight line where the rotation end position and the fitting center position are located; substitute the fitting radius and the inclination angle into formula (5) to obtain the offset error;
6、获取待操作对象对应的目标图像位置,将目标图像位置乘以旋转平移矩阵和投影畸变矩阵,得到待操作对象在末端坐标系下的转换位置,将转换位置加上偏移误差,得到待操作对象在基坐标系下的目标操作位置。6. Obtain the target image position corresponding to the object to be operated, multiply the target image position by the rotation and translation matrix and the projection distortion matrix to obtain the transformed position of the object to be operated in the terminal coordinate system, add the offset error to the transformed position, and obtain the target operation position of the object to be operated in the base coordinate system.
在上述确定操作位置的方法中,标定物位于标定平面,且标定平面和工作平面同一个平面,若标定物位于标定平面,且标定平面和工作平面不在同一个平面的情况下,智能设备在确定标定参数值之后,以及在确定待操作对象对应的目标操作位置之前,智能对象控制机械臂移动到位于工作平面的修正标定物,得到一组修正末端位置和修正图像位置,在进行多次移动之后,得到多组修正末端位置和修正图像位置;针对每一个修正图像位置,智能设备将修正图像位置乘以标定参数值,得到修正图像位置对应的修正转换位置;基于多组修正末端位置和修正转换位置对公式(6)进行拟合,得到标定平面和工作平面之间的平面转换关系,平面转换关系中包括缩放矩阵和平移矩阵。In the above method for determining the operation position, the calibration object is located on the calibration plane, and the calibration plane and the working plane are in the same plane. If the calibration object is located on the calibration plane, and the calibration plane and the working plane are not in the same plane, after the intelligent device determines the calibration parameter value and before determining the target operation position corresponding to the object to be operated, the intelligent object controls the robot arm to move to the corrected calibration object located on the working plane to obtain a set of corrected end positions and corrected image positions. After multiple movements, multiple sets of corrected end positions and corrected image positions are obtained; for each corrected image position, the intelligent device multiplies the corrected image position by the calibration parameter value to obtain a corrected transformation position corresponding to the corrected image position; based on the multiple sets of corrected end positions and corrected transformation positions, formula (6) is fitted to obtain a plane transformation relationship between the calibration plane and the working plane, and the plane transformation relationship includes a scaling matrix and a translation matrix.
在确定平面转换关系之后,获取确定的旋转平移矩阵和投影畸变矩阵,以及待操作对象对应的目标图像位置,将目标图像位置乘以旋转平移矩阵和投影畸变矩阵,得到待操作对象在末端坐标系下的转换位置,将转换位置加上偏移误差,得到待操作对象在基坐标系下的初始操作位置;将初始操作位置减去平面转换关系中的平移矩阵,得到平移差异位置,将平移差异位置乘以平面转换关系中的缩放矩阵,得到待操作对象对应的目标操作位置。After determining the plane transformation relationship, obtain the determined rotation translation matrix and projection distortion matrix, as well as the target image position corresponding to the object to be operated, multiply the target image position by the rotation translation matrix and the projection distortion matrix to obtain the transformation position of the object to be operated in the terminal coordinate system, add the offset error to the transformation position to obtain the initial operation position of the object to be operated in the base coordinate system; subtract the translation matrix in the plane transformation relationship from the initial operation position to obtain the translation difference position, multiply the translation difference position by the scaling matrix in the plane transformation relationship to obtain the target operation position corresponding to the object to be operated.
上述机械臂标定方法,在确定待操作对象的目标操作位置之前,通过多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值和偏移误差,相比于仅通过多组移动末端位置和移动图像位置确定标定参数值,使用多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值,结合了机械臂进行移动的多组数据和机械臂进行旋转的多组数据,从而提高了标定参数值的准确性;在确定待操作对象的目标操作位置的过程中,使用准确性较高的标定参数值确定待操作对象对应的转换位置,提高了转换位置的准确性,再使用确定的偏移误差对转换位置进行修正,得到待操作对象对应的目标操作位置,从而进一步提高了操作位置的准确性。在标定物位于标定平面,且标定平面和工作平面位于不同的平面的情况下,根据多组修正末端位置和修正转换位置,确定标定平面和工作平面之间的平面转换关系,然后使用平面转换关系将位于标定平面的初始操作位置,转到为位于操作平面的目标操作位置,从而确保目标操作位置位于机械臂的工作平面,提高了目标操作位置的准确性。The above-mentioned robot arm calibration method determines the calibration parameter value and the offset error through multiple sets of moving end positions and moving image positions, and multiple sets of rotating end positions and rotating image positions, before determining the target operation position of the object to be operated. Compared with determining the calibration parameter value only through multiple sets of moving end positions and moving image positions, multiple sets of moving end positions and moving image positions, and multiple sets of rotating end positions and rotating image positions are used to determine the calibration parameter value, and multiple sets of data of the robot arm movement and multiple sets of data of the robot arm rotation are combined, thereby improving the accuracy of the calibration parameter value; in the process of determining the target operation position of the object to be operated, the calibration parameter value with higher accuracy is used to determine the conversion position corresponding to the object to be operated, thereby improving the accuracy of the conversion position, and then the determined offset error is used to correct the conversion position to obtain the target operation position corresponding to the object to be operated, thereby further improving the accuracy of the operation position. When the calibration object is located on the calibration plane, and the calibration plane and the working plane are located on different planes, the plane transformation relationship between the calibration plane and the working plane is determined according to multiple sets of corrected end positions and corrected transformation positions, and then the plane transformation relationship is used to transform the initial operation position located on the calibration plane to the target operation position located on the operating plane, thereby ensuring that the target operation position is located on the working plane of the robot arm, thereby improving the accuracy of the target operation position.
应该理解的是,虽然如上的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的机械臂标定方法的机械臂标定装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个机械臂标定装置实施例中的具体限定可以参见上文中对于机械臂标定方法的限定,在此不再赘述。Based on the same inventive concept, the embodiment of the present application also provides a robot arm calibration device for implementing the robot arm calibration method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more robot arm calibration device embodiments provided below can refer to the limitations of the robot arm calibration method above, and will not be repeated here.
在一个实施例中,如图7所示,提供了一种机械臂标定装置,包括:确定模块702、获取模块704和修正模块706,其中:In one embodiment, as shown in FIG. 7 , a robot arm calibration device is provided, including: a determination module 702 , an acquisition module 704 , and a correction module 706 , wherein:
确定模块702,用于基于多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值和偏移误差;移动末端位置为机械臂移动后,机械臂末端位于基坐标系中的位置,移动图像位置为机械臂移动后,标定物位于拍摄图像中的位置;旋转末端位置为机械臂旋转后,机械臂末端位于基坐标系中的位置,旋转图像位置为机械臂旋转后,标定物位于拍摄图像中的位置;The determination module 702 is used to determine the calibration parameter value and the offset error based on multiple sets of moving end positions and moving image positions, and multiple sets of rotating end positions and rotating image positions; the moving end position is the position of the end of the manipulator in the base coordinate system after the manipulator moves, and the moving image position is the position of the calibration object in the captured image after the manipulator moves; the rotating end position is the position of the end of the manipulator in the base coordinate system after the manipulator rotates, and the rotating image position is the position of the calibration object in the captured image after the manipulator rotates;
获取模块704,用于获取待操作对象的目标图像位置,基于目标图像位置和标定参数值,确定待操作对象对应的转换位置;An acquisition module 704 is used to acquire a target image position of the object to be operated, and determine a conversion position corresponding to the object to be operated based on the target image position and the calibration parameter value;
修正模块706,用于基于转换位置和偏移误差,得到待操作对象对应的目标操作位置。The correction module 706 is used to obtain a target operation position corresponding to the object to be operated based on the conversion position and the offset error.
在一个实施例中,确定模块702还用于:对多组移动末端位置进行平均,得到平均位置;确定移动末端位置与平均位置之间的移动差异位置,以及旋转末端位置与平均位置之间的旋转差异位置;基于多组移动差异位置和移动图像位置,以及多组旋转差异位置和旋转图像位置,确定标定参数值;基于标定参数值和平均位置,确定偏移误差。In one embodiment, the determination module 702 is also used to: average multiple groups of moving end positions to obtain an average position; determine the moving difference position between the moving end position and the average position, and the rotational difference position between the rotating end position and the average position; determine calibration parameter values based on multiple groups of moving difference positions and moving image positions, and multiple groups of rotational difference positions and rotated image positions; determine the offset error based on the calibration parameter values and the average position.
在一个实施例中,确定模块702还用于:针对每个旋转图像位置,基于旋转图像位置和标定参数值,得到旋转图像位置在末端坐标系下对应的第一图像位置;对多个第一图像位置进行曲线拟合,得到拟合圆心位置;基于一组旋转末端位置和旋转图像位置、拟合圆心位置和平均位置,确定偏移误差。In one embodiment, the determination module 702 is also used to: for each rotated image position, based on the rotated image position and the calibration parameter value, obtain the first image position corresponding to the rotated image position in the terminal coordinate system; perform curve fitting on multiple first image positions to obtain the fitted center position; and determine the offset error based on a set of rotational end positions and rotated image positions, the fitted center position and the average position.
在一个实施例中,确定模块702还用于:基于多组移动末端位置和移动图像位置,以及多组旋转末端位置和旋转图像位置,确定标定参数值;针对每个旋转图像位置,基于旋转图像位置和标定参数值,得到旋转图像位置在基坐标系下对应的第二图像位置;对多个第二图像位置进行曲线拟合,得到拟合圆心位置和拟合半径;基于一组旋转末端位置和旋转图像位置、拟合圆心位置和拟合半径,确定偏移误差。In one embodiment, the determination module 702 is also used to: determine calibration parameter values based on multiple sets of moving end positions and moving image positions, and multiple sets of rotating end positions and rotated image positions; for each rotated image position, based on the rotated image position and the calibration parameter values, obtain the second image position corresponding to the rotated image position in the base coordinate system; perform curve fitting on multiple second image positions to obtain the fitting center position and the fitting radius; determine the offset error based on a set of rotating end positions and rotating image positions, the fitting center position and the fitting radius.
在一个实施例中,确定模块702还用于:基于旋转末端位置和拟合圆心位置,确定旋转末端位置和拟合圆心位置所在直线的倾斜角度;基于倾斜角度的正弦值、倾斜角度的余弦值和拟合半径,得到偏移误差。In one embodiment, the determination module 702 is also used to: determine the inclination angle of the straight line where the rotation end position and the fitting center position are located based on the rotation end position and the fitting center position; and obtain the offset error based on the sine value of the inclination angle, the cosine value of the inclination angle and the fitting radius.
在一个实施例中,修正模块706还用于:获取多组修正末端位置和修正图像位置;修正末端位置为机械臂移动到位于工作平面的修正标定物后,机械臂末端位于基坐标系中的位置;修正图像位置为修正标定物位于拍摄图像中的位置;基于修正图像位置和标定参数值,确定修正图像位置对应的修正转换位置;基于多组修正末端位置和修正转换位置,确定标定平面和工作平面之间的平面转换关系;基于转换位置和偏移误差,得到待操作对象对应的初始操作位置;基于初始操作位置和平面转换关系,得到待操作对象对应的目标操作位置。In one embodiment, the correction module 706 is also used to: obtain multiple sets of corrected end positions and corrected image positions; the corrected end position is the position of the end of the robotic arm in the base coordinate system after the robotic arm moves to the corrected calibration object located on the working plane; the corrected image position is the position of the corrected calibration object in the captured image; based on the corrected image position and the calibration parameter value, determine the corrected transformation position corresponding to the corrected image position; based on multiple sets of corrected end positions and corrected transformation positions, determine the plane transformation relationship between the calibration plane and the working plane; based on the transformation position and the offset error, obtain the initial operation position corresponding to the object to be operated; based on the initial operation position and the plane transformation relationship, obtain the target operation position corresponding to the object to be operated.
上述机械臂标定装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于智能设备中的处理器中,也可以以软件形式存储于智能设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。Each module in the above-mentioned robot arm calibration device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the smart device in the form of hardware, or can be stored in the memory of the smart device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
在一个实施例中,提供了一种智能设备,该智能设备可以是终端,其内部结构图可以如图8所示。该智能设备包括处理器、存储器、输入/输出接口、通信接口、显示单元和输入装置。其中,处理器、存储器和输入/输出接口通过系统总线连接,通信接口、显示单元和输入装置通过输入/输出接口连接到系统总线。其中,该智能设备的处理器用于提供计算和控制能力。该智能设备的存储器包括非易失性存储介质和内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该智能设备的输入/输出接口用于处理器与外部设备之间交换信息。该智能设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、移动蜂窝网络、NFC(近场通信)或其他技术实现。该计算机程序被处理器执行时以实现一种机械臂标定方法。该智能设备的显示单元用于形成视觉可见的画面,可以是显示屏、投影装置或虚拟现实成像装置。显示屏可以是液晶显示屏或者电子墨水显示屏,该智能设备的输入装置可以是显示屏上覆盖的触摸层,也可以是智能设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a smart device is provided, which can be a terminal, and its internal structure diagram can be shown in Figure 8. The smart device includes a processor, a memory, an input/output interface, a communication interface, a display unit and an input device. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input/output interface. The processor of the smart device is used to provide computing and control capabilities. The memory of the smart device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input/output interface of the smart device is used to exchange information between the processor and an external device. The communication interface of the smart device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for calibrating a robotic arm is implemented. The display unit of the smart device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the smart device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the smart device shell, or an external keyboard, touchpad or mouse.
本领域技术人员可以理解,图8中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的智能设备的限定,具体的智能设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art will understand that the structure shown in FIG. 8 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the smart device to which the scheme of the present application is applied. A specific smart device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
在一个实施例中,提供了一种智能设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现上述各方法实施例中的步骤。In one embodiment, a smart device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述各方法实施例中的步骤。In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
在一个实施例中,提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现上述各方法实施例中的步骤。In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
需要说明的是,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据。It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-OnlyMemory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive Random Access Memory,MRAM)、铁电存储器(Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic RandomAccess Memory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410774213.3A CN118342520B (en) | 2024-06-17 | 2024-06-17 | Mechanical arm calibration method and device, intelligent equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410774213.3A CN118342520B (en) | 2024-06-17 | 2024-06-17 | Mechanical arm calibration method and device, intelligent equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN118342520A true CN118342520A (en) | 2024-07-16 |
CN118342520B CN118342520B (en) | 2024-10-29 |
Family
ID=91823157
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410774213.3A Active CN118342520B (en) | 2024-06-17 | 2024-06-17 | Mechanical arm calibration method and device, intelligent equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118342520B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180214167A1 (en) * | 2017-02-02 | 2018-08-02 | Ethicon Llc | Calibration of a robotic surgical tool |
CN112880562A (en) * | 2021-01-19 | 2021-06-01 | 佛山职业技术学院 | Method and system for measuring pose error of tail end of mechanical arm |
CN114012731A (en) * | 2021-11-23 | 2022-02-08 | 深圳市如本科技有限公司 | Hand-eye calibration method and device, computer equipment and storage medium |
CN116091619A (en) * | 2022-12-27 | 2023-05-09 | 北京纳通医用机器人科技有限公司 | Calibration method, device, equipment and medium |
CN117301052A (en) * | 2023-09-19 | 2023-12-29 | 杭州海康机器人股份有限公司 | Pose conversion method, device, equipment and storage medium |
CN117817660A (en) * | 2023-12-26 | 2024-04-05 | 同方威视技术股份有限公司 | Robot arm calibration method, device, system, electronic equipment and storage medium |
-
2024
- 2024-06-17 CN CN202410774213.3A patent/CN118342520B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180214167A1 (en) * | 2017-02-02 | 2018-08-02 | Ethicon Llc | Calibration of a robotic surgical tool |
CN112880562A (en) * | 2021-01-19 | 2021-06-01 | 佛山职业技术学院 | Method and system for measuring pose error of tail end of mechanical arm |
CN114012731A (en) * | 2021-11-23 | 2022-02-08 | 深圳市如本科技有限公司 | Hand-eye calibration method and device, computer equipment and storage medium |
CN116091619A (en) * | 2022-12-27 | 2023-05-09 | 北京纳通医用机器人科技有限公司 | Calibration method, device, equipment and medium |
CN117301052A (en) * | 2023-09-19 | 2023-12-29 | 杭州海康机器人股份有限公司 | Pose conversion method, device, equipment and storage medium |
CN117817660A (en) * | 2023-12-26 | 2024-04-05 | 同方威视技术股份有限公司 | Robot arm calibration method, device, system, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN118342520B (en) | 2024-10-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108346165B (en) | Robot and three-dimensional sensing assembly combined calibration method and device | |
CN111445533B (en) | Binocular camera calibration method, device, equipment and medium | |
CN112330752A (en) | Multi-camera joint calibration method, device, terminal device and readable storage medium | |
CN109901123A (en) | Sensor calibration method, device, computer equipment and storage medium | |
CN117944025A (en) | Robot hand-eye calibration method, device, computer equipment and storage medium | |
CN112902961B (en) | Calibration method, medium, calibration equipment and system based on machine vision positioning | |
CN109636783B (en) | Method, device, computer equipment and storage medium for determining robot arm length | |
CN115042184A (en) | Robot hand-eye coordinate conversion method and device, computer equipment and storage medium | |
CN117359639A (en) | Robot cluster cooperative control method and system | |
CN113793387A (en) | Calibration method, device and terminal of monocular speckle structured light system | |
CN114833825B (en) | Collaborative robot control method, device, computer equipment and storage medium | |
CN118342520B (en) | Mechanical arm calibration method and device, intelligent equipment and storage medium | |
CN118781166B (en) | Point cloud registration method, point cloud registration device, readable storage medium and program product | |
CN113487685B (en) | Calibration method, device, equipment and storage medium of line laser scanning camera | |
CN115049744A (en) | Robot hand-eye coordinate conversion method and device, computer equipment and storage medium | |
CN115543514A (en) | Pointer display method, device, chip, electronic watch, and readable storage medium | |
CN106651950B (en) | Single-camera pose estimation method based on quadratic curve perspective projection invariance | |
CN114596365A (en) | Radar and camera calibration methods, apparatus, equipment, media and program products | |
CN115205419A (en) | Instant positioning and map construction method and device, electronic equipment and readable storage medium | |
CN114119661A (en) | A target tracking processor, target tracking method and device | |
CN116100564B (en) | High-precision calibration method and device for calibrating manipulator | |
CN118657841B (en) | Camera calibration method, device and electronic equipment | |
CN118533067A (en) | Distance measuring method and device, robot control method and computer equipment | |
CN118885102B (en) | Precise follow-up interaction method, device and storage medium based on Unreal Engine platform | |
CN114373131B (en) | Manipulator movement compensation method, device, computer equipment and storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |