Robot control method and device, electronic equipment and readable storage medium

The preset dictionary performs instruction decoding and queue management of robot task files, which solves the problem of poor expansion of robot programming instructions in the prior art, and achieves more efficient robot control and operation ease of use.

CN119512562APending Publication Date: 2025-02-25UBTECH ROBOTICS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411639257.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In the prior art, the expansion of robot programming instructions is poor, resulting in poor control effect on the robot.

Method used

The task file is decoded through a preset dictionary, and the instructions to be executed are generated and stored in the queue. To determine whether the current instruction has a predecessor command. If it exists and the predecessor command has been executed, the current instruction is executed.

Benefits of technology

It improves the scalability of robot operations, lowers the operating threshold, and enhances the ease of use of humanoid robots.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512562A_ABST
    Figure CN119512562A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a robot control method and device, electronic equipment and a readable storage medium, and belongs to the technical field of robots. The method comprises the steps of performing instruction decoding on a task file according to a preset dictionary to obtain at least one to-be-executed instruction, and storing each to-be-executed instruction into a to-be-executed instruction queue; each to-be-executed instruction comprises a command name, a command parameter and an execution state; reading a head instruction of the instruction queue to be executed as a current instruction; and judging whether the current instruction has a preorder instruction or not, and if the preorder instruction exists and execution of the preorder instruction is completed, executing the current instruction according to the preset dictionary. Therefore, the robot operation instruction is decoded through the preset dictionary, the decoding process is simple, the expansibility is high, complex robot operation can be programmed, the robot operation threshold is reduced, and the usability of the humanoid robot is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of robotics technology, and in particular to a robot control method, device, electronic device and readable storage medium. Background Art

[0002] In the prior art, robot programming instructions can be used to implement repetitive and complex operations. Currently, commercialized robotic arms have robot programming instructions, but their scalability is relatively poor. Currently, there are no commercial programming instructions for robots, and the existing programming instructions have a relatively poor control effect on robots. Summary of the invention

[0003] In order to solve the above technical problems, the embodiments of the present application provide a robot control method, device, electronic device and readable storage medium.

[0004] In a first aspect, an embodiment of the present application provides a method for controlling a robot, the method comprising:

[0005] Decode the task file according to the preset dictionary to obtain at least one instruction to be executed, and store each instruction to be executed in a queue of instructions to be executed; each instruction to be executed includes a command name, command parameters and execution status;

[0006] Reading the head instruction of the to-be-executed instruction queue as the current instruction;

[0007] It is determined whether the current instruction has a preceding instruction. If the preceding instruction exists and the preceding instruction has been executed, the current instruction is executed according to the preset dictionary.

[0008] In one embodiment, the method further comprises:

[0009] If the preceding instruction does not exist, the current instruction is executed according to the preset dictionary.

[0010] In one embodiment, the step of decoding the task file according to the preset dictionary includes:

[0011] Parsing the instruction code of the task file according to the dictionary structure of the preset dictionary to obtain the command name and command parameters corresponding to each line of instruction code;

[0012] The corresponding to-be-executed instruction is generated according to the command name and command parameters corresponding to each line of instruction code.

[0013] In one embodiment, the preset dictionary includes a keyword and a value, the keyword of the preset dictionary is a command name, and the value of the preset dictionary is a function pointer corresponding to the command name;

[0014] The executing the current instruction according to the preset dictionary includes:

[0015] Searching the preset dictionary for a target function pointer that matches the command name of the current instruction;

[0016] The corresponding target function is called according to the target function pointer, and the target function is executed according to the named parameters of the current instruction.

[0017] In one embodiment, the method further comprises:

[0018] Set the preamble parameters, which are used to specify the instructions to be executed in the preamble;

[0019] The determining whether the current instruction has a preceding instruction comprises:

[0020] Determining whether the current instruction has a preceding instruction according to the preceding parameter;

[0021] If the current instruction conflicts with the instruction in the preceding parameter, it is determined that the current instruction has a preceding instruction; or,

