CN115502980A - Mechanical arm control method, device, equipment and medium - Google Patents

Mechanical arm control method, device, equipment and medium Download PDF

Info

Publication number
CN115502980A
CN115502980A CN202211308971.3A CN202211308971A CN115502980A CN 115502980 A CN115502980 A CN 115502980A CN 202211308971 A CN202211308971 A CN 202211308971A CN 115502980 A CN115502980 A CN 115502980A
Authority
CN
China
Prior art keywords
target
program
interface
mechanical arm
instantiation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211308971.3A
Other languages
Chinese (zh)
Inventor
魏洪兴
崔元洋
郭凤贺
赵永利
唐亚伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Aubo Beijing Intelligent Technology Co ltd
Original Assignee
Aubo Beijing Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Aubo Beijing Intelligent Technology Co ltd filed Critical Aubo Beijing Intelligent Technology Co ltd
Priority to CN202211308971.3A priority Critical patent/CN115502980A/en
Publication of CN115502980A publication Critical patent/CN115502980A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1602Programme controls characterised by the control system, structure, architecture
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J13/00Controls for manipulators
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1602Programme controls characterised by the control system, structure, architecture
    • B25J9/161Hardware, e.g. neural networks, fuzzy logic, interfaces, processor
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1656Programme controls characterised by programming, planning systems for manipulators

Landscapes

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

Abstract

The application provides a mechanical arm control method, a device, equipment and a medium, which relate to the field of mechanical arm control, and the method comprises the following steps: acquiring a target plug-in interface corresponding to at least one function class contained in a mechanical arm control program; after exposing a target plug-in interface, acquiring a target custom program and/or a target library file which meet the control requirements of a mechanical arm of a user; obtaining an instantiation pointer corresponding to the target self-defining program based on the target self-defining program and/or the target library file; and running the self-defining program based on the instantiation pointer corresponding to the target self-defining program so as to control the target mechanical arm. According to the method and the device, at least one function class contained in the mechanical arm control program is realized as the target plug-in interface, so that a user can develop a target self-defined program meeting the control requirement of the mechanical arm based on the target plug-in interface, the control on the target mechanical arm is realized, the problem of redundancy of the mechanical arm control program is avoided, the control process does not need the user to send an instruction, and the control time delay is reduced.

Description

