Four-axis robotic arm clicking and position calibration method and system based on artificial intelligence
Through artificial intelligence technology, cameras and reinforcement learning algorithms are used to automatically extract the three-dimensional coordinates of clicked elements on the screen, solving the automation problem of the click position calibration of the four-axis robotic arm, realizing the intelligence of the robotic arm, and reducing manpower investment and system resource usage. , improving testing efficiency.
Patent Information
- Application Number
- CN202111612458.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-12-27
AI Technical Summary
When using a four-axis robotic arm to click, the existing technology cannot automatically extract the position of the element that needs to be clicked on the screen and convert it into a three-dimensional spatial coordinate recognized by the robotic arm. This requires manual teaching, which is time-consuming and labor-intensive, and the software simulates click events to occupy the system. resources and cannot accurately reflect system performance.
Using an artificial intelligence-based method, we make a tooling fixture to place the tested screen in a horizontal position, use a camera to obtain regional information, use the YOLOv3 model to identify key points, and combine it with a reinforcement learning algorithm to allow the robotic arm to gradually approach the key points and optimize through the reward function Click on the path to achieve robotic arm click and position calibration.
It eliminates the need for tedious teaching work, reduces manpower investment and human errors, realizes automated clicking of the robotic arm, improves testing efficiency, reduces system resource usage, enables remote testing in a cloud computing environment, and reduces travel consumption.
Smart Images

