[go: up one dir, main page]

CN114670194B - Positioning method and device for manipulator system - Google Patents

Positioning method and device for manipulator system Download PDF

Info

Publication number
CN114670194B
CN114670194B CN202210286905.4A CN202210286905A CN114670194B CN 114670194 B CN114670194 B CN 114670194B CN 202210286905 A CN202210286905 A CN 202210286905A CN 114670194 B CN114670194 B CN 114670194B
Authority
CN
China
Prior art keywords
coordinates
coordinate system
camera
manipulator
electronic device
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.)
Active
Application number
CN202210286905.4A
Other languages
Chinese (zh)
Other versions
CN114670194A (en
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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202210286905.4A priority Critical patent/CN114670194B/en
Publication of CN114670194A publication Critical patent/CN114670194A/en
Application granted granted Critical
Publication of CN114670194B publication Critical patent/CN114670194B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1628Programme controls characterised by the control loop
    • B25J9/1635Programme controls characterised by the control loop flexible-arm control
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J19/00Accessories fitted to manipulators, e.g. for monitoring, for viewing; Safety devices combined with or specially adapted for use in connection with manipulators
    • B25J19/02Sensing devices
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1602Programme controls characterised by the control system, structure, architecture
    • B25J9/161Hardware, e.g. neural networks, fuzzy logic, interfaces, processor
    • 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/1661Programme controls characterised by programming, planning systems for manipulators characterised by task planning, object-oriented languages
    • 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
    • B25J9/1692Calibration of manipulator

Landscapes

  • Engineering & Computer Science (AREA)
  • Robotics (AREA)
  • Mechanical Engineering (AREA)
  • Automation & Control Theory (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Manipulator (AREA)

Abstract

The application provides a mechanical arm system positioning method and a mechanical arm system positioning device, wherein the method obtains a first mapping relation between a mechanical coordinate system and a camera coordinate system; acquiring a second mapping relation between a camera coordinate system and a device coordinate system of the electronic device; obtaining a third mapping relation between the equipment coordinate system and the mechanical coordinate system based on the first mapping relation and the second mapping relation; and acquiring the equipment coordinates of the target position of the electronic equipment in the equipment coordinate system, and converting the equipment coordinates to obtain the mechanical coordinates of the target position based on the third mapping relation. According to the scheme, the mechanical position of the target position is not required to be obtained according to the mechanical arm equipment, the development and debugging process of the automatic script can be decoupled from the mechanical arm equipment, and the development and debugging efficiency of the automatic script is improved. Meanwhile, the mechanical coordinates corresponding to the target position do not need to be obtained by a camera, so that the time consumption of the mechanical coordinate obtaining process of the target position is saved, and the testing efficiency of the whole testing process is improved.

Description

机械手系统定位方法及装置Positioning method and device for manipulator system

技术领域technical field

本申请涉及机器视觉系统技术领域,尤其涉及一种机械手系统定位方法及装置。The present application relates to the technical field of machine vision systems, in particular to a positioning method and device for a manipulator system.

背景技术Background technique

利用机械手系统可以实现设备的自动化测试、自动装配等,广泛应用于工业生产中。机器视觉系统是机械手系统的重要组成部分,机器视觉系统相当于机械手系统的眼睛,通过机器视觉系统获得设备上被测试项的位置坐标。进一步,控制机械手设备移动至该位置坐标处执行相应的操作,如可以对电子设备的屏幕进行滑动、点击、长按等,如实现目标电子设备的自动化测试,如压力测试、性能测试。但目前的机械手系统的效率低。The automatic testing and automatic assembly of equipment can be realized by using the manipulator system, which is widely used in industrial production. The machine vision system is an important part of the manipulator system. The machine vision system is equivalent to the eyes of the manipulator system. The position coordinates of the tested items on the device are obtained through the machine vision system. Further, control the manipulator to move to the position coordinates to perform corresponding operations, such as sliding, clicking, and long-pressing the screen of the electronic device, such as realizing automated testing of the target electronic device, such as stress testing and performance testing. But current robotic systems are inefficient.

发明内容Contents of the invention

有鉴于此,本申请提供了一种机械手系统定位方法及装置,以解决上述的技术问题,其公开的技术方案如下:In view of this, this application provides a positioning method and device for a manipulator system to solve the above-mentioned technical problems. The disclosed technical solutions are as follows:

第一方面,本申请提供了一种机械手系统定位方法,该方法包括:获取机械坐标系与相机坐标系之间的第一映射关系;获取相机坐标系与电子设备的设备坐标系之间的第二映射关系;基于第一映射关系和第二映射关系,获得设备坐标系与机械坐标系之间的第三映射关系;获取电子设备的目标位置在设备坐标系中的设备坐标,并基于第三映射关系转换得到目标位置的机械坐标。可见,该方案提供的机械手系统定位方法可以直接将电子设备的目标位置对应的设备坐标转换为机械坐标,进一步基于该机械坐标控制机械手设备移动至目标位置并执行相应的操作。该方案可以通过工具获得目标位置的设备坐标,或者直接将目标位置的设备坐标写入自动化脚本中,这样不需要依据机械手设备写入目标位置的机械位置,因此自动化脚本的开发和调试过程可以与机械手设备解耦,从而提高了自动化脚本的开发和调试效率。同时,利用该方案不需要利用相机获得目标位置的相机坐标,再将相机坐标转换为机械坐标,因此,节省了获得目标位置的机械坐标这一过程的耗时,提高了整个测试过程的测试效率。In a first aspect, the present application provides a positioning method for a manipulator system, the method comprising: obtaining a first mapping relationship between a mechanical coordinate system and a camera coordinate system; obtaining a first mapping relationship between a camera coordinate system and a device coordinate system of an electronic device Two mapping relationships; based on the first mapping relationship and the second mapping relationship, obtain a third mapping relationship between the device coordinate system and the mechanical coordinate system; obtain the device coordinates of the target position of the electronic device in the device coordinate system, and based on the third The mapping relationship is transformed to obtain the mechanical coordinates of the target position. It can be seen that the robot system positioning method provided by this solution can directly convert the device coordinates corresponding to the target position of the electronic device into mechanical coordinates, and further control the robot device to move to the target position and perform corresponding operations based on the mechanical coordinates. This solution can obtain the equipment coordinates of the target position through tools, or directly write the equipment coordinates of the target position into the automation script, so that there is no need to write the mechanical position of the target position according to the manipulator device, so the development and debugging process of the automation script can be compared with The decoupling of manipulator equipment improves the development and debugging efficiency of automation scripts. At the same time, this solution does not need to use the camera to obtain the camera coordinates of the target position, and then convert the camera coordinates into mechanical coordinates. Therefore, the time-consuming process of obtaining the mechanical coordinates of the target position is saved, and the test efficiency of the entire test process is improved. .

在第一方面一种可能的实现方式中,目标位置是电子设备的显示界面上的目标控件;获取电子设备的目标位置在设备坐标系中的设备坐标,包括:获取目标控件对应的控件标识;向电子设备发送用于获得目标控件的设备坐标的控件坐标请求,控件坐标请求包括目标控件的控件标识;接收电子设备发送的目标控件对应的设备坐标。可见,该场景下,可以直接通过电子设备上安装的工具获得任一控件对应的设备坐标,无需在自动化脚本中写入目标位置的设备坐标,只需在自动化脚本中写入控件对应的标识,对于物理尺寸有差异但控件标识不变的不同类型的电子设备,不需要重新开发自动化脚本,因此,利用该方案开发得到的自动化脚本能够兼容不同物理尺寸的电子设备,即提高了自动化脚本的兼容性。In a possible implementation of the first aspect, the target position is a target control on the display interface of the electronic device; obtaining the device coordinates of the target position of the electronic device in the device coordinate system includes: obtaining a control identifier corresponding to the target control; Sending a control coordinate request for obtaining the device coordinates of the target control to the electronic device, where the control coordinate request includes the control identifier of the target control; and receiving the device coordinates corresponding to the target control sent by the electronic device. It can be seen that in this scenario, the device coordinates corresponding to any control can be obtained directly through the tools installed on the electronic device. It is not necessary to write the device coordinates of the target position in the automation script, but only need to write the corresponding identification of the control in the automation script. For different types of electronic devices with different physical sizes but the same control identification, there is no need to re-develop automation scripts. Therefore, the automation scripts developed by using this scheme can be compatible with electronic devices of different physical sizes, which improves the compatibility of automation scripts sex.

在第一方面另一种可能的实现方式中,目标位置是所述电子设备的显示界面的非控件位;所述获取所述电子设备的目标位置在所述设备坐标系中的设备坐标,包括:接收所述电子设备发送的所述目标位置对应的设备坐标,所述设备坐标由所述电子设备接收到对所述目标位置的点击操作后获得。可见,该场景需要预先获得目标位置的设备坐标并写入自动化脚本中。In another possible implementation manner of the first aspect, the target position is a non-control position of the display interface of the electronic device; the acquiring the device coordinates of the target position of the electronic device in the device coordinate system includes : receiving the device coordinates corresponding to the target position sent by the electronic device, and the device coordinates are obtained after the electronic device receives a click operation on the target position. It can be seen that this scene needs to obtain the device coordinates of the target position in advance and write them into the automation script.

在第一方面又一种可能的实现方式中,获取机械坐标系与相机坐标系之间的第一映射关系,包括:获取机械手设备上的至少两个机械手标定点对应的机械坐标;通过相机获取每个机械手标定点在相机坐标系中的相机坐标;基于至少两个机械手标定点对应的机械坐标和相机坐标,获得机械坐标系与相机坐标系之间的第一映射关系。可见,该方案直接在机械手设备上设置标定点,这样不需要依赖机械手获得机械标定点的机械坐标,实现与机械手设备之间的解耦,同时,提高了标定效率。In yet another possible implementation of the first aspect, obtaining the first mapping relationship between the mechanical coordinate system and the camera coordinate system includes: obtaining the mechanical coordinates corresponding to at least two manipulator calibration points on the manipulator device; The camera coordinates of each manipulator calibration point in the camera coordinate system; based on the machine coordinates and camera coordinates corresponding to at least two manipulator calibration points, a first mapping relationship between the machine coordinate system and the camera coordinate system is obtained. It can be seen that this scheme directly sets the calibration point on the manipulator device, so that it does not need to rely on the manipulator to obtain the mechanical coordinates of the mechanical calibration point, realizes decoupling from the manipulator device, and improves the calibration efficiency at the same time.

在第一方面另一种可能的实现方式中,获取机械手设备上的至少两个机械手标定点对应的机械坐标,包括:机械手设备的夹具平台上设置有至少两个标定点,基于机械手设备的设备信息获得每个标定点的机械坐标。In another possible implementation of the first aspect, obtaining the mechanical coordinates corresponding to at least two manipulator calibration points on the manipulator device includes: at least two calibration points are set on the fixture platform of the manipulator device, and the equipment based on the manipulator device information to obtain the machine coordinates of each calibration point.

在第一方面又一种可能的实现方式中,获取相机坐标系与电子设备的设备坐标系之间的第二映射关系包括:获取电子设备上的至少两个设备标定点对应的设备坐标;通过相机获取每个设备标定点在所述相机坐标系中的相机坐标;基于所述至少两个设备标定点对应的设备坐标和相机坐标,获得所述相机坐标系与所述设备坐标系之间的第二映射关系。In yet another possible implementation of the first aspect, obtaining the second mapping relationship between the camera coordinate system and the device coordinate system of the electronic device includes: obtaining device coordinates corresponding to at least two device calibration points on the electronic device; The camera obtains the camera coordinates of each device calibration point in the camera coordinate system; based on the device coordinates and camera coordinates corresponding to the at least two device calibration points, obtain the coordinates between the camera coordinate system and the device coordinate system Second mapping relationship.

在第一方面再一种可能的实现方式中,设备标定点是电子设备的显示界面上的标定控件;获取电子设备上的至少两个设备标定点对应的设备坐标,包括:获取标定控件对应的控件标识;向电子设备发送控件坐标请求,所述控件坐标请求包括所述控件标识;接收电子设备发送的所述标定控件对应的设备坐标。In yet another possible implementation of the first aspect, the device calibration point is a calibration control on the display interface of the electronic device; obtaining the device coordinates corresponding to at least two device calibration points on the electronic device includes: obtaining the coordinates corresponding to the calibration control Control identification; sending a control coordinate request to the electronic device, the control coordinate request including the control identification; receiving the device coordinate corresponding to the calibration control sent by the electronic device.

在第一方面另一种可能的实现方式中,设备标定点是电子设备显示的预设图片中的标定点;获取电子设备上的至少两个设备标定点对应的设备坐标包括:基于标定点在预设图片中的坐标,获得标定点在设备坐标系中的设备坐标。In another possible implementation of the first aspect, the device calibration point is a calibration point in a preset picture displayed by the electronic device; obtaining device coordinates corresponding to at least two device calibration points on the electronic device includes: Preset the coordinates in the image to obtain the device coordinates of the calibration point in the device coordinate system.

在第一方面又一种可能的实现方式中,通过相机获取每个设备标定点在相机坐标系中的相机坐标包括:接收相机拍摄的电子设备的图像,该图像包括设备标定点;基于图像识别技术识别出图像包含的设备标定点,并确定每个设备标定点在图像中的位置坐标,获得设备标定点的相机坐标。In yet another possible implementation manner of the first aspect, obtaining the camera coordinates of each device calibration point in the camera coordinate system through the camera includes: receiving an image of the electronic device captured by the camera, the image including the device calibration point; The technology identifies the device calibration points contained in the image, and determines the position coordinates of each device calibration point in the image, and obtains the camera coordinates of the device calibration points.

在第一方面另一种可能的实现方式中,目标位置是电子设备的显示界面的非控件位置;获取电子设备的目标位置在设备坐标系中的设备坐标,包括:接收电子设备发送的目标位置对应的设备坐标,设备坐标由电子设备接收到对目标位置的点击操作后获得。In another possible implementation of the first aspect, the target position is a non-control position of the display interface of the electronic device; obtaining the device coordinates of the target position of the electronic device in the device coordinate system includes: receiving the target position sent by the electronic device Corresponding device coordinates, the device coordinates are obtained after the electronic device receives a click operation on the target position.

在第一方面又一种可能的实现方式中,基于第三映射关系转换得到目标位置的机械坐标,包括:将目标位置的设备坐标输入至映射关系,计算得到目标位置对应的机械坐标。In yet another possible implementation manner of the first aspect, converting to obtain the mechanical coordinates of the target position based on the third mapping relationship includes: inputting the device coordinates of the target position into the mapping relationship, and calculating the mechanical coordinates corresponding to the target position.

在第一方面再一种可能的实现方式中,该方法还包括:基于目标位置的机械坐标控制机械手设备移动至电子设备的目标位置处;控制机械手在目标位置处执行相应的操作。In yet another possible implementation manner of the first aspect, the method further includes: controlling the manipulator to move to the target position of the electronic device based on the mechanical coordinates of the target position; and controlling the manipulator to perform corresponding operations at the target position.

在第一方面另一种可能的实现方式中,基于所述目标位置的机械坐标控制所述机械手设备移动至所述电子设备的目标位置处,包括:基于所述目标位置的机械坐标,以及所述机械手设备当前所处位置的机械坐标,生成运动控制指令;向所述机械手设备发送所述运动控制指令,以使所述机械手设备响应所述运动控制指令从所述当前所处位置移动至所述目标位置。In another possible implementation manner of the first aspect, controlling the manipulator device to move to the target position of the electronic device based on the mechanical coordinates of the target position includes: based on the mechanical coordinates of the target position, and the The mechanical coordinates of the current position of the manipulator device to generate a motion control command; send the motion control command to the manipulator device, so that the manipulator device moves from the current position to the position in response to the motion control command the target location.

第二方面,本申请还提供了一种计算机设备,电子设备包括:一个或多个处理器、存储器和触摸屏;存储器用于存储程序代码;处理器用于运行程序代码,使得电子设备实现如第一方面任一种可能的实现方式所述的机械手系统定位方法。In a second aspect, the present application also provides a computer device, the electronic device includes: one or more processors, memory and touch screen; the memory is used to store program code; the processor is used to run the program code, so that the electronic device realizes the first The robot system positioning method described in any possible implementation manner of the aspect.

第三方面,本申请还提供了一种计算机可读存储介质,其上存储有指令,当指令在计算机设备上运行时,使得电子设备执行如第一方面任一种所述的机械手系统定位方法。In the third aspect, the present application also provides a computer-readable storage medium, on which instructions are stored, and when the instructions are run on the computer equipment, the electronic equipment executes the manipulator system positioning method described in any one of the first aspect .

应当理解的是,本申请中对技术特征、技术方案、有益效果或类似语言的描述并不是暗示在任意的单个实施例中可以实现所有的特点和优点。相反,可以理解的是对于特征或有益效果的描述意味着在至少一个实施例中包括特定的技术特征、技术方案或有益效果。因此,本说明书中对于技术特征、技术方案或有益效果的描述并不一定是指相同的实施例。进而,还可以任何适当的方式组合本实施例中所描述的技术特征、技术方案和有益效果。本领域技术人员将会理解,无需特定实施例的一个或多个特定的技术特征、技术方案或有益效果即可实现实施例。在其他实施例中,还可在没有体现所有实施例的特定实施例中识别出额外的技术特征和有益效果。It should be understood that descriptions of technical features, technical solutions, beneficial effects or similar language in this application do not imply that all features and advantages can be realized in any single embodiment. On the contrary, it can be understood that the description of features or beneficial effects means that specific technical features, technical solutions or beneficial effects are included in at least one embodiment. Therefore, descriptions of technical features, technical solutions or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and beneficial effects described in this embodiment may also be combined in any appropriate manner. Those skilled in the art will understand that the embodiments can be implemented without one or more specific technical features, technical solutions or advantageous effects of the specific embodiments. In other embodiments, additional technical features and beneficial effects may also be identified in certain embodiments that do not embody all embodiments.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are For some embodiments of the present invention, those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1是本申请实施例提供的一种机械手夹具平台的示意图;Fig. 1 is a schematic diagram of a manipulator clamp platform provided by an embodiment of the present application;

图2是本申请实施例提供的机械手夹具平台上放置目标电子设备时对应图像的示意图;Fig. 2 is a schematic diagram of the corresponding image when the target electronic device is placed on the manipulator fixture platform provided by the embodiment of the present application;

图3是本申请实施例提供的一种机械手系统的结构示意图;Fig. 3 is a schematic structural diagram of a manipulator system provided by an embodiment of the present application;

图4是本申请实施例提供的一种目标电子设备的设备坐标系的示意图;FIG. 4 is a schematic diagram of a device coordinate system of a target electronic device provided in an embodiment of the present application;

图5是本申请实施例提供的一种机械坐标系、相机坐标系及设备坐标系的示意图;Fig. 5 is a schematic diagram of a machine coordinate system, a camera coordinate system and a device coordinate system provided by the embodiment of the present application;

图6是本申请实施例提供的一种机械手系统定位方法的流程图;Fig. 6 is a flow chart of a positioning method for a manipulator system provided by an embodiment of the present application;

图7是本申请实施例提供的一种夹具平台上的标定点的示意图;Fig. 7 is a schematic diagram of a calibration point on a fixture platform provided by an embodiment of the present application;

图8是本申请实施例提供的一种夹具平台上的标定点的相机坐标的示意图;Fig. 8 is a schematic diagram of camera coordinates of a calibration point on a fixture platform provided by an embodiment of the present application;

图9是本申请实施例提供的一种目标电子设备的标定点的设备坐标的示意图;FIG. 9 is a schematic diagram of device coordinates of a calibration point of a target electronic device provided in an embodiment of the present application;

图10是本申请实施例提供的一种目标电子设备的标定点的相机坐标的示意图;FIG. 10 is a schematic diagram of camera coordinates of a calibration point of a target electronic device provided in an embodiment of the present application;

图11是本申请实施例提供的一种夹具平台和目标电子设备上的标定点对应的相机坐标的示意图。FIG. 11 is a schematic diagram of a fixture platform provided in an embodiment of the present application and camera coordinates corresponding to calibration points on a target electronic device.

具体实施方式Detailed ways

本申请说明书和权利要求书及附图说明中的术语“第一”、“第二”和“第三”等是用于区别不同对象,而不是用于限定特定顺序。The terms "first", "second" and "third" in the specification, claims and description of the drawings of this application are used to distinguish different objects, rather than to limit a specific order.

在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of the present application, words such as "exemplary" or "for example" are used as examples, illustrations or illustrations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application shall not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete manner.

为了下述各实施例的描述清楚简洁,首先给出相关技术的简要介绍:In order to make the description of the following embodiments clear and concise, a brief introduction of related technologies is first given:

机器视觉系统是利用机器代替人眼做测量和判断,通过图像摄取装置(如相机)将被摄取目标转换成图像信号,进一步处理该图像信号获得目标的某些特征,进而根据该特征控制现场的设备动作。The machine vision system uses machines instead of human eyes to make measurements and judgments, converts the captured target into an image signal through an image capture device (such as a camera), and further processes the image signal to obtain certain characteristics of the target, and then controls the scene based on the characteristics. Device action.

坐标系标定,是指对两个不同的坐标系之间的转换关系的标定,例如,在本申请中,涉及视觉坐标系(也称为相机坐标系)、机械坐标系(即机械手夹具平台的坐标系)和设备坐标系这三个坐标系之间转换关系的标定,通过坐标系标定帮助机器人(即机械手系统)转换获得的视觉信息,从而完成后续的控制工作,例如视觉抓取等。Coordinate system calibration refers to the calibration of the conversion relationship between two different coordinate systems. For example, in this application, it involves the visual coordinate system (also called the camera coordinate system), the mechanical coordinate system (that is, the coordinate system of the manipulator fixture platform) coordinate system) and the device coordinate system to calibrate the conversion relationship between the three coordinate systems, and help the robot (ie, the manipulator system) to convert the obtained visual information through the coordinate system calibration, so as to complete the subsequent control work, such as visual grasping, etc.

下面以利用机械手系统对电子设备屏幕进行自动化测试的场景为例进行说明,其中,相关技术提供的一种机械手系统定位方法如下:The following is an example of a scene where a manipulator system is used to automatically test the screen of an electronic device. Among them, a manipulator system positioning method provided by the related art is as follows:

在开发自动化脚本阶段,先将电子设备放置在机械手的夹具平台上,并将机械手移动到指定的被测位置,并记录这些被测位置对应的机械坐标,并将这些机械坐标写入测试脚本中。In the stage of developing the automation script, first place the electronic device on the fixture platform of the manipulator, move the manipulator to the specified measured position, record the mechanical coordinates corresponding to these measured positions, and write these mechanical coordinates into the test script .

在电子设备的测试阶段,执行自动化脚本,根据测试脚本中被测位置的机械坐标控制机械手移动至相应的被测位置,并对被测位置进行相应的测试操作。In the testing phase of electronic equipment, the automation script is executed, and the manipulator is controlled to move to the corresponding measured position according to the mechanical coordinates of the measured position in the test script, and the corresponding test operation is performed on the measured position.

可见,该过程在开发自动化脚本阶段,依赖于机械手设备获得被测位置对应的机械坐标,导致自动化脚本的开发效率低。此外,如果测试设备的物理尺寸改变,需要重新依赖机械手设备获得被测位置的机械坐标,并修改自动化脚本中测试点的坐标,可见此种方式开发的自动化脚本的对不同物理尺寸的电子设备的兼容能力差。It can be seen that in the stage of developing the automation script, the process relies on the manipulator to obtain the mechanical coordinates corresponding to the measured position, resulting in low development efficiency of the automation script. In addition, if the physical size of the test equipment changes, it is necessary to rely on the manipulator again to obtain the mechanical coordinates of the measured position and modify the coordinates of the test points in the automation script. It can be seen that the automation script developed in this way is suitable for electronic devices of different physical sizes. Poor compatibility.

相关技术中的另一种机械手系统定位方式是:通过相机坐标系与机械坐标系之间的映射关系获得电子设备中被测位置的机械坐标,进而依据被测位置对应的机械坐标控制机械手移动。Another positioning method of the manipulator system in the related art is: obtain the mechanical coordinates of the measured position in the electronic device through the mapping relationship between the camera coordinate system and the mechanical coordinate system, and then control the movement of the manipulator according to the mechanical coordinates corresponding to the measured position.

例如,为测试电子设备中安装的应用程序的基本功能是否符合要求,需控制相应的控件(如,设置控件、弹窗删除控件、确认控件等)执行相应的操作。此种场景下,控件的图标比较容易通过图像识别技术识别出来,因此,对于图标对应位置的机械坐标可以通过建立机械坐标系与相机坐标系之间的映射关系获得,具体过程如下:For example, in order to test whether the basic functions of the application program installed in the electronic device meet the requirements, it is necessary to control the corresponding controls (such as setting controls, pop-up window deletion controls, confirmation controls, etc.) to perform corresponding operations. In this scenario, the icon of the control is easier to identify through image recognition technology. Therefore, the machine coordinates of the corresponding position of the icon can be obtained by establishing the mapping relationship between the machine coordinate system and the camera coordinate system. The specific process is as follows:

在开发自动化测试脚本阶段,使用相机拍摄包含待测试的图标的电子设备屏幕的图片,进一步从该图片中获得待识别的图标的图片并保存为模板图片。In the stage of developing the automated test script, a camera is used to take a picture of the screen of the electronic device containing the icon to be tested, and the picture of the icon to be recognized is further obtained from the picture and saved as a template picture.

在执行自动化测试脚本对电子设备进行自动化测试时,如图1所示,目标电子设备(如手机、平板电脑、手表等)放置在机械手的夹具平台上。然后,利用相机拍摄得到如图2所示的目标电子设备的图像。基于图像识别技术识别出该图像包含的与模板图片相匹配的图标对象后,获得该图标对象(如图2中的P点)对应的相机坐标。When executing automated test scripts for automated testing of electronic devices, as shown in Figure 1, target electronic devices (such as mobile phones, tablet computers, watches, etc.) are placed on the fixture platform of the manipulator. Then, the image of the target electronic device as shown in FIG. 2 is obtained by shooting with a camera. After identifying the icon object contained in the image that matches the template picture based on the image recognition technology, the camera coordinates corresponding to the icon object (such as point P in FIG. 2 ) are obtained.

进一步,根据机械坐标系与相机坐标系之间的映射关系,将P点的相机坐标转换为机械坐标系中的坐标,即得到P点的机械坐标。最后,基于P点的机械坐标控制机械手执行相应的操作。Further, according to the mapping relationship between the machine coordinate system and the camera coordinate system, the camera coordinates of point P are converted into coordinates in the machine coordinate system, that is, the machine coordinates of point P are obtained. Finally, based on the mechanical coordinates of point P, the manipulator is controlled to perform corresponding operations.

可见,此种方式在获得被测设备的机械坐标时需要利用相机拍摄相应的图像,导致测试效率低。It can be seen that in this way, when obtaining the mechanical coordinates of the device under test, a camera needs to be used to capture corresponding images, resulting in low test efficiency.

为了解决上述技术问题,本申请的发明人提供了一种机械手系统定位方法,该方案通过在机械手的夹具平台上设置至少两个标定点,即已知标定点的机械坐标。利用相机拍摄夹具平台的图像,获得夹具平台上标定点在相机坐标系中的坐标,即标定点的相机坐标。通过夹具平台上的标定点对应的机械坐标和相机坐标,获得机械坐标系与相机坐标系之间的映射关系。以及,在被测电子设备上确定至少两个标定点,即已知被测电子设备上的标定点在设备坐标系中的坐标,即设备坐标。然后,利用相机拍摄被测电子设备的图像,获得被测电子设备上的标定点的相机坐标。进而获得设备坐标系与相机坐标系之间的映射关系。进一步,根据上述的机械坐标系与相机坐标系之间的映射关系,以及相机坐标系与设备坐标系之间的映射关系,获得设备坐标系与机械坐标系之间的映射关系。基于机械坐标系与设备坐标系之间的映射关系,可以直接将被测电子设备上的任一点的设备坐标转换为机械坐标。最后,基于该点的机械坐标控制机械手移动至相应的位置处并执行相应的操作。In order to solve the above technical problems, the inventors of the present application provide a positioning method for the manipulator system. The solution is to set at least two calibration points on the gripper platform of the manipulator, that is, the mechanical coordinates of the calibration points are known. The image of the fixture platform is captured by the camera, and the coordinates of the calibration point on the fixture platform in the camera coordinate system are obtained, that is, the camera coordinates of the calibration point. Through the machine coordinates and camera coordinates corresponding to the calibration points on the fixture platform, the mapping relationship between the machine coordinate system and the camera coordinate system is obtained. And, at least two calibration points are determined on the electronic device under test, that is, the coordinates of the calibration points on the electronic device under test are known in the device coordinate system, that is, the device coordinates. Then, the camera is used to capture the image of the electronic device under test, and the camera coordinates of the calibration points on the electronic device under test are obtained. Further, the mapping relationship between the device coordinate system and the camera coordinate system is obtained. Further, according to the above-mentioned mapping relationship between the machine coordinate system and the camera coordinate system, and the mapping relationship between the camera coordinate system and the device coordinate system, the mapping relationship between the device coordinate system and the machine coordinate system is obtained. Based on the mapping relationship between the mechanical coordinate system and the device coordinate system, the device coordinates of any point on the electronic device under test can be directly converted into mechanical coordinates. Finally, based on the mechanical coordinates of this point, the manipulator is controlled to move to the corresponding position and perform corresponding operations.

可见,利用该方案提供的机械手定位方法可以直接基于被测电子设备的被测位置的设备坐标控制机械手,该方案获得的自动化脚本不需要写入被测位置的机械坐标,换言之,该方案的自动化脚本的开发和调试过程与机械手设备解耦,从而提高了自动化脚本的开发和调试效率。It can be seen that the manipulator positioning method provided by this scheme can directly control the manipulator based on the equipment coordinates of the measured position of the electronic device under test, and the automation script obtained by this scheme does not need to be written into the mechanical coordinates of the measured position. In other words, the automation of this scheme The development and debugging process of the script is decoupled from the manipulator device, thereby improving the development and debugging efficiency of the automation script.

同时,利用该方案可以直接获得被测位置的设备坐标,不需要先利用相机获得被测位置的相机坐标,降低了获得被测位置的机械坐标这一过程的耗时,提高了整个测试过程的测试效率。At the same time, this solution can directly obtain the equipment coordinates of the measured position without first using the camera to obtain the camera coordinates of the measured position, which reduces the time-consuming process of obtaining the mechanical coordinates of the measured position and improves the efficiency of the entire testing process. Test efficiency.

进一步地,在对被测设备的被测控件进行自动化测试的场景中,被测位置即被测控件所在位置。此种场景下,该方案的自动化脚本中无需写入电子设备的被测位置的机械坐标,而是写入被测控件对应的控件ID,对于同类型的被测电子设备,如两种不同型号的手机(或其他电子设备),物理尺寸存在差异,但同一被测控件对应的控件ID不改变,因此,对于此类被测电子设备无需修改自动化脚本,即本方案获得的自动化脚本可以兼容不同物理尺寸的被测设备,提高了自动化脚本对不同物理尺寸的兼容能力。Further, in the scenario of performing automated testing on the tested control of the device under test, the tested location is the location of the tested control. In this scenario, the automation script of this solution does not need to write the mechanical coordinates of the measured position of the electronic device, but writes the control ID corresponding to the tested control. For the same type of tested electronic device, such as two different models The physical size of mobile phones (or other electronic devices) is different, but the control ID corresponding to the same control under test does not change. Therefore, there is no need to modify the automation script for this type of electronic device under test, that is, the automation script obtained by this scheme can be compatible with different The physical size of the device under test improves the compatibility of automation scripts with different physical sizes.

为了下述各实施例的描述清楚简洁,以利用机械手系统对手机进行自动化测试为例说明机械手系统的工作过程。In order to make the description of the following embodiments clear and concise, the working process of the manipulator system is illustrated by taking the automatic test of the mobile phone by the manipulator system as an example.

请参见图3,示出了本申请实施例提供的一种机械手系统的结构示意图,如图3所示,该机械手系统包括:机械手设备、至少一个相机(或可称为摄像机)、计算机。其中,机械手Please refer to FIG. 3 , which shows a schematic structural diagram of a manipulator system provided by an embodiment of the present application. As shown in FIG. 3 , the manipulator system includes: a manipulator device, at least one camera (or may be called a video camera), and a computer. Among them, the manipulator

包括机械手设备包括机械手(或可称为操作机构)和夹具平台(或可称为支撑平台)。Including manipulator equipment includes manipulator (or can be called operating mechanism) and fixture platform (or can be called support platform).

可以理解的是,本实施例示意的自动装配设备的结构并不构成对该设备的具体限定。在另一些实施例中,该自动装配设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者,不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure of the automatic assembly equipment shown in this embodiment does not constitute a specific limitation on the equipment. In other embodiments, the automated assembly equipment may include more or fewer components than shown, or combine certain components, or separate certain components, or a different arrangement of components. The illustrated components can be realized in hardware, software or a combination of software and hardware.

在自动化测试的场景中,机械手用于控制电子设备进行自动化测试,夹具平台用于固定电子设备。例如,将待测试的手机固定在夹具平台上,以便对手机进行稳定性测试、功能测试和功耗测试等自动化测试。In the automated testing scenario, the manipulator is used to control the electronic equipment for automated testing, and the fixture platform is used to fix the electronic equipment. For example, the mobile phone to be tested is fixed on the fixture platform, so that automated tests such as stability test, function test and power consumption test can be performed on the mobile phone.

在本申请中,目标电子设备是指通过机械手系统进自动测试,目标电子设备可以是手机、平板电脑、桌面型、膝上型、笔记本电脑、超级移动个人计算机(Ultra-mobilePersonal Computer,UMPC)、手持计算机、上网本、个人数字助理(Personal DigitalAssistant,PDA)、可穿戴电子设备、智能手表等设备,本申请对电子设备的具体形式不做特殊限制。In this application, the target electronic device refers to the automatic testing by the manipulator system, and the target electronic device can be a mobile phone, a tablet computer, a desktop, a laptop, a notebook computer, an ultra-mobile personal computer (Ultra-mobile Personal Computer, UMPC), Handheld computers, netbooks, personal digital assistants (Personal Digital Assistant, PDA), wearable electronic devices, smart watches and other devices, this application does not specifically limit the specific form of electronic devices.

相机用于拍摄目标电子设备的图像,确定目标电子设备的位置坐标。相机可以采用CCD相机、CMOS相机中的任意一种。The camera is used to take images of the target electronic device and determine the position coordinates of the target electronic device. Any one of a CCD camera and a CMOS camera can be used as the camera.

计算机用于控制机械手的运动状态,控制相机的工作状态,以及对相机拍摄的图像进行图像分析获得图像中的目标位置的坐标。其中,本申请提供的机械手系统定位方法运行于图3所示的计算机中。The computer is used to control the motion state of the manipulator, control the working state of the camera, and perform image analysis on the image captured by the camera to obtain the coordinates of the target position in the image. Wherein, the positioning method of the manipulator system provided by the present application runs on the computer shown in FIG. 3 .

计算机向相机发送拍摄指令,相机执行该拍摄指令进行相应的拍摄操作。相机向计算机发送拍摄的图像,以便计算机进行图像处理得到图像中目标位置的坐标,并将目标位置的坐标转换为机械坐标。进一步地,计算机基于目标位置的机械坐标生成运动控制指令并发送至机械手,以控制机械手移动至目标位置,并执行相应的操作。The computer sends a shooting instruction to the camera, and the camera executes the shooting instruction to perform corresponding shooting operations. The camera sends the captured image to the computer, so that the computer can process the image to obtain the coordinates of the target position in the image, and convert the coordinates of the target position into mechanical coordinates. Further, the computer generates motion control instructions based on the mechanical coordinates of the target position and sends them to the manipulator to control the manipulator to move to the target position and perform corresponding operations.

以目标电子设备是手机为例,图4所示为手机的坐标系,即设备坐标系。Taking the target electronic device as a mobile phone as an example, FIG. 4 shows the coordinate system of the mobile phone, that is, the device coordinate system.

假设机械手在生产时通过提高精度可以保证上述的三个坐标系(即相机坐标系、机械坐标系和设备坐标系)处于同一平面,如图5所示,示出了处于同一平面的相机坐标系、机械坐标系和设备坐标系。Assuming that the manipulator can ensure that the above three coordinate systems (ie camera coordinate system, machine coordinate system and device coordinate system) are on the same plane by improving the accuracy during production, as shown in Figure 5, which shows the camera coordinate system on the same plane , machine coordinate system and device coordinate system.

如图5所示,xoy坐标系是相机坐标系,x'o'y'坐标系是机械坐标系,x”o”y”坐标系是设备坐标系。不同坐标系的原点及坐标轴的正方向不同。As shown in Figure 5, the xoy coordinate system is the camera coordinate system, the x'o'y' coordinate system is the mechanical coordinate system, and the x"o"y" coordinate system is the device coordinate system. The origin of different coordinate systems and the positive coordinates of the coordinate axes The direction is different.

前已叙及,机器视觉系统基于相机坐标系建立,而机械手的操作基于机械坐标系,因此,需要建立相机坐标系与机械坐标系之间的映射关系。获得这两个坐标系之间的映射关系后,对于同一个位置点,如果已知该位置点在任一坐标系的坐标,根据两个坐标之间的映射关系可以转换到该位置点在另一个坐标系中的坐标。例如,在获得位置点对应的相机坐标后,根据相机坐标和机械坐标之间的映射关系,可以转换得到该位置点对应的机械坐标。As mentioned above, the machine vision system is established based on the camera coordinate system, and the operation of the manipulator is based on the mechanical coordinate system. Therefore, the mapping relationship between the camera coordinate system and the mechanical coordinate system needs to be established. After obtaining the mapping relationship between the two coordinate systems, for the same location point, if the coordinates of the location point in any coordinate system are known, according to the mapping relationship between the two coordinates, it can be converted to the location point in another Coordinates in the coordinate system. For example, after obtaining the camera coordinates corresponding to the position point, according to the mapping relationship between the camera coordinates and the machine coordinates, the machine coordinates corresponding to the position point can be converted to obtain.

下面将结合图6介绍本申请实施例提供的机械手系统定位方法的流程,该方法运行于图3中的计算机中。如图6所示,所述机械手系统定位方法包括以下步骤:The flow of the positioning method for the manipulator system provided by the embodiment of the present application will be described below with reference to FIG. 6 , and the method runs on the computer in FIG. 3 . As shown in Figure 6, the manipulator system positioning method includes the following steps:

S110,获取机械手的夹具平台上的至少两个标定点A、B的机械坐标。S110. Obtain mechanical coordinates of at least two calibration points A and B on the fixture platform of the manipulator.

在一示例性中,可以在机械手生产时,就在机械手的夹具平台上固定两个点作为标定点,且在机械手出厂时就标注了至少两个标定点的机械坐标。例如,可以直接在夹具平台上标注每个标定点的机械坐标。In one example, when the manipulator is produced, two points can be fixed on the fixture platform of the manipulator as calibration points, and the mechanical coordinates of at least two calibration points can be marked when the manipulator leaves the factory. For example, the mechanical coordinates of each calibration point can be marked directly on the fixture platform.

其中,夹具平台上的标定点的数量可以是两个或两个以上,本申请对此不作限定。Wherein, the number of calibration points on the fixture platform may be two or more, which is not limited in this application.

在另一示例中,可以由使用机械手的一方在机械手的夹具平台上选取两个固定点作为标定点,根据机械手的机械坐标系确定出这两个标定点对应的机械坐标。In another example, the party using the manipulator may select two fixed points on the fixture platform of the manipulator as calibration points, and determine the mechanical coordinates corresponding to the two calibration points according to the mechanical coordinate system of the manipulator.

例如,如图7所示,夹具平台上的两个标定点对应的机械坐标分别为A(x′1,y′1),B(x′2,y′2)。For example, as shown in FIG. 7 , the mechanical coordinates corresponding to the two calibration points on the fixture platform are A(x′ 1 , y′ 1 ), B(x′ 2 , y′ 2 ), respectively.

在一示例性实施例中,可以通过修改夹具平台上的标定点的颜色或增加荧光提高图像识别精度。In an exemplary embodiment, the image recognition accuracy can be improved by modifying the color of the calibration points on the fixture platform or adding fluorescence.

S120,获取夹具平台上的每个标定点对应的相机坐标。S120. Obtain camera coordinates corresponding to each calibration point on the fixture platform.

可以利用高清相机拍摄夹具平台的图像,如图8所示,为相机拍摄的夹具平台的图像的示意图,该图像中包含夹具平台,以及夹具平台上的标定点A和B。The image of the fixture platform can be taken by a high-definition camera, as shown in FIG. 8 , which is a schematic diagram of the image of the fixture platform captured by the camera. The image includes the fixture platform and calibration points A and B on the fixture platform.

进一步通过图像识别技术获得该图像中两个标定点在相机坐标系中的坐标,即获得图像中标定点A和B对应的相机坐标,如A(x1,y1)、B(x2,y2)。Further obtain the coordinates of the two calibration points in the image in the camera coordinate system through image recognition technology, that is, obtain the camera coordinates corresponding to the calibration points A and B in the image, such as A(x 1 , y 1 ), B(x 2 , y 2 ).

S130,根据夹具平台上的标定点对应的机械坐标和相机坐标,获得机械坐标系和相机坐标系之间的映射关系,或称为第一映射关系。S130. Obtain a mapping relationship between the machine coordinate system and the camera coordinate system, or called a first mapping relationship, according to the machine coordinates and camera coordinates corresponding to the calibration points on the fixture platform.

如果已知某一个点分别对应的相机坐标和机械坐标,则可以建立相机坐标系与机械坐标系之间的映射关系,例如,某一个点的相机坐标为(x,y),该点在机械坐标系中的坐标为(x',y'),则相机坐标系与机械坐标系之间的映射关系可以采用如下的公式(1)表示:If the camera coordinates and machine coordinates corresponding to a certain point are known, the mapping relationship between the camera coordinate system and the machine coordinate system can be established. For example, the camera coordinates of a certain point are (x, y), and the point is The coordinates in the coordinate system are (x', y'), then the mapping relationship between the camera coordinate system and the machine coordinate system can be expressed by the following formula (1):

Figure BDA0003558621040000061
Figure BDA0003558621040000061

公式(1)中的a、b、c、d为未知参数。a, b, c, d in formula (1) are unknown parameters.

已知A和B两个标定点对应的相机坐标(x1,y1)、(x2,y2),以及已知A和B对应的机械坐标(x′1,y′1)和(x′2,y′2),分别将A、B两点对应的相机坐标和机械坐标代入公式(1)中得到公式(2)所示的方程组:The camera coordinates (x 1 , y 1 ), (x 2 , y 2 ) corresponding to the two calibration points of A and B are known, and the mechanical coordinates (x′ 1 , y′ 1 ) and ( x′ 2 , y′ 2 ), respectively substituting the camera coordinates and machine coordinates corresponding to points A and B into formula (1) to obtain the equation group shown in formula (2):

Figure BDA0003558621040000062
Figure BDA0003558621040000062

根据公式(2)所示的方程组,可以求解得到未知参数a、b、c、d的具体数值,即如果已知任一点的相机坐标,利用该映射关系可以转换得到该点对应的机械坐标。同理,如果已知某一点对应的机械坐标,可以转换得到该点对应的相机坐标。According to the equations shown in formula (2), the specific values of the unknown parameters a, b, c, and d can be solved, that is, if the camera coordinates of any point are known, the corresponding mechanical coordinates of the point can be converted by using the mapping relationship . Similarly, if the machine coordinates corresponding to a certain point are known, the camera coordinates corresponding to the point can be converted.

机械坐标系与相机坐标系之间的映射关系,只需在相机位置改变后重新计算。在相机位置不改变的前提下,S110~S130所述的过程只需执行一次,后续可以直接使用第一映射关系。The mapping relationship between the machine coordinate system and the camera coordinate system only needs to be recalculated after the camera position changes. On the premise that the camera position does not change, the processes described in S110-S130 only need to be performed once, and the first mapping relationship can be directly used subsequently.

如在相机检修或更换等场景下相机的位置可能会改变。相机位置改变后,重新按照上述的S110~S130的过程重新计算机械坐标系与相机坐标系之间的映射关系。For example, the position of the camera may change in scenarios such as camera inspection or replacement. After the camera position is changed, recalculate the mapping relationship between the machine coordinate system and the camera coordinate system according to the above-mentioned process of S110-S130.

S140,获取目标电子设备上至少两个标定点在设备坐标系中的坐标(即设备坐标)。S140. Acquire coordinates (ie, device coordinates) of at least two calibration points on the target electronic device in the device coordinate system.

本申请实施例以目标电子设备是手机为例进行说明。目标电子设备上标注的标定点的数量可以是两个或两个以上,本申请对此不做限定。In this embodiment of the present application, the target electronic device is a mobile phone as an example for description. The number of calibration points marked on the target electronic device may be two or more, which is not limited in this application.

在对手机的屏幕进行自动化测试的场景下,可以选取手机上的两个点作为标定点,例如,可以选取手机显示界面上的两个控件所在位置为标定点。或者,可以在手机上显示包含标定点的图片,该图片的分辨率与手机屏幕的分辨率相同,该图片可以是纯色图片,且标定点的颜色与图片的颜色不同,例如,该图片可以是白色,标定点的颜色可以是黑色。In the scenario of automatically testing the screen of the mobile phone, two points on the mobile phone can be selected as calibration points, for example, the locations of two controls on the display interface of the mobile phone can be selected as the calibration points. Alternatively, a picture containing the calibration points can be displayed on the mobile phone. The resolution of the picture is the same as that of the screen of the mobile phone. The picture can be a solid color picture, and the color of the calibration points is different from the color of the picture. For example, the picture can be White, the color of the calibration point can be black.

对于标定点为手机显示界面上显示的控件的场景,可以利用UI自动化测试工具直接获取个控件对应的设备坐标。例如,可以利用电子设备中安装UI自动化测试工具(如UIAutomator)获得控件对应的设备坐标。For the scene where the calibration point is a control displayed on the display interface of the mobile phone, the UI automation test tool can be used to directly obtain the device coordinates corresponding to each control. For example, the device coordinates corresponding to the controls can be obtained by using a UI automated testing tool (such as UIAutomator) installed in the electronic device.

对于标定点为图片中的标定点的场景,可以根据被测试设备的屏幕分辨率生成包含标定点的图片,即已知图片中的标定点的设备坐标。For the scene where the calibration point is the calibration point in the picture, the picture containing the calibration point can be generated according to the screen resolution of the device under test, that is, the device coordinates of the calibration point in the picture are known.

例如,如图9所示,手机上的两个标定点对应的设备坐标分别是C(x″3,y″3)和D(x″4,y″4)。For example, as shown in FIG. 9 , the device coordinates corresponding to the two calibration points on the mobile phone are C(x″ 3 , y″ 3 ) and D(x″ 4 , y″ 4 ), respectively.

S150,获取目标电子设备上的标定点对应的相机坐标。S150. Obtain camera coordinates corresponding to the calibration points on the target electronic device.

与获取夹具平台上的标定点的相机坐标的方式相似,将目标电子设备固定在机械手的夹具平台的固定位置处,然后,利用高清相机拍摄目标电子设备的图像。Similar to the manner of obtaining the camera coordinates of the calibration point on the fixture platform, the target electronic device is fixed at a fixed position on the fixture platform of the manipulator, and then the image of the target electronic device is captured by a high-definition camera.

进一步,通过图像识别技术获得该图像中标定点C、D对应的相机坐标,例如,如图10所示,标定点C、D在相机坐标系中的坐标分别为C(x′3,y′3)和D(x′4,y′4)。Further, the camera coordinates corresponding to the calibration points C and D in the image are obtained through image recognition technology, for example, as shown in Figure 10, the coordinates of the calibration points C and D in the camera coordinate system are C(x′ 3 , y′ 3 ) and D(x′ 4 , y′ 4 ).

S160,根据目标电子设备上的标定点对应的设备坐标和相机坐标,获得相机坐标系与设备坐标系之间的映射关系,或称为第二映射关系。S160. Obtain a mapping relationship between the camera coordinate system and the device coordinate system, or called a second mapping relationship, according to the device coordinates and camera coordinates corresponding to the calibration point on the target electronic device.

对于同一个位置点,若已知该点在设备坐标系中的坐标,以及该点在相机坐标中的坐标,则可以建立设备坐标系与相机坐标系之间的映射关系。例如,该映射关系可以采用如下的公式(3)表示:For the same location point, if the coordinates of the point in the device coordinate system and the coordinates of the point in the camera coordinate are known, the mapping relationship between the device coordinate system and the camera coordinate system can be established. For example, the mapping relationship can be represented by the following formula (3):

Figure BDA0003558621040000071
Figure BDA0003558621040000071

公式(3)中a1、b1、c1、d1均为未知参数。In formula (3), a 1 , b 1 , c 1 , and d 1 are all unknown parameters.

将目标电子设备上的C、D两点对应的设备坐标和相机坐标代入公式(3)中,得到如下公式(4)所示的方程组:Substituting the device coordinates and camera coordinates corresponding to points C and D on the target electronic device into the formula (3), the equation group shown in the following formula (4) is obtained:

Figure BDA0003558621040000072
Figure BDA0003558621040000072

根据公式(4)所示的方程组,可以求解得到未知参数a1、b1、c1、d1的具体数值,即如果已知目标电子设备上的任一点对应的相机坐标,利用该映射关系可以转换得到该点对应的设备坐标。同理,如果已知目标电子设备上任一点对应的设备坐标,可以转换得到该点对应的相机坐标。According to the equations shown in formula (4), the specific values of the unknown parameters a 1 , b 1 , c 1 , and d 1 can be obtained by solving them, that is, if the camera coordinates corresponding to any point on the target electronic device are known, use the mapping The relationship can be converted to obtain the device coordinates corresponding to the point. Similarly, if the device coordinates corresponding to any point on the target electronic device are known, the camera coordinates corresponding to the point can be obtained through conversion.

通过S140~S160所述的过程获得相机坐标系与设备坐标系之间的第二映射关系后,在电子设备的物理尺寸不改变的情况下,后续可以直接使用第二映射关系,即S140~S160只需执行一次。After obtaining the second mapping relationship between the camera coordinate system and the device coordinate system through the process described in S140-S160, the second mapping relationship can be directly used subsequently, that is, S140-S160, provided that the physical size of the electronic device does not change It only needs to be done once.

在电子设备的物理尺寸发生改变的情况下,第二映射关系会跟随电子设备的变化而更新,例如,不同型号的测试设备(如,不同型号的手机),或者不同类型的测试设备(如,手机与平板电脑、智能手表等)的物理尺寸可能不同,测试设备的物理尺寸不同,其对应的设备坐标系也不同,因此,需要针对不同物理尺寸的测试设备分别建立设备坐标系与相机坐标系之间的映射关系。即,更换测试设备后,需要按照S140~S160重新确定第二映射关系。When the physical size of the electronic device changes, the second mapping relationship will be updated following the change of the electronic device, for example, different types of test equipment (such as different models of mobile phones), or different types of test equipment (such as, The physical size of the mobile phone and tablet computer, smart watch, etc.) may be different, and the physical size of the test device is different, and the corresponding device coordinate system is also different. Therefore, it is necessary to establish a device coordinate system and a camera coordinate system for test devices with different physical sizes. mapping relationship between them. That is, after the test device is replaced, the second mapping relationship needs to be re-determined according to S140-S160.

通过以上步骤,获得了机械坐标系与相机坐标系之间的映射关系的参数,即a、b、c、d的具体数值,以及,设备坐标系与相机坐标系之间的映射关系的参数,如a1、b1、c1、d1的具体数值。进一步,可以根据第一映射关系和第二映射关系的参数值,得到机械坐标系与设备坐标系之间的映射关系,或可称为第三映射关系。Through the above steps, the parameters of the mapping relationship between the machine coordinate system and the camera coordinate system, that is, the specific values of a, b, c, and d, and the parameters of the mapping relationship between the device coordinate system and the camera coordinate system, Such as the specific values of a 1 , b 1 , c 1 , and d 1 . Further, the mapping relationship between the machine coordinate system and the device coordinate system may be obtained according to the parameter values of the first mapping relationship and the second mapping relationship, or may be called a third mapping relationship.

在另一示例中,夹具平台上标注有标定点A、B,进一步可以直接将显示有标定点C、D的目标电子设备固定在该夹具平台的固定位置上。然后,利用相机拍摄包含夹具平台和目标电子设备的一张图像,即获得如图11所示的图像。In another example, calibration points A and B are marked on the fixture platform, and the target electronic device displayed with calibration points C and D can be directly fixed on the fixed position of the fixture platform. Then, a camera is used to take an image including the fixture platform and the target electronic device, that is, an image as shown in FIG. 11 is obtained.

如图11所示,该图像包括夹具平台和放置在夹具平台上的手机,而且,包括夹具平台上的标定点A、B,以及手机上的标定点C、D。As shown in FIG. 11 , the image includes the jig platform and the mobile phone placed on the jig platform, and includes calibration points A and B on the jig platform, and calibration points C and D on the mobile phone.

分析图11所示的一张图像即可同时获得夹具平台上的标定点A、B对应的相机坐标,以及手机上的标定点C、D对应的相机坐标。无需相机分别拍摄夹具平台、测试设备的图像,分别进行图像分析获得标定点A、B,以及标定点C、D的相机坐标。提高了坐标系标定过程的效率。By analyzing an image shown in Figure 11, the camera coordinates corresponding to the calibration points A and B on the fixture platform and the camera coordinates corresponding to the calibration points C and D on the mobile phone can be obtained at the same time. There is no need for a camera to take images of the fixture platform and test equipment separately, and perform image analysis to obtain the camera coordinates of calibration points A, B, and calibration points C and D. Improved efficiency of the coordinate system calibration process.

S170,基于机械坐标系与相机坐标系之间的第一映射关系,以及设备坐标系与相机坐标系之间的第二映射关系,获得机械坐标系与设备坐标系之间的第三映射关系。S170. Obtain a third mapping relationship between the machine coordinate system and the device coordinate system based on the first mapping relationship between the machine coordinate system and the camera coordinate system and the second mapping relationship between the device coordinate system and the camera coordinate system.

将公式(1)代入公式(3)中,即可获得机械坐标系与设备坐标系之间的第三映射关系,例如,第三映射关系如公式(5)所示:Substituting formula (1) into formula (3), the third mapping relationship between the machine coordinate system and the device coordinate system can be obtained. For example, the third mapping relationship is shown in formula (5):

Figure BDA0003558621040000081
Figure BDA0003558621040000081

其中,a、b、c、d和a1、b1、c1、d1均已知,因此,参数aa1-bb1,a1b+ab1,-ab1-a1b,a1c+b1d+c1和a1d-b1c+d1均可以计算得到具体数值。Among them, a, b, c, d and a 1 , b 1 , c 1 , d 1 are all known, therefore, the parameters aa 1 -bb 1 , a 1 b+ab 1 , -ab 1 -a 1 b, a Both 1 c+b 1 d+c 1 and a 1 db 1 c+d 1 can be calculated to obtain specific values.

需要说明的是,在相机的位置未改变且电子设备的物理尺寸未改变的情况下,S170所述的获得第三映射关系的过程也只需执行一次,后续使用机械手系统时,可以直接使用第三映射关系。例如,对相同物理尺寸的电子设备进行测试时,上述S110~S170所述的过程只需执行一次获得第三映射关系后,对具有同一物理尺寸的多个电子设备进行测试时,可以直接使用第三映射关系。It should be noted that, when the position of the camera and the physical size of the electronic device remain unchanged, the process of obtaining the third mapping relationship described in S170 only needs to be performed once. Three mapping relationships. For example, when testing electronic devices with the same physical size, the process described in S110-S170 above only needs to be performed once to obtain the third mapping relationship. When testing multiple electronic devices with the same physical size, the first mapping can be directly used. Three mapping relationships.

S180,获取目标电子设备上目标位置对应的设备坐标,基于第三映射关系将目标位置的设备坐标转换为机械坐标。S180. Acquire device coordinates corresponding to the target position on the target electronic device, and convert the device coordinates of the target position into mechanical coordinates based on the third mapping relationship.

在利用机械手操作手机屏幕实现自动化测试的场景下,机械手需要移动至被测位置处进行相应的测试操作。例如,对手机屏幕进行触控性能测试时,需要机械手移动至测试点并对屏幕进行触摸操作;又如,对手机屏幕进行压力测试时,同样需要机械手移动至测试点并对屏幕进行按压操作。In the scenario where a manipulator is used to operate the screen of a mobile phone to realize automated testing, the manipulator needs to move to the position to be tested for corresponding test operations. For example, when testing the touch performance of a mobile phone screen, the manipulator needs to move to the test point and touch the screen; another example, when performing a stress test on the mobile phone screen, the manipulator also needs to move to the test point and press the screen.

获得屏幕上被测位置对应的设备坐标后,可以直接根据第三映射关系将被测位置的设备坐标转换为机械坐标。进一步,基于被测位置对应的机械坐标控制机械手移动至相应的被测位置处。在一种场景中,被测位置是手机显示界面上的控件,此种场景下,可以在目标电子设备中安装UI自动化测试工具,如UI Automator,通过UI自动化测试工具可以获得被测试控件的设备坐标。而且,更换同类型的其他电子设备后,如测试完某一型号手机的某些控件后,又继续测试另一型号手机的这些控件,此种场景下,这些被测试控件的控件ID不变,利用UI自动化测试工具可以快速获得这些被测控件对应控件的设备坐标,即更换电子设备后也可以快速获得被测试控件的坐标,无需修改自动化脚本,而且,提高了自动化脚本的兼容能力。After obtaining the device coordinates corresponding to the measured position on the screen, the device coordinates of the measured position can be directly converted into mechanical coordinates according to the third mapping relationship. Further, the manipulator is controlled to move to the corresponding measured position based on the mechanical coordinates corresponding to the measured position. In one scenario, the location to be tested is a control on the display interface of the mobile phone. In this scenario, a UI automated testing tool, such as UI Automator, can be installed in the target electronic device, and the device of the tested control can be obtained through the UI automated testing tool coordinate. Moreover, after replacing other electronic devices of the same type, such as after testing some controls of a certain model of mobile phone, continue to test these controls of another model of mobile phone. In this scenario, the control IDs of these tested controls remain unchanged. The device coordinates of the corresponding controls of these tested controls can be quickly obtained by using the UI automated test tool, that is, the coordinates of the tested controls can be quickly obtained after replacing the electronic device, without modifying the automation script, and the compatibility of the automation script is improved.

在另一种场景中,如果被测位置是没有控件的位置,如手机显示界面上的空白位置,此种场景下,将手指定位在手机的被测位置处,通过电子设备的“指针位置”功能,可以获得被触摸的位置的设备坐标,并将该被测位置的设备坐标写入自动化脚本中。在对被测设备进行测试的阶段,基于设备坐标系与机械坐标系之间的映射关系,将被测位置的设备坐标转换为机械坐标,并基于该机械坐标控制机械手移动至被测位置处,执行相应的测试操作。可见,此种场景也不需要依赖机械手开发自动化脚本。In another scenario, if the measured position is a position without controls, such as a blank position on the display interface of the mobile phone, in this scenario, position the finger at the measured position of the mobile phone, and use the "pointer position" of the electronic device to Function, you can get the device coordinates of the touched position, and write the device coordinates of the measured position into the automation script. In the stage of testing the tested equipment, based on the mapping relationship between the equipment coordinate system and the mechanical coordinate system, the equipment coordinates of the measured position are converted into mechanical coordinates, and the manipulator is controlled to move to the measured position based on the mechanical coordinates. Execute the corresponding test operation. It can be seen that this kind of scenario does not need to rely on the manipulator to develop automation scripts.

S190,基于目标位置的机械坐标生成运动控制指令,并向机械手发送运动控制指令,使得机械手移动至目标位置。S190. Generate a motion control command based on the mechanical coordinates of the target position, and send the motion control command to the manipulator, so that the manipulator moves to the target position.

在一示例中,计算机生成的运动控制指令可以直接控制机械手移动。例如,计算机基于机械手的当前位置以及目标位置对应的机械坐标,基于这两个位置的机械坐标生成控制机械手移动的运动控制指令,如,左移300mm,再向正前方移动500mm,生成的运动控制指令发送至机械手。机械手接收到运动控制指令执行该指令后从当前位置移动到目标位置。In one example, computer-generated motion control instructions can directly control manipulator movement. For example, based on the current position of the manipulator and the mechanical coordinates corresponding to the target position, the computer generates motion control commands to control the movement of the manipulator based on the mechanical coordinates of these two positions, for example, move 300mm to the left, and then move 500mm to the front, the generated motion control Commands are sent to the robot. The manipulator moves from the current position to the target position after receiving the motion control command and executing the command.

在另一示例中,计算机生成的运动控制指令用于告知机械手目标位置,例如,计算机获得目标位置的机械坐标后,向机械手发送运动控制指令,该运动控制指令包含目标位置。机械手解析该运动控制指令后获得目标位置的机械坐标,进一步,机械手根据自己当前所处的位置以及接收到的目标位置,生成移动指令,并执行该移动指令从当前位置移动至目标位置。In another example, the motion control command generated by the computer is used to inform the manipulator of the target position. For example, after the computer obtains the mechanical coordinates of the target position, it sends a motion control command to the manipulator, and the motion control command includes the target position. After analyzing the motion control command, the manipulator obtains the mechanical coordinates of the target position. Further, the manipulator generates a movement command according to its current position and the received target position, and executes the movement command to move from the current position to the target position.

本申请实施例对机械手从当前位置移动至目标位置的控制方式不作限定。The embodiment of the present application does not limit the control method for moving the manipulator from the current position to the target position.

S1100,向机械手发送测试指令,使得机械手对目标电子设备上的目标位置进行相应的测试操作。S1100, sending a test instruction to the manipulator, so that the manipulator performs a corresponding test operation on the target position on the target electronic device.

在一示例性中,机械手移动至目标位置后向计算机反馈自己已移动至目标位置处,此时,计算机向机械手发送测试指令,如控制机械手执行触摸或按压等操作。机械手接收到测试执行后解析并执行测试指令,实现对测试设备的自动化测试。In one example, after the manipulator moves to the target position, it feeds back to the computer that it has moved to the target position. At this time, the computer sends test instructions to the manipulator, such as controlling the manipulator to perform operations such as touching or pressing. After receiving the test execution, the manipulator parses and executes the test instructions to realize the automated test of the test equipment.

本实施例提供的机械手系统定位方法,通过在机械手的夹具平台上设置至少两个标定点,即已知标定点在机械坐标系中的机械坐标。利用相机拍摄夹具平台的图像,获得夹具平台上的标定点的相机坐标。通过夹具平台上的至少两个标定点对应的机械坐标和相机坐标,获得机械坐标系与相机坐标系之间的映射关系。同理,可以在目标电子设备上确定至少两个标定点,即已知目标电子设备上的标定点的设备坐标。然后,利用相机拍摄目标电子设备的图像,获得目标电子设备上的标定点的相机坐标。进而获得设备坐标系与相机坐标系之间的映射关系。进一步,根据上述的两个坐标系之间的映射关系,获得设备坐标系与机械坐标系之间的映射关系。最后,基于机械坐标系与设备坐标系之间的映射关系,可以直接将目标电子设备上任一点的设备坐标转换为机械坐标。最后,基于该点的机械坐标控制机械手移动至相应的位置处并执行相应的操作。可见,利用该方案可以直接基于输入的目标电子设备的设备坐标控制机械手,该方案获得的自动化脚本不需要写入被测位置的机械坐标,换言之,该方案的自动化脚本的开发和调试过程与机械手设备解耦,从而提高了自动化脚本的开发和调试效率。In the positioning method of the manipulator system provided in this embodiment, at least two calibration points are set on the fixture platform of the manipulator, that is, the mechanical coordinates of the calibration points in the mechanical coordinate system are known. The image of the fixture platform is captured by the camera, and the camera coordinates of the calibration points on the fixture platform are obtained. Through the machine coordinates and camera coordinates corresponding to at least two calibration points on the fixture platform, the mapping relationship between the machine coordinate system and the camera coordinate system is obtained. Similarly, at least two calibration points may be determined on the target electronic device, that is, the device coordinates of the calibration points on the target electronic device are known. Then, the camera is used to capture the image of the target electronic device, and the camera coordinates of the calibration points on the target electronic device are obtained. Further, the mapping relationship between the device coordinate system and the camera coordinate system is obtained. Further, according to the mapping relationship between the above two coordinate systems, the mapping relationship between the equipment coordinate system and the machine coordinate system is obtained. Finally, based on the mapping relationship between the machine coordinate system and the device coordinate system, the device coordinates of any point on the target electronic device can be directly converted into machine coordinates. Finally, based on the mechanical coordinates of this point, the manipulator is controlled to move to the corresponding position and perform corresponding operations. It can be seen that using this scheme, the manipulator can be directly controlled based on the equipment coordinates of the input target electronic equipment. The automation script obtained by this scheme does not need to be written into the mechanical coordinates of the measured position. In other words, the development and debugging process of the automation script of this scheme is similar to that of the manipulator Device decoupling improves the development and debugging efficiency of automation scripts.

同时,利用该方案可以直接获得被测位置的设备坐标,不需要先利用相机获得被测位置的相机坐标,降低了获得被测位置的机械坐标这一过程的耗时,提高了整个测试过程的测试效率。At the same time, this solution can directly obtain the equipment coordinates of the measured position without first using the camera to obtain the camera coordinates of the measured position, which reduces the time-consuming process of obtaining the mechanical coordinates of the measured position and improves the efficiency of the entire testing process. Test efficiency.

进一步地,更换相机位置后,相机坐标系也随之改变,机械坐标系与相机坐标系之间的第一映射关系,相机坐标系与设备坐标系之间的第二映射关系,以及机械坐标系与设备坐标系之间的第三映射关系都会随之改变。同理,更换测试设备后,测试设备的物理尺寸改变,设备坐标系跟随改变,设备坐标系与相机坐标系之间的第二映射关系,设备坐标系与机械坐标系之间的第三映射关系也跟随改变。利用本申请的方案,预先在机械手的夹具平台和测试设备上分别设置至少两个标定点,基于夹具平台上的标定点能够快速地、自动地标定机械坐标系与相机坐标系之间的第一映射关系。基于测试设备上的标定点可以快速、自动地标定设备坐标系与相机坐标系之间的第二映射关系。在更新第一映射关系、第二映射关系后,可以快速地更新第三映射关系。可见,该方案可以快速实现三个坐标系之间的自动标定,提高了坐标系标定过程的效率。Further, after changing the camera position, the camera coordinate system also changes accordingly, the first mapping relationship between the machine coordinate system and the camera coordinate system, the second mapping relationship between the camera coordinate system and the device coordinate system, and the machine coordinate system The third mapping relationship with the device coordinate system will change accordingly. Similarly, after the test equipment is replaced, the physical size of the test equipment changes, the equipment coordinate system changes accordingly, the second mapping relationship between the equipment coordinate system and the camera coordinate system, and the third mapping relationship between the equipment coordinate system and the machine coordinate system Also follow the change. Using the solution of this application, at least two calibration points are respectively set on the fixture platform of the manipulator and the test equipment in advance, based on the calibration points on the fixture platform, the first coordinate system between the machine coordinate system and the camera coordinate system can be quickly and automatically calibrated. Mapping relations. The second mapping relationship between the device coordinate system and the camera coordinate system can be quickly and automatically calibrated based on the calibration points on the test device. After updating the first mapping relationship and the second mapping relationship, the third mapping relationship can be quickly updated. It can be seen that this scheme can quickly realize the automatic calibration among the three coordinate systems, and improves the efficiency of the coordinate system calibration process.

进一步地,在对被测设备的被测控件进行自动化测试的场景中,被测位置即被测控件所在位置。此种场景下,该方案的自动化脚本中无需写入电子设备的被测位置的机械坐标,而是写入被测控件对应的控件ID,对于同类型的被测电子设备,如两种不同型号的手机(或其他电子设备),物理尺寸存在差异,但同一被测控件对应的控件ID不改变,因此,对于此类被测电子设备无需修改自动化脚本,即本方案获得的自动化脚本可以兼容不同物理尺寸的被测设备,提高了自动化脚本对不同物理尺寸的兼容能力。Further, in the scenario of performing automated testing on the tested control of the device under test, the tested location is the location of the tested control. In this scenario, the automation script of this solution does not need to write the mechanical coordinates of the measured position of the electronic device, but writes the control ID corresponding to the tested control. For the same type of tested electronic device, such as two different models The physical size of mobile phones (or other electronic devices) is different, but the control ID corresponding to the same control under test does not change. Therefore, there is no need to modify the automation script for this type of electronic device under test, that is, the automation script obtained by this scheme can be compatible with different The physical size of the device under test improves the compatibility of automation scripts with different physical sizes.

通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated according to needs It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the above-described system, device, and unit, reference may be made to the corresponding process in the foregoing method embodiments, and details are not repeated here.

在本实施例所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this embodiment, it should be understood that the disclosed system, device and method may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be Incorporation may either be integrated into another system, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of this embodiment may be integrated into one processing unit, or each unit may physically exist separately, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium In, several instructions are included to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor execute all or part of the steps of the method described in each embodiment. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk, and other various media capable of storing program codes.

以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the application, but the protection scope of the application is not limited thereto, and any changes or replacements within the technical scope disclosed in the application should be covered within the protection scope of the application . Therefore, the protection scope of the present application should be determined by the protection scope of the claims.

Claims (13)

1.一种机械手系统定位方法,其特征在于,包括:1. A positioning method for a manipulator system, comprising: 获取机械坐标系与相机坐标系之间的第一映射关系;Obtain the first mapping relationship between the machine coordinate system and the camera coordinate system; 基于电子设备的至少两个设备标定点对应的设备坐标及相机坐标,获得相机坐标系与电子设备的设备坐标系之间的第二映射关系,所述设备标定点是所述电子设备的显示界面上的标定控件,或者所述电子设备显示的预设图片中的标定点;Obtain a second mapping relationship between the camera coordinate system and the device coordinate system of the electronic device based on the device coordinates and camera coordinates corresponding to at least two device calibration points of the electronic device, the device calibration points being the display interface of the electronic device The calibration control on the computer, or the calibration point in the preset picture displayed by the electronic device; 基于所述第一映射关系和所述第二映射关系,获得所述设备坐标系与所述机械坐标系之间的第三映射关系;Obtaining a third mapping relationship between the equipment coordinate system and the machine coordinate system based on the first mapping relationship and the second mapping relationship; 获取所述电子设备的目标位置在所述设备坐标系中的设备坐标,并基于所述第三映射关系转换得到所述目标位置的机械坐标。Acquiring the device coordinates of the target position of the electronic device in the device coordinate system, and converting based on the third mapping relationship to obtain the mechanical coordinates of the target position. 2.根据权利要求1所述的方法,其特征在于,所述获取机械坐标系与相机坐标系之间的第一映射关系,包括:2. The method according to claim 1, wherein said obtaining the first mapping relationship between the mechanical coordinate system and the camera coordinate system comprises: 获取机械手设备上的至少两个机械手标定点对应的机械坐标;Obtain the mechanical coordinates corresponding to at least two manipulator calibration points on the manipulator device; 通过相机获取每个机械手标定点在所述相机坐标系中的相机坐标;Obtain the camera coordinates of each manipulator calibration point in the camera coordinate system through the camera; 基于所述至少两个机械手标定点对应的机械坐标和相机坐标,获得所述机械坐标系与所述相机坐标系之间的第一映射关系。Based on the machine coordinates and camera coordinates corresponding to the at least two manipulator calibration points, a first mapping relationship between the machine coordinate system and the camera coordinate system is obtained. 3.根据权利要求2所述的方法,其特征在于,所述获取机械手设备上的至少两个机械手标定点对应的机械坐标,包括:3. The method according to claim 2, wherein said acquiring mechanical coordinates corresponding to at least two manipulator calibration points on the manipulator device comprises: 所述机械手设备的夹具平台上设置有至少两个标定点,基于所述机械手设备的设备信息获得每个标定点的机械坐标。At least two calibration points are set on the fixture platform of the manipulator device, and the mechanical coordinates of each calibration point are obtained based on the equipment information of the manipulator device. 4.根据权利要求1或2所述的方法,其特征在于,所述基于所述电子设备的至少两个设备标定点对应的设备坐标及相机坐标,获得相机坐标系与电子设备的设备坐标系之间的第二映射关系,包括:4. The method according to claim 1 or 2, wherein the camera coordinate system and the device coordinate system of the electronic device are obtained based on the device coordinates and camera coordinates corresponding to at least two device calibration points of the electronic device The second mapping relationship between, including: 获取所述电子设备上的至少两个设备标定点对应的设备坐标;Obtain device coordinates corresponding to at least two device calibration points on the electronic device; 通过相机获取每个设备标定点在所述相机坐标系中的相机坐标;Obtain the camera coordinates of each device calibration point in the camera coordinate system through the camera; 基于所述至少两个设备标定点对应的设备坐标和相机坐标,获得所述相机坐标系与所述设备坐标系之间的第二映射关系。Based on the device coordinates and camera coordinates corresponding to the at least two device calibration points, a second mapping relationship between the camera coordinate system and the device coordinate system is obtained. 5.根据权利要求4所述的方法,其特征在于,所述设备标定点是所述电子设备的显示界面上的标定控件;获取所述电子设备上的至少两个设备标定点对应的设备坐标,包括:5. The method according to claim 4, wherein the device calibration point is a calibration control on the display interface of the electronic device; obtain the device coordinates corresponding to at least two device calibration points on the electronic device ,include: 获取所述标定控件对应的控件标识;Acquiring a control identifier corresponding to the calibration control; 向所述电子设备发送控件坐标请求,所述控件坐标请求包括所述控件标识;sending a control coordinate request to the electronic device, where the control coordinate request includes the control identifier; 接收所述电子设备发送的所述标定控件对应的设备坐标。Receive the device coordinates corresponding to the calibration control sent by the electronic device. 6.根据权利要求4所述的方法,其特征在于,所述设备标定点是所述电子设备显示的预设图片中的标定点;获取所述电子设备上的至少两个设备标定点对应的设备坐标,包括:6. The method according to claim 4, wherein the device calibration point is a calibration point in a preset picture displayed by the electronic device; obtain the corresponding information of at least two device calibration points on the electronic device Device coordinates, including: 基于所述标定点在所述预设图片中的坐标,获得所述标定点在所述设备坐标系中的设备坐标。Based on the coordinates of the calibration point in the preset picture, the device coordinates of the calibration point in the device coordinate system are obtained. 7.根据权利要求4所述的方法,其特征在于,所述通过相机获取每个设备标定点在所述相机坐标系中的相机坐标,包括:7. The method according to claim 4, wherein the obtaining the camera coordinates of each device calibration point in the camera coordinate system through the camera comprises: 接收相机拍摄的所述电子设备的图像,所述图像包括所述设备标定点;receiving an image of the electronic device captured by a camera, the image including a calibration point of the device; 基于图像识别技术识别出所述图像包含的所述设备标定点,并确定每个设备标定点在所述图像中的位置坐标,获得所述设备标定点的相机坐标。The device calibration points contained in the image are identified based on image recognition technology, and the position coordinates of each device calibration point in the image are determined to obtain the camera coordinates of the device calibration points. 8.根据权利要求1所述的方法,其特征在于,所述目标位置是所述电子设备的显示界面的非控件位置;所述获取所述电子设备的目标位置在所述设备坐标系中的设备坐标,包括:8. The method according to claim 1, wherein the target position is a non-control position of the display interface of the electronic device; the acquisition of the target position of the electronic device in the device coordinate system Device coordinates, including: 接收所述电子设备发送的所述目标位置对应的设备坐标,所述设备坐标由所述电子设备接收到对所述目标位置的点击操作后获得。receiving device coordinates corresponding to the target position sent by the electronic device, where the device coordinates are obtained after the electronic device receives a click operation on the target position. 9.根据权利要求1所述的方法,其特征在于,基于所述第三映射关系转换得到所述目标位置的机械坐标,包括:9. The method according to claim 1, wherein converting the mechanical coordinates of the target position based on the third mapping relationship comprises: 将所述目标位置的设备坐标输入至所述映射关系,计算得到所述目标位置对应的机械坐标。The device coordinates of the target position are input into the mapping relationship, and the machine coordinates corresponding to the target position are calculated. 10.根据权利要求1所述的方法,其特征在于,所述方法还包括:10. The method of claim 1, further comprising: 基于所述目标位置的机械坐标控制机械手设备移动至所述电子设备的目标位置处;controlling the manipulator device to move to the target position of the electronic device based on the mechanical coordinates of the target position; 控制所述机械手在所述目标位置处执行相应的操作。The manipulator is controlled to perform corresponding operations at the target position. 11.根据权利要求10所述的方法,其特征在于,基于所述目标位置的机械坐标控制所述机械手设备移动至所述电子设备的目标位置处,包括:11. The method according to claim 10, wherein controlling the manipulator device to move to the target position of the electronic device based on the mechanical coordinates of the target position comprises: 基于所述目标位置的机械坐标,以及所述机械手设备当前所处位置的机械坐标,生成运动控制指令;generating a motion control instruction based on the mechanical coordinates of the target position and the mechanical coordinates of the current position of the manipulator device; 向所述机械手设备发送所述运动控制指令,以使所述机械手设备响应所述运动控制指令从所述当前所处位置移动至所述目标位置。sending the motion control command to the manipulator device, so that the manipulator device moves from the current position to the target position in response to the motion control command. 12.一种计算机设备,其特征在于,所述电子设备包括:一个或多个处理器、存储器和触摸屏;所述存储器用于存储程序代码;所述处理器用于运行所述程序代码,使得所述电子设备实现如权利要求1至11任一项所述的机械手系统定位方法。12. A computer device, characterized in that the electronic device comprises: one or more processors, memory and touch screen; the memory is used to store program code; the processor is used to run the program code, so that the The electronic device implements the manipulator system positioning method according to any one of claims 1 to 11. 13.一种计算机可读存储介质,其特征在于,其上存储有指令,当所述指令在计算机设备上运行时,使得所述电子设备执行如权利要求1至11任一项所述的机械手系统定位方法。13. A computer-readable storage medium, characterized in that instructions are stored thereon, and when the instructions are run on a computer device, the electronic device executes the manipulator according to any one of claims 1 to 11 System positioning method.
CN202210286905.4A 2022-03-22 2022-03-22 Positioning method and device for manipulator system Active CN114670194B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210286905.4A CN114670194B (en) 2022-03-22 2022-03-22 Positioning method and device for manipulator system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210286905.4A CN114670194B (en) 2022-03-22 2022-03-22 Positioning method and device for manipulator system

Publications (2)

Publication Number Publication Date
CN114670194A CN114670194A (en) 2022-06-28
CN114670194B true CN114670194B (en) 2023-06-27

Family

ID=82074025

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210286905.4A Active CN114670194B (en) 2022-03-22 2022-03-22 Positioning method and device for manipulator system

Country Status (1)

Country Link
CN (1) CN114670194B (en)

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064557A (en) * 2013-01-05 2013-04-24 联信摩贝软件(北京)有限公司 Method and system for inputting information to electronic equipment on basis of coordinates and acceleration of touch screen
CN105631875A (en) * 2015-12-25 2016-06-01 广州视源电子科技股份有限公司 Method and system for determining mapping relation between camera coordinates and manipulator paw coordinates
CN105867433A (en) * 2016-03-31 2016-08-17 纳恩博(北京)科技有限公司 Moving control method, moving electronic device and moving control system
CN109187637B (en) * 2018-07-31 2020-05-19 中国科学院自动化研究所 Method and system for workpiece defect measurement based on infrared thermal imager
CN110488751B (en) * 2018-08-29 2022-08-19 中山大学 Graphite tray visual positioning system of automatic process line
CN109974584B (en) * 2019-04-12 2020-03-20 山东大学 Calibration system and calibration method for auxiliary laser osteotomy robot
CN110238845B (en) * 2019-05-22 2021-12-10 湖南视比特机器人有限公司 Automatic hand-eye calibration method and device for optimal calibration point selection and error self-measurement
CN110640745B (en) * 2019-11-01 2021-06-22 苏州大学 Vision-based robot automatic calibration method, equipment and storage medium
CN111775154B (en) * 2020-07-20 2021-09-03 广东拓斯达科技股份有限公司 Robot vision system
CN112669383B (en) * 2020-12-30 2023-04-07 上海新时达机器人有限公司 Tracking method and camera calibration method of assembly line tracking system
CN113592959B (en) * 2021-08-17 2023-11-28 北京博视智动技术有限公司 Visual processing-based membrane lamination method and system
CN113643384B (en) * 2021-10-12 2022-02-08 深圳荣耀智能机器有限公司 Coordinate system calibration method, automatic assembly method and device
CN113977637A (en) * 2021-12-03 2022-01-28 深圳市超准视觉科技有限公司 Robot vision identification grabbing system and method applicable to non-precision work bin

Also Published As

Publication number Publication date
CN114670194A (en) 2022-06-28

Similar Documents

Publication Publication Date Title
US20210312707A1 (en) Method, apparatus, device and storage medium for three-dimensional reconstruction
CN102904996B (en) The method and device of a kind of handset touch panel performance test, system
US20210405111A1 (en) Test method and electronic device
US11537329B1 (en) Emulation test system for flash translation layer and method thereof
CN110879777A (en) Control testing method and device for application interface, computer equipment and storage medium
CN116038720A (en) A hand-eye calibration method, device and equipment based on point cloud registration
WO2024179592A1 (en) Mechanical arm safety plane information display method and related product
CN117140517A (en) High-precision automatic hand-eye calibration method and system for mechanical arm
JP2016515236A (en) System and method for interactive image caricature using electronic devices
CN114670194B (en) Positioning method and device for manipulator system
CN111738162A (en) Display method, device, electronic device and storage medium of face image
CN115338872A (en) Gluing robot pose calculation method, device, equipment and storage medium
WO2022193640A1 (en) Robot calibration method and apparatus, and robot and storage medium
CN115469160A (en) Screen test method, system and device and electronic equipment
CN108984097A (en) Touch operation method, device, storage medium and electronic device
CN112380134A (en) WebUI automatic testing method based on image recognition
CN116136388A (en) Calibration method, device, equipment and storage medium for robot tool coordinate system
US20200274829A1 (en) General purpose ring buffer handling in a network controller
CN115070770B (en) Tool coordinate system calibration method, system, device and storage medium
CN111898489B (en) Method and device for marking palm pose, electronic equipment and storage medium
CN110322484B (en) Calibration method and system for multi-device shared augmented reality virtual space
CN115421749A (en) A method, system, device and medium for refreshing hard disk firmware based on Linux system
CN115294065A (en) FPC-BTB interface detection positioning method and system based on tph-yolov5 deep learning
CN113689398A (en) Robot tapping method and device
CN111752813A (en) A test method and system for BMC memory under DOS

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after: Honor Terminal Co.,Ltd.

Country or region after: China

Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Patentee before: Honor Device Co.,Ltd.

Country or region before: China