Mechanical arm control method, device, equipment and medium
Technical Field
The application relates to the technical field of mechanical arm control, in particular to a mechanical arm control method, a device, equipment and a medium.
Background
The process of operating the mechanical arm by the user comprises the following steps: and a user operates the client, and the client communicates with the mechanical arm control program through the developed sdk interface to realize the control of the mechanical arm.
However, in a scenario where a user uses a robot arm, there may be some requirements, for example, two shafts are added, and the robot arm constitutes an eight-shaft linkage, and the current robot arm control program does not provide an sdk interface for these requirements, so that only by additionally adding a program in the source code of the robot arm control program, an sdk interface suitable for the new requirements can be newly developed to meet the user requirements. However, user demands vary widely, and excessive development of robot arm control programs leads to increasing redundancy of robot arm control programs. In addition, interaction between the client and the mechanical arm control program is achieved through the sdk interface, delay is high for some high-performance requirements, for example, a user needs to operate the mechanical arm in real time, but the sdk interface mode enables the user to have high delay between sending an instruction and responding to the instruction by the mechanical arm, and user experience is poor.
Disclosure of Invention
In view of this, the present application provides a method, an apparatus, a device, and a medium for controlling a robot arm, which are used to solve the problem of program redundancy caused by modifying a source code of a robot arm control program and the problem of high delay caused by issuing an instruction in an sdk interface manner in the prior art, and the technical solutions are as follows:
a method of robot arm control, comprising:
acquiring a target plug-in interface corresponding to at least one function class contained in a mechanical 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 for calling the program of the at least one function class contained in the mechanical arm control program through an instantiation pointer of the at least one function class, and any one function class in the at least one function class is used for controlling a target mechanical arm to realize a corresponding function;
after the target plug-in interface is exposed, acquiring a target custom program and/or a target library file which meet the control requirement of a mechanical arm of a user, wherein the library file is compiled based on the target custom program, and the target custom program is the custom program obtained based on the inherited and realized target plug-in interface;
obtaining an instantiation pointer corresponding to the target self-defining program based on the target self-defining program and/or the target library file;
and operating the target self-defining program based on the instantiation pointer corresponding to the target self-defining program so as to control the target mechanical arm.
Optionally, the obtaining of the target plug-in interface corresponding to at least one function class included in the robot arm control program includes:
acquiring and inheriting at least one function class contained in a mechanical arm control program;
the virtual functions contained in at least one function class are realized as interfaces to obtain instantiation pointers corresponding to the at least one function class;
and transmitting instantiation pointers corresponding to at least one function class into the virtual base class as parameters to obtain a virtual base class after being transmitted, and using the virtual base class after being transmitted as a target plug-in interface corresponding to at least one function class.
Optionally, obtaining an instantiation pointer corresponding to the target user-defined program based on the target user-defined program includes:
compiling the target self-defining program into a target library file;
and loading the target library file to obtain an instantiation pointer corresponding to the target self-defined program.
Optionally, loading the target library file to obtain an instantiation pointer corresponding to the target custom program, including:
and loading the target library file by using a dlopen library function to obtain an instantiation pointer corresponding to the target library file, wherein the instantiation pointer is used as the instantiation pointer corresponding to the target custom program.
Optionally, running the target custom program based on the instantiation pointer corresponding to the target custom program includes:
calling an initialization interface in a target plug-in interface based on an instantiation pointer corresponding to a target custom program, and initializing user resource information related to a target library file;
and after initialization, calling a starting interface in the target plug-in interface and running a target custom program.
Optionally, the method further includes:
and after the target custom program runs, calling a stop interface in the target plug-in interface, and unloading the running target custom program.
Optionally, the initialization interface, the start interface, and the stop interface are non-blocking interfaces.
A robot arm control apparatus comprising:
the system comprises a target plug-in interface acquisition module, a target plug-in interface acquisition module and a target plug-in interface processing module, wherein the target plug-in interface acquisition module is used for acquiring a target plug-in interface corresponding to at least one function class contained in a mechanical arm control program and exposing the target plug-in interface corresponding to the at least one function class, the target plug-in interface is used for calling a program of the at least one function class contained in the mechanical 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 for controlling a target mechanical arm to realize a corresponding function;
the system comprises a custom information acquisition module, a target plug-in interface acquisition module and a target library file, wherein the custom information acquisition module is used for acquiring a target custom program and/or a target library file meeting the control requirement of a mechanical arm of a user after exposing the target plug-in interface, the library file is compiled based on the target custom program, and the target custom program is a custom program obtained based on the inherited and realized target plug-in interface;
the program pointer determining module is used for obtaining an instantiation pointer corresponding to the target self-defining program based on the target self-defining program and/or the target library file;
and the mechanical arm control module is used for operating the target self-defining program based on the instantiation pointer corresponding to the target self-defining program so as to control the target mechanical arm.
A robot arm control apparatus includes a memory and a processor;
a memory for storing a program;
and a processor for executing a program to implement the steps of the robot arm control method according to any one of the above.
A readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the robot arm control method according to any one of the preceding claims.
According to the technical scheme, the mechanical arm control method includes the steps of firstly obtaining a target plug-in interface corresponding to at least one function class contained in a mechanical arm control program, then obtaining a target self-defined program and/or a target library file meeting mechanical arm control requirements of a user after the target plug-in interface is exposed, then obtaining an instantiation pointer corresponding to the target self-defined program based on the target self-defined program and/or the target library file, and finally running the self-defined program based on the instantiation pointer corresponding to the target self-defined program to control the target mechanical arm. According to the method and the device, at least one function class contained in the mechanical arm control program is realized as a target plug-in interface, so that a user can develop a target self-defining program meeting the control requirement of the mechanical arm based on the target plug-in interface, the control of the target mechanical arm can be realized by operating the target self-defining program, when the user needs to control the target mechanical arm according to other functions except the at least one function class, the additional addition of a program in a source code of the mechanical arm control program is not needed, the redundancy problem of the mechanical arm control program is avoided, the user does not need to send an instruction, the time delay of mechanical arm control is reduced, and the user experience is better.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flowchart of a robot arm control method according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a robot arm control device according to an embodiment of the present disclosure;
fig. 3 is a hardware block diagram of a robot arm control apparatus according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In view of the problems of the prior art, the present inventors have conducted extensive studies to finally provide a robot arm control method, and the following embodiments will describe the robot arm control method provided in the present application in detail.
Referring to fig. 1, a flow chart of a robot arm control method according to an embodiment of the present disclosure is shown, where the robot arm control method includes:
step S101, a target plug-in interface corresponding to at least one function class contained in the mechanical arm control program is obtained, and the target plug-in interface corresponding to the at least one function class is exposed.
The target plug-in interface is used for calling a program of at least one function class contained in the mechanical arm control program through an instantiation pointer of the at least one function class, and any one of the at least one function class is used for controlling the target mechanical arm to realize a corresponding function.
Specifically, in this embodiment, a robot arm control program in the prior art may be adjusted according to each robot arm function included in the robot arm control program to obtain a robot arm control program including at least one function class, then obtain a target plug-in interface corresponding to the at least one function class, and then expose the obtained target plug-in interface, so that a user may call the at least one function class based on the exposed target plug-in interface to write a target custom program meeting the robot arm control requirement of the user.
Here, at least one function class included in the robot arm control program is obtained by dividing according to the control requirement of the target robot arm, for example, according to the forward and reverse solutions, the motion control, the peripheral IO control, the robot state acquisition, the robot startup and shutdown, the cooperative robot safety control, and the like. In this step, each function class is used to control the robot arm to implement a corresponding function.
In an alternative embodiment, the function classes in this step include the following 6 classes: the first type is an algorithmic interface type, including, for example: mechanical arm coordinate system conversion, forward and inverse solution, coordinate point conversion of different coordinate systems and the like; the second category is the robot control category, for example, including: starting parameters, tool parameters, setting joint PID and the like; the third type is a robot IO type, for example, the method includes setting and acquiring user IO, acquiring an IO state in the robot, and the like; the fourth type is a robot motion control type, for example, including robot speed, acceleration, joint motion, linear motion, blend radius, trajectory motion, and the like; the fifth category is a robot safety category, for example, including a reduction mode, a collision grade, and the like; the sixth category is a robot status category, and includes, for example, acquiring a robot event, acquiring robot device information, and the like.
Of course, the above-identified 6 categories are merely examples and are not intended to limit the present application.
And S102, after the target plug-in interface is exposed, acquiring a target custom program and/or a target library file which meet the control requirement of the mechanical arm of the user.
The library file is compiled based on a target self-defined program, and the target self-defined program is a self-defined program obtained based on an inherited and realized target plug-in interface.
Specifically, the target plug-in interface can be realized, and the target plug-in interface is exposed as an external interface, so that a user can add other function codes according to requirements on the basis of the exposed target plug-in interface to write a target self-defined program meeting the control requirements of the mechanical arm, the target plug-in interface can be inherited and realized in the target self-defined program, and the mechanical arm control requirements of the user can be realized based on the inherited and realized target plug-in interface. Here, the robot arm control demand may be a demand for realizing control of the target robot arm based on at least one of the above-described function classes.
Optionally, the step may directly obtain a target custom program written by the user; optionally, the user may compile the written target user-defined program into a target library file through the PC, so that the target library file may be obtained in this step; optionally, in this step, the target custom program may be acquired, and the target library file may also be acquired.
And S103, obtaining an instantiation pointer corresponding to the target custom program based on the target custom program and/or the target library file.
Specifically, if the target user-defined program is obtained in the foregoing step, the target user-defined program may be compiled into a target library file in this step, and then the target library file is instantiated to obtain an instantiation pointer corresponding to the target user-defined program; if the target library file is obtained in the previous step, the target library file can be directly instantiated in the previous step, and an instantiation pointer corresponding to the target custom program is obtained.
And step S104, operating the target self-defining program based on the instantiation pointer corresponding to the target self-defining program so as to control the target mechanical arm.
The mechanical arm control method comprises the steps of firstly obtaining a target plug-in interface corresponding to at least one function class contained in a mechanical arm control program, then obtaining a target self-defined program and/or a target library file meeting mechanical arm control requirements of a user after exposing the target plug-in interface, then obtaining an instantiation pointer corresponding to the target self-defined program based on the target self-defined program and/or the target library file, and finally running the self-defined program based on the instantiation pointer corresponding to the target self-defined program so as to control a target mechanical arm. The method and the device have the advantages that at least one function class contained in the mechanical arm control program is realized as the target plug-in interface, a user can develop the target self-defined program meeting the mechanical arm control requirement based on the target plug-in interface, the control over the target mechanical arm can be realized by running the target self-defined program, when the user needs to control the target mechanical arm according to other functions outside the at least one function class, the program does not need to be additionally added into a source code of the mechanical arm control program, the redundancy problem of the mechanical arm control program is avoided, the user does not need to send an instruction, the time delay of mechanical arm control is reduced, and the user experience is better.
In an embodiment of the present application, a process of obtaining a target plug-in interface corresponding to at least one function class included in the robot arm control program in step S101 is described.
Optionally, the process of "step S101, obtaining the target plug-in interface corresponding to at least one function class included in the robot arm control program" may include the following steps:
and step S1011, acquiring and inheriting at least one function class contained in the mechanical arm control program.
Step S1012, implementing the virtual functions included in each of the at least one function class as an interface to obtain instantiation pointers corresponding to each of the at least one function class.
Specifically, a plurality of virtual functions are provided for a user in c + +, so that each function class included in at least one function class may include a plurality of virtual functions in c + +, and in this step, after inheriting each function class, the virtual functions included in each function class are implemented as an interface to obtain instantiation pointers corresponding to the at least one function class respectively. Here, an instantiation pointer corresponding to a function class is used to point to the function class, and the function class can be called by calling the instantiation pointer corresponding to the function class to perform function control on the target mechanical arm.
Step S1013, the instantiation pointers corresponding to the at least one function class are transmitted into the virtual base class as parameters to obtain a virtual base class after being transmitted, and the virtual base class after being transmitted is used as a target plug-in interface corresponding to the at least one function class.
Here, the virtual base class after the reference transfer refers to the virtual base class after the instantiation pointers corresponding to the at least one function class are respectively transferred, and in this step, the virtual base class after the reference transfer may be defined as a "robotplus" class.
Optionally, as described in step S1012, each function class includes a plurality of virtual functions, and then the target plugin interface obtained in this step may include a plurality of function interfaces corresponding to the plurality of virtual functions in at least one function class, for example, the target plugin interface includes an interface for controlling the axis motion of the target robot arm.
According to the embodiment, the function of a control program of the mechanical arm is stripped, the external interface is realized again, and the target plug-in interface is provided for the outside in a C + + virtual function mode, so that a user can use the target plug-in interface, a target self-defined program is compiled according to the requirement, and the control experience of the user on the target mechanical arm is improved.
In the following embodiment, a process of "obtaining an instantiation pointer corresponding to the target self-defined program based on the target self-defined program" in step S103 is described.
In this embodiment, the process of obtaining the instantiation pointer corresponding to the target self-defined program based on the target self-defined program may include:
and step S1031, compiling the target custom program into a target library file.
And S1032, loading the target library file to obtain an instantiation pointer corresponding to the target self-defined program.
Optionally, the process of "loading the target library file to obtain the instantiation pointer corresponding to the target custom program" in this step may include: and loading the target library file by using a dlopen library function to obtain an instantiation pointer corresponding to the target library file, wherein the instantiation pointer is used as the instantiation pointer corresponding to the target self-defined program.
In order to load the target custom program in the operation process of the mechanical arm control program, a dlopen library function in the C language can be used to record a target library file, where dlopen can open a specified dynamic link library file in a specified mode and return a handle (for this step, the handle is an instantiation pointer corresponding to the target custom program) to the calling process.
Specifically, in this step, the target library file may be exported to a form recognizable by dlopen using the extra "C" in C + +, and then loaded using a dlopen library function to obtain an instantiation pointer corresponding to the target library file, where the instantiation pointer is the instantiation pointer corresponding to the target custom program mentioned in the above step.
Through the process of the embodiment, the target custom program can be loaded and run in the subsequent steps.
In an alternative embodiment, the process of "step S104, running the target custom program based on the instantiation pointer corresponding to the target custom program" may include:
and step S1041, calling an initialization interface in the target plug-in interface based on the instantiation pointer corresponding to the target custom program, and initializing user resource information related to the target library file.
Optionally, the target plug-in interface in this embodiment at least includes an initialization interface and a start interface, where the initialization interface is used to optimize user resource information related to the target library file, and the start interface is used to run the target custom program after optimization.
In this step, the initialization interface can be accessed through the instantiation pointer corresponding to the target self-defined program, so as to initialize the user resource information in the target library file.
Step S1042, after initialization, a starting interface in the target plug-in interface is called, and a target custom program is operated.
In the step, the target mechanical arm can be controlled by operating the target self-defined program.
If a user controls the mechanical arm through jsonrpc data, the user can use the functions after acquiring instantiation pointers corresponding to at least one function class in an initialization interface, the webserver is started to receive in a starting interface, json data is received and analyzed, and the instantiation pointers are correspondingly used to control the target mechanical arm according to the method in the json data, if the method in the json data is moveJoint, and the data is 6 0, the axis-motion interface in the robot motion control class can be called to control the motion of the target mechanical arm.
Considering that a user may not need to control the target mechanical arm any more subsequently or need to control the target mechanical arm according to other requirements after controlling the target mechanical arm based on the target custom program, the running target custom program can be unloaded at the moment to avoid resource occupation.
Then, optionally, this embodiment may further include the following step S1043:
and step S1043, after the target custom program runs, calling a stop interface in the target plug-in interface, and unloading the running target custom program.
That is, optionally, the target plug-in interface may further include a stop interface, where the stop interface is used to unload the run target custom program, and therefore, in this step, after the target custom program runs, the stop interface in the target plug-in interface may be called according to the unloading requirement of the user, so as to unload the run target custom program.
In a possible implementation manner, considering that other programs may be executed during execution of the present application, in order to avoid that the execution of other programs is affected when any one of the initialization interface, the start interface, and the stop interface is called in this embodiment, optionally, all of the initialization interface, the start interface, and the stop interface are non-blocking interfaces.
In another possible implementation manner, a user may generate a plurality of robot arm control requirements, and therefore a plurality of target custom programs may be written, for this reason, this embodiment may further provide a configuration file, and when the target custom programs and/or the target library files corresponding to the target custom programs are acquired in step S102, configuration is sequentially performed in the configuration file according to the acquisition sequence of the target custom programs and/or the target library files, so that the target custom programs are sequentially run by using the above embodiments; or, according to the requirement of the user on the control sequence, the running sequence of each target self-defined program is configured in the configuration file in advance, so that each target self-defined program is run according to the sequence in the configuration file by adopting each embodiment.
The embodiment of the present application further provides a robot arm control device, which is described below, and the robot arm control device described below and the robot arm control method described above may be referred to in a corresponding manner.
Referring to fig. 2, a schematic structural diagram of a robot arm control device according to an embodiment of the present disclosure is shown, and as shown in fig. 2, the robot arm control device may include: the system comprises a target plug-in interface acquisition module 201, a custom information acquisition module 202, a program pointer determination module 203 and a mechanical arm control module 204.
The target plug-in interface acquiring module 201 is configured to acquire a target plug-in interface corresponding to at least one function class included in the robot control program, and expose the target plug-in interface corresponding to the at least one function class, where the target plug-in interface is configured to call a program of the at least one function class included in the robot 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.
The custom information obtaining module 202 is configured to, after the target plug-in interface is exposed, obtain a target custom program and/or a target library file that meet the control requirement of the mechanical arm of the user, where the library file is a library file compiled based on the target custom program, and the target custom program is a custom program obtained based on the inherited and implemented target plug-in interface.
And the program pointer determining module 203 is configured to obtain an instantiation pointer corresponding to the target custom program based on the target custom program and/or the target library file.
And the mechanical arm control module 204 is configured to run the target self-defining program based on the instantiation pointer corresponding to the target self-defining program so as to control the target mechanical arm.
The mechanical arm control device provided by the application comprises the steps of firstly obtaining a target plug-in interface corresponding to at least one function class contained in a mechanical arm control program, then obtaining a target self-defined program and/or a target library file meeting the mechanical arm control requirement of a user after exposing the target plug-in interface, then obtaining an instantiation pointer corresponding to the target self-defined program based on the target self-defined program and/or the target library file, and finally running the self-defined program based on the instantiation pointer corresponding to the target self-defined program so as to control the target mechanical arm. According to the method and the device, at least one function class contained in the mechanical arm control program is realized as a target plug-in interface, so that a user can develop a target self-defining program meeting the control requirement of the mechanical arm based on the target plug-in interface, the control of the target mechanical arm can be realized by operating the target self-defining program, when the user needs to control the target mechanical arm according to other functions except the at least one function class, the additional addition of a program in a source code of the mechanical arm control program is not needed, the redundancy problem of the mechanical arm control program is avoided, the user does not need to send an instruction, the time delay of mechanical arm control is reduced, and the user experience is better.
In a possible implementation manner, the target plug-in interface obtaining module 201 may include: the function class acquisition inheritance module, the function pointer determination module and the virtual base class inheritance module.
And the function class acquisition and inheritance module is used for acquiring and inheriting at least one function class contained in the mechanical arm control program.
And the function pointer determining module is used for realizing the virtual functions contained in the at least one function class as interfaces so as to obtain instantiation pointers corresponding to the at least one function class.
And the virtual base class parameter transmission module is used for transmitting instantiation pointers corresponding to the at least one function class into the virtual base class as parameters to obtain a parameter-transmitted virtual base class, and the parameter-transmitted virtual base class is used as a target plug-in interface corresponding to the at least one function class.
In a possible implementation manner, when obtaining the instantiation pointer corresponding to the target self-defined program based on the target self-defined program, the program pointer determining module 203 may include: a program compiling module and a library file loading module.
And the program compiling module is used for compiling the target self-defining program into a target library file.
And the library file loading module is used for loading the target library file so as to obtain an instantiation pointer corresponding to the target self-defined program.
In a possible implementation manner, the library file loading module may be specifically configured to load the target library file by using a dlopen library function to obtain an instantiation pointer corresponding to the target library file, and use the instantiation pointer as the instantiation pointer corresponding to the target custom program.
In one possible implementation, the robot arm control module 204 may include: the device comprises an initialization interface calling module and a starting interface calling module.
The initialization interface calling module is used for calling an initialization interface in the target plug-in interface based on the instantiation pointer corresponding to the target custom program and initializing user resource information related to the target library file;
and the starting interface calling module is used for calling a starting interface in the target plug-in interface after initialization and running the target self-defined program.
In a possible implementation manner, the robot arm control device provided in the embodiment of the present application may further include: and stopping the interface calling module.
And the stop interface calling module is used for calling a stop interface in the target plug-in interface after the target custom program runs, and unloading the running target custom program.
In a possible implementation manner, the initialization interface, the start interface and the stop interface are non-blocking interfaces.
The embodiment of the application also provides mechanical arm control equipment. Alternatively, fig. 3 shows a block diagram of a hardware structure of the robot arm control apparatus, and referring to fig. 3, the hardware structure of the robot arm control apparatus 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;
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 complete communication with each other through the communication bus 304;
the processor 301 may be a central processing unit CPU, or an Application Specific Integrated Circuit ASIC (Application Specific Integrated Circuit), or one or more Integrated circuits configured to implement an embodiment of the present invention, etc.;
the memory 303 may include a high-speed RAM memory, and may further include a non-volatile memory (non-volatile memory) or the like, such as at least one disk memory;
wherein the memory 303 stores a program and the processor 301 may call the program stored in the memory 303 for:
acquiring a target plug-in interface corresponding to at least one function class contained in a mechanical 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 for calling the program of the at least one function class contained in the mechanical 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 for controlling a target mechanical arm to realize a corresponding function;
after exposing a target plug-in interface, acquiring a target custom program and/or a target library file which meet the control requirement of a mechanical arm of a user, wherein the library file is compiled based on the target custom program and is obtained, and the target custom program refers to the custom program obtained based on the inherited and realized target plug-in interface;
obtaining an instantiation pointer corresponding to the target self-defining program based on the target self-defining program and/or the target library file;
and running the target self-defining program based on the instantiation pointer corresponding to the target self-defining program so as to control the target mechanical arm.
Alternatively, the detailed function and the extended function of the program may be as described above.
Embodiments of the present application further provide a readable storage medium, on which a computer program is stored, where when the computer program is executed by a processor, the method for controlling a robot arm is implemented.
Alternatively, the detailed function and the extended function of the program may be as described above.
Finally, it should also be noted that, in this document, relational terms such as "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A robot arm control method is characterized by comprising the following steps:
acquiring a target plug-in interface corresponding to at least one function class contained in a mechanical 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 for calling the program of the at least one function class contained in the mechanical 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 for controlling a target mechanical arm to realize a corresponding function;
after the target plug-in interface is exposed, acquiring a target custom program and/or a target library file meeting the control requirement of a mechanical arm of a user, wherein the library file is compiled based on the target custom program, and the target custom program is a custom program obtained based on the inherited and realized target plug-in interface;
obtaining an instantiation pointer corresponding to the target self-defining program based on the target self-defining program and/or the target library file;
and operating the target self-defining program based on the instantiation pointer corresponding to the target self-defining program so as to control the target mechanical arm.
2. The method according to claim 1, wherein the obtaining of the target plug-in interface corresponding to at least one function class included in the robot control program comprises:
acquiring and inheriting at least one function class contained in the mechanical arm control program;
the virtual functions respectively contained in the at least one function class are realized as interfaces to obtain instantiation pointers respectively corresponding to the at least one function class;
and transmitting instantiation pointers corresponding to the at least one function class into a virtual base class as parameters to obtain a reference-transmitted virtual base class, and using the reference-transmitted virtual base class as a target plug-in interface corresponding to the at least one function class.
3. The mechanical arm control method of claim 1, wherein obtaining an instantiation pointer corresponding to the target custom program based on the target custom program comprises:
compiling the target custom program into the target library file;
and loading the target library file to obtain an instantiation pointer corresponding to the target self-defined program.
4. The method as claimed in claim 3, wherein the loading the target library file to obtain an instantiation pointer corresponding to the target custom program comprises:
and loading the target library file by using a dlopen library function to obtain an instantiation pointer corresponding to the target library file, wherein the instantiation pointer is used as the instantiation pointer corresponding to the target self-defined program.
5. The method for controlling a robot arm according to claim 1, wherein the running the target custom program based on the instantiation pointer corresponding to the target custom program comprises:
calling an initialization interface in the target plug-in interface based on an instantiation pointer corresponding to the target custom program, and initializing user resource information related to the target library file;
and after initialization, calling a starting interface in the target plug-in interface, and running the target custom program.
6. The robot arm control method according to claim 5, further comprising:
and after the target custom program runs, calling a stop interface in the target plug-in interface, and unloading the running target custom program.
7. The method of claim 6, wherein the initialization interface, the start interface, and the stop interface are non-blocking interfaces.
8. A robot arm control apparatus, comprising:
the system comprises a target plug-in interface acquisition module, a target plug-in interface acquisition module and a target plug-in interface acquisition module, wherein the target plug-in interface acquisition module is used for acquiring a target plug-in interface corresponding to at least one function class contained in a mechanical arm control program and exposing the target plug-in interface corresponding to the at least one function class, the target plug-in interface is used for calling the program of the at least one function class contained in the mechanical arm control program through an instantiation pointer of the at least one function class, and any one function class in the at least one function class is used for controlling a target mechanical arm to realize a corresponding function;
the user-defined information acquisition module is used for acquiring a target user-defined program and/or a target library file meeting the control requirement of the mechanical arm of a user after the target plug-in interface is exposed, wherein the library file is compiled based on the target user-defined program, and the target user-defined program is a user-defined program obtained based on the inherited and realized target plug-in interface;
the program pointer determining module is used for obtaining an instantiation pointer corresponding to the target self-defining program based on the target self-defining program and/or the target library file;
and the mechanical arm control module is used for operating the target self-defining program based on the instantiation pointer corresponding to the target self-defining program so as to control the target mechanical arm.
9. A robot arm control apparatus characterized by comprising a memory and a processor;
the memory is used for storing programs;
the processor is configured to execute the program to implement the steps of the robot arm control method according to any one of claims 1 to 7.
10. A readable storage medium having stored thereon a computer program for implementing the steps of the robot arm control method according to any of claims 1-7 when executed by a processor.
CN202211308971.3A 2022-10-25 2022-10-25 Mechanical arm control method, device, equipment and medium Pending CN115502980A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211308971.3A CN115502980A (en) 2022-10-25 2022-10-25 Mechanical arm control method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211308971.3A CN115502980A (en) 2022-10-25 2022-10-25 Mechanical arm control method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115502980A true CN115502980A (en) 2022-12-23