Figure CN114393576B
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of computer software and hardware testing, and specifically discloses a four-axis mechanical arm clicking and position calibration method and system based on artificial intelligence. Background Art
[0002] In the field of automated testing, human behavior is usually simulated through software and hardware to conduct human-computer interaction. In the testing process of devices with touch screens, common simulation methods include: 1. Software simulation of touch screen events; 2. Using a robotic arm to control a touch pen to click. Using software to simulate screen click events can usually only be used for functional test verification and cannot test the actual responsiveness of the screen; it also takes up additional system resources to simulate click events and cannot correctly reflect system performance; in addition, the software simulation method invades the system under test to a certain extent, which is prone to cause failures caused by software other than the system under test, resulting in additional time and cost for locating and analyzing problems.
[0003] Before using the robot arm to perform a click action, manual teaching is usually required to guide the robot arm to move to the specified position and then record the position information. If there are multiple actions, manual teaching is required multiple times, which is time-consuming and laborious. Summary of the invention
[0004] The purpose of the present invention is to overcome the defects of the prior art. One of the purposes of the present invention is to provide a four-axis robotic arm clicking and position calibration method and system based on artificial intelligence, which is used to solve the problem in the prior art of how to extract the position of the element to be clicked on the screen when using a four-axis desktop industrial-grade robotic arm to click, convert it into a three-dimensional space coordinate recognized by the robotic arm, obtain the conversion relationship, and have a robotic arm clicking system that automatically improves the recognition ability.
[0005] In order to achieve the above objectives and other objectives, the present invention is implemented by including the following technical solutions:
[0006] A four-axis robot arm click and position calibration method based on artificial intelligence, comprising the following steps:
[0007] Make a fixture to keep the screen under test in a horizontal position;
[0008] According to key point recognition, the area information of the screen under test is obtained by using a camera;
[0009] Using the camera at a fixed position to shoot the designated key point, and converting the distance relationship according to the acquired size of the key point; and
[0010] Using a reinforcement learning algorithm, the robotic arm is allowed to gradually and actively approach the key points, and the relationship between the effective jump caused by the clicked screen and the pressure feedback at the end of the robotic arm is used as the reward function.
[0011] In one embodiment of the present invention, the manufacturing of the fixture so that the screen to be tested is in a horizontal position includes:
[0012] Place the screen under test on a horizontal plane; and
[0013] Make sure the base of the four-axis desktop industrial-grade robotic arm is also on a horizontal plane.
[0014] In one embodiment of the present invention, the step of identifying key points and acquiring area information of the screen under test using a camera includes:
[0015] Use the YOLOv3 model for small target recognition;
[0016] Identify a designated small target from the image captured by the camera at the fixed position; and
[0017] Crop the effective area of the screen into ROI.
[0018] In one embodiment of the present invention, the using the camera at a fixed position to shoot the designated key point, and converting the distance relationship according to the acquired size of the key point, includes:
[0019] According to the pixel sizes obtained after shooting key points of the same size at different depths, the conversion relationship between pixels and depth is obtained, so as to obtain the vertical relationship between the horizontal plane where the screen under test is located and the camera, that is, the Z-axis relationship between the horizontal plane where the screen under test is located and the camera;
[0020] According to the Z-axis relationship between the base of the four-axis desktop industrial-grade robotic arm and the camera, the Z-axis relationship between the robotic arm and the horizontal plane where the measured screen is located is obtained.
[0021] In one embodiment of the present invention, the use of a reinforcement learning algorithm to allow the robotic arm to gradually and actively approach the key point, and taking the relationship between the effective feedback of screen clicks and the pressure feedback of the robotic arm itself as a reward function, includes:
[0022] Using reinforcement learning, set the reward function and penalty function used in reinforcement learning, so that it can autonomously choose a path to move to the screen and obtain the world coordinates (x, y, z) of at least three points on the screen; and
[0023] According to the manufacturing fixture, the screen to be tested is placed in a horizontal position, and z1 = z2 = z3… is obtained.
[0024] In one embodiment of the present invention, the reward function includes:
[0025] The area range after the robot arm reaches down is within the area identified according to the key points and the area information of the screen under test is obtained by using a camera; and
[0026] The end of the robotic arm senses the feedback pressure through its own pressure, and the end of the robotic arm clicks onto the screen.
[0027] A four-axis robot arm clicking and position calibration system based on artificial intelligence, comprising:
[0028] Reinforcement learning model module;
[0029] Screen distance measurement module; and
[0030] Module for converting screen 2D coordinates to robotic arm 3D coordinates.
[0031] In one embodiment of the present invention, the reinforcement learning model module includes:
[0032] The experimental environment model module uses local training to pre-train the model and accelerate model convergence; and the production environment model module uses online training to collect data in real time for retraining so that the model matches the specific production environment.
[0033] In one embodiment of the present invention, the screen distance measurement module uses a fixed-focus camera to shoot a fixed-size anchor point, measures the depth relationship between the anchor point and the camera, and uses the camera imaging formula to obtain a new distance after vertically moving the anchor point.
[0034] In one embodiment of the present invention, the module for converting screen 2D coordinates to robotic arm 3D coordinates achieves the purpose of reducing 3D to 2D by placing the screen horizontally so that the surface of the screen coincides with the world coordinate surface of the robotic arm. Then, a camera is used to take pictures and proportional calculations are performed based on the similarity of the graphics to obtain the position of the element on the screen relative to the point where the robotic arm wants to click.
[0035] In summary, the present invention provides a method and system for clicking and calibrating a four-axis robot arm based on artificial intelligence. After using this method and system, there is no need for tedious teaching work, which reduces manpower input and human errors, and no longer relies on manual clicking of the robot arm. The robot arm under cloud computing is intelligently improved, and the existing test / operation steps can be remotely input to places that are inaccessible to manpower, reducing travel expenses. Other features, benefits and advantages will be apparent from the text disclosure detailed herein, including the specification and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is an example diagram of the conversion between two-dimensional coordinates and world coordinates of the present invention;
[0037] Figure 2 It is a schematic diagram of position calculation based on a fixed-focus camera in the present invention;
[0038] Figure 3 It is the recognition effect diagram of the present invention;
[0039] Figure 4 is a network structure diagram of online reinforcement learning of the present invention;
[0040] Figure 5 It is a schematic diagram of the structure of the reward function of the present invention. DETAILED DESCRIPTION
[0041] The present invention is further described below in conjunction with specific examples. It should be understood that these examples are only used to illustrate the present invention and are not used to limit the scope of protection of the present invention.
[0042] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention.
[0043] The four-axis robot arm clicking and position calibration method based on artificial intelligence of the present invention can strengthen pre-learning in an experimental environment and can also be run in a remote environment.
[0044] Example 1
[0045] When strengthening pre-learning in an experimental environment, it specifically includes steps S1 to S4:
[0046] S1. Make a fixture to make the screen to be tested in a horizontal position. Specifically, place the screen to be tested on a horizontal plane, and make the base of the four-axis desktop industrial-grade robot arm also on a horizontal plane. Put the device to be tested into the bracket and use a level to detect it. Make the screen level and affix calibration labels to the four vertices of the screen. After this operation, the three-dimensional space conversion problem will be reduced to a lower dimension. Figure 1 As shown, the solution to the two-dimensional coordinate transformation relationship is formed, which greatly reduces the difficulty of calculation.
[0047] S2, according to the key point recognition, and use the camera to obtain the area information of the screen under test, specifically, turn on the camera, load the reinforcement learning module, the element recognition module, use the YOLOv3 model to recognize the small target, and recognize the specified small target from the picture taken by the fixed position camera, such as Figure 4As shown, the effective area of the screen is cropped ROI (region of interest).
[0048] S3, using the camera at a fixed position to shoot the designated key point, and converting the distance relationship according to the size of the key point obtained, such as Figure 2 As shown, according to the information obtained in step S2, the parameters of the reward and penalty functions are automatically adjusted, and a series of target points are randomly generated. Specifically, after calibration, in the case of a monocular camera, the pixel-depth conversion relationship can be obtained according to the pixel size obtained after shooting the key points of the same size at different depths, thereby obtaining the vertical relationship between the horizontal plane where the screen to be tested is located and the camera, that is, the Z-axis relationship between the horizontal plane where the screen to be tested is located and the camera. In addition, the vertical distance between the base of the four-axis desktop industrial-grade robotic arm fixed on the operating desktop and the camera, that is, the Z-axis relationship between the base of the four-axis desktop industrial-grade robotic arm and the camera is known, so the Z-axis relationship between the robotic arm and the horizontal plane where the screen to be tested is located can be obtained.
[0049] S4. Use the reinforcement learning algorithm to allow the robot to gradually and actively approach the key point, and use the relationship between the effective jump of the clicked screen and the pressure feedback of the end of the robot as the reward function. Specifically, using the reinforcement learning method, set the reward function and penalty function used in reinforcement learning, so that it can autonomously choose a path to move to the screen, and obtain the world coordinates (x, y, z) of at least three points on the screen. At this time, because of the method F1 described in the claim, in the robot arm teaching mode, the robot arm is moved to the four vertices of the screen, and the coordinates of the robot arm are obtained respectively. At this time, z1≈z2≈z3... must be obtained. Then our reward function only needs to ensure that the area range after the robot arm probes down is within the area obtained in S2, and the pressure at the end of the robot arm itself feels the feedback pressure, that is, the end of the robot arm clicks on the screen. The penalty function only needs to ensure that the depth of the end of the robot arm is greater than the screen z1 where the screen is located, and the end of the robot arm exceeds the area, and the pressure feedback at the end of the robot arm is greater than the threshold.
[0050] like Figure 5 As shown in Figure 1, further, the reward function and the penalty function are two algorithm functions set to ensure that the model approaches a better solution in the unsupervised reinforcement learning process. Usually, without training, the system cannot determine whether the current operation is correct and effective. Therefore, we stipulate that if the current operation of the system is correct, a positive score is calculated according to the reward function; if the operation is wrong, a negative score is calculated according to the reward function. The penalty function is used to call the penalty function when an error occurs in the system to adjust the system's operating intention.
[0051] The formula of the reward function is as follows:
[0052]
[0053] In some embodiments, the robot moves a distance s, the points clicked by the robot are distributed in a four-square grid K1K2K3K4 with the screen as the plane, the robot finally clicks the position K0, the clicked screen effectively jumps J, the pressure feedback F at the end of the robot (F0 is the maximum click force), and the robot clicks the position k. The intention of the robot to click is: the values XYZ of the x-axis, y-axis, and z-axis. Therefore, we expect that every time the robot moves, the screen can effectively jump J1, and the pressure feedback F1 <= F0.
[0054] Therefore, the reward function calculation formula of the present invention is:
[0055]
[0056] That is, using logarithm with base e as the calculation makes the reward result smoother. Therefore, there is pressure feedback at the end and the page jumps, and both must occur at the same time for the calculation result to be non-negative.
[0057] But at this time we can see that Max(R)=0, so we add the variable of the robot arm's moving distance into the formula so that within the operable domain, the farther the robot arm walks, the higher the reward.
[0058]
[0059] The penalty function is to amplify the situation outside all areas. The function pseudo code is as follows:
[0060] if F > F0:
[0061] Execute excessive pressure penalty (i.e. z-axis depth reduction)
[0062] if F = 0:
[0063] Execute the penalty of too little pressure (i.e. not pressing any position, need to deepen the z-axis)
[0064] if 0 < F <= F0 and J != True:
[0065] At this time, the robot arm clearly pressed the button, but the screen page did not jump.
[0066] Perform position change penalties (i.e. the button was pressed but in the wrong position, so adjust the X, Y, and Z coordinates).
[0067] Example 2
[0068] When running in a remote environment, it specifically includes steps F1 to F5:
[0069] F1. Place the device under test in the bracket and use a level to check the screen to make it level. Stick calibration labels on the four vertices of the screen.
[0070] F2, turn on the camera and element recognition module.
[0071] F3. Randomly generate three to six coordinate points, for example, four, based on the existing image position and the parameter information left by the reinforcement learning module. Drive the robot arm to try to click. If it works, use these three to six coordinate points; otherwise, load the reinforcement learning module in the online learning state and continue training.
[0072] F4. Calculate the relationship between these three to six points and the screen to obtain the conversion relationship.
[0073] F5. Continue with subsequent testing.
[0074] In summary, the present invention provides a four-axis robotic arm clicking and position calibration method and system based on artificial intelligence. After using this method and system, there is no need for tedious teaching work, which reduces manpower input and human errors, and no longer relies on manual robotic arm clicking. The intelligent improvement of the robotic arm under cloud computing can remotely input the existing test / operation steps to places that are inaccessible to manpower, thereby reducing travel costs.
[0075] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A four-axis robotic arm click and position calibration method based on artificial intelligence, It is characterized in that The following steps are involved: Make a fixture to keep the screen under test in a horizontal position; According to key point recognition, the area information of the screen under test is obtained by using a camera; Use the camera at a fixed position to shoot the designated key points, and convert the distance relationship according to the acquired size of the key points; as well as Using a reinforcement learning algorithm, the robot arm is gradually and actively approaching the key points, and the relationship between the effective jump of the clicked screen and the pressure feedback at the end of the robot arm is used as a reward function; The step of identifying key points and obtaining area information of the screen under test using a camera includes: Use the YOLOv3 model for small target recognition; Identify a designated small target from the image captured by the camera at the fixed position; and Crop the effective area of the screen into ROI; Among them, the clicked screen has an effective jump J, the pressure feedback at the end of the robotic arm is F, and the robotic arm click position is k. The reward function calculation formula is: , The robot arm moves distance s, add the robot arm moving distance variable into the formula, 。 2. The calibration method according to claim 1, It is characterized in that The manufacturing of the fixture makes the screen to be tested in a horizontal position, including: Place the screen under test on a horizontal plane; and Make sure the base of the four-axis desktop industrial-grade robotic arm is also on a horizontal plane.
3. The calibration method according to claim 1, It is characterized in that The step of using the camera at a fixed position to shoot the designated key point and converting the distance relationship according to the acquired size of the key point includes: According to the pixel sizes obtained after shooting key points of the same size at different depths, the conversion relationship between pixels and depth is obtained, so as to obtain the vertical relationship between the horizontal plane where the screen under test is located and the camera, that is, the Z-axis relationship between the horizontal plane where the screen under test is located and the camera; According to the Z-axis relationship between the base of the four-axis desktop industrial-grade robotic arm and the camera, the Z-axis relationship between the robotic arm and the horizontal plane where the measured screen is located is obtained.
4. The calibration method according to claim 1, It is characterized in that The reinforcement learning algorithm is used to allow the robot arm to gradually and actively approach the key point, and the relationship between the effective feedback of the screen click and the pressure feedback of the robot arm itself is used as the reward function, including: Using reinforcement learning, set the reward function and penalty function used in reinforcement learning, so that it can autonomously choose a path to move to the screen and obtain the world coordinates (x, y, z) of at least three points on the screen; and According to the manufacturing fixture, the screen to be tested is placed in a horizontal position, and z1=z2=z3… is obtained.
5. The calibration method according to claim 4, It is characterized in that The reward function includes: The area range after the robot arm reaches down is within the area identified according to the key points and the area information of the screen under test is obtained by using a camera; and The end of the robotic arm senses the feedback pressure through its own pressure, and the end of the robotic arm clicks onto the screen.
6. A calibration system calibrated by the calibration method according to any one of claims 1 to 5, It is characterized in that include: Reinforcement learning model module; Screen distance measurement module; as well as Module for converting screen 2D coordinates to robotic arm 3D coordinates.
7. The calibration system according to claim 6, It is characterized in that The reinforcement learning model module includes: The experimental environment model module uses local training to pre-train the model and accelerate model convergence; and The production environment model module adopts online training method, collects data in real time for retraining, so that the model matches the specific production environment.
8. The calibration system according to claim 6, It is characterized in that The screen distance measurement module uses a fixed-focus camera to shoot a fixed-size anchor point, measures the depth relationship between the anchor point and the camera, and uses the camera imaging formula to obtain the new distance after the anchor point is vertically moved.
9. The calibration system according to claim 6, It is characterized in that The screen 2D coordinate to robot arm 3D coordinate module places the screen horizontally so that the screen surface coincides with the robot arm world coordinate surface, thereby achieving the purpose of reducing 3D to 2D. The camera is then used to take pictures, and proportional calculations are performed based on the similarity of the graphics to obtain the position of the element on the screen relative to the point where the robot arm wants to click.