[0022] If it is determined according to the control sequence of the task file that the instruction in the preceding parameter needs to be executed before the current instruction, it is determined that the current instruction has a preceding instruction.

[0023] In one implementation, the setting of the preamble parameters includes:

[0024] Determine whether the current instruction conflicts with the previous instruction, and if the current instruction conflicts with the previous instruction, store the command name of the current instruction into the preceding parameter; or,

[0025] According to the control sequence of the task file, the command name of at least one instruction to be executed is stored in the preceding parameter respectively.

[0026] In one embodiment, the method further comprises:

[0027] If there is no conflict between the current instruction and the instruction in the preceding parameter, and it is determined according to the control sequence of the task file that the instruction in the preceding parameter does not need to be executed before the current instruction, it is determined that the current instruction has no preceding instruction.

[0028] In a second aspect, an embodiment of the present application provides a control device for a robot, the control device for the robot comprising:

[0029] A decoding module is used to decode the instructions of the task file according to a preset dictionary to obtain at least one instruction to be executed, and store each of the instructions to be executed into a queue of instructions to be executed; each of the instructions to be executed includes a command name, command parameters and execution status;

[0030] A reading module, used for reading the head instruction of the to-be-executed instruction queue as the current instruction;

[0031] The processing module is used to determine whether the current instruction has a preceding instruction, and if the preceding instruction exists and the preceding instruction has been executed, the current instruction is executed according to the preset dictionary. In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, the memory is used to store a computer program, and the computer program executes the robot control method provided in the first aspect when the processor is running.

[0032] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which executes the robot control method provided in the first aspect when the computer program is run on a processor.

[0033] The robot control method provided by the present application is to decode the instructions of the task file according to the preset dictionary, obtain at least one instruction to be executed, and store each of the instructions to be executed in the queue of instructions to be executed; each of the instructions to be executed includes a command name, command parameters and execution status; read the head instruction of the queue of instructions to be executed as the current instruction; determine whether the current instruction has a preceding instruction, if the preceding instruction exists and the preceding instruction has been executed, then execute the current instruction according to the preset dictionary. In this way, the robot operation instructions are decoded by the preset dictionary, the decoding process is simple, the scalability is strong, and complex robot operations can be programmed, the threshold for robot operation is lowered, and the usability of the humanoid robot is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope of protection of the present application. In each of the drawings, similar components are numbered similarly.

[0035] Figure 1 A schematic diagram of a process flow of a robot control method provided by an embodiment of the present application is shown;

[0036] Figure 2 An example diagram of instructions provided by an embodiment of the present application is shown;

[0037] Figure 3Another schematic diagram of the process of controlling a robot provided by an embodiment of the present application is shown;

[0038] Figure 4 Another schematic diagram of a process of controlling a robot provided in an embodiment of the present application is shown;

[0039] Figure 5 Another schematic diagram of a process of controlling a robot provided in an embodiment of the present application is shown;

[0040] Figure 6 A schematic structural diagram of a robot control device provided in an embodiment of the present application is shown.

[0041] Icon: 600: robot control device, 601: decoding module, 602: reading module, 603: processing module. DETAILED DESCRIPTION

[0042] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0043] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0044] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present application, are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing items.

[0045] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.

[0046] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.

[0047] Example 1

[0048] An embodiment of the present application provides a robot control method, which can perform instruction decoding processing on the robot's control instructions, realize controlling the robot to perform complex operations, and improve the scalability of the robot's control instructions.

[0049] In this embodiment, the robot may be a humanoid robot or other forms of robots, which are not limited here. The method may provide a set of control instructions to control the movement of a controlled object of the robot, wherein the controlled object may be a movable part, and the movable part may include an arm part, a leg part, a waist part, a head part, etc., which are not limited here.

[0050] See also Figure 1 The robot control method includes steps S101 to S103, and each step is described below.

[0051] Step S101 , decoding the instructions of the task file according to a preset dictionary to obtain at least one instruction to be executed, and storing each of the instructions to be executed into a queue of instructions to be executed.