Family

ID=84513172

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211308971.3A Pending CN115502980A (en) 2022-10-25 2022-10-25 Mechanical arm control method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115502980A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050193392A1 (en) * 2004-02-27 2005-09-01 Francesco Carusi Method and system for instantiating components conforming to the "COM" specification in custom contexts
EP1944701A1 (en) * 2006-12-21 2008-07-16 Research In Motion Limited Sharing user defined location based zones
CN101683037A (en) * 2008-09-26 2010-03-31 中国农业大学 Controller for fruit picking robot
US20140075372A1 (en) * 2012-09-13 2014-03-13 Joyce Wu Pointer unification
WO2014114127A1 (en) * 2013-01-24 2014-07-31 Tencent Technology (Shenzhen) Company Limited Method, apparatus and system for webpage access control
CN104598282A (en) * 2015-02-05 2015-05-06 广州华多网络科技有限公司 Control capture method and equipment
CN109828796A (en) * 2019-01-17 2019-05-31 武汉精立电子技术有限公司 A kind of plug-in unit call method and device based on microkernel architecture
CN109910010A (en) * 2019-03-23 2019-06-21 广东石油化工学院 A kind of system and method for efficient control robot
CN113051088A (en) * 2021-03-31 2021-06-29 广州锦行网络科技有限公司 Program loading method, device, equipment and computer readable medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050193392A1 (en) * 2004-02-27 2005-09-01 Francesco Carusi Method and system for instantiating components conforming to the "COM" specification in custom contexts
EP1944701A1 (en) * 2006-12-21 2008-07-16 Research In Motion Limited Sharing user defined location based zones
CN101683037A (en) * 2008-09-26 2010-03-31 中国农业大学 Controller for fruit picking robot
US20140075372A1 (en) * 2012-09-13 2014-03-13 Joyce Wu Pointer unification
WO2014114127A1 (en) * 2013-01-24 2014-07-31 Tencent Technology (Shenzhen) Company Limited Method, apparatus and system for webpage access control
CN104598282A (en) * 2015-02-05 2015-05-06 广州华多网络科技有限公司 Control capture method and equipment
CN109828796A (en) * 2019-01-17 2019-05-31 武汉精立电子技术有限公司 A kind of plug-in unit call method and device based on microkernel architecture
CN109910010A (en) * 2019-03-23 2019-06-21 广东石油化工学院 A kind of system and method for efficient control robot
CN113051088A (en) * 2021-03-31 2021-06-29 广州锦行网络科技有限公司 Program loading method, device, equipment and computer readable medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
徐雪峰;黄余;: "基于机器视觉的机器人智能采摘实验平台开发", 中国农机化学报, no. 12, 15 December 2019 (2019-12-15), pages 183 - 189 *

