A robot arm control method, device, equipment and medium
By obtaining the function type target plug-in interface and custom programs of the robot arm control program, instantiating and running the user-defined program is solved, and the problems of redundancy and high delay of the robot arm control program are improved, and the user experience is improved.
Patent Information
- Application Number
- CN202211308971.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-25
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2042-10-25
AI Technical Summary
The existing robotic arm control program redundancy and SDK interface methods have high delay problems, and user needs are varied and difficult to meet the needs of high-performance real-time operation.
By obtaining the function-class target plug-in interface of the robotic arm control program, exposing custom programs and library files, instantiating and running user-defined programs, avoiding adding additional programs to the source code and reducing delays.
Reduces redundancy of robotic arm control programs, reduces user command response delays, and improves user experience.
Smart Images

Figure CN115502980B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of robot arm control, and in particular to a robot arm control method, device, equipment and medium. Background Art
[0002] The process of user operating the robotic arm includes: the user operates the client, and the client communicates with the robotic arm control program through the developed SDK interface to realize the control of the robotic arm.
[0003] However, there may be some requirements in the scenario where users use the robotic arm, such as adding two axes and forming an eight-axis linkage with the robotic arm. The current robotic arm control program does not provide an SDK interface for these requirements. Therefore, the user needs can only be met by adding additional programs to the source code of the robotic arm control program to develop new SDK interfaces suitable for new requirements. However, user needs are ever-changing, and excessive development of robotic arm control programs has led to more and more redundant robotic arm control programs. In addition, the interaction between the client and the robotic arm control program through the SDK interface has a high latency for some high-performance requirements. For example, the user needs to operate the robotic arm in real time, but the SDK interface method causes a high latency between the user issuing a command and the robotic arm responding to the command, resulting in a poor user experience. Summary of the invention
[0004] In view of this, the present application provides a robot arm control method, device, equipment and medium, which are used to solve the problem of program redundancy caused by modifying the source code of the robot arm control program and the problem of high delay caused by sending instructions in the SDK interface mode in the prior art. The technical solution is as follows:
[0005] A method for controlling a robotic arm, comprising:
[0006] Obtaining a target plug-in interface corresponding to at least one function class included in the robot arm control program, and exposing the target plug-in interface corresponding to the at least one function class, wherein the target plug-in interface is used to call the program of at least one function class included in the robot arm control program through an instantiation pointer of the at least one function class, and any function class in the at least one function class is used to control the target robot arm to implement a corresponding function;
[0007] After exposing the target plug-in interface, a target custom program and / or a target library file that meets the user's robot arm control requirements is obtained, wherein the library file is a library file compiled based on the target custom program, and the target custom program refers to a custom program obtained based on the inherited and implemented target plug-in interface;
[0008] Based on the target custom program and / or the target library file, obtain an instantiation pointer corresponding to the target custom program;
[0009] The target custom program is run based on the instantiation pointer corresponding to the target custom program to control the target robot arm.
[0010] Optionally, obtaining a target plug-in interface corresponding to at least one function class included in the robot arm control program includes:
[0011] Obtain and inherit at least one function class included in the robot arm control program;
[0012] Implementing virtual functions respectively included in at least one functional class as interfaces to obtain instantiation pointers respectively corresponding to at least one functional class;
[0013] The instantiation pointer corresponding to at least one functional class is passed as a parameter into the virtual base class to obtain the virtual base class after the parameter is passed, and the virtual base class after the parameter is passed is used as the target plug-in interface corresponding to the at least one functional class.
[0014] Optionally, based on the target custom program, an instantiation pointer corresponding to the target custom program is obtained, including:
[0015] Compile the target customized program into a target library file;
[0016] Load the target library file to obtain the instantiation pointer corresponding to the target custom program.
[0017] Optionally, load the target library file to obtain the instantiation pointer corresponding to the target custom program, including:
[0018] Use the dlopen library function to load the target library file to obtain the instantiation pointer corresponding to the target library file as the instantiation pointer corresponding to the target custom program.
[0019] Optionally, running the target custom program based on the instantiation pointer corresponding to the target custom program includes:
[0020] Based on the instantiation pointer corresponding to the target custom program, the initialization interface in the target plug-in interface is called to initialize the user resource information related to the target library file;
[0021] After initialization, call the startup interface in the target plug-in interface to run the target custom program.
[0022] Optionally, also include:
[0023] After the target customized program is running, the stop interface in the target plug-in interface is called to uninstall the running target customized program.
[0024] Optionally, the initialization interface, the start interface, and the stop interface are all non-blocking interfaces.
[0025] A robot arm control device, comprising:
[0026] A target plug-in interface acquisition module is used to acquire a target plug-in interface corresponding to at least one function class included in the robot arm control program, and expose the target plug-in interface corresponding to the at least one function class, wherein the target plug-in interface is used to call the program of at least one function class included in the robot arm control program through an instantiation pointer of at least one function class, and any function class in the at least one function class is used to control the target robot arm to realize the corresponding function;
[0027] A custom information acquisition module is used to obtain a target custom program and / or a target library file that meets the user's robot arm control requirements after exposing the target plug-in interface, wherein the library file is a library file compiled based on the target custom program, and the target custom program refers to a custom program obtained based on the inherited and implemented target plug-in interface;
[0028] A program pointer determination module, used to obtain an instantiation pointer corresponding to a target custom program based on a target custom program and / or a target library file;
[0029] The robot arm control module is used to run the target custom program based on the instantiation pointer corresponding to the target custom program to control the target robot arm.
[0030] A robot arm control device, comprising a memory and a processor;
[0031] Memory, used to store programs;
[0032] The processor is used to execute the program to implement each step of any of the above-mentioned robot arm control methods.
[0033] A readable storage medium stores a computer program, and when the computer program is executed by a processor, each step of any of the above-mentioned robot arm control methods is implemented.
[0034] Through the above technical solution, it can be known that the robot arm control method provided by the present application first obtains the target plug-in interface corresponding to at least one functional class contained in the robot arm control program, and then after exposing the target plug-in interface, obtains the target custom program and / or target library file that meets the user's robot arm control requirements, and then obtains the instantiation pointer corresponding to the target custom program based on the target custom program and / or the target library file, and finally runs the custom program based on the instantiation pointer corresponding to the target custom program to control the target robot arm. The present application implements at least one functional class contained in the robot arm control program as a target plug-in interface, so that the user can develop a target custom program that meets the robot arm control requirements based on the target plug-in interface, so that the present application can realize the control of the target robot arm by running the target custom program. When the user needs to control the target robot arm according to other functions outside of at least one functional class, the present application does not need to add additional programs to the source code of the robot arm control program, avoiding the problem of redundancy of the robot arm control program, and the present application does not require the user to issue instructions, reducing the delay of the robot arm control, and providing a better user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0036] Figure 1 A schematic diagram of a flow chart of a robotic arm control method provided in an embodiment of the present application;
[0037] Figure 2 A schematic diagram of the structure of a robotic arm control device provided in an embodiment of the present application;
[0038] Figure 3 This is a hardware structure block diagram of the robotic arm control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0040] In view of the problems existing in the prior art, the inventor of this case conducted in-depth research and finally proposed a robotic arm control method. The robotic arm control method provided in this application will be introduced in detail through the following embodiments.
[0041] See also Figure 1 , shows a schematic flow chart of a robot arm control method provided in an embodiment of the present application, and the robot arm control method may include:
[0042] Step S101: Acquire a target plug-in interface corresponding to at least one functional class included in a robot arm control program, and expose the target plug-in interface corresponding to at least one functional class.
[0043] Among them, the target plug-in interface is used to call at least one function class program included in the robot arm control program through the instantiation pointer of at least one function class, and any function class in the at least one function class is used to control the target robot arm to realize the corresponding function.
[0044] Specifically, this embodiment can adjust the robot arm control program in the prior art according to the various robot arm functions contained therein, to obtain a robot arm control program including at least one function class, and then obtain a target plug-in interface corresponding to at least one function class, and then expose the obtained target plug-in interface so that the user can call at least one function class based on the exposed target plug-in interface to write a target custom program that meets the user's robot arm control needs.
[0045] Here, the at least one function class included in the robot control program is divided according to the control requirements of the target robot, for example, according to forward and inverse solutions, motion control, peripheral IO control, robot state acquisition, robot power on and off, collaborative robot safety control, etc. In this step, each function class is used to control the robot to achieve the corresponding function.
[0046] In an optional embodiment, the function classes in this step include the following 6 categories: the first category is the algorithm interface class, for example, including: robot arm coordinate system conversion, forward and inverse solutions, conversion of coordinate points in different coordinate systems, etc.; the second category is the robot control class, for example, including: startup parameters, tool parameters, setting joint PID, etc.; the third category is the robot IO class, for example, including setting and obtaining user IO, obtaining robot internal IO status, etc.; the fourth category is the robot motion control class, for example, including robot speed, acceleration, joint motion, linear motion, blending radius, trajectory motion, etc.; the fifth category is the robot safety class, for example, including reduction mode, collision level, etc.; the sixth category is the robot status class, for example, including obtaining robot events, obtaining robot device information, etc.
[0047] Of course, the six categories divided above are only examples and are not intended to limit the present application.
[0048] Step S102: After exposing the target plug-in interface, obtain a target custom program and / or target library file that meets the user's robotic arm control requirements.
[0049] The library file is a library file compiled based on the target custom program, and the target custom program refers to a custom program obtained based on the inherited and implemented target plug-in interface.
[0050] Specifically, the present application can implement a target plug-in interface and expose the target plug-in interface as an external interface, so that users can add other functional codes according to their needs based on the exposed target plug-in interface to write a target custom program that meets the robot arm control requirements. The target plug-in interface can be inherited and implemented in the target custom program, and the user's robot arm control requirements can be implemented based on the inherited and implemented target plug-in interface. Here, the robot arm control requirement can be the requirement to control the target robot arm based on at least one of the above-mentioned functional classes.
[0051] Optionally, this step can directly obtain the target custom program written by the user; optionally, the user can compile the written target custom program into a target library file through a PC, and then this step can obtain the target library file; optionally, this step can also obtain both the target custom program and the target library file.
[0052] Step S103: Based on the target custom program and / or the target library file, obtain an instantiation pointer corresponding to the target custom program.
[0053] Specifically, if the target custom program is obtained in the above steps, this step can compile the target custom program into a target library file, and then instantiate the target library file to obtain the instantiation pointer corresponding to the target custom program; if the target library file is obtained in the above steps, this step can directly instantiate the target library file to obtain the instantiation pointer corresponding to the target custom program.
[0054] Step S104: running the target custom program based on the instantiation pointer corresponding to the target custom program to control the target robotic arm.
[0055] The robot arm control method provided by the present application first obtains the target plug-in interface corresponding to at least one functional class contained in the robot arm control program, and then after exposing the target plug-in interface, obtains the target custom program and / or target library file that meets the user's robot arm control requirements, then obtains the instantiation pointer corresponding to the target custom program based on the target custom program and / or target library file, and finally runs the custom program based on the instantiation pointer corresponding to the target custom program to control the target robot arm. The present application implements at least one functional class contained in the robot arm control program as a target plug-in interface, so that the user can develop a target custom program that meets the robot arm control requirements based on the target plug-in interface, so that the present application can realize the control of the target robot arm by running the target custom program. When the user needs to control the target robot arm according to other functions outside of at least one functional class, the present application does not need to add additional programs to the source code of the robot arm control program, thus avoiding the problem of redundancy of the robot arm control program, and the present application does not require the user to issue instructions, thus reducing the delay of the robot arm control and providing a better user experience.
[0056] In one embodiment of the present application, the process of the aforementioned “step S101, obtaining a target plug-in interface corresponding to at least one functional class included in the robot arm control program” is introduced.
[0057] Optionally, the process of “step S101, obtaining a target plug-in interface corresponding to at least one function class included in the robot arm control program” may include the following steps:
[0058] Step S1011, obtaining and inheriting at least one function class included in the robot arm control program.
[0059] Step S1012: Implement the virtual functions respectively included in at least one functional class as interfaces to obtain instantiation pointers respectively corresponding to at least one functional class.
[0060] Specifically, many virtual functions are provided to users in C++, so each function class contained in at least one function class can contain multiple virtual functions in C++. In this step, after inheriting each function class, the virtual functions contained in each function class can be implemented as interfaces to obtain instantiation pointers corresponding to at least one function class. Here, the instantiation pointer corresponding to a function class is used to point to the function class, and the function class can be called to perform functional control on the target robot arm by calling the instantiation pointer corresponding to the function class.
[0061] Step S1013: passing the instantiation pointers corresponding to at least one functional class as parameters into the virtual base class to obtain the virtual base class after the parameters are passed, and using the virtual base class after the parameters are passed as the target plug-in interface corresponding to the at least one functional class.
[0062] Here, the virtual base class after parameter transmission refers to the virtual base class after at least one instantiation pointer corresponding to a functional class is transmitted. In this step, the virtual base class after parameter transmission can be defined as the "RobotPlugin" class.
[0063] Optionally, as introduced in the aforementioned step S1012, each functional class includes multiple virtual functions. Then, the target plug-in interface obtained in this step may include multiple functional interfaces corresponding to the multiple virtual functions in at least one functional class. For example, the target plug-in interface includes an interface for controlling the movement of the target robotic arm axis.
[0064] This embodiment strips away the robot arm control program function, re-implements the external interface, and provides a target plug-in interface to the outside through C++ virtual functions, so that users can use the target plug-in interface and write target custom programs as required, thereby improving the user's control experience of the target robot arm.
[0065] The following embodiment describes the process of "obtaining an instantiation pointer corresponding to the target customized program based on the target customized program" in step S103.
[0066] In this embodiment, the process of “obtaining an instantiation pointer corresponding to the target customized program based on the target customized program” may include:
[0067] Step S1031, compile the target customized program into a target library file.
[0068] Step S1032: Load the target library file to obtain an instantiation pointer corresponding to the target custom program.
[0069] Optionally, the process of this step "loading the target library file to obtain the instantiation pointer corresponding to the target custom program" may include: using the dlopen library function to load the target library file to obtain the instantiation pointer corresponding to the target library file as the instantiation pointer corresponding to the target custom program.
[0070] In order to load the target custom program during the operation of the robot arm control program, the dlopen library function in C language can be used to record the target library file. Here, dlopen can open the specified dynamic link library file in the specified mode and return a handle (for this step, the handle is the instantiation pointer corresponding to the target custom program) to the calling process.
[0071] Specifically, in this step, the target library file can be exported into a form recognizable by dlopen using extern "C" in C++, and then loaded using the dlopen library function to obtain the instantiation pointer corresponding to the target library file, which is also the instantiation pointer corresponding to the target custom program mentioned in the above step.
[0072] Through the process of this embodiment, the subsequent steps can load and run the target customized program.
[0073] In an optional embodiment, the process of "step S104, running the target custom program based on the instantiation pointer corresponding to the target custom program" may include:
[0074] Step S1041: calling an initialization interface in a target plug-in interface based on an instantiation pointer corresponding to a target custom program to initialize user resource information related to a target library file.
[0075] Optionally, the target plug-in interface in this embodiment includes at least an initialization interface and a startup interface, wherein the initialization interface is used to optimize user resource information related to the target library file, and the startup interface is used to run the target custom program after optimization.
[0076] In this step, the initialization interface can be accessed through the instantiation pointer corresponding to the target custom program to implement the initialization of user resource information in the target library file.
[0077] Step S1042: After initialization, call the startup interface in the target plug-in interface to run the target custom program.
[0078] In this step, you can control the target robotic arm by running the target custom program.
[0079] If the user controls the robotic arm through jsonrpc data, the user can use these functions after obtaining the instantiation pointer corresponding to at least one function class in the initialization interface, and start the webserver reception in the startup interface, receive the json data and parse it, and use the instantiation pointer to control the target robotic arm according to the method in the json data. For example, if the method in the json data is moveJoint and the data is 6 zeros, the axis movement interface in the robot motion control class can be called to control the movement of the target robotic arm.
[0080] Considering that after the user controls the target robotic arm based on the target custom program, the user may no longer need to control the target robotic arm, or may need to control the target robotic arm according to other requirements, the running target custom program can be uninstalled to avoid resource occupation.
[0081] Then, optionally, this embodiment may further include the following steps S1043:
[0082] Step S1043: After the target customized program is running, the stop interface in the target plug-in interface is called to uninstall the running target customized program.
[0083] That is, optionally, the target plug-in interface may also include a stop interface, which is used to uninstall the running target customized program. Therefore, this step can call the stop interface in the target plug-in interface to uninstall the running target customized program according to the user's uninstallation requirements after the target customized program is running.
[0084] In one possible implementation, taking into account that other programs may also be executing when the present application is executed, in order to avoid the present embodiment affecting the execution of other programs when calling any of the initialization interface, start interface and stop interface, optionally, the initialization interface, start interface and stop interface are all non-blocking interfaces.
[0085] In another possible implementation, the user may have multiple robot arm control requirements, and thus may write multiple target custom programs. For this purpose, the present embodiment may also provide a configuration file. When each target custom program and / or the target library file corresponding to each target custom program is obtained in step S102, the configuration files are sequentially configured in the configuration file according to the order in which the target custom programs and / or the target library files are obtained, so as to run each target custom program in sequence according to the above embodiments; or, according to the user's requirements for the control sequence, the running sequence of each target custom program is pre-configured in the configuration file, so as to run each target custom program in the sequence in the configuration file according to the above embodiments.
[0086] An embodiment of the present application also provides a robot arm control device. The robot arm control device provided in the embodiment of the present application is described below. The robot arm control device described below and the robot arm control method described above can be referenced to each other.
[0087] See also Figure 2 , shows a schematic diagram of the structure of the robot arm control device provided in an embodiment of the present application, such as Figure 2 As shown, the robot arm control device may include: a target plug-in interface acquisition module 201 , a custom information acquisition module 202 , a program pointer determination module 203 and a robot arm control module 204 .
[0088] The target plug-in interface acquisition module 201 is used to obtain the target plug-in interface corresponding to at least one function class contained in the robot arm control program, and expose the target plug-in interface corresponding to at least one function class, wherein the target plug-in interface is used to call the program of at least one function class contained in the robot arm control program through the instantiation pointer of at least one function class, and any function class in the at least one function class is used to control the target robot arm to realize the corresponding function.
[0089] The custom information acquisition module 202 is used to obtain the target custom program and / or target library file that meets the user's robotic arm control requirements after exposing the target plug-in interface, wherein the library file is a library file compiled based on the target custom program, and the target custom program refers to a custom program obtained based on the inherited and implemented target plug-in interface.
[0090] The program pointer determination module 203 is used to obtain an instantiation pointer corresponding to the target custom program based on the target custom program and / or the target library file.
[0091] The robot arm control module 204 is used to run the target custom program based on the instantiation pointer corresponding to the target custom program to control the target robot arm.
[0092] The robot arm control device provided by the present application first obtains the target plug-in interface corresponding to at least one functional class contained in the robot arm control program, and then obtains the target custom program and / or target library file that meets the user's robot arm control requirements after exposing the target plug-in interface, and then obtains the instantiation pointer corresponding to the target custom program based on the target custom program and / or the target library file, and finally runs the custom program based on the instantiation pointer corresponding to the target custom program to control the target robot arm. The present application implements at least one functional class contained in the robot arm control program as a target plug-in interface, so that the user can develop a target custom program that meets the robot arm control requirements based on the target plug-in interface, so that the present application can control the target robot arm by running the target custom program. When the user needs to control the target robot arm according to other functions outside of at least one functional class, the present application does not need to add additional programs to the source code of the robot arm control program, thus avoiding the problem of redundancy of the robot arm control program, and the present application does not require the user to issue instructions, which reduces the delay of the robot arm control and provides a better user experience.
[0093] In a possible implementation, the target plug-in interface acquisition module 201 may include: a function class acquisition inheritance module, a function pointer determination module and a virtual base class parameter transmission module.
[0094] The function class acquisition and inheritance module is used to acquire and inherit at least one function class included in the robot arm control program.
[0095] The function pointer determination module is used to implement the virtual functions respectively included in at least one function class as interfaces to obtain instantiation pointers respectively corresponding to at least one function class.
[0096] The virtual base class parameter transfer module is used to pass the instantiation pointer corresponding to at least one functional class as a parameter into the virtual base class to obtain the virtual base class after the parameter transfer, and the virtual base class after the parameter transfer is used as the target plug-in interface corresponding to at least one functional class.
[0097] In a possible implementation, the program pointer determination module 203 may include: a program compiling module and a library file loading module when obtaining the instantiation pointer corresponding to the target customized program based on the target customized program.
[0098] The program compilation module is used to compile the target custom program into a target library file.
[0099] The library file loading module is used to load the target library file to obtain the instantiation pointer corresponding to the target custom program.
[0100] In a possible implementation, the library file loading module may be specifically used to load the target library file using the dlopen library function to obtain an instantiation pointer corresponding to the target library file as an instantiation pointer corresponding to the target custom program.
[0101] In a possible implementation, the robot arm control module 204 may include: an initialization interface calling module and a startup interface calling module.
[0102] The initialization interface calling module is used to call the initialization interface in the target plug-in interface based on the instantiation pointer corresponding to the target custom program to initialize the user resource information related to the target library file;
[0103] The startup interface calling module is used to call the startup interface in the target plug-in interface after initialization to run the target custom program.
[0104] In a possible implementation, the robotic arm control device provided in the embodiment of the present application may further include: a stop interface calling module.
[0105] The stop interface calling module is used to call the stop interface in the target plug-in interface after the target custom program is running, so as to uninstall the running target custom program.
[0106] In a possible implementation, the initialization interface, the start interface, and the stop interface are all non-blocking interfaces.
[0107] The embodiment of the present application also provides a robot arm control device. Optionally, Figure 3 The hardware structure diagram of the robot arm control device is shown in FIG. Figure 3 , the hardware structure of the robot arm control device may include: at least one processor 301, at least one communication interface 302, at least one memory 303 and at least one communication bus 304;
[0108] In the embodiment of the present application, the number of the processor 301, the communication interface 302, the memory 303, and the communication bus 304 is at least one, and the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304;
[0109] The processor 301 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention;
[0110] The memory 303 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;
[0111] The memory 303 stores a program, and the processor 301 can call the program stored in the memory 303, and the program is used to:
[0112] Obtaining a target plug-in interface corresponding to at least one function class included in the robot arm control program, and exposing the target plug-in interface corresponding to the at least one function class, wherein the target plug-in interface is used to call the program of at least one function class included in the robot arm control program through an instantiation pointer of the at least one function class, and any function class in the at least one function class is used to control the target robot arm to implement a corresponding function;
[0113] After exposing the target plug-in interface, a target custom program and / or a target library file that meets the user's robot arm control requirements is obtained, wherein the library file is a library file compiled based on the target custom program, and the target custom program refers to a custom program obtained based on the inherited and implemented target plug-in interface;
[0114] Based on the target custom program and / or the target library file, obtain an instantiation pointer corresponding to the target custom program;
[0115] The target custom program is run based on the instantiation pointer corresponding to the target custom program to control the target robot arm.
[0116] Optionally, the detailed functions and extended functions of the program may refer to the above description.
[0117] An embodiment of the present application also provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned robot arm control method is implemented.
[0118] Optionally, the detailed functions and extended functions of the program may refer to the above description.
[0119] Finally, it should be noted that, in this article, relational terms such as and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device 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 device. In the absence of further restrictions, the elements defined by the statement "comprises a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0120] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0121] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A robot arm control method, characterized in that: include: Obtaining a target plug-in interface corresponding to at least one function class included in the robot arm control program, and exposing the target plug-in interface corresponding to the at least one function class, wherein the target plug-in interface is used to call the program of the at least one function class included in the robot arm control program through an instantiation pointer of the at least one function class, and any function class in the at least one function class is used to control the target robot arm to implement a corresponding function; After exposing the target plug-in interface, a target custom program and / or a target library file that meets the user's robot arm control requirements is obtained, wherein the library file is a library file compiled based on the target custom program, and the target custom program refers to a custom program obtained based on the inherited and implemented target plug-in interface; Based on the target custom program and / or the target library file, obtaining an instantiation pointer corresponding to the target custom program; Running the target custom program based on the instantiation pointer corresponding to the target custom program to control the target robotic arm; The step of obtaining a target plug-in interface corresponding to at least one functional class included in the robot arm control program includes: Acquire and inherit at least one function class included in the robot arm control program; Implementing the virtual functions respectively included in the at least one functional class as interfaces to obtain instantiation pointers respectively corresponding to the at least one functional class; The instantiation pointers corresponding to the at least one functional class are passed as parameters into the virtual base class to obtain the virtual base class after the parameter transfer, and the virtual base class after the parameter transfer is used as the target plug-in interface corresponding to the at least one functional class.
2. The robot arm control method according to claim 1, characterized in that: Based on the target custom program, obtaining an instantiation pointer corresponding to the target custom program includes: Compiling the target custom program into the target library file; The target library file is loaded to obtain an instantiation pointer corresponding to the target custom program.
3. The robot arm control method according to claim 2, characterized in that: The loading of the target library file to obtain an instantiation pointer corresponding to the target custom program includes: The target library file is loaded using the dlopen library function to obtain an instantiation pointer corresponding to the target library file as an instantiation pointer corresponding to the target custom program.
4. The robot arm control method according to claim 1, characterized in that: The step of running the target custom program based on the instantiation pointer corresponding to the target custom program includes: Calling the initialization interface in the target plug-in interface based on the instantiation pointer corresponding to the target custom program to initialize the user resource information related to the target library file; After initialization, the startup interface in the target plug-in interface is called to run the target custom program.
5. The robot arm control method according to claim 4, characterized in that: Also includes: After the target custom program is running, the stop interface in the target plug-in interface is called to uninstall the running target custom program.
6. The robot arm control method according to claim 5, characterized in that: The initialization interface, the start interface and the stop interface are all non-blocking interfaces.
7. A robot arm control device, characterized in that: include: A target plug-in interface acquisition module is used to acquire a target plug-in interface corresponding to at least one function class included in the robot arm control program, and expose the target plug-in interface corresponding to the at least one function class, wherein the target plug-in interface is used to call the program of the at least one function class included in the robot arm control program through the instantiation pointer of the at least one function class, and any function class in the at least one function class is used to control the target robot arm to realize the corresponding function; A custom information acquisition module, used to acquire a target custom program and / or a target library file that meets the user's robot arm control requirements after exposing the target plug-in interface, wherein the library file is a library file compiled based on the target custom program, and the target custom program refers to a custom program obtained based on the inherited and implemented target plug-in interface; A program pointer determination module, used to obtain an instantiation pointer corresponding to the target custom program based on the target custom program and / or the target library file; A robot arm control module, used to run the target custom program based on the instantiation pointer corresponding to the target custom program to control the target robot arm; The target plug-in interface acquisition module acquires a target plug-in interface corresponding to at least one function class included in the robot arm control program, including: Acquire and inherit at least one function class included in the robot arm control program; Implementing the virtual functions respectively included in the at least one functional class as interfaces to obtain instantiation pointers respectively corresponding to the at least one functional class; The instantiation pointers corresponding to the at least one functional class are passed as parameters into the virtual base class to obtain the virtual base class after the parameter transfer, and the virtual base class after the parameter transfer is used as the target plug-in interface corresponding to the at least one functional class.
8. A robot arm control device, characterized in that: including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the robot arm control method according to any one of claims 1 to 6.
9. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the robot arm control method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
System and method for efficiently controlling robot
CN109910010A
Sharing user defined location based zones
EP1944701A1