[0052] In this embodiment, for the robot's task file, each task file may include multiple control instructions, which are used to control the robot to perform corresponding complex operations. The corresponding preset dictionary can be generated using the dictionary data format in the preset database, wherein the preset dictionary includes keywords, values, and parameter lists, the keywords of the preset dictionary are command names, the values ​​of the preset dictionary are function pointers corresponding to the command names; and the parameter list is the command parameters corresponding to the command names. The preset database can be a Python database or other databases, which are not limited here.

[0053] It can be understood that the meaning of each instruction to be executed can be determined by the robot manufacturer or robot programming. According to the dictionary structure of the Python database, the corresponding information is extracted from the corresponding string of the instruction to be executed. For example, for the following instruction: MOV_ARM q = [1,2,3,4,5], the instruction is decoded using the dictionary structure of the Python database, that is, the command name MOV_ARM and the command parameters [1,2,3,4,5,6] are extracted from the string.

[0054] In this embodiment, the dictionary structure of the Python database is used to decode instructions, which makes it easier to add new instructions, can significantly improve the development speed of robot control operations, and the robot programming instructions are more extensible.

[0055] In this embodiment, each of the to-be-executed instructions includes a command name, command parameters, and execution status. Exemplarily, each of the to-be-executed instructions may be a motion instruction of a movable component, for example, an operation instruction such as a left arm motion, a right arm motion, and a leg joint motion, which is not limited here.

[0056] Specifically, arm operation instructions include the following types: MOV_ARM_J: Control the arm to move in the joint space. The command parameter is the target joint position. If the left arm moves, the command name can be set to LA, and if the right arm moves, the command name can be set to RA. MOV_DUAL_ARM_J: Control both arms to move in the joint space at the same time. The command parameters include the desired positions of the left and right arms. MOV_ARM_W: Control the arm to move in a straight line in Cartesian space. The command parameters are the pose vectors (position and attitude) of the movement. MOV_DUAL_ARM_W: Control the arm to move in a straight line in Cartesian space. The command parameters include the desired pose vectors of the left and right arms. TELE_OP: Teleoperation instruction. Executing this instruction will enter the teleoperation mode, and then obtain joint movement instructions from the outside. The command parameters can specify whether to teleoperate the left arm, the right arm, or both arms. OPERATE_GRIPPER: Used to control the action of the gripper or dexterous manipulator. START_FORCE_MODE_ARM: The end of the arm enters the mixed control mode. For example, some degrees of freedom are controlled by position, and some degrees of freedom are controlled by force; the command parameters are desired degrees of freedom (desired_wrench) and degrees of freedom mask (dof_mask). Desired_wrench is a 6-element vector indicating the desired force or torque for each degree of freedom. dof_mask is also a 6-element vector, each element is an integer, which is used to determine the control mode of the current degree of freedom, such as 0 for position control, 1 for force tracking, etc. END_FORCE_MODE_ARM and START_FORCE_MODE_ARM are used together.

[0057] Leg operation commands include the following types: MOV_WAIST: Move the waist position, the command parameter is the desired waist position and posture. WALK_V: Walk at the desired speed, the command parameter is the walking speed, which includes the speed in the x, y, and yaw directions. WALK_Q: Walk to the desired position, the command parameter includes the x, y positions, and the yaw angle.

[0058] The variable modification instructions include the following types: CHANGE_ADMITTANCE_MBK: Modify the mass, damping and spring parameters in the arm admittance control mode. SET_PAYLOAD_INFO: Set the mass of the load when walking with weight, and also set the position of the center of mass at the same time. SET_ARM_TASK_CTRL_FRAME: Set the task space coordinate system of the arm, that is, in which coordinate system to perform the task.

[0059] Other flow control instructions include the following: WAIT: Stops executing instructions in the execution queue for a given time. EXE_MULT_LINES: By default, only one instruction is executed at a time until it is completed. This instruction can execute multiple instructions at a time, and the command parameter is the number of instructions to be executed simultaneously. For example, you can perform arm operations while squatting.