Similar Documents

Publication Publication Date Title
CN109032706B (en) Intelligent contract execution method, device, equipment and storage medium
CN108121594B (en) Process management method and device
KR20050108518A (en) Robot control software framework in open distributed process architecture
US9792198B2 (en) Debugger with method restart capability
CN113641413B (en) Target model loading updating method and device, readable medium and electronic equipment
US20200210829A1 (en) Network off-line model processing method, artificial intelligence processing device and related products
CN113297566A (en) Sandbox implementation method, sandbox implementation device, sandbox implementation equipment and storage medium
CN112925717B (en) Method, apparatus, device and medium for determining object of call stack frame
CN112256421A (en) Communication processing method, communication processing device, storage medium and electronic equipment
CN114048415A (en) Form generation method and device, electronic equipment and computer readable storage medium
CN115502980A (en) Mechanical arm control method, device, equipment and medium
CN108667902B (en) Remote control system, method, device and equipment of iOS equipment
CN111352644A (en) Applet updating method, device, server and storage medium
CN110018831B (en) Program processing method, program processing apparatus, and computer-readable storage medium
CN111168668A (en) Robot control method and robot
CN114756243A (en) Custom module control system, method, device and storage medium
CN113760347B (en) Data processing
US8713545B2 (en) Architecture for accelerated computer processing
CN111258715B (en) Multi-operating system rendering processing method and device
EP3502887A2 (en) Interrupt handling for multiple virtual machines
CN112540835B (en) Method and device for operating hybrid machine learning model and related equipment
CN112929675B (en) Image resource compression method and device and electronic equipment
CN115061403A (en) Software-defined controller and programming method and motion control method thereof
EP3992795A1 (en) Computer system executing multiple operating systems
CN118656144A (en) Matlab drive loading method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination