Method, device, electronic device and storage medium for determining position of robotic arm
By obtaining the position parameters of the robotic arm and the image acquisition device, determining their coordinate system relationship and performing position transformation processing, the problem of cumulative error and low accuracy in determining the robotic arm position is solved, and high-precision robotic arm position determination is achieved.
Patent Information
- Application Number
- CN202110757391.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-05
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-07-05
AI Technical Summary
In the existing technology, the position determination method of the robotic arm relies on multiple cameras to obtain the position of the calibration plate. There are cumulative errors and the accuracy of single attitude acquisition is poor, resulting in a huge workload and low accuracy when detecting a large number of points.
By obtaining the position parameters of the robot arm and the image acquisition device, determining its relationship with the intermediate coordinate system, performing position transformation processing, and obtaining the transformation relationship parameters, and then accurately determining the position of the robot arm, reducing cumulative errors and improving the accuracy of single attitude acquisition. Spend.
It achieves accurate determination of the position of the robotic arm, reduces cumulative errors, improves the accuracy of single attitude acquisition, and facilitates users to use the robotic arm.
Smart Images

Figure CN115582829B
Abstract
Description
Technical Field
[0001] The present invention relates to visual information processing technology, and in particular to a method, device, electronic equipment, storage medium and robot for determining the position of a robotic arm. Background Art
[0002] In the operation of a robotic arm based on a visual algorithm, there is usually a need to obtain the coordinate system transformation relationship between the visual sensor device and the robotic arm. The target position obtained by the visual sensor device can be converted to the robotic arm coordinate system through the coordinate system transformation relationship. Since the number of points that the robotic arm can reach in its motion space is theoretically infinite, the current positioning accuracy detection device can only detect some special points or limited points. When a large number of points need to be detected, the workload is very huge; in traditional technology, when hand-eye calibration is performed, the robotic arm grasps the calibration plate, moves the robotic arm multiple times, and the camera obtains the position of the calibration plate to complete the calibration. This method relies on the accuracy of multiple cameras obtaining the position of the calibration plate, and there is a cumulative error. At the same time, the accuracy of the single posture acquisition effect is poor. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a method, device, electronic device, storage medium and robot for determining the position of a robotic arm, which can accurately determine the position of the robotic arm, reduce cumulative errors, and improve the accuracy of a single posture acquisition effect, so that users can use the robotic arm more conveniently.
[0004] The technical solution of the embodiment of the present invention is achieved as follows:
[0005] An embodiment of the present invention provides a method for determining the position of a robot arm, comprising:
[0006] Obtaining position parameters of the robotic arm;
[0007] Determining a first positional relationship between the robotic arm and an intermediate coordinate system based on a position parameter of the robotic arm;
[0008] Acquiring position parameters of the image acquisition device;
[0009] Determining a second positional relationship between the image acquisition device and the intermediate coordinate system based on the position parameters of the image acquisition device;
[0010] Performing position transformation processing on the first position relationship and the second position relationship to obtain transformation relationship parameters of the first position relationship and the second position relationship;
[0011] Based on the first position relationship and the second position relationship conversion relationship parameters, the position of the robotic arm is determined.
[0012] An embodiment of the present invention further provides a device for determining the position of a robot arm, comprising:
[0013] An information transmission module, used to obtain the position parameters of the robotic arm;
[0014] An information processing module, used for determining a first positional relationship between the robotic arm and the intermediate coordinate system based on the position parameters of the robotic arm;
[0015] The information transmission module is used to obtain the position parameters of the image acquisition device;
[0016] The information processing module is used to determine a second positional relationship between the image acquisition device and the intermediate coordinate system based on the position parameters of the image acquisition device;
[0017] The information processing module is used to perform position transformation processing on the first position relationship and the second position relationship to obtain conversion relationship parameters of the first position relationship and the second position relationship;
[0018] The information processing module is used to determine the position of the robotic arm based on the first position relationship and the second position relationship conversion relationship parameters.
[0019] In the above scheme,
[0020] The information processing module is used to configure a calibration tip at the end of the robotic arm based on the position parameters of the robotic arm;
[0021] The information processing module is used to configure a first calibration point, a second calibration point, a third calibration point and a fourth calibration point in the calibration plate corresponding to the robotic arm;
[0022] The information processing module is used to determine the first calibration point, the second calibration point, the third calibration point and the fourth calibration point, and a set of first calibration point coordinates in the calibration plate coordinate system of the calibration plate;
[0023] The information processing module is used to adjust the calibration tip to the corresponding position of different calibration points of the calibration plate;
[0024] The information processing module is used to determine, according to corresponding positions of different calibration points on the calibration plate, a set of second calibration point coordinates of the first calibration point, the second calibration point, the third calibration point and the fourth calibration point in a mechanical arm base coordinate system corresponding to the mechanical arm;
[0025] The information processing module is used to determine a transformation matrix corresponding to the first positional relationship based on the set of the first calibration point coordinates and the set of the second calibration point coordinates;
[0026] The information processing module is used to determine the first position relationship between the robotic arm and the intermediate coordinate system through a transformation matrix corresponding to the first position relationship.
[0027] In the above scheme,
[0028] The information processing module is used to determine the first three-dimensional center point and the second three-dimensional center point of different calibration point matrices based on the set of the first calibration point coordinates and the set of the second calibration point coordinates;
[0029] The information processing module is used to perform secondary centralization processing on the calibration points in the calibration plate to obtain secondary centralization processing results;
[0030] The information processing module is used to perform singular value decomposition processing on the secondary centralization processing result to obtain a rotation matrix;
[0031] The information processing module is used to determine a transfer matrix according to the first three-dimensional center point, the second three-dimensional center point and the rotation matrix;
[0032] The information processing module is used to perform matrix combination processing on the rotation matrix and the transfer matrix to obtain a transformation matrix corresponding to the first position relationship.
[0033] In the above scheme,
[0034] The information processing module is used to determine the type of the calibration plate;
[0035] The information processing module is used to determine the side length parameter of the unit calibration block in the type of the calibration plate based on the type of the calibration plate;
[0036] The information processing module is used to adjust the set of the first calibration point coordinates according to the side length parameter of the unit calibration block.
[0037] In the above scheme,
[0038] The information processing module is used to collect images of the use environment of the mechanical equipment through the image acquisition device;
[0039] The information processing module is used to determine the side length parameter of the unit calibration block in the type of the calibration plate;
[0040] The information processing module is used to determine the spatial posture of the calibration plate based on the image in the use environment of the mechanical equipment and the pixel difference of the side length parameter of the unit calibration block;
[0041] The information processing module is used to determine the position parameters of the image acquisition device according to the spatial posture of the calibration plate;
[0042] The information processing module is used to determine the image acquisition matrix according to the spatial posture of the calibration plate and the position parameters of the image acquisition device, and determine the second position relationship between the image acquisition device and the intermediate coordinate system according to the image acquisition matrix.
[0043] In the above scheme,
[0044] The information processing module is used to obtain the target position of the robotic arm;
[0045] The information processing module is configured to compare the position of the robotic arm with the target position when determining the position of the robotic arm based on the first position relationship and the second position relationship conversion relationship parameter;
[0046] The information processing module is used to adjust the position of the robotic arm when the coordinate difference between the position of the robotic arm and the target position exceeds a threshold.
[0047] An embodiment of the present invention further provides an electronic device, including:
[0048] A memory for storing executable instructions;
[0049] The processor is used to implement the preceding method for determining the position of the robotic arm when running the executable instructions stored in the memory, or to implement the preceding method for determining the position of the robotic arm.
[0050] An embodiment of the present invention also provides a computer-readable storage medium storing executable instructions, characterized in that when the executable instructions are executed by a processor, the preceding method for determining the position of a robotic arm is implemented, or the preceding method for determining the position of a robotic arm is implemented.
[0051] An embodiment of the present invention further provides a robot, comprising:
[0052] Mechanical equipment, the mechanical equipment includes a mechanical arm and an image acquisition device, which is used to receive instructions from a processor to implement the position determination method of the mechanical arm in the previous sequence
[0053] A memory for storing executable instructions;
[0054] The processor is used to implement the preceding method for determining the position of the robotic arm when running the executable instructions stored in the memory, or to implement the preceding method for determining the position of the robotic arm.
[0055] The embodiments of the present invention have the following beneficial effects:
[0056] The present invention obtains the position parameters of the robotic arm; determines a first position relationship between the robotic arm and an intermediate coordinate system based on the position parameters of the robotic arm; obtains the position parameters of the image acquisition device; determines a second position relationship between the image acquisition device and the intermediate coordinate system based on the position parameters of the image acquisition device; performs position transformation processing on the first position relationship and the second position relationship to obtain conversion relationship parameters of the first position relationship and the second position relationship; and determines the position of the robotic arm based on the conversion relationship parameters of the first position relationship and the second position relationship. Thus, the position of the robotic arm can be accurately determined, the cumulative error can be reduced, and the accuracy of a single posture acquisition effect can be improved, so that users can use the robotic arm more conveniently. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 A schematic diagram of a use environment of a method for determining a position of a robotic arm provided by an embodiment of the present invention;
[0058] Figure 2 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;
[0059] Figure 3 An optional flow chart of a method for determining the position of a robotic arm provided in an embodiment of the present invention;
[0060] Figure 4 An optional flow chart of a method for determining the position of a robotic arm provided in an embodiment of the present invention;
[0061] Figure 5 Schematic diagram of the calibration plate processing process in an embodiment of the present invention;
[0062] Figure 6 An optional flowchart of a method for determining the position of a robotic arm provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present invention. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.
[0064] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0065] Before further describing the embodiments of the present invention in detail, the nouns and terms involved in the embodiments of the present invention are described. The nouns and terms involved in the embodiments of the present invention are subject to the following interpretations.
[0066] 1) In response, it is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed may be in real time or have a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations executed are executed.
[0067] 2) Calibration Target: In machine vision, image measurement, photogrammetry, 3D reconstruction and other applications, it is necessary to establish a geometric model of camera imaging in order to correct lens distortion, determine the conversion relationship between physical size and pixels, and determine the relationship between the 3D geometric position of a point on the surface of a spatial object and its corresponding point in the image.
[0068] By shooting a flat plate with a fixed-pitch pattern array with a camera and calculating it with a calibration algorithm, the geometric model of the camera can be obtained, thereby obtaining high-precision measurement and reconstruction results. The flat plate with a fixed-pitch pattern array is the calibration plate.
[0069] 3) Client, a carrier that implements specific functions in a terminal, for example, a mobile client (APP) is a carrier of specific functions in a mobile terminal, such as a program that performs the function of user gesture recognition.
[0070] 4) Singular Value Decomposition (SVD) is an important matrix decomposition in linear algebra, which is insensitive to matrix perturbations.
[0071] In introducing the method for determining the position of the robot arm provided in this application, combined with Figure 1 The implementation environment shown in the figure briefly introduces the defects in the traditional technology. In the traditional technology, the calibration plate is fixed at the end of the robot arm, and the calibration plate is photographed multiple times by the camera to obtain the position of the camera to the calibration plate. At the same time, the position transformation relationship from the robot arm base to the end of the robot arm is obtained by using the internal interface of the robot arm, and finally the position transformation relationship from the camera to the robot arm is calculated. However, the method of using the camera to obtain the position of the calibration plate will cause errors due to inaccurate calibration of the camera internal parameters, changes in external lighting, and the calibration plate is not in the center of the image, which will lead to poor calibration effect of the overall system.
[0072] Figure 1A schematic diagram of a use scenario of the method for determining the position of a robot arm provided in an embodiment of the present invention, wherein the method for determining the position of a robot arm provided in the present application can assist mechanical equipment in a production line to perform different tasks through a robot arm, see Figure 1 , the terminal (including terminal 10-1 and terminal 10-2) is provided with corresponding clients capable of executing different functions, wherein the corresponding clients are terminals (including terminal 10-1 and terminal 10-2) that obtain different target locations and corresponding execution instructions from the corresponding server 200 through network 300, and control the mechanical equipment 400 to perform different tasks. The terminal is connected to the server 200 through network 300, and the network 300 can be a wide area network or a local area network, or a combination of the two, and a wireless link is used to realize data transmission, wherein the corresponding task types obtained by the terminal (including terminal 10-1 and terminal 10-2) from the corresponding server 200 through network 300 can be the same or different, for example: the terminal (including terminal 10-1 and terminal 10-2) can obtain cargo handling tasks from the corresponding server 200 through network 300, control the robot to complete a preset standard grasping and placing action group, and realize the robot's function of grasping and placing objects. The camera is installed on the part outside the robot arm, fixed relatively to the base (world coordinate system) of the robot, and does not move with the movement of the robot. The method for determining the position of the robot arm provided in the present application can be implemented in the following steps: obtaining the position parameters of the robot arm; determining the first position relationship between the robot arm and the intermediate coordinate system based on the position parameters of the robot arm; obtaining the position parameters of the image acquisition device; determining the second position relationship between the image acquisition device and the intermediate coordinate system based on the position parameters of the image acquisition device; performing position transformation processing on the first position relationship and the second position relationship to obtain conversion relationship parameters of the first position relationship and the second position relationship; determining the position of the robot arm based on the conversion relationship parameters of the first position relationship and the second position relationship.
[0073] Among them, the embodiments of the present invention can be implemented in combination with cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software and network in a wide area network or a local area network to realize data calculation, storage, processing and sharing. It can also be understood as a general term for network technology, information technology, integration technology, management platform technology and application technology based on cloud computing business model applications. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites, so cloud technology needs to be supported by cloud computing.
[0074] It should be noted that cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called the "cloud". From the user's point of view, the resources in the "cloud" can be infinitely expanded, and can be obtained at any time, used on demand, expanded at any time, and paid for by use. As a basic capability provider for cloud computing, a cloud computing resource pool platform will be established, referred to as a cloud platform, generally referred to as Infrastructure as a Service (IaaS), and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (which can be virtualized machines, including operating systems), storage devices and network devices.
[0075] Combined with the embodiment Figure 1 As shown, the target object determination method provided in the embodiment of the present invention can be implemented by corresponding cloud devices, for example: the terminal (including the terminal 10-1 and the terminal 10-2) is connected to the server 200 located in the cloud through the network 300, and the network 300 can be a wide area network or a local area network, or a combination of the two. It is worth noting that the server 200 can be a physical device or a virtualized device.
[0076] Among them, the cloud device can also save the position parameters of the image acquisition device, the first position relationship and the second position relationship conversion relationship parameters and the position of the robotic arm, so as to facilitate timely retrieval of the position parameters saved by the cloud device in different application environments and save the adjustment time of the robotic arm.
[0077] Specifically, in combination with the above embodiment Figure 1 As shown, server 200 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application does not limit this.
[0078] The structure of the electronic device of the embodiment of the present invention is described in detail below. The electronic device can be implemented in various forms, such as a dedicated robot with a position adjustment function, or a mechanical arm with a position adjustment function, such as the aforementioned Figure 1 Server 200 in. Figure 2The schematic diagram of the structure of the electronic device provided by the embodiment of the present invention can be understood as follows: Figure 2 Only exemplary structures of electronic devices are shown, not all structures, and may be implemented as needed. Figure 2 Partial or complete structure shown.
[0079] The electronic device provided in the embodiment of the present invention includes: at least one processor 201, a memory 202, a user interface 203 and at least one network interface 204. The various components in the electronic device 20 are coupled together through a bus system 205. It can be understood that the bus system 205 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 205 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 205 is not used in the following examples. Figure 2 Various buses are labeled as bus system 205 .
[0080] The user interface 203 may include a display, a keyboard, a mouse, a trackball, a click wheel, keys, buttons, a touch pad or a touch screen.
[0081] It is understood that the memory 202 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. The memory 202 in the embodiment of the present invention can store data to support the operation of the terminal (such as 10-1). Examples of these data include: any computer program for operating on the terminal (such as 10-1), such as an operating system and an application. Among them, the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application can include various applications.
[0082] In some embodiments, the position determination device of the mechanical arm provided in the embodiment of the present invention can be implemented in a combination of software and hardware. As an example, the position determination device of the mechanical arm provided in the embodiment of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the position determination method of the mechanical arm provided in the embodiment of the present invention. For example, the processor in the form of a hardware decoding processor can adopt one or more application specific integrated circuits (ASIC, Application Specific Integrated Circuit), DSP, programmable logic device (PLD, Programmable Logic Device), complex programmable logic device (CPLD, Complex Programmable Logic Device), field programmable gate array (FPGA, Field-Programmable Gate Array) or other electronic components.
[0083] As an example of a robot arm position determination device provided in an embodiment of the present invention being implemented by a combination of software and hardware, the robot arm position determination device provided in an embodiment of the present invention can be directly embodied as a combination of software modules executed by a processor 201, and the software module can be located in a storage medium, and the storage medium is located in the memory 202. The processor 201 reads the executable instructions included in the software module in the memory 202, and completes the robot arm position determination method provided in an embodiment of the present invention in combination with necessary hardware (for example, including the processor 201 and other components connected to the bus 205).
[0084] As an example, the processor 201 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0085] As an example of hardware implementation of the position determination device of the robotic arm provided in an embodiment of the present invention, the device provided in an embodiment of the present invention can be directly executed by a processor 201 in the form of a hardware decoding processor, for example, one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs) or other electronic components to implement the position determination method of the robotic arm provided in an embodiment of the present invention.
[0086] The memory 202 in the embodiment of the present invention is used to store various types of data to support the operation of the electronic device 20. Examples of such data include: any executable instructions for operating on the electronic device 20, such as executable instructions, and the program for implementing the method for determining the position of the slave robot arm in the embodiment of the present invention may be included in the executable instructions.
[0087] In other embodiments, the position determination device of the robot arm provided in the embodiment of the present invention can be implemented in a software manner. Figure 2The position determination device 2020 of the robot arm stored in the memory 202 is shown, which may be software in the form of a program and a plug-in, and includes a series of modules. As an example of a program stored in the memory 202, the robot arm position determination device 2020 may be included, and the robot arm position determination device 2020 includes the following software modules:
[0088] The information transmission module 2081 is used to obtain the position parameters of the robotic arm.
[0089] The information processing module 2082 is used to determine a first position relationship between the robotic arm and the intermediate coordinate system based on the position parameters of the robotic arm.
[0090] The information transmission module 2081 is used to obtain the position parameters of the image acquisition device.
[0091] The information processing module 2082 is used to determine a second positional relationship between the image acquisition device and the intermediate coordinate system based on the position parameters of the image acquisition device.
[0092] The information processing module 2082 is used to perform position transformation processing on the first position relationship and the second position relationship to obtain transformation relationship parameters of the first position relationship and the second position relationship;
[0093] The information processing module is used to determine the position of the robotic arm based on the first position relationship and the second position relationship conversion relationship parameters.
[0094] Combination Figure 2 The position determination device of the mechanical arm shown in the figure illustrates the position determination method of the mechanical arm provided by the embodiment of the present invention, see Figure 3 , Figure 3 An optional flow chart of the method for determining the position of a robot arm provided in an embodiment of the present invention is provided. It can be understood that: Figure 3 The method for determining the position of the robot arm shown can be applied to the field of robot-assisted recognition to determine the position of the robot arm, wherein: Figure 3 The steps shown can be performed by various electronic devices running the position determination device of the robot arm, such as a special robot with a position adjustment function, a medical robot arm with a human body inspection function. Figure 3 The steps shown are explained.
[0095] Step 301: A position determination device of a robotic arm obtains position parameters of the robotic arm.
[0096] Step 302: The position determination device of the robotic arm determines a first position relationship between the robotic arm and the intermediate coordinate system based on the position parameters of the robotic arm.
[0097] In some embodiments of the present invention, reference Figure 4 , Figure 4 An optional flow chart of a method for determining the position of a robotic arm provided in an embodiment of the present invention is provided to obtain a first position relationship between the robotic arm and the intermediate coordinate system, specifically comprising the following steps:
[0098] Step 401: Based on the position parameters of the robotic arm, a calibration tip is configured at the end of the robotic arm.
[0099] Step 402: configuring a first calibration point, a second calibration point, a third calibration point and a fourth calibration point in a calibration plate corresponding to the robotic arm.
[0100] Among them, reference Figure 5 , Figure 5 Schematic diagram of the calibration plate processing process in an embodiment of the present invention. Specifically, the first calibration point, the second calibration point, the third calibration point and the fourth calibration point are A, B, C, and D respectively.
[0101] Step 403: Determine the first calibration point, the second calibration point, the third calibration point and the fourth calibration point, and a set of first calibration point coordinates in the calibration plate coordinate system of the calibration plate.
[0102] Step 404: Adjust the calibration tip to a corresponding position of different calibration points of the calibration plate.
[0103] Step 405: Determine the first calibration point, the second calibration point, the third calibration point and the fourth calibration point according to the corresponding positions of the different calibration points on the calibration plate, and a set of second calibration point coordinates in the robotic arm base coordinate system corresponding to the robotic arm.
[0104] like Figure 5 As shown, in the calibration plate coordinate system, assuming that the side length of each square is 0.03m, the coordinates of the four points A, B, C, and D are known, corresponding to (0, 0, 0), (0.3, 0, 0), (0.21, 0, 0), and (0.3, 0.21, 0). By moving the calibration tip at the end of the manipulator to these four points, the coordinates of the four points of the end of the manipulator relative to the coordinate system of the manipulator base can be obtained. Therefore, after the four known points in the two coordinate systems are determined, the goal is to determine the transformation matrix of the coordinate system where the four points A, B, C, and D are located (where the transformation matrix is composed of a rotation matrix R and a transfer matrix T), where the set of the first calibration point coordinates of the four points A, B, C, and D is recorded as A (a1, a2, a3, a4), and the set of the second calibration point coordinates is recorded as B (b1, b2, b3, b4). The determination process of the transformation matrix refers to Formula 1:
[0105]
[0106] Among them, t=Bc-R*Ac, Bc is the average value of the set of coordinates of the second calibration point obtained by the mean function, Ac is the average value of the set of coordinates of the first calibration point obtained by the mean function. When B=R*a+T is satisfied, the transformation matrix can be composed of the rotation matrix R and the transfer matrix T.
[0107] Step 406: Based on the set of the first calibration point coordinates and the set of the second calibration point coordinates, determine a transformation matrix corresponding to the first positional relationship.
[0108] In some embodiments of the present invention, determining the transformation matrix corresponding to the first positional relationship based on the set of the first calibration point coordinates and the set of the second calibration point coordinates can be implemented in the following manner:
[0109] Based on the set of the first calibration point coordinates and the set of the second calibration point coordinates, determine the first three-dimensional center point and the second three-dimensional center point of different calibration point matrices; perform secondary centering processing on the calibration points in the calibration plate to obtain the secondary centering processing result; perform singular value decomposition processing on the secondary centering processing result to obtain a rotation matrix; determine the transfer matrix according to the first three-dimensional center point and the second three-dimensional center point and the rotation matrix; perform matrix combination processing on the rotation matrix and the transfer matrix to obtain the transformation matrix corresponding to the first position relationship. Among them, the first three-dimensional center point Ac and the second three-dimensional center point Bc of the A and B matrices are calculated, and then the R matrix needs to be solved in an optimized manner. In order to eliminate the influence of the transfer matrix T, the A and B point sets need to be re-centered to generate sets A and B, and the SVD decomposition is used to obtain the matrix u, s, and v, so that the rotation matrix R can be obtained. Further, the transfer matrix T can be calculated based on the rotation matrix R combined with the first three-dimensional center point Ac and the second three-dimensional center point Bc.
[0110] Step 407: Determine a first positional relationship between the robotic arm and the intermediate coordinate system through a transformation matrix corresponding to the first positional relationship.
[0111] Step 303: The position determination device of the robot arm obtains the position parameters of the image acquisition device.
[0112] Step 304: The position determination device of the robot arm determines a second position relationship between the image acquisition device and the intermediate coordinate system based on the position parameters of the image acquisition device.
[0113] In some embodiments of the present invention, determining the second positional relationship between the image acquisition device and the intermediate coordinate system based on the position parameters of the image acquisition device can be achieved in the following manner:
[0114] The image in the use environment of the mechanical equipment is collected by the image acquisition device; the side length parameters of the unit calibration block in the type of the calibration plate are determined; the spatial posture of the calibration plate is determined based on the image in the use environment of the mechanical equipment and the pixel difference between the side length parameters of the unit calibration block; the position parameters of the image acquisition device are determined according to the spatial posture of the calibration plate; the image acquisition matrix is determined according to the spatial posture of the calibration plate and the position parameters of the image acquisition device, and the second position relationship between the image acquisition device and the intermediate coordinate system is determined according to the image acquisition matrix.
[0115] Step 305: The position determination device of the robot arm performs position transformation processing on the first position relationship and the second position relationship to obtain conversion relationship parameters of the first position relationship and the second position relationship.
[0116] Among them, the intermediate coordinate system is world, the coordinate system of the image acquisition device is Camera, and the coordinate system of the end of the robotic arm is Robot. Then the transformation formula of the robotic arm under the image acquisition device refers to Formula 2:
[0117]
[0118] Therefore, the conversion between the coordinate system of the image acquisition device and the coordinate system of the end of the robot arm can be achieved through Formula 2.
[0119] In some embodiments of the present invention, the type of the calibration plate can also be determined; based on the type of the calibration plate, the side length parameters of the unit calibration block in the type of the calibration plate are determined; according to the side length parameters of the unit calibration block, the set of the first calibration point coordinates is adjusted, thereby adapting to different robotic arm usage environments.
[0120] Step 306: The position determination device of the robotic arm determines the position of the robotic arm based on the first position relationship and the second position relationship conversion relationship parameters.
[0121] In some embodiments of the present invention, the target position of the robotic arm can also be obtained; when the position of the robotic arm is determined based on the first position relationship and the second position relationship conversion relationship parameters, the position of the robotic arm is compared with the target position; when the coordinate difference between the position of the robotic arm and the target position exceeds a threshold, the position of the robotic arm is adjusted, thereby allowing the user to use the robotic arm more conveniently.
[0122] Continue to combine Figure 2 The position determination device of the mechanical arm shown in the figure illustrates the position determination method of the mechanical arm provided by the embodiment of the present invention, see Figure 6 , Figure 6An optional flow chart of a method for determining the position of a robot arm provided in an embodiment of the present invention is as follows. It can be understood that: Figure 6 The method for determining the position of the robotic arm shown can be applied to the field of medical image processing to detect the lesions of the patient through the robotic arm, such as ultrasound images of renal bleeding and ultrasound images of gallbladder tumors, wherein: Figure 6 The steps shown can be performed by various electronic devices running the position determination device of the robot arm, for example, a medical robot with a position adjustment function, a medical robot arm with a human body inspection function. Figure 6 The steps shown are explained.
[0123] Step 601: Determine a first positional relationship between the robotic arm and an intermediate coordinate system based on the position parameters of the robotic arm.
[0124] Step 602: Determine a second positional relationship between the image acquisition device and the intermediate coordinate system based on the position parameters of the image acquisition device.
[0125] Step 603: Perform position transformation processing on the first position relationship and the second position relationship to obtain conversion relationship parameters of the first position relationship and the second position relationship.
[0126] Step 604: Determine the position of the robotic arm based on the first position relationship and the second position relationship conversion relationship parameters.
[0127] Step 605: Compare with the lesion detection position.
[0128] Among them, the medical image obtained by the method for determining the position of the robotic arm provided by the present application includes a set of medical images to be segmented of the same target area of the target object, which can be at least one CT image or endoscopic image of the lesion of the same patient. By adjusting the position of the robotic arm, the medical image can be flipped, rotated, scaled and contrast-enhanced. Among them, the type of the input medical image can be a two-dimensional plane image or a three-dimensional image; for example: electronic computer tomography (CT), magnetic resonance imaging (MRI), ultrasound, X-ray, electrocardiogram, electroencephalogram, optical photography, etc., images generated by medical instruments.
[0129] Step 606: When the coordinate difference between the position of the robotic arm and the lesion detection position exceeds a threshold, the position of the robotic arm is adjusted.
[0130] Among them, when it is determined that the coordinate difference between the position of the robotic arm of the ultrasound image of renal bleeding and the lesion detection position is greater than or equal to a threshold value of 1 cm, the position of the robotic arm is adjusted; when it is determined that the coordinate difference between the position of the robotic arm of the ultrasound image of a gallbladder tumor and the lesion detection position is greater than or equal to a threshold value of 0.5 cm, the position of the robotic arm is adjusted to achieve accurate imaging of the lesion by accurately determining the position of the robotic arm.
[0131] Beneficial technical effects:
[0132] The embodiment of the present invention obtains the position parameters of the robotic arm; determines a first position relationship between the robotic arm and an intermediate coordinate system based on the position parameters of the robotic arm; obtains the position parameters of the image acquisition device; determines a second position relationship between the image acquisition device and the intermediate coordinate system based on the position parameters of the image acquisition device; performs position transformation processing on the first position relationship and the second position relationship to obtain conversion relationship parameters of the first position relationship and the second position relationship; and determines the position of the robotic arm based on the conversion relationship parameters of the first position relationship and the second position relationship. Thus, it is possible to accurately determine the position of the robotic arm, reduce cumulative errors, and improve the accuracy of a single posture acquisition effect, so that users can use the robotic arm more conveniently.
[0133] The above descriptions are merely embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for determining the position of a robot arm, the method being used in a mechanical device consisting of a robot arm and an image acquisition device, characterized in that: The method comprises: Obtaining position parameters of the robotic arm; Determining a first positional relationship between the robotic arm and an intermediate coordinate system based on a position parameter of the robotic arm; Acquiring position parameters of the image acquisition device; Based on the position parameters of the image acquisition device, determining a second position relationship between the image acquisition device and the intermediate coordinate system; performing position transformation processing on the first position relationship and the second position relationship to obtain conversion relationship parameters of the first position relationship and the second position relationship; Determining the position of the robotic arm based on the first position relationship and the second position relationship conversion relationship parameters; The determining, based on the position parameter of the robotic arm, a first position relationship between the robotic arm and the intermediate coordinate system comprises: Based on the position parameters of the robotic arm, configuring a calibration tip at the end of the robotic arm; Determine a set of first calibration point coordinates configured in a calibration plate corresponding to the robotic arm; The calibration tip is adjusted to a position corresponding to different calibration points of the calibration plate, and a set of coordinates of the first calibration points is determined as a set of coordinates of the second calibration points in a coordinate system of a robot base corresponding to the robot; Determining a transformation matrix corresponding to the first positional relationship based on the set of the first calibration point coordinates and the set of the second calibration point coordinates; The first position relationship between the robot arm and the intermediate coordinate system is determined by the transformation matrix corresponding to the first position relationship.
2. The method according to claim 1, characterized in that The step of adjusting the calibration tip to a position corresponding to different calibration points of the calibration plate and determining a set of coordinates of the first calibration points and a set of coordinates of the second calibration points in a coordinate system of a robot base corresponding to the robot arm comprises: Arrange a first calibration point, a second calibration point, a third calibration point and a fourth calibration point in the calibration plate corresponding to the mechanical arm; Determine the first calibration point, the second calibration point, the third calibration point and the fourth calibration point, and a set of coordinates of the first calibration point in a calibration plate coordinate system of the calibration plate; According to the corresponding positions of different calibration points on the calibration plate, the first calibration point, the second calibration point, the third calibration point and the fourth calibration point, and the set of coordinates of the second calibration point in the robotic arm base coordinate system corresponding to the robotic arm are determined.
3. The method according to claim 2, characterized in that The determining, based on the set of the first calibration point coordinates and the set of the second calibration point coordinates, a transformation matrix corresponding to the first positional relationship includes: Determining a first three-dimensional center point and a second three-dimensional center point of different calibration point matrices based on the set of the first calibration point coordinates and the set of the second calibration point coordinates; Performing secondary centralization processing on the calibration points in the calibration plate to obtain secondary centralization processing results; Performing singular value decomposition processing on the secondary centralization processing result to obtain a rotation matrix; Determine a transfer matrix according to the first three-dimensional center point, the second three-dimensional center point and the rotation matrix; Perform matrix combination processing on the rotation matrix and the transfer matrix to obtain a transformation matrix corresponding to the first position relationship.
4. The method according to claim 2, characterized in that: The method further comprises: Determining the type of the calibration plate; Based on the type of the calibration plate, determining a side length parameter of a unit calibration block in the type of the calibration plate; The set of the first calibration point coordinates is adjusted according to the side length parameter of the unit calibration block.
5. The method according to claim 1, characterized in that The determining, based on the position parameter of the image acquisition device, a second position relationship between the image acquisition device and the intermediate coordinate system comprises: The image acquisition device is used to acquire images of the use environment of the mechanical equipment; Determine the side length parameter of the unit calibration block in the type of calibration plate; Determining the spatial posture of the calibration plate based on the image in the use environment of the mechanical equipment and the pixel difference of the side length parameter of the unit calibration block; Determining the position parameters of the image acquisition device according to the spatial posture of the calibration plate; An image acquisition matrix is determined according to the spatial posture of the calibration plate and the position parameters of the image acquisition device, and a second positional relationship between the image acquisition device and the intermediate coordinate system is determined according to the image acquisition matrix.
6. The method according to claim 1, characterized in that The method further comprises: Get the target position of the robot arm; When determining the position of the robotic arm based on the first position relationship and the second position relationship conversion relationship parameter, comparing the position of the robotic arm with the target position; When the coordinate difference between the position of the robotic arm and the target position exceeds a threshold, the position of the robotic arm is adjusted.
7. A device for determining the position of a mechanical arm, the device being used in a mechanical device consisting of a mechanical arm and an image acquisition device, characterized in that: The device comprises: An information transmission module, used to obtain the position parameters of the robotic arm; An information processing module, used for determining a first positional relationship between the robotic arm and the intermediate coordinate system based on the position parameters of the robotic arm; The information transmission module is used to obtain the position parameters of the image acquisition device; The information processing module is used to determine a second positional relationship between the image acquisition device and the intermediate coordinate system based on the position parameters of the image acquisition device; The information processing module is used to perform position transformation processing on the first position relationship and the second position relationship to obtain conversion relationship parameters of the first position relationship and the second position relationship; The information processing module is used to determine the position of the robotic arm based on the first position relationship and the second position relationship conversion relationship parameter; The information processing module is used to configure a calibration tip at the end of the robotic arm based on the position parameters of the robotic arm; determine a set of first calibration point coordinates configured in a calibration plate corresponding to the robotic arm; determine a set of second calibration point coordinates of the first calibration point coordinates in a robotic arm base coordinate system corresponding to the robotic arm according to the corresponding position when the calibration tip is adjusted to different calibration points of the calibration plate; determine a transformation matrix corresponding to the first position relationship based on the set of the first calibration point coordinates and the set of the second calibration point coordinates; and determine a first position relationship between the robotic arm and the intermediate coordinate system through the transformation matrix corresponding to the first position relationship.
8. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable instructions; A processor is used to implement the method for determining the position of a robotic arm as described in any one of claims 1 to 6 when running the executable instructions stored in the memory.
9. A computer-readable storage medium storing executable instructions, characterized in that: When the executable instructions are executed by the processor, the method for determining the position of the robotic arm described in any one of claims 1 to 6 is implemented.
10. A robot, characterized in that: The robot comprises: A mechanical device, comprising a mechanical arm and an image acquisition device, configured to receive instructions from a processor and implement the method for determining the position of the mechanical arm according to any one of claims 1 to 6; A memory for storing executable instructions; A processor is used to implement the method for determining the position of a robotic arm as described in any one of claims 1 to 6 when running the executable instructions stored in the memory.