[0060] It should be noted that arm operation instructions, leg operation instructions, variable modification instructions and other process control instructions may also include other instructions, which are not limited here. Complex instruction control of the robot can be achieved by combining arm operation instructions, leg operation instructions, variable modification instructions and other process control instructions. Complex instruction control can be generated in combination with actual needs.

[0061] It can be understood that for instructions to be executed, a line of instructions to be executed is a string of characters, such as MOV_ARMq=[1,2,3,4,5]. The instructions to be executed are decoded, that is, the command name MOV_ARM and command parameters [1,2,3,4,5,6] are extracted from the string. The corresponding robot action is to move the arm to the position [1,2,3,4,5,6].

[0062] For example, an instruction for carrying heavy objects using a combination of the aforementioned related instructions is as follows: Figure 2As shown in the figure, instruction 1 is to adjust the waist position, instruction 2 is to change the joint movement speed, instructions 3-6 are to adjust the position of both arms to the vicinity of the box, instruction 7 is to operate both arms at the same time, instructions 8-11 are to set the control mode of both arms, and instructions 12-15 are mainly to squat down to pick up the box and move the waist upward to adjust the posture. In this way, the entire handling process of the robot can be represented by fewer lines of code.

[0063] See also Figure 3 , step S101 includes:

[0064] Step S1011, parsing the instruction code of the task file according to the dictionary structure of the preset dictionary to obtain the command name and command parameters corresponding to each line of instruction code;

[0065] Step S1012: Generate the corresponding to-be-executed instruction according to the command name and command parameters corresponding to each line of instruction code.

[0066] Exemplarily, in each line of instruction code, the first word is specified as the command name, followed by the command parameters, that is, the named parameters are the parameter list corresponding to the command name, and the parameter list corresponds to the data structure of the preset dictionary of the Python database. The parameter list can be directly parsed using the data format of the preset dictionary of Python to generate the instructions to be executed for each line of code.

[0067] Step S102, reading the head instruction of the to-be-executed instruction queue as the current instruction.

[0068] See also Figure 4 , the decoding thread can be used as a separate thread, and the instruction execution process can be used as the robot control thread. The decoding process and the robot control thread complement each other, and the relevant data are placed in a shared queue. The decoding thread includes: reading the task file with instructions, decoding each line of instruction code, obtaining the decoded instructions to be executed, and storing the instructions to be executed in the queue of instructions to be executed. The robot control thread includes: determining whether the queue of instructions to be executed is empty. If it is not empty, read the head instruction as the current instruction. Each time the robot control thread executes an instruction, it will put it into the current instruction queue and query the status.

[0069] It should be noted that the shared queue is a queue that can be accessed by both the decoding thread and the robot control thread. The current instruction queue and the pending instruction queue are both shared queues. The pending instruction queue contains the command name, command parameters, and execution status of the instructions that have not yet been executed. The current instruction queue contains the command name, command parameters, and execution status of all instructions being executed.

[0070] Step S103, determining whether there is a preceding instruction for the current instruction; if there is a preceding instruction and the preceding instruction has been executed, executing the current instruction according to the preset dictionary.

[0071] In this embodiment, the preceding parameter is used to specify a preceding instruction, which needs to be executed before the current instruction. That is, if the preceding parameter is not empty, the current instruction can only be executed after the instructions in the preceding parameter are executed.

[0072] In one embodiment, the method further includes: setting a preceding parameter, wherein the preceding parameter is used to specify the instruction to be executed in the preceding order. For example, if the current instruction is to control waist operation, and the previous instruction is also a waist operation, the command name of the waist operation can be put into the preceding parameter, and then it is necessary to wait for the previous instruction (i.e., the previous waist operation) to be executed before entering the current waist operation, so as to avoid conflicts in the operations of the same movable part.

[0073] In one implementation, the setting of the preamble parameters includes:

