Robotic arm control method, device, robotic arm and storage medium
The pose and target position of the robotic arm are determined through the zoom camera and deep learning model, which solves the problem of insufficient grasping accuracy of the robotic arm and achieves efficient automated production.
Patent Information
- Application Number
- CN202310314860.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-20
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2043-03-20
AI Technical Summary
In automated production with high precision requirements, the grasping accuracy of the robotic arm is insufficient, and replacing the depth camera affects the efficiency of the production line.
A zoom camera is used to obtain image data of different focal lengths, and a deep learning model is used to determine the pose information of the robotic arm and the position information of the target object, thereby controlling the robotic arm to grasp the target object and improve the grasping accuracy.
Without replacing the depth camera, the grabbing accuracy of the robotic arm is improved, and the efficiency and accuracy of the production line are enhanced.
Smart Images

Figure CN116330285B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automation, and in particular to a robot arm control method, a robot arm control device, a robot arm and a storage medium. Background Art
[0002] With the development of automated production, when producing equipment with high precision and high quality requirements, a robotic arm is generally used for installation, and it is necessary to control the robotic arm to perform tasks such as grabbing and transportation. At present, the position information of the target object is obtained through a depth camera to improve the accuracy of grabbing. However, replacing the ordinary camera on the robotic arm with a depth camera will cause significant changes to the production line, affecting production efficiency.
[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of the present invention is to provide a robot arm control method, a robot arm control device, a robot arm and a storage medium, aiming to improve the grasping accuracy of the robot arm without affecting the production line.
[0005] To achieve the above object, the present invention provides a method for controlling a robotic arm, wherein the robotic arm is provided with a zoom camera, and the method for controlling the robotic arm comprises the following steps:
[0006] Acquire image data of a target object captured by the zoom camera at different focal lengths;
[0007] Inputting more than one image data into a first deep learning model, and determining the posture information of the robot arm and the position information of the target object according to an output result of the first deep learning model;
[0008] The robot arm is controlled to grasp the target object according to the posture information and the position information.
[0009] Optionally, the step of inputting more than one image data into a first deep learning model, and determining the posture information of the robot arm and the position information of the target object according to an output result of the first deep learning model comprises:
[0010] Inputting more than one image data into a first deep learning model corresponding to the target object, obtaining first position information of the target object and second position information of a background area outside the target object in each image data, wherein the output result includes more than one first position information and corresponding second position information;
[0011] Segment the corresponding image data according to the first position information and the corresponding second position information to obtain object image data corresponding to each image data and background image data corresponding to the background area;
[0012] The position information is determined based on the more than one object image data, and the posture information is determined based on the more than one background image data.
[0013] Optionally, the position information includes a target distance between the target object and the robotic arm, and the step of determining the position information according to the more than one object image data includes:
[0014] Determine the change gradient of the edge area in the object image data according to the edge detection algorithm;
[0015] Determine the focal length corresponding to the object image data having the largest change gradient as the target focal length;
[0016] The target distance is determined according to the target focal length.
[0017] Optionally, the step of determining the target distance according to the target focal length includes:
[0018] When the first position information is the geometric center of the corresponding image data, determining the target distance according to the correspondence between focal length and distance and the target focal length;
[0019] When the first position information is a position other than the geometric center of the corresponding image data, the target distance is determined according to the target focal length, the corresponding relationship, and the pixel difference between the first position information and the geometric center.
[0020] Optionally, before the step of determining the posture information according to the more than one background image data, the step further includes:
[0021] Acquire preset image data of the background area photographed by the robotic arm at different preset posture distances, and record the first background focal length and the first orientation angle corresponding to each of the preset image data;
[0022] Training a preset deep learning model according to all the preset image data, all the first background focal lengths, and all the first orientation angles to obtain the second deep learning model;
[0023] The step of determining the posture information according to the more than one background image data comprises:
[0024] Inputting the background image data with the highest definition among the more than one background image data into the second deep learning model to obtain the second background focal length and second orientation angle currently corresponding to the robotic arm;
[0025] Determine target image data in more than one preset image data according to the second background focal length and the first background focal length, and determine the preset posture distance corresponding to the target image data as the target posture distance;
[0026] The posture information is determined according to the target posture distance and the second orientation angle.
[0027] Optionally, the step of controlling the robot arm to grasp the target object according to the posture information and the position information includes:
[0028] Determining a grasping mode of the robotic arm according to the posture information, the position information and the size parameters of the robotic arm;
[0029] Determining the rotation amount of the rotary joint of the robotic arm and the extension amount of the robotic arm according to the grasping mode;
[0030] The robotic arm is controlled to grasp a target object according to the rotation amount and the extension amount.
[0031] Optionally, before the step of acquiring the image data of the target object captured by the zoom camera at different focal lengths, the step further includes:
[0032] Determining the depth of field of the zoom camera according to the volume of the target object;
[0033] Determining the number of focal lengths according to the depth of field;
[0034] More than one of the focal lengths is determined based on the number.
[0035] In addition, to achieve the above-mentioned purpose, the present invention further provides a robot arm control device, wherein the robot arm is provided with a zoom camera, and the robot arm control device comprises:
[0036] An acquisition module, used to acquire image data of a target object captured by the zoom camera at different focal lengths;
[0037] A computing module, configured to input more than one image data into a first deep learning model, and determine the posture information of the robotic arm and the position information of the target object according to an output result of the first deep learning model;
[0038] A control module is used to control the robot arm to grasp the target object according to the posture information and the position information.
[0039] In addition, to achieve the above-mentioned objectives, the present invention also provides a robotic arm, which includes: a memory, a processor, and a robotic arm control program stored in the memory and executable on the processor, wherein the robotic arm control program is configured to implement the steps of the robotic arm control method as described in any one of the above items.
[0040] In addition, to achieve the above-mentioned purpose, the present invention also provides a storage medium, on which a robot arm control program is stored, and when the robot arm control program is executed by a processor, the steps of any of the above-mentioned robot arm control methods are implemented.
[0041] The present invention proposes a method for controlling a robotic arm, the method comprising: obtaining image data of a target object captured by the zoom camera at different focal lengths; inputting more than one image data into a first deep learning model, determining the posture information of the robotic arm and the position information of the target object according to the output result of the first deep learning model; and controlling the robotic arm to grasp the target object according to the posture information and the position information. Compared with the current depth camera, by obtaining image data of different focal lengths and inputting them into the first deep learning model, the posture information and the position information corresponding to the image data at the optimal focal length are determined according to the output result of the first deep learning model, thereby making the obtained posture information and the position information more accurate on the basis of the original ordinary camera, and improving the grasping accuracy of the robotic arm without the need to replace it with a depth camera. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a schematic diagram of the structure of a mechanical arm in a hardware operating environment involved in an embodiment of the present invention;
[0043] Figure 2 It is a schematic flow chart of a first embodiment of a method for controlling a robot arm according to the present invention;
[0044] Figure 3 is a flow chart of a second embodiment of a method for controlling a robotic arm according to the present invention;
[0045] Figure 4 Schematic diagram of the flow of the third embodiment of the robot arm control method of the present invention;
[0046] Figure 5 4 is a flow chart of a fifth embodiment of a robot arm control method according to the present invention.
[0047] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0048] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0049] Reference Figure 1 , Figure 1 A schematic diagram of the mechanical arm structure of the hardware operating environment involved in the embodiment of the present invention.
[0050] like Figure 1 As shown, the robot arm may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a zoom camera 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The zoom camera 1003 may include a camera and a lens module, and the zoom camera 1003 may optionally be connected to the communication bus through a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
[0051] In addition, one end of the robotic arm may also include: a robotic gripper, a suction cup, etc.
[0052] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation of the robot arm, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0053] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module and a robotic arm control program.
[0054] exist Figure 1 In the robotic arm shown, the network interface 1004 is mainly used for data communication with other devices; the zoom camera 1003 is mainly used to obtain image data; the processor 1001 and the memory 1005 in the robotic arm of the present invention can be set in the robotic arm, and the robotic arm calls the robotic arm control program stored in the memory 1005 through the processor 1001, and executes the robotic arm control method provided by an embodiment of the present invention.
[0055] The embodiment of the present invention provides a method for controlling a mechanical arm, referring to Figure 2 , Figure 2It is a flow chart of a first embodiment of a robot arm control method of the present invention.
[0056] In this embodiment, the robot arm control method includes:
[0057] Step S10, acquiring image data of the target object captured by the zoom camera at different focal lengths;
[0058] The zoom camera is controlled to determine a plurality of shooting focal lengths in its adjustable focal lengths. When the zoom camera is adjusted to the shooting focal length, image data of the target object is collected, and the image data collected by the zoom camera at different focal lengths is obtained. And in the process of shooting the image data, the robotic arm is kept in the same posture. In this embodiment, the ratio of the pixels occupied by the target object in the image data to the total number of pixels in the image data is generally made not to exceed a preset pixel ratio. In some cases, the ratio of the pixels occupied by the target object in the image data to the total number of pixels in the image data can be made to exceed the preset pixel ratio, for example: when the robotic arm is about to grasp the target object, or when the distance between the robotic arm and the target object is less than a preset distance.
[0059] Step S20, inputting more than one image data into a first deep learning model, and determining the posture information of the robot arm and the position information of the target object according to the output result of the first deep learning model;
[0060] The first deep learning model here is a deep learning model obtained by training the image of the target object, and the output result here is the position information of the target object and the position information of the background area other than the target object. The algorithm of the first deep learning model here can be: Convolutional Neural Networks (CNN). According to the first deep learning model, the imaging position of the target object in the image data can be determined. Specifically, the image data collected by all the zoom cameras at different focal lengths are respectively input into the first deep learning model, and the posture information of the robot arm and the position information of the target object are determined according to the output result of the first deep learning model. Since there is image data in the image data whose focus is not on the target object, there is a situation where the first deep learning model cannot recognize the target object.
[0061] Step S30: Controlling the robotic arm to grasp the target object according to the posture information and the position information.
[0062] The posture information here refers to the position information of the robot arm, such as the pitch of the robot arm, the direction of the robot arm, and the extension and retraction of the robot arm. The position information here refers to the information of the position of the target object. According to the posture information and the position information, the robot arm is controlled to move close to the target object, and the gripper is controlled to grasp the target object.
[0063] In this embodiment, compared with the current depth camera, image data with different focal lengths are obtained and input into the first deep learning model, and the posture information and the position information corresponding to the image data at the optimal focal length are determined according to the output result of the first deep learning model. Therefore, on the basis of the original ordinary camera, the obtained posture information and the position information are more accurate, and the accuracy of the robot arm grasping is improved without the need to replace it with a depth camera.
[0064] Further, based on the first embodiment, a second embodiment of the robot arm control method of the present invention is proposed. In this embodiment, referring to Figure 3 The step of inputting more than one image data into a first deep learning model and determining the posture information of the robot arm and the position information of the target object according to the output result of the first deep learning model comprises:
[0065] Step S21, inputting more than one image data into a first deep learning model corresponding to the target object, obtaining first position information of the target object and second position information of a background area outside the target object in each image data, wherein the output result includes more than one first position information and corresponding second position information;
[0066] Input more than one of the image data into the first deep learning model corresponding to the target object, and the first deep learning model determines the corresponding occupied pixels of the target object in the image data, thereby determining the first position information and the second position information. The output result includes the first position information and the second position information corresponding to each of the image data.
[0067] Step S22, segmenting the corresponding image data according to the first position information and the corresponding second position information to obtain object image data corresponding to each image data and background image data corresponding to the background area;
[0068] The object image data here refers to the pixel value of the position corresponding to the first position information in the image data, and the background image data here refers to the pixel value of the position corresponding to the second position information in the image data. The image data is segmented according to the first position information and the corresponding second position information to obtain the object image data and background image data corresponding to each of the image data.
[0069] Step S23: determining the position information according to the more than one object image data, and determining the posture information according to the more than one background image data.
[0070] The position information is determined by performing image processing on the more than one object image data to determine the focal length corresponding to the object image data with the highest definition among the more than one object image data, and the posture information is determined according to the more than one background image data. In other embodiments, since the posture of the robotic arm is the same during the shooting process. The first position information and the second position information corresponding to one of the image data can be used to update the first position information and the second position information corresponding to all the image data, and the first position information and the second position information corresponding to the object image data with the highest definition among the more than one object image data are used as the first position information and the second position information of all the image information respectively, and the step of segmenting the corresponding image data according to the first position information and the corresponding second position information is returned to obtain the object image data corresponding to each image data and the background image data corresponding to the background area.
[0071] In this embodiment, the image data is segmented by the first position information and the second position information to determine the object image data and the background image data, and the position information is determined based on the more than one object image data, and the posture information is determined based on the more than one background image data, thereby improving the accuracy of the robotic arm.
[0072] Further, based on the second embodiment, a third embodiment of the robot arm control method of the present invention is proposed. In this embodiment, referring to Figure 4 , the position information includes a target distance between the target object and the robotic arm, and the step of determining the position information based on the more than one object image data includes:
[0073] Step S231, determining a change gradient of an edge region in the object image data according to an edge detection algorithm;
[0074] The edge region here includes the region of the contour of the target object in the object image data. The pixel value of each pixel position in the object image data is obtained, and the first-order derivative is solved based on the pixel value to obtain the change gradient of the edge region.
[0075] Step S232, determining the focal length corresponding to the object image data having the largest change gradient as the target focal length;
[0076] When the focal length is not on the target object, the outline of the target object cannot be clearly shown in the object image data. Specifically, in this embodiment, the object image data with the largest change gradient can be determined by calculating the sum of the absolute values of the first-order derivatives of each pixel in the edge area as the gradient sum, comparing the gradient sums corresponding to all the object image data, and determining the focal length corresponding to the object image data corresponding to the maximum gradient sum as the target focal length.
[0077] Step S233, determining the target distance according to the target focal length.
[0078] Here, the target distance between the target object and the robotic arm is determined based on the correspondence between focal length and distance and the target focal length. In other embodiments, by comparing the pixel brightness value of the pixel with the lowest brightness in each of the object image data, the focal length corresponding to the object image data where the pixel with the lowest pixel brightness value is located is determined as the target focal length, and the target distance is determined based on the target focal length. Specifically, the formula for calculating the target distance can be:
[0079] u=1÷(1÷f-1÷v)
[0080] Wherein, u is the target distance, f is the target focal length, and v is the distance between the lens in the zoom camera lens and the camera photosensitive element, i.e., the image distance. Unlike the general method of adjusting the focal length first and then adjusting the image distance to achieve a clear image during shooting, in this embodiment, the image distance is generally fixed, but needs to be greater than one times the focal length. Therefore, it can generally be set to be equal to or greater than the maximum adjustable focal length of the zoom camera. In some embodiments, since the zoom camera does not need to reach the maximum focal length when the target object is close, the image distance can be determined according to the actual shooting environment.
[0081] In addition, in other embodiments, all the object image data can be processed according to the super-resolution reconstruction algorithm to obtain a processed image with higher resolution. Thereby avoiding the problem of low imaging quality caused by the low number of camera pixels. After obtaining the processed image with higher resolution, the focal length corresponding to the object processed image with the highest clarity among all processed images is determined by the user or other recognition methods as the target focal length. The super-resolution reconstruction algorithm here includes: super-resolution reconstruction based on interpolation, super-resolution reconstruction based on degradation model, and super-resolution reconstruction based on deep learning method, etc. Since it is used to reconstruct a low-resolution image in this application, a reconstruction method based on a single low-resolution image (Single Image Super-Resolution, SISR) is generally used to process all the object image data. Through the super-resolution reconstruction algorithm, the technical solution of this embodiment can be implemented even on some cameras with low pixel numbers and low imaging quality.
[0082] In this embodiment, by comparing the change gradients, the focal length corresponding to the object image data with the largest change gradient is determined as the target focal length, and the focal length corresponding to the object image data with the best imaging quality is determined as the target focal length, resulting in a higher accuracy of the target focal length, thereby improving the accuracy of the target distance, thereby improving the accuracy of the robotic arm.
[0083] Further, based on the third embodiment, a fourth embodiment of the robot arm control method of the present invention is proposed. In this embodiment, the step of determining the target distance according to the target focal length includes:
[0084] When the first position information is the geometric center of the corresponding image data, determining the target distance according to the correspondence between focal length and distance and the target focal length;
[0085] When the first position information is a position other than the geometric center of the corresponding image data, the target distance is determined according to the target focal length, the corresponding relationship, and the pixel difference between the first position information and the geometric center.
[0086] In this embodiment, specifically, the first pixel position of the first geometric center corresponding to the target object in the first position information is compared with the second pixel position of the geometric center of the image data. When the first pixel position is equal to the second pixel position, the target distance is determined according to the correspondence between the focal length and the distance and the target focal length. When the first pixel position is not equal to the second pixel position, the actual deviation distance between the geometric center point and the target object is determined according to the actual length of the two ends of the target object and the pixel distance corresponding to the two ends of the target object in the object image data and the pixel difference, and the target distance is determined according to the correspondence between the target focal length, the actual distance of the geometric center and the actual deviation distance.
[0087] In this embodiment, by judging whether the first position information is the geometric center of the corresponding image data, a method for calculating the target distance is determined, thereby improving the accuracy of calculating the target distance and further improving the precision of the robotic arm.
[0088] Further, based on the above second to fourth embodiments, a fifth embodiment of the robot arm control method of the present invention is proposed, referring to Figure 5 In this embodiment, before the step of determining the posture information according to the more than one background image data, it also includes:
[0089] Step S2301, obtaining preset image data of a background area photographed by the robot arm at different preset posture distances, and recording a first background focal length and a first orientation angle corresponding to each of the preset image data;
[0090] The preset posture distance here is the distance between the robot arm in the current posture and the background area being photographed. The first background focal length here refers to the focal length of the zoom camera when the focal length of the zoom camera is adjusted to make the background area clearest during the process of photographing the background area at the preset posture distance. For example: when the clarity of the background wall in the background area is the highest, the focal length of the zoom camera is determined to be the first background focal length; when the clarity of the object occupying the largest area in the background area is the highest, the focal length of the zoom camera is determined to be the first background focal length; the first orientation angle here refers to the angle of the gripping point of the robot arm. The zoom camera in this embodiment is the same as the first orientation angle.
[0091] Step S2302: training a preset deep learning model according to all the preset image data, all the first background focal lengths, and all the first orientation angles to obtain the second deep learning model;
[0092] Each of the preset image data is used as a training input, and the preset image data corresponding to the first background focal length and the first orientation angle are used as training outputs to form a set of training data in a training set. The preset deep learning model is trained according to the training set to obtain the second deep learning model.
[0093] The step of determining the posture information according to the more than one background image data comprises:
[0094] Step S2303, inputting the background image data with the highest definition among the more than one background image data into the second deep learning model to obtain the second background focal length and the second orientation angle currently corresponding to the robotic arm;
[0095] Determine the background image data with the highest definition among all the background image data as the data for inputting into the second deep learning model. Specifically, the definition may be the sum of the absolute values of the first-order derivatives of each pixel in the background image data. It may also be other parameters of the background image data. Obtain the output of the second deep learning model to obtain the second background focal length and the second orientation angle currently corresponding to the robotic arm.
[0096] Step S2304, determining target image data in more than one preset image data according to the second background focal length and the first background focal length, and determining the preset posture distance corresponding to the target image data as the target posture distance;
[0097] In this embodiment, the values of the first background focal length and the second background focal length are compared to determine target image data in more than one preset image data, and the first orientation angle corresponding to the target image data is compared with the second orientation angle to verify whether the target image is correct. Specifically, when the first orientation angle corresponding to the target image data is equal to the second orientation angle, it is determined that the target image data is verified correctly. The preset posture distance corresponding to the target image data is the target posture distance.
[0098] Step S2305: determining the posture information according to the target posture distance and the second orientation angle.
[0099] Specifically, taking a robotic arm including two sub-arms as an example, the two ends of the first sub-arm are respectively connected to the second sub-arm and the robotic arm base, and the two ends of the second sub-arm are respectively connected to the gripper and the first sub-arm. The position and orientation of the second sub-arm in space are determined according to the target posture distance and the second orientation angle, the joint position where the second sub-arm is connected to the first sub-arm is determined according to the size parameters of the second sub-arm, and the position and orientation of the first sub-arm in space are determined according to the joint position and the base. Thus, the posture information of the robotic arm is determined. For a robotic arm including more than two sub-arms, the number of zoom cameras can be determined according to the number of sub-arms. And the zoom cameras are correspondingly set on the sub-arms. In other embodiments, grids corresponding to stripes of different colors are set at different positions in the background area, the second orientation angle of the robotic arm is determined according to the color and stripes of the grid in the background image data, the target posture distance is determined according to the number of pixels of the background image data occupied by the grid, and the posture information is determined according to the target posture distance and the second orientation angle.
[0100] In this embodiment, by inputting the background image data into the second deep learning model, the second background focal length and the second orientation angle are obtained, which improves the accuracy of determining the target posture distance, thereby improving the accuracy of the determined posture information, and further improving the accuracy of the robotic arm.
[0101] Further, based on any of the above embodiments, a sixth embodiment of the robot arm control method of the present invention is proposed. In this embodiment, the step of controlling the robot arm to grasp the target object according to the posture information and the position information includes:
[0102] Determining a grasping mode of the robotic arm according to the posture information, the position information and the size parameters of the robotic arm;
[0103] Determining the rotation amount of the rotary joint of the robotic arm and the extension amount of the robotic arm according to the grasping mode;
[0104] The robotic arm is controlled to grasp a target object according to the rotation amount and the extension amount.
[0105] The direction of grasping the object is determined according to the posture information, the position information and the size parameters of the robotic arm. Specifically, for example, when the posture information and the size parameters of the robotic arm can only reach the first side of the position information, it is determined to grasp the target object on the first side. The rotation amount of the rotary joint of the robotic arm and the extension amount of the robotic arm when the gripper is moved to the first side are determined, and the robotic arm is controlled to grasp the target object according to the rotation amount and the extension amount. In other embodiments, the posture information and the position information determine the minimum movement mode for the robotic arm to move to grasp the target object, and the robotic arm is controlled to move to a position adjacent to the position information according to the minimum movement mode, and grasp the target object.
[0106] In this embodiment, the grasping method is determined by the target, and the rotation amount of the rotary joint of the robotic arm and the extension amount of the robotic arm are determined, thereby improving the grasping efficiency in the process of grasping the target object.
[0107] Further, based on any of the above embodiments, a sixth embodiment of the robot arm control method of the present invention is proposed. In this embodiment, before the step of obtaining the image data of the target object captured by the zoom camera at different focal lengths, it also includes:
[0108] Determining the depth of field of the zoom camera according to the volume of the target object;
[0109] Determining the number of focal lengths according to the depth of field;
[0110] More than one of the focal lengths is determined based on the number.
[0111] In addition to forming a clear image at the focal plane during the shooting process, a clear image can also be formed in the area between the foreground depth of field and the back depth of field. Therefore, by determining the depth of field of the zoom camera according to the volume of the target object, it can be determined that a clear image can be formed at each position of the target object. Specifically, the size of the aperture can be adjusted so that the depth of field shot at different focal lengths is the same, and the number of the focal lengths is determined according to the depth of field. As the depth of field decreases, the number of the focal lengths increases. More than one focal length is set according to the number of focal lengths. In other embodiments, more than one focal length is determined according to the zoom range of the zoom camera.
[0112] In this embodiment, the depth of field of the zoom camera is determined by the volume of the target object, thereby determining the appropriate number of focal lengths, avoiding setting too many focal lengths, thereby reducing the number and time of capturing the image data, and thus improving the efficiency of the robotic arm in grasping the target object.
[0113] In addition, an embodiment of the present invention further provides a robot arm control device, wherein the robot arm is provided with a zoom camera, and the robot arm control device comprises:
[0114] An acquisition module, used to acquire image data of a target object captured by the zoom camera at different focal lengths;
[0115] A computing module, configured to input more than one image data into a first deep learning model, and determine the posture information of the robotic arm and the position information of the target object according to an output result of the first deep learning model;
[0116] A control module is used to control the robot arm to grasp the target object according to the posture information and the position information.
[0117] In addition, an embodiment of the present invention further proposes a storage medium, on which a robot arm control program is stored. When the robot arm control program is executed by a processor, the steps of any of the above-mentioned embodiments of the robot arm control method are implemented.
[0118] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0119] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0120] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0121] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A robot arm control method, characterized in that: The mechanical arm is provided with a zoom camera, and the mechanical arm control method comprises the following steps: Acquire image data of a target object captured by the zoom camera at different focal lengths; Input more than one image data into a first deep learning model, and determine the posture information of the robotic arm and the position information of the target object corresponding to the image data at the optimal focal length according to the output result of the first deep learning model, including: input more than one image data into the first deep learning model corresponding to the target object, obtain the first position information of the target object and the second position information of the background area outside the target object in each image data, and the output result includes more than one first position information and the corresponding second position information; segment the corresponding image data according to the first position information and the corresponding second position information to obtain the object image data corresponding to each image data and the background image data corresponding to the background area; determine the position information according to more than one object image data, and determine the posture information according to more than one background image data; Wherein, before the step of determining the posture information according to the more than one background image data, it also includes: obtaining preset image data of the background area photographed by the robot arm at different preset posture distances, and recording the first background focal length and the first orientation angle corresponding to each of the preset image data; training a preset deep learning model according to all the preset image data, all the first background focal lengths and all the first orientation angles to obtain a second deep learning model; The step of determining the posture information according to the more than one background image data comprises: inputting the background image data with the highest definition among the more than one background image data into the second deep learning model to obtain the second background focal length and the second orientation angle currently corresponding to the robotic arm; determining the target image data among the more than one preset image data according to the second background focal length and the first background focal length, and determining the preset posture distance corresponding to the target image data as the target posture distance; determining the posture information according to the target posture distance and the second orientation angle; The robot arm is controlled to grasp the target object according to the posture information and the position information.
2. The robot arm control method according to claim 1, characterized in that: The position information includes a target distance between the target object and the robotic arm, and the step of determining the position information based on the more than one object image data includes: Determine the change gradient of the edge area in the object image data according to the edge detection algorithm; Determine the focal length corresponding to the object image data having the largest change gradient as the target focal length; The target distance is determined according to the target focal length.
3. The robot arm control method according to claim 2, characterized in that: The step of determining the target distance according to the target focal length comprises: When the first position information is the geometric center of the corresponding image data, determining the target distance according to the correspondence between focal length and distance and the target focal length; When the first position information is a position other than the geometric center of the corresponding image data, the target distance is determined according to the target focal length, the corresponding relationship, and the pixel difference between the first position information and the geometric center.
4. The robot arm control method according to claim 1, characterized in that: The step of controlling the mechanical arm to grasp the target object according to the posture information and the position information comprises: Determining a grasping mode of the robotic arm according to the posture information, the position information and the size parameters of the robotic arm; Determining the rotation amount of the rotary joint of the robotic arm and the extension amount of the robotic arm according to the grasping mode; The robotic arm is controlled to grasp a target object according to the rotation amount and the extension amount.
5. The robot arm control method according to any one of claims 1 to 4, characterized in that: Before the step of obtaining the image data of the target object collected by the zoom camera at different focal lengths, the method further includes: Determining the depth of field of the zoom camera according to the volume of the target object; Determining the number of focal lengths according to the depth of field; More than one of the focal lengths is determined based on the number.
6. A robot arm control device, characterized in that: The mechanical arm is provided with a zoom camera, and the mechanical arm control device comprises: An acquisition module, used to acquire image data of a target object captured by the zoom camera at different focal lengths; A computing module, used to input more than one image data into a first deep learning model, and determine the posture information of the robotic arm and the position information of the target object corresponding to the image data at the optimal focal length according to the output result of the first deep learning model, including: inputting more than one image data into the first deep learning model corresponding to the target object, obtaining the first position information of the target object in each image data and the second position information of the background area outside the target object, the output result including more than one first position information and the corresponding second position information; segmenting the corresponding image data according to the first position information and the corresponding second position information to obtain the object image data corresponding to each image data and the background image data corresponding to the background area; determining the position information according to more than one object image data, and determining the posture information according to more than one background image data; wherein, determining the position information according to the more than one background image data Before the step of determining the posture information, it also includes: obtaining preset image data of the background area photographed by the robotic arm at different preset posture distances, and recording the first background focal length and the first orientation angle corresponding to each of the preset image data; training a preset deep learning model according to all the preset image data, all the first background focal lengths and all the first orientation angles to obtain a second deep learning model; the step of determining the posture information according to the more than one background image data includes: inputting the background image data with the highest clarity among the more than one background image data into the second deep learning model to obtain the second background focal length and the second orientation angle currently corresponding to the robotic arm; determining the target image data among the more than one preset image data according to the second background focal length and the first background focal length, and determining the preset posture distance corresponding to the target image data as the target posture distance; determining the posture information according to the target posture distance and the second orientation angle; A control module is used to control the robot arm to grasp the target object according to the posture information and the position information.
7. A robotic arm, characterized in that: The robot arm comprises: a memory, a processor, and a robot arm control program stored in the memory and executable on the processor, wherein the robot arm control program is configured to implement the steps of the robot arm control method according to any one of claims 1 to 5.
8. A storage medium, characterized in that: The storage medium stores a robot control program, and when the robot control program is executed by the processor, the steps of the robot control method according to any one of claims 1 to 5 are implemented.