[0074] Determine whether the current instruction conflicts with the previous instruction, and if the current instruction conflicts with the previous instruction, store the command name of the current instruction into the preceding parameter; or,

[0075] According to the control sequence of the task file, the command name of at least one instruction to be executed is stored in the preceding parameter respectively.

[0076] For example, if the current instruction is to control the left arm operation, and the previous instruction is also for the left arm operation, then the command name of the current left arm operation can be put into the preceding parameter, and the current instruction will wait for the previous instruction (i.e. the previous arm operation) to be executed, thus avoiding the conflict of operations on the same movable part. In addition, it can also be used for sequential control, for example, the instruction name of the right arm can be put into the preceding parameter, and the current instruction will be executed only after the right arm has finished moving.

[0077] In this embodiment, the method further includes: if the preceding instruction does not exist, executing the current instruction according to the preset dictionary. Exemplarily, if the preceding instruction is empty and the current instruction does not have a preceding instruction, the current instruction can be directly executed in the current control cycle to improve the control efficiency of the robot.

[0078] Please see again Figure 4, the robot control thread also includes: if the current instruction has a preceding instruction, then determine whether the preceding instruction has been executed. If the preceding instruction has been executed, then execute the current instruction. If the preceding instruction has not been executed, then store the current instruction in the current instruction queue, wait for the next control cycle, and execute the current instruction in the next control cycle.

[0079] In this embodiment, a dictionary form may be used, the keyword of the dictionary is the command name, and the value of the dictionary is the function pointer. When the program is initialized, a preset dictionary may be initialized, and the preset dictionary maps the supported command names to the function names, that is, each command name corresponds to a function pointer, and the function pointer is used to call the corresponding function, input the command parameters into the called function, and execute the corresponding instruction.

[0080] In one implementation, the determining whether the current instruction has a preceding instruction in step S103 includes:

[0081] Determining whether the current instruction has a preceding instruction according to the preceding parameter;

[0082] If the current instruction conflicts with the instruction in the preceding parameter, it is determined that the current instruction has a preceding instruction; or,

[0083] If it is determined according to the control sequence of the task file that the instruction in the preceding parameter needs to be executed before the current instruction, it is determined that the current instruction has a preceding instruction.

[0084] Exemplarily, if the current instruction is to control the left foot operation, and the predecessor parameter includes the left foot operation, then there is a conflict between the current instruction and the instruction in the predecessor parameter, and it is determined that there is a predecessor instruction for the left foot operation, and the predecessor instruction is the previous left foot operation. For example, the predecessor parameter includes the instruction name of the right arm movement, and the control order in the task file is: the right arm movement is before the left arm movement. If the current instruction is the left arm movement, since the predecessor parameter includes the instruction name of the right arm movement, it is determined that the predecessor instruction for the left arm movement is the right arm movement.

[0085] In one embodiment, the method further comprises:

[0086] If there is no conflict between the current instruction and the instruction in the preceding parameter, and it is determined according to the control sequence of the task file that the instruction in the preceding parameter does not need to be executed before the current instruction, it is determined that the current instruction has no preceding instruction.

[0087] See also Figure 5 , the executing the current instruction according to the preset dictionary in step S103 includes:

[0088] Step S1031, searching the preset dictionary for a target function pointer that matches the command name of the current instruction;

[0089] Step S1032, calling the corresponding target function according to the target function pointer, and executing the target function according to the named parameters of the current instruction.

[0090] It can be understood that the preset dictionary includes keywords, values ​​and parameter lists. The keywords are command names, and the values ​​of the dictionary are function pointers. The command name of the current instruction can be queried in the preset dictionary, and the corresponding target function pointer can be matched based on the queried command name. The target function pointer is used to indicate the function storage location corresponding to the queried command name. The target function pointer can call the target function from the corresponding storage location, substitute the named parameters of the current instruction into the target function, and run the target function, thereby executing the current instruction to control the robot to perform related operations.

[0091] The robot control method provided in this embodiment decodes the instructions of the task file according to the preset dictionary to obtain at least one instruction to be executed, and stores each of the instructions to be executed in the queue of instructions to be executed; each of the instructions to be executed includes a command name, command parameters and execution status; reads the head instruction of the queue of instructions to be executed as the current instruction; determines whether the current instruction has a preceding instruction, and if the preceding instruction exists and the preceding instruction has been executed, executes the current instruction according to the preset dictionary. In this way, the robot operation instructions are decoded by the preset dictionary, the decoding process is simple, the scalability is strong, and complex robot operations can be programmed, the threshold for robot operation is lowered, and the usability of the humanoid robot is improved.

[0092] Example 2

[0093] In addition, an embodiment of the present application provides a control device for a robot.

[0094] like Figure 6 As shown, the control device 600 of the robot includes:

[0095] The decoding module 601 is used to decode the instructions of the task file according to the preset dictionary to obtain at least one instruction to be executed, and store each of the instructions to be executed into a queue of instructions to be executed; each of the instructions to be executed includes a command name, command parameters and execution status;

[0096] A reading module 602 is used to read the head instruction of the to-be-executed instruction queue as the current instruction;

[0097] The processing module 603 is used to determine whether there is a preceding instruction for the current instruction. If there is a preceding instruction and the preceding instruction has been executed, the current instruction is executed according to the preset dictionary.

[0098] In one implementation, the processing module 603 is configured to execute the current instruction according to the preset dictionary if the preceding instruction does not exist.

[0099] In one embodiment, the decoding module 601 is used to parse the instruction code of the task file according to the dictionary structure of the preset dictionary to obtain the command name and command parameters corresponding to each line of instruction code;

[0100] The corresponding to-be-executed instruction is generated according to the command name and command parameters corresponding to each line of instruction code.

[0101] In one embodiment, the preset dictionary includes keywords and values, the keywords of the preset dictionary are command names, and the values ​​of the preset dictionary are function pointers corresponding to the command names; the processing module 603 is used to search the preset dictionary for a target function pointer that matches the command name of the current instruction;

[0102] The corresponding target function is called according to the target function pointer, and the target function is executed according to the named parameters of the current instruction.

[0103] In one embodiment, the robot control device 600 further includes:

[0104] A setting module, used to set preamble parameters, wherein the preamble parameters are used to specify instructions to be executed preamble;

[0105] A processing module 603 is used to determine whether the current instruction has a preceding instruction according to the preceding parameter;

[0106] If the current instruction conflicts with the instruction in the preceding parameter, it is determined that the current instruction has a preceding instruction; or,

[0107] If it is determined according to the control sequence of the task file that the instruction in the preceding parameter needs to be executed before the current instruction, it is determined that the current instruction has a preceding instruction.

[0108] In one embodiment, a module is provided to determine whether the current instruction conflicts with the previous instruction, and if the current instruction conflicts with the previous instruction, the command name of the current instruction is stored in the preceding parameter; or

[0109] According to the control sequence of the task file, the command name of at least one instruction to be executed is stored in the preceding parameter respectively.

[0110] In one embodiment, the processing module 603 is used to determine that the current instruction does not have a preceding instruction if there is no conflict between the current instruction and the instruction in the preceding parameter, and it is determined according to the control sequence of the task file that the instruction in the preceding parameter does not need to be executed before the current instruction.

[0111] The robot control device 600 provided in this embodiment can implement the robot control method provided in Example 1, and will not be described again here to avoid repetition.

[0112] The robot control device provided in this embodiment decodes the instructions of the task file according to the preset dictionary to obtain at least one instruction to be executed, and stores each of the instructions to be executed in the queue of instructions to be executed; each of the instructions to be executed includes a command name, command parameters and execution status; reads the head instruction of the queue of instructions to be executed as the current instruction; determines whether the current instruction has a preceding instruction, and if the preceding instruction exists and the preceding instruction has been executed, executes the current instruction according to the preset dictionary. In this way, the robot operation instructions are decoded by the preset dictionary, the decoding process is simple, the scalability is strong, and complex robot operations can be programmed, the threshold for robot operation is lowered, and the usability of the humanoid robot is improved.

[0113] Example 3

[0114] In addition, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, the robot control method provided in Example 1 is executed.

[0115] The electronic device provided in this embodiment can implement the robot control method provided in Example 1, and will not be described again here to avoid repetition.

[0116] Example 4

[0117] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the robot control method provided in Example 1 is implemented.

[0118] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0119] The computer-readable storage medium provided in this embodiment can implement the robot control method provided in Example 1, and will not be described again here to avoid repetition.

[0120] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal 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 terminal. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or terminal including the element.

[0121] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0122] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A robot control method, characterized in that: The method comprises: Decode the task file according to the preset dictionary to obtain at least one instruction to be executed, and store each instruction to be executed in a queue of instructions to be executed; each instruction to be executed includes a command name, command parameters and execution status; Reading the head instruction of the to-be-executed instruction queue as the current instruction; It is determined whether the current instruction has a preceding instruction. If the preceding instruction exists and the preceding instruction has been executed, the current instruction is executed according to the preset dictionary.

2. The method according to claim 1, characterized in that The method further comprises: If the preceding instruction does not exist, the current instruction is executed according to the preset dictionary.

3. The method according to claim 1, characterized in that The step of decoding the task file according to the preset dictionary includes: Parsing the instruction code of the task file according to the dictionary structure of the preset dictionary to obtain the command name and command parameters corresponding to each line of instruction code; The corresponding to-be-executed instruction is generated according to the command name and command parameters corresponding to each line of instruction code.

4. The method according to claim 1 or 2, characterized in that: The preset dictionary includes keywords and values, the keywords of the preset dictionary are command names, and the values ​​of the preset dictionary are function pointers corresponding to the command names; The executing the current instruction according to the preset dictionary includes: Searching the preset dictionary for a target function pointer that matches the command name of the current instruction; The corresponding target function is called according to the target function pointer, and the target function is executed according to the named parameters of the current instruction.

5. The method according to claim 1, characterized in that: The method further comprises: Set the preamble parameters, which are used to specify the instructions to be executed in the preamble; The determining whether the current instruction has a preceding instruction comprises: Determining whether the current instruction has a preceding instruction according to the preceding parameter; If the current instruction conflicts with the instruction in the preceding parameter, it is determined that the current instruction has a preceding instruction; or, If it is determined according to the control sequence of the task file that the instruction in the preceding parameter needs to be executed before the current instruction, it is determined that the current instruction has a preceding instruction.

6. The method according to claim 5, characterized in that The setting of the preceding parameters includes: Determine whether the current instruction conflicts with the previous instruction, and if the current instruction conflicts with the previous instruction, store the command name of the current instruction into the preceding parameter; or, According to the control sequence of the task file, the command name of at least one instruction to be executed is stored in the preceding parameter respectively.

7. The method according to claim 5, characterized in that The method further comprises: If there is no conflict between the current instruction and the instruction in the preceding parameter, and it is determined according to the control sequence of the task file that the instruction in the preceding parameter does not need to be executed before the current instruction, it is determined that the current instruction has no preceding instruction.

8. A robot control device, characterized in that: The device comprises: A decoding module is used to decode the instructions of the task file according to a preset dictionary to obtain at least one instruction to be executed, and store each of the instructions to be executed into a queue of instructions to be executed; each of the instructions to be executed includes a command name, command parameters and execution status; A reading module, used for reading the head instruction of the to-be-executed instruction queue as the current instruction; The processing module is used to determine whether there is a preceding instruction for the current instruction, and if the preceding instruction exists and the preceding instruction has been executed, execute the current instruction according to the preset dictionary.

9. A robot, characterized in that: The robot control method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the robot control method according to any one of claims 1 to 7 is executed.

10. A computer-readable storage medium, characterized in that: The computer program stores a computer program, which executes the robot control method according to any one of claims 1 to 7 when running on a processor.