WO2018054303A1 - 一种控制机器人的方法及装置 - Google Patents

一种控制机器人的方法及装置 Download PDF

Info

Publication number
WO2018054303A1
WO2018054303A1 PCT/CN2017/102475 CN2017102475W WO2018054303A1 WO 2018054303 A1 WO2018054303 A1 WO 2018054303A1 CN 2017102475 W CN2017102475 W CN 2017102475W WO 2018054303 A1 WO2018054303 A1 WO 2018054303A1
Authority
WO
WIPO (PCT)
Prior art keywords
logic block
logic
block
user
robot
Prior art date
Application number
PCT/CN2017/102475
Other languages
English (en)
French (fr)
Inventor
黄真
潘毅飞
Original Assignee
遨博(北京)智能科技有限公司
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 遨博(北京)智能科技有限公司 filed Critical 遨博(北京)智能科技有限公司
Publication of WO2018054303A1 publication Critical patent/WO2018054303A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions

Definitions

  • the present invention relates to the field of robot technology, and in particular, to a method and apparatus for controlling a robot.
  • the user writes the control logic of the robot in a procedural procedural language under the guidance of the teach pendant.
  • the teach pendant sends instructions to the robot by converting the control logic written by the user in the procedural procedural language into an interpreted procedural language, thereby implementing control of the robot.
  • an embodiment of the present invention discloses a method for controlling a robot, including:
  • the instructions for each logical block transformation are sent to the robot to control the robot.
  • the logic block is divided into a basic condition logic block and an advanced condition logic block according to a preset condition, wherein the preset condition includes a frequency at which the logic block is selected or a control corresponding to editing the logic block The difficulty of logic statements;
  • the step of displaying a preset logic block includes:
  • the advanced conditional logic block option button in the programming interface When it is detected that the advanced conditional logic block option button in the programming interface is pressed, the advanced conditional logic block is displayed in the programming interface.
  • the step of displaying the logic block selected by the user in a tree structure in an order determined by the user comprises:
  • the logic block selected by the user is displayed in a tree structure from top to bottom;
  • the logical block editing button is: add button or delete button.
  • the step of displaying the logic block configuration interface corresponding to the logic block for each logical block selected by the user includes:
  • a logic block configuration interface is displayed; the logic block configuration interface includes all optional parameters of the logic block, and/or a parameter input box of the logic block.
  • the program logic corresponding to the logic block is generated according to the configuration parameter selected by the user. And converting the program logic corresponding to the logic block into instructions that the robot can recognize, including:
  • the XML language source code corresponding to the logic block is converted into a script language code recognizable by the robot.
  • the programming interface is integrated in the robot teach pendant software.
  • an embodiment of the present invention further discloses an apparatus for controlling a robot, including:
  • a first display unit configured to display a preset logic block; wherein each logic block corresponds to a control logic statement;
  • An obtaining unit configured to acquire a logical block selected by a user
  • a second display unit configured to display a logic block selected by the user in a tree structure in an order determined by the user
  • a third display unit configured to display, according to each logical block selected by the user, a logical block configuration interface corresponding to the logical block;
  • a receiving unit configured to receive a configuration parameter corresponding to the logic block selected by the user through the logic block configuration interface
  • a conversion unit configured to generate program logic corresponding to the logic block according to a configuration parameter selected by the user, and convert the program logic corresponding to the logic block into an instruction recognizable by the robot;
  • control unit configured to send the instruction for each logical block conversion to the robot to control the robot.
  • the device further comprises:
  • a dividing unit configured to divide the logical block into a basic condition logic block and an advanced condition logic block according to a preset condition, where the preset condition includes a frequency at which the logic block is selected or edit the logic block corresponding to The difficulty of controlling the logic statement;
  • the first display unit includes:
  • a first display subunit configured to display a programming interface according to a user instruction
  • a second display subunit configured to display a basic condition logic block in the programming interface when detecting that a basic condition logic block option button in the programming interface is pressed;
  • a third display subunit configured to: when detecting an advanced conditional logic block option in the programming interface When the button is pressed, the advanced conditional logic block is displayed in the programming interface.
  • the second display unit comprises:
  • a fourth display subunit configured to display, in a first preset area of the programming interface, a logical block selected by a user from top to bottom in a first preset area of the programming interface;
  • a fifth display subunit configured to: when it is detected that any one of the programming interface is pressed, perform an editing operation corresponding to the logic block editing button, add a logic block in the tree structure or Delete the position of the logic block in the tree structure; the logic block edit button is: add button or delete button.
  • the third display unit is specifically configured to:
  • a logic block configuration interface is displayed; the logic block configuration interface includes all optional parameters of the logic block, and/or a parameter input box of the logic block.
  • the converting unit comprises:
  • a first conversion unit configured to: when detecting that the confirmation button in the logic block configuration interface is pressed, generate an XML language source code corresponding to the logic block according to the configuration parameter selected by the user;
  • the second conversion unit is configured to convert the XML language source code corresponding to the logic block into a script language code recognizable by the robot.
  • the method for controlling a robot provided by an embodiment of the present invention, after obtaining a logical block selected by a user from a displayed logical block, adding the logical block to the tree structure according to the order in which the user selects the logical block, and in each logical block
  • the configuration interface selects the configuration parameters corresponding to each logic block, generates program logic corresponding to the logic block, and further converts the program logic into an instruction that the robot can recognize, and the robot can be controlled by the instruction.
  • the user only needs to select the required logic block from the displayed logic block, and then selects the configuration parameters of each logic block through the logic block configuration interface, thereby realizing the control of the robot, thereby simplifying the control.
  • the robot's method allows non-professionals to master the method of controlling the robot in a short time. It is not necessarily necessary to achieve all of the advantages described above at the same time to implement any of the products or methods of the present invention.
  • FIG. 1 is a flowchart of a method for controlling a robot according to an embodiment of the present invention
  • FIG. 2 is an interface diagram of selecting a Loop logic block in a basic condition logic block in a method for controlling a robot according to an embodiment of the present invention
  • FIG. 3 is an interface diagram of a tree structure generated by a basic condition logic block selected by a user in a method for controlling a robot according to an embodiment of the present invention
  • FIG. 4 is an interface diagram of selecting an advanced condition logic block in a method for controlling a robot according to an embodiment of the present invention
  • FIG. 5 is a configuration interface diagram of a Loop logic block in a basic condition logic block in a method for controlling a robot according to an embodiment of the present invention
  • FIG. 6 is a configuration interface diagram of a Set logic block in a basic condition logic block in a method for controlling a robot according to an embodiment of the present invention
  • FIG. 7 is a configuration interface diagram of an If logic block in a basic condition logic block in a method for controlling a robot according to an embodiment of the present invention
  • FIG. 8 is a configuration interface diagram of a Move logic block in a basic condition logic block in a method for controlling a robot according to an embodiment of the present invention
  • FIG. 9 is a configuration interface diagram of a Waypoint logic block in a basic condition logic block in a method for controlling a robot according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of an apparatus for controlling a robot according to an embodiment of the present invention.
  • Embodiments of the present invention provide a method and apparatus for controlling a robot to simplify control of operation of the robot and reduce requirements for users.
  • the logic selected by the user is obtained from the displayed logic block.
  • the selected logic block is sequentially added to the tree structure according to the order of the logic blocks selected by the user, and the configuration interface corresponding to the logic block is displayed for each logical block selected by the user, and the configuration interface is selected in the configuration interface.
  • the configuration parameter corresponding to the logic block obtains the program logic corresponding to the logic block, and further converts the program logic into an instruction recognizable by the robot, so that the control of the robot can be realized by the instruction.
  • the method and apparatus for controlling a robot simplifies a method of controlling a robot, so that a non-professional person grasps a method of controlling the robot in a short time.
  • FIG. 1 is a flowchart of a method for controlling a robot according to an embodiment of the present invention, including the following steps:
  • each logical block corresponds to a control logic language, and when each logical block is displayed, the user can see the name of the displayed logical block.
  • Loop logic block Break logic block, Continue logic block, Condition (If/Else if/Else) logic block, Switch logic block, Case logic block, Default (Default) Logic Block, Line Comment Logic Block, Block Logic Block, Move Logic Block, Waypoint/Waypoint Logic Block, Set Logic Block, Wait ( Wait) Logic block, Thread logic block, Procedure logic block, Script logic block, Message logic block, Track logic block, and so on.
  • the conditional (If/Else if/Else) logical block represents three logical blocks, including an If logical block, an Else if logical block, and an Else logical block.
  • S103 Display a logical block selected by a user in a tree structure in an order determined by a user.
  • the selected logical block is sequentially added to the tree structure according to the order of selecting the logical block.
  • the tree structure is blank before the user selects any logic block. It can be understood that the tree structure does not exist.
  • the selected logic block is added to the blank tree.
  • each of the logic blocks corresponds to a respective logic block configuration interface
  • the logic block configuration interface is used to select a configuration parameter corresponding to the logic block.
  • each configuration parameter of the logical block is selected, the configuration parameter is received, and the configuration parameter is received. It is noted that the configuration parameters corresponding to each logical block are pre-edited, and the user according to his actual situation. Requirements, in the configuration parameters, select the appropriate configuration parameters; in addition, some logic block configuration parameters only need to perform simple parameter input.
  • the generated tree structure selecting configuration parameters for the logic blocks in the tree structure, and generating corresponding program logic of the logic blocks in the tree structure, so that the program logic corresponding to the tree structure is the tree shape
  • the logic of the program corresponding to each logical block in the structure is converted into an instruction that the robot can recognize, that is, the program logic corresponding to the tree structure is converted into an instruction that the robot can recognize.
  • the instruction is sent to the robot, and the robot performs an action according to the instruction to implement control of the robot.
  • the tree structure is generated according to the logic block selected by the user, so the logical block selected by the user is different, and the generated tree structure is also different, then the program logic corresponding to the tree structure is also different, then the program logic is converted.
  • the instructions that the robot can recognize are different, thus controlling the robot to perform different actions. Therefore, the user can select different logic blocks according to his own needs, and generate different tree structures, so that the program logic is converted into different instructions that the robot can recognize, and the robot is controlled to perform different actions.
  • each logic block selects the configuration parameter corresponding to each logic block, generates program logic corresponding to the logic block, converts the program logic into an instruction recognizable by the robot, and realizes control of the robot.
  • the method of controlling the robot is simplified, so that the non-professionals grasp the method of controlling the robot in a short time.
  • the logic block is divided into a basic condition logic block and an advanced condition logic block according to a preset condition, where the preset condition includes that the logic block is selected.
  • the frequency or the difficulty level of the control logic statement corresponding to the logic block is edited, and the logic block is divided into a basic condition logic block and an advanced condition logic block according to a preset condition.
  • the basic condition logic block includes: Loop logic block, Break logic block, Continue logic block, Condition (If/Else if/Else) logic block, Switch logic block, Instance (Case) logic block, default (Default) logic block, line comment (Line Comment) logic block, segment comment (Block) logic block, move (Move) logic block, waypoint / motion pose (Waypoint) logic block, settings ( Set) Logic block, Wait logic block.
  • the high-level conditional logic block includes: a Thread logic block, a procedure logic block, a script logic block, a message logic block, and a track logic block.
  • the condition (If/Else if/Else) logic block can be replaced with a switch logic block, a case logic block, and a default logic block, that is, in a tree structure,
  • the three logical blocks of the Switch logical block, the Case logical block, and the Default logical block replace the three logical blocks of the If logical block, the Else if logical block, and the Else logical block.
  • the step of displaying a preset logic block includes: displaying a programming interface according to a user instruction; displaying, when the basic condition logic block option button in the programming interface is pressed, displaying in the programming interface A base condition logic block; when it is detected that an advanced conditional logic block option button in the programming interface is pressed, an advanced conditional logic block is displayed in the programming interface.
  • FIG. 2 is an interface diagram of selecting a Loop logic block in a basic condition logic block in a method for controlling a robot according to an embodiment of the present invention. 2 shows that when the user selects the basic condition logic block option button (Basic) is pressed, after the basic condition logic block is displayed in the programming interface, the user selects the Loop in the Basic Condition logic block.
  • the logic block shows the name of the Loop logic block under the Project Program.
  • the Basic Condition logic block is displayed in the programming interface.
  • the Advanced Condition logic block is displayed in the programming interface.
  • Figure 2 also shows the project button, subengineering procedure, conditional button, development kit button (Wizard), adding the logic block button (Add before), adding the logic block afterwards.
  • Button (Add after), Copy button (Copy), Paste button (Paste), Delete button (Remove), Variable button (Variable), Script button (Script), Simulator button (Track), Start button ( Start), Stop button (Stop) and Next button (Step).
  • the step of displaying the logic block selected by the user in a tree structure in the order determined by the user comprises: in the order of the user selecting the logic block, in the first preset area of the programming interface, in a tree shape
  • the structure displays a logic block selected by the user from top to bottom; when it is detected that any one of the logic block editing buttons in the programming interface is pressed, performing an editing operation corresponding to the logic block editing button, in the tree structure Add a logical block or delete the position of the logical block in the tree structure; the logical block edit button is: add button or delete button.
  • the first preset area is the area where the Project Program in FIG. 2 is located.
  • FIG. 3 is an interface diagram of a tree structure generated by a basic condition logic block selected by a user in a method for controlling a robot according to an embodiment of the present invention.
  • FIG. 3 shows that the logic blocks selected by the user include: a Loop logic block, an If logic block, a Move logic block, a Waypoint logic block, and an Else logic block, and the order of the user-selected sequential logic blocks is a Loop logic block and an If logic.
  • the logical block selected by the user is displayed in a tree structure from top to bottom.
  • the logic block editing button includes: an add button and a delete button; the add button includes: adding a logic before button (Add before) and adding a logical after button (Add after).
  • the delete button is used to delete the selected logical block in the tree structure and the logical block under the logical block. For example, in the first preset area, a Loop logic block is selected, and when a previous add logic block button (Add before) is pressed, a Loop logic block is added before the Loop logic block, and a logic block is added later. When the button (Add after) is pressed, a Loop logic block is added after the Loop logic block.
  • the first preset area select a Loop logic block, and when the delete button is When (Remove) is pressed, the Loop logic block in the tree structure and the logic block below the Loop logic block are deleted.
  • the first preset area is the area where the Project Program in FIG. 2 is located.
  • the logic block selected by the user is in the first preset area in the programming interface, and the logical block selected by the user is displayed from top to bottom in the order of selecting the logical block. For example, when the Loop logic block is selected, the Loop logic block is added.
  • the first preset area when the user selects the If logic block, adds the If logic block to the bottom of the Loop logic block in the first preset area.
  • FIG. 4 is an interface diagram of selecting an advanced condition logic block in a method for controlling a robot according to an embodiment of the present invention. 4 illustrates that selecting an advanced conditional logic block includes: a Thread logic block, a procedure logic block, a script logic block, a message logic block, a track logic block, and the like.
  • the step of displaying a logical block configuration interface corresponding to the logic block for each logical block selected by the user includes:
  • a logic block configuration interface is displayed; the logic block configuration interface includes all optional parameters of the logic block, and/or a parameter input box of the logic block.
  • the second preset area is the area where the Loop Condition is located.
  • the configuration interface of the Loop logic block includes optional parameters of the Loop logic block, and the optional parameters include: loop always, Loop times and loop conditions are given.
  • the second preset area further includes: a clear button, a delete button, and a confirm button. The clear button is used to clear the content of the user input in the parameter input box of the Loop logic block.
  • the step of generating the program logic corresponding to the logic block according to the configuration parameter selected by the user, and converting the program logic corresponding to the logic block into an instruction recognizable by the robot includes:
  • the XML language source code corresponding to the Loop logic block is generated according to the loop always selected by the user, or according to the user selected Loop times to generate Loop logic blocks
  • Corresponding XML language source code, or configuration parameters of a loop condition generates an XML language source code corresponding to the Loop logic block.
  • the XML language source code corresponding to the logic block is converted into a script language code recognizable by the robot.
  • the XML language source code corresponding to the logic block is program logic corresponding to the logic block
  • the script language code recognizable by the robot is an instruction that the robot can recognize.
  • the robot can be controlled. For example, after the XML language source code is converted into the script language code, when it is detected that the start button (Start) in FIG. 5 is pressed, the robot starts to operate, and when it is detected that the stop button (Stop) is pressed When it is down, the robot stops the action being performed. When it detects that the next step (Step) is pressed, the robot will perform the next action of the current action.
  • FIG. 6 is a configuration interface diagram of a Set logic block in a basic condition logic block in a method for controlling a robot according to an embodiment of the present invention.
  • the second preset area is the area where the Set Condition is located.
  • the configuration interface of the Set logic block includes an optional parameter of the Set logic block and a parameter input box of the Set logic block.
  • the second preset area further includes: a clear button, a delete button, and a confirm button.
  • the clear button is used to clear the content of the user input in the parameter input box of the logic block.
  • FIG. 7 is a configuration interface diagram of an If logic block in a basic condition logic block in a method for controlling a robot according to an embodiment of the present invention.
  • the second preset area is an area where the If Condition is located.
  • the configuration interface of the If logic block includes a parameter input box of the If logic block.
  • the second preset area further includes: a clear button, a button for adding an Else If logic block, a button for adding an Else logic block, a remove button, and a confirm button.
  • the clear button is used to clear the content of the user input in the parameter input box of the logic block, and the button for adding the Else If logic block is used to add an Else If logic block in the tree structure, the adding Else logic block
  • the button is used to add a button to the Else logic block in the tree structure.
  • the delete button is used to delete the If logical block in the tree structure and the logical block under the If logical block. For example, in FIG. 7, when it is detected that the delete button (Remove) is pressed, the first preset area is deleted (Project The If logic block in the area where the Program is located and the Move logic block under the If logic block and the two Waypoint logic blocks.
  • FIG. 8 is a configuration interface diagram of a Move logic block in a basic condition logic block in a method for controlling a robot according to an embodiment of the present invention.
  • the configuration interface of the Move logic block includes optional parameters of the Move logic block.
  • the second preset area further includes: a reverse button (Reversal), a delete button (Remove), and a confirmation button (Confirm).
  • the clear button is used to clear the content of the user input in the parameter input box of the logic block.
  • the confirmation button is used to convert the program logic corresponding to the Move logic block into an instruction that the robot can recognize.
  • FIG. 9 is a configuration interface diagram of a Waypoint logic block in a basic condition logic block in a method for controlling a robot according to an embodiment of the present invention.
  • the method includes: adding a logic before button (Add before) and adding a logic after button (Add after), a drag and drop button (Set Waypoint), and a move button (Move here).
  • the Add before button is used to add a Waypoint logical block before the logical block of the Waypoint in the tree structure
  • the Add before button is used to add a Waypoint logical block after the Waypoint logical block in the tree structure.
  • the Set Waypoint is used to drag and drop the robot in the simulation map
  • the Move here button is used to move the robot in the simulation map to the target position.
  • the simulation map is the robot simulation diagram shown in FIG.
  • the source code of the XML language corresponding to the Loop logic block is:
  • the script language script code corresponding to the Loop logic block is:
  • the XML language source code corresponding to the Set logic block is:
  • the script language script code corresponding to the Set logic block is:
  • Var_bool_1 not var_bool_1
  • row_number 0
  • the corresponding basic condition logic block displays the position of the Set logic block in the interface
  • logic_mark 12
  • mode_mark 6
  • the source code of the XML language corresponding to the If logic block is:
  • the source code of the script language corresponding to the If logic block is:
  • the source code of the XML language corresponding to the Move and Waypoint logic blocks is:
  • the source code of the script language corresponding to the Move and Waypoint logic blocks is:
  • the source code of the XML language corresponding to the Else logic block is:
  • the source code of the script language corresponding to the Else logic block is:
  • Embodiments of the present invention also provide an apparatus for controlling a robot.
  • FIG. 10 is a schematic structural diagram of an apparatus for controlling a robot according to an embodiment of the present invention, including:
  • a first display unit 1010 configured to display a preset logic block; wherein each logic block corresponds to a control logic statement;
  • An obtaining unit 1020 configured to acquire a logic block selected by a user
  • the second display unit 1030 is configured to display the logic block selected by the user in a tree structure in an order determined by the user;
  • the third display unit 1040 is configured to display, according to each logical block selected by the user, a logical block configuration interface corresponding to the logical block;
  • the receiving unit 1050 is configured to receive the logic block selected by the user through the logic block configuration interface. Corresponding configuration parameters;
  • the converting unit 1060 is configured to generate program logic corresponding to the logic block according to the configuration parameter selected by the user, and convert the program logic corresponding to the logic block into an instruction that the robot can recognize;
  • the control unit 1070 is configured to send the instruction for each logical block conversion to the robot to control the robot.
  • the device further includes:
  • a dividing unit configured to divide the logical block into a basic condition logic block and an advanced condition logic block according to a preset condition, where the preset condition includes a frequency at which the logic block is selected or edit the logic block corresponding to The difficulty of controlling the logic statement;
  • the first display unit includes:
  • a first display subunit configured to display a programming interface according to a user instruction
  • a second display subunit configured to display a basic condition logic block in the programming interface when detecting that a basic condition logic block option button in the programming interface is pressed;
  • a third display subunit configured to display the advanced condition logic block in the programming interface when it is detected that the advanced conditional logic block option button in the programming interface is pressed.
  • the second display unit includes:
  • a fourth display subunit configured to display, in a first preset area of the programming interface, a logical block selected by a user from top to bottom in a first preset area of the programming interface;
  • a fifth display subunit configured to: when it is detected that any one of the programming interface is pressed, perform an editing operation corresponding to the logic block editing button, add a logic block in the tree structure or Delete the position of the logical block or move the logical block in the tree structure; the logical block edit button is: add button or delete button or move button.
  • the third display unit is specifically configured to:
  • a logic block configuration interface is displayed; the logic block configuration interface includes all optional parameters of the logic block, and/or a parameter input box of the logic block.
  • the conversion unit includes:
  • a first conversion unit configured to: when detecting that the confirmation button in the logic block configuration interface is pressed, generate an XML language source code corresponding to the logic block according to the configuration parameter selected by the user;
  • a second conversion unit configured to convert the XML language source code corresponding to the logic block into a robot energy A sufficiently recognizable scripting language code.
  • obtaining a logical block selected by a user from the displayed logical block obtaining a logical block selected by a user from the displayed logical block, generating a tree structure according to the logical block selected by the user, and selecting a configuration parameter of each logical block in a configuration interface corresponding to each logical block.
  • the program logic corresponding to the logic block in the tree structure is generated, and the program logic corresponding to the tree structure is converted into an instruction that the robot can recognize, and the control of the robot is realized. In this way, the method of controlling the robot is simplified, so that the non-professionals grasp the method of controlling the robot in a short time.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.

Abstract

一种控制机器人的方法及装置,所述方法包括:显示预先设置的逻辑块(S101);获取用户选择的逻辑块(S102);按用户确定的顺序,以树形结构显示用户选择的逻辑块(S103);针对用户选择的每个逻辑块,显示该逻辑块对应的逻辑块配置界面(S104);接收用户通过所述逻辑块配置界面选择的该逻辑块对应的配置参数(S105);按照用户选择的配置参数,生成该逻辑块对应的程序逻辑,并将该逻辑块对应的程序逻辑转换为机器人能够识别的指令(S106);将针对每个逻辑块转换的所述指令发送给机器人,对机器人进行控制(S107)。应用该方法,简化了控制机器人的方法,使得非专业人员在短时间内掌握控制机器人的方法。

Description

一种控制机器人的方法及装置
本申请要求于2016年09月20号提交中国专利局、申请号为201610833829.9、发明名称为“一种控制机器人的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及机器人技术领域,特别是涉及一种控制机器人的方法及装置。
背景技术
目前,对传统机器人的控制,需要专业的技术人员编写复杂抽象的程序来实现对机器人的控制,为了简化对机器人的控制难度,主流的机器人大部分采用过程语言(即不需要编译,直接可以运行)对机器人进行控制。虽然过程语言与以前的复杂抽象的程序相比较,降低了部分难度,可是过程语言依旧难以被非专业人员掌握使用,所以出现了示教器来控制机器人的模式。
现有技术大多采用示教器结合类过程语言的方式来控制机器人,具体控制机器人过程主要包括两个步骤:
第一,用户在示教器的指导下,用类过程语言来编写机器人的控制逻辑。
第二,示教器将用户用类过程语言编写的控制逻辑转换为解释性过程语言的指令发送给机器人,从而实现对机器人的控制。
可见,当用户对机器人进行控制时,仍然需要用户用类过程语言来编写机器人的控制逻辑。这样的控制方式比较复杂,对用户本身的要求比较高,非专业人员难以通过短时间的学习,来掌握控制机器人的方法。
发明内容
本发明实施例的目的在于提供一种控制机器人的方法及装置,以简化控制机器人的操作,降低对用户的要求。具体技术方案如下:
一方面,本发明实施例公开了一种控制机器人的方法,包括:
显示预先设置的逻辑块;其中,每个逻辑块对应一条控制逻辑语句;
获取用户选择的逻辑块;
按用户确定的顺序,以树形结构显示用户选择的逻辑块;
针对用户选择的每个逻辑块,显示该逻辑块对应的逻辑块配置界面;
接收用户通过所述逻辑块配置界面选择的该逻辑块对应的配置参数;
按照用户选择的配置参数,生成该逻辑块对应的程序逻辑,并将该逻辑块对应的程序逻辑转换为机器人能够识别的指令;
将针对每个逻辑块转换的所述指令发送给机器人,对机器人进行控制。
较佳的,所述逻辑块根据预设条件被划分为基础条件逻辑块和高级条件逻辑块,其中,所述预设条件包括所述逻辑块被选择的频率或者编辑所述逻辑块对应的控制逻辑语句的难易程度;
所述显示预先设置的逻辑块的步骤,包括:
按用户指令显示编程界面;
当检测到所述编程界面中的基础条件逻辑块选项按钮被按下,则在所述编程界面中显示基础条件逻辑块;
当检测到所述编程界面中的高级条件逻辑块选项按钮被按下,则在所述编程界面中显示高级条件逻辑块。
较佳的,所述按用户确定的顺序,以树形结构显示用户选择的逻辑块的步骤,包括:
按用户选择逻辑块的顺序,在所述编程界面的第一预设区域中,以树形结构由上至下显示用户选择的逻辑块;
当检测到所述编程界面中的任一个逻辑块编辑按钮被按下,则执行该逻辑块编辑按钮对应的编辑操作,在所述树形结构中增加逻辑块或删除逻辑块在树形结构中的位置;所述逻辑块编辑按钮为:增加按钮或删除按钮。
较佳的,所述针对用户选择的每个逻辑块,显示该逻辑块对应的逻辑块配置界面的步骤,包括:
在所述编程界面的第二预设区域中,显示逻辑块配置界面;所述逻辑块配置界面中包含该逻辑块所有可选的参数,和/或该逻辑块的参数输入框。
较佳的,所述按照用户选择的配置参数,生成该逻辑块对应的程序逻辑, 并将该逻辑块对应的程序逻辑转换为机器人能够识别的指令的步骤,包括:
当检测到所述逻辑块配置界面中的确认按钮被按下,则按照用户选择的配置参数,生成该逻辑块对应的XML语言源代码;
将该逻辑块对应的XML语言源代码转换为机器人能够识别的脚本语言代码。
较佳的,所述的编程界面集成于机器人示教器软件中。
另一方面,本发明实施例还公开了一种控制机器人的装置,包括:
第一显示单元,用于显示预先设置的逻辑块;其中,每个逻辑块对应一条控制逻辑语句;
获取单元,用于获取用户选择的逻辑块;
第二显示单元,用于按用户确定的顺序,以树形结构显示用户选择的逻辑块;
第三显示单元,用于针对用户选择的每个逻辑块,显示该逻辑块对应的逻辑块配置界面;
接收单元,用于接收用户通过所述逻辑块配置界面选择的该逻辑块对应的配置参数;
转换单元,用于按照用户选择的配置参数,生成该逻辑块对应的程序逻辑,并将该逻辑块对应的程序逻辑转换为机器人能够识别的指令;
控制单元,用于将针对每个逻辑块转换的所述指令发送给机器人,对机器人进行控制。
较佳的,所述装置还包括:
划分单元,用于将所述逻辑块根据预设条件被划分为基础条件逻辑块和高级条件逻辑块,其中,所述预设条件包括所述逻辑块被选择的频率或者编辑所述逻辑块对应的控制逻辑语句的难易程度;
所述第一显示单元,包括:
第一显示子单元,用于按用户指令显示编程界面;
第二显示子单元,用于当检测到所述编程界面中的基础条件逻辑块选项按钮被按下,则在所述编程界面中显示基础条件逻辑块;
第三显示子单元,用于当检测到所述编程界面中的高级条件逻辑块选项按 钮被按下,则在所述编程界面中显示高级条件逻辑块。
较佳的,所述第二显示单元,包括:
第四显示子单元,用于按用户选择逻辑块的顺序,在所述编程界面的第一预设区域中,以树形结构由上至下显示用户选择的逻辑块;
第五显示子单元,用于当检测到所述编程界面中的任一个逻辑块编辑按钮被按下,则执行该逻辑块编辑按钮对应的编辑操作,在所述树形结构中增加逻辑块或删除逻辑块在树形结构中的位置;所述逻辑块编辑按钮为:增加按钮或删除按钮。
较佳的,所述第三显示单元具体用于:
在所述编程界面的第二预设区域中,显示逻辑块配置界面;所述逻辑块配置界面中包含该逻辑块所有可选的参数,和/或该逻辑块的参数输入框。
较佳的,所述转换单元,包括:
第一转换单元,用于当检测到所述逻辑块配置界面中的确认按钮被按下,则按照用户选择的配置参数,生成该逻辑块对应的XML语言源代码;
第二转换单元,用于将该逻辑块对应的XML语言源代码转换为机器人能够识别的脚本语言代码。
本发明实施例提供的控制机器人的方法,在获得用户从显示的逻辑块中选择的逻辑块后,将该逻辑块按照用户选择逻辑块的顺序,添加到树形结构,并在每个逻辑块的配置界面,选择每个逻辑块对应的配置参数,生成该逻辑块对应的程序逻辑,进一步将程序逻辑转换为机器人能够识别的指令,通过该指令就可以实现对机器人的控制。应用本发明实施例,用户只需要从显示的逻辑块中,选择出需要的逻辑块,再通过逻辑块配置界面选择各个逻辑块的配置参数,就能够实现对机器人的控制,因此,简化了控制机器人的方法,使得非专业人员在短时间内掌握控制机器人的方法。实施本发明的任一产品或方法必不一定需要同时达到以上所述的所有优点。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述 中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的控制机器人的方法的流程图;
图2为本发明实施例提供的控制机器人的方法中,选择基础条件逻辑块中Loop逻辑块的界面图;
图3为本发明实施例提供的控制机器人的方法中,用户选择的基础条件逻辑块生成的树形结构的界面图;
图4为本发明实施例提供的控制机器人的方法中,选择高级条件逻辑块的界面图;
图5为本发明实施例提供的控制机器人的方法中,基础条件逻辑块中的Loop逻辑块的配置界面图;
图6为本发明实施例提供的控制机器人的方法中,基础条件逻辑块中的Set逻辑块的配置界面图;
图7为本发明实施例提供的控制机器人的方法中,基础条件逻辑块中的If逻辑块的配置界面图;
图8为本发明实施例提供的控制机器人的方法中,基础条件逻辑块中的Move逻辑块的配置界面图;
图9为本发明实施例提供的控制机器人的方法中,基础条件逻辑块中的Waypoint逻辑块的配置界面图;
图10为本发明实施例提供的控制机器人的装置的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例提供了一种控制机器人的方法及装置,以简化控制机器人的操作,降低对用户的要求。
需要说明的是,本发明实施例,从显示的逻辑块中,获得用户选择的逻辑 块后,按照用户选择的逻辑块的顺序,依次将所选择的逻辑块,添加到树形结构,针对用户选择的每个逻辑块,显示该逻辑块对应的配置界面,在该配置界面选择该逻辑块对应的配置参数,得到该逻辑块对应的程序逻辑,进一步将程序逻辑转换为机器人能够识别的指令,这样,通过所述指令,就可以实现对机器人的控制。本发明实施例的控制机器人的方法及装置,简化了控制机器人的方法,使得非专业人员在短时间内掌握控制机器人的方法。
参见图1,图1为本发明实施例提供的控制机器人的方法的流程图,包括以下步骤:
S101,显示预先设置的逻辑块;其中,每个逻辑块对应一条控制逻辑语句;
具体的,每个逻辑块对应一条控制逻辑语言,在显示每个逻辑块时,用户能够看到显示的逻辑块的名称。例如,循环(Loop)逻辑块、中断(Break)逻辑块、继续(Continue)逻辑块、条件(If/Else if/Else)逻辑块、交换(Switch)逻辑块、实例(Case)逻辑块、默认(Default)逻辑块、行注释(Line Comment)逻辑块、段注释(Block)逻辑块、移动(Move)逻辑块、路点/运动姿态(Waypoint)逻辑块、设置(Set)逻辑块、等待(Wait)逻辑块、线程(Thread)逻辑块、过程(Procedure)逻辑块、脚本(Script)逻辑块、消息(Message)逻辑块、轨迹(Track)逻辑块等。其中,条件(If/Else if/Else)逻辑块代表三个逻辑块,包括If逻辑块、Else if逻辑块以及Else逻辑块。
S102,获取用户选择的逻辑块;
在显示的预先设置的逻辑块中,当用户选择逻辑块中的一个逻辑块时,就得到该逻辑块及该逻辑块对应的一条控制逻辑语句。
S103,按用户确定的顺序,以树形结构显示用户选择的逻辑块;
优选的,用户在选择的逻辑块时,根据选择逻辑块的顺序,依次将选择的逻辑块添加到树形结构。这里。需要注意的是,在用户没有选择任何逻辑块之前,树形结构是空白的,可以理解为,树形结构不存在,当用户选择一个逻辑块时,将选择的逻辑块添加到空白的树形结构,当用户选择了多个逻辑块时,将多个逻辑块按照选择逻辑块的先后顺序依次将所述多个逻辑块,添加到树形结构,从而生成包括多个逻辑块的完整的树形结构。
S104,针对用户选择的每个逻辑块,显示该逻辑块对应的逻辑块配置界面;
可以理解的是,在所述树形结构中,包含多个用户选择的逻辑块,每个逻辑块的对应各自的逻辑块配置界面,该逻辑块配置界面用于选择该逻辑块对应的配置参数。
S105,接收用户通过所述逻辑块配置界面选择的该逻辑块对应的配置参数;
在每个逻辑块配置界面,选择了该逻辑块对应的配置参数后,接收所述配置参数,需要注意的是,每个逻辑块对应的配置参数很多是预先编辑好的,用户根据自己的实际需求,在配置参数中,选择合适配置参数即可;另外有些逻辑块的配置参数也只需要进行简单的参数输入即可。
S106,按照用户选择的配置参数,生成该逻辑块对应的程序逻辑,并将该逻辑块对应的程序逻辑转换为机器人能够识别的指令;
在所生成的树形结构中,为该树形结构中的逻辑块选择配置参数,并生成树形结构中的逻辑块的对应的程序逻辑,这样,树形结构对应的程序逻辑为该树形结构中每个逻辑块对应的程序逻辑组成的。树形结构中的每个逻辑块对应的程序逻辑转换为机器人能够识别的指令,也就是将树形结构对应的程序逻辑转换为机器人能够识别的指令。
S107,将针对每个逻辑块转换的所述指令发送给机器人,对机器人进行控制。
在将树形结构中的逻辑块对应的程序逻辑转换为机器人能够识别的指令后,将所述指令发送给机器人,机器人就会按照该指令执行动作,以实现对机器人的控制。
需要注意的是,树形结构是根据用户选择的逻辑块生成的,所以用户选择的逻辑块不同,生成的树形结构也不同,那么树形结构对应的程序逻辑也不同,则将程序逻辑转换为机器人能够识别的指令也就不同,从而控制机器人完成不同的动作。所以,用户可以根据自己的需求,选择不同的逻辑块,生成不同的树形结构,使得将程序逻辑转换为机器人能够识别的不同指令,控制机器人完成不同的动作。
应用上述各个实施例,从显示的逻辑块中,获得用户所选择的逻辑块后,将用户所选择的逻辑块,按照用户选择逻辑块的顺序,添加到树形结构,在每 个逻辑块的配置界面,选择每个逻辑块对应的配置参数,生成该逻辑块对应的程序逻辑,将所述程序逻辑转换为机器人能够识别的指令,实现对机器人的控制。这样,简化了控制机器人的方法,使得非专业人员在短时间内掌握控制机器人的方法。
在本发明实施例的一种可能的实现方式中,所述逻辑块根据预设条件被划分为基础条件逻辑块和高级条件逻辑块,其中,所述预设条件包括所述逻辑块被选择的频率或者编辑所述逻辑块对应的控制逻辑语句的难易程度,将逻辑块根据预设条件被划分为基础条件逻辑块和高级条件逻辑块。
具体的,基础条件逻辑块包括:循环(Loop)逻辑块、中断(Break)逻辑块、继续(Continue)逻辑块、条件(If/Else if/Else)逻辑块、交换(Switch)逻辑块、实例(Case)逻辑块、默认(Default)逻辑块、行注释(Line Comment)逻辑块、段注释(Block)逻辑块、移动(Move)逻辑块、路点/运动姿态(Waypoint)逻辑块、设置(Set)逻辑块、等待(Wait)逻辑块。
所述高级条件逻辑块包括:线程(Thread)逻辑块、过程(Procedure)逻辑块、脚本(Script)逻辑块、消息(Message)逻辑块、轨迹(Track)逻辑块。其中,所述条件(If/Else if/Else)逻辑块可以和交换(Switch)逻辑块、实例(Case)逻辑块、默认(Default)逻辑块三者替换,即在树形结构中,可以用Switch逻辑块、Case逻辑块以及Default逻辑块这三各逻辑块替换If逻辑块、Else if逻辑块以及Else逻辑块这三个逻辑块。
具体的,所述显示预先设置的逻辑块的步骤,包括:按用户指令显示编程界面;当检测到所述编程界面中的基础条件逻辑块选项按钮被按下,则在所述编程界面中显示基础条件逻辑块;当检测到所述编程界面中的高级条件逻辑块选项按钮被按下,则在所述编程界面中显示高级条件逻辑块。
参见图2,图2为本发明实施例提供的控制机器人的方法中,选择基础条件逻辑块中的Loop逻辑块的界面图。图2示出了,当检测到用户选择了基础条件逻辑块选项按钮(Basic)被按下时,在编程界面中显示基础条件(Basic Condition)逻辑块后,用户选择Basic Condition逻辑块中的Loop逻辑块,在工程项目(Project Program)下显示了Loop逻辑块的名称。
例如,当检测到用户选择了基础条件逻辑块选项按钮(Basic)被按下时, 在编程界面中显示基础条件(Basic Condition)逻辑块。当检测到用户选择了高级条件逻辑块选项按钮(Advanced)被按下时,在编程界面中显示基础条件(Advanced Condition)逻辑块。
图2还示出了,工程按钮(Project)、子工程按钮(procedure)、条件按钮(Condition)、开发工具包按钮(Wizard)、在前增加逻辑块按钮(Add before)、在后增加逻辑块按钮(Add after)、复制按钮(Copy)、粘贴按钮(Paste)、删除按钮(Remove)、变量按钮(Variable)、脚本按钮(Script)、仿真按钮(Simulator)轨迹按钮(Track)、开始按钮(Start)、停止按钮(Stop)以及下一步按钮(Step)。
优选的,所述按用户确定的顺序,以树形结构显示用户选择的逻辑块的步骤,包括:按用户选择逻辑块的顺序,在所述编程界面的第一预设区域中,以树形结构由上至下显示用户选择的逻辑块;当检测到所述编程界面中的任一个逻辑块编辑按钮被按下,则执行该逻辑块编辑按钮对应的编辑操作,在所述树形结构中增加逻辑块或删除逻辑块在树形结构中的位置;所述逻辑块编辑按钮为:增加按钮或删除按钮。需要注意的是,这里,所述第一预设区域为图2中的Project Program所在的区域。
参见图3,图3为本发明实施例提供的控制机器人的方法中,用户选择的基础条件逻辑块生成的树形结构的界面图。图3示出了,在用户选择的逻辑块包括:Loop逻辑块、If逻辑块、Move逻辑块、Waypoint逻辑块以及Else逻辑块,且用户选择的顺序逻辑块的顺序是Loop逻辑块、If逻辑块、Move逻辑块、Waypoint逻辑块、Waypoint逻辑块、Else逻辑块、Move逻辑块、Waypoint逻辑块以及Waypoint逻辑块;按照用户选择逻辑块的顺序,在所述编程界面的第一预设区域中,以树形结构由上至下显示用户选择的逻辑块。
这里,所述逻辑块编辑按钮包括:增加按钮和删除按钮;所述增加按钮包括:在前增加逻辑块按钮(Add before)和在后增加逻辑块按钮(Add after)。所述删除按钮(Remove)用于删除树形结构中选择的逻辑块以及该逻辑块下的逻辑块。例如,在所述第一预设区域中,选择Loop逻辑块,当在前增加逻辑块按钮(Add before)被按下时,在Loop逻辑块前增加一个Loop逻辑块,当在后增加逻辑块按钮(Add after)被按下时,在Loop逻辑块后增加一个Loop逻辑块。又如,在所述第一预设区域中,选择Loop逻辑块,当删除按钮 (Remove)被按下时,树形结构中的Loop逻辑块以及Loop逻辑块以下的逻辑块都被删除了。需要注意的是,所述第一预设区域为图2中的Project Program 所在的区域。
可见,用户选择的逻辑块在编程界面中的第一预设区域,以选择逻辑块的顺序,由上至下显示用户选择的逻辑块,例如,当选择Loop逻辑块时,将Loop逻辑块加入所述第一预设区域,当用户选择If逻辑块时,将If逻辑块添加至第一预设区域中的Loop逻辑块的下方。
参见图4,图4为本发明实施例提供的控制机器人的方法中,选择高级条件逻辑块的界面图。图4示出了,选择高级条件逻辑块包括:线程(Thread)逻辑块、过程(Procedure)逻辑块、脚本(Script)逻辑块、消息(Message)逻辑块、轨迹(Track)逻辑块等。
在本发明实施例的一种可能的实现方式中,所述针对用户选择的每个逻辑块,显示该逻辑块对应的逻辑块配置界面的步骤,包括:
在所述编程界面的第二预设区域中,显示逻辑块配置界面;所述逻辑块配置界面中包含该逻辑块所有可选的参数,和/或该逻辑块的参数输入框。
例如,如图5所示,在编辑界面的第二预设区域中,这里,所述第二预设区域为Loop Condition所在的区域。图5示出了,在所述第二预设区域中,Loop逻辑块的配置界面中,包含了Loop逻辑块的可选的参数,所述可选的参数包括:始终循环(loop always)、给定次数循环(loop times)以及条件循环(loop condition)。在所述第二预设区域还包括:清空按钮(Clear)、删除按钮(Remove)以及确认按钮(Confirm)。所述清空按钮用于清空所述Loop逻辑块的参数输入框中的用户输入的内容。
另外,所述按照用户选择的配置参数,生成该逻辑块对应的程序逻辑,并将该逻辑块对应的程序逻辑转换为机器人能够识别的指令的步骤,包括:
当检测到所述逻辑块配置界面中的确认按钮被按下,则按照用户选择的配置参数,生成该逻辑块对应的XML语言源代码;
例如,当检测到所述逻辑块配置界面中的确认按钮(Confirm)被按下,按照用户选择的始终循环(loop always),生成Loop逻辑块对应的XML语言源代码,或者按照用户选择的给定次数循环(loop times),生成Loop逻辑块 对应的XML语言源代码,或者条件循环(loop condition)的配置参数,生成Loop逻辑块对应的XML语言源代码。
将该逻辑块对应的XML语言源代码转换为机器人能够识别的脚本语言代码。
这里,所述逻辑块对应的XML语言源代码为所述逻辑块对应的程序逻辑,所述机器人能够识别的脚本语言代码为所述机器人能够识别的指令。根据所述指令,就可以控制机器人。例如,在所述XML语言源代码转换为所述脚本语言代码之后,当检测到图5中的开始按钮(Start)被按下时,机器人就开始动作,当检测到停止按钮(Stop)被按下时,机器人就停止正在执行的动作,当检测到下一步按钮(Step)被按下时,机器人将执行当前动作的下一步动作。
需要注意的是,上述各个实施例中的编程界面集成于机器人示教器软件中。
参见图6,图6为本发明实施例提供的控制机器人的方法中,基础条件逻辑块中的Set逻辑块的配置界面图。
例如,在编辑界面的第二预设区域中,这里,所述第二预设区域为Set Condition所在的区域。在所述第二预设区域中,Set逻辑块的配置界面中,包含了Set逻辑块的可选的参数以及Set逻辑块的参数输入框。在所述第二预设区域还包括:清空按钮(Clear)、删除按钮(Remove)以及确认按钮(Confirm)。所述清空按钮用于清空所述逻辑块的参数输入框中的用户输入的内容。
图7为本发明实施例提供的控制机器人的方法中,基础条件逻辑块中的If逻辑块的配置界面图。具体的,这里,所述第二预设区域为If Condition所在的区域。在所述第二预设区域中,If逻辑块的配置界面中,包含了If逻辑块的参数输入框。在所述第二预设区域还包括:清空按钮(Clear)、增加Else If逻辑块的按钮、增加Else逻辑块的按钮、删除按钮(Remove)以及确认按钮(Confirm)。所述清空按钮用于清空所述逻辑块的参数输入框中的用户输入的内容,所述增加Else If逻辑块的按钮用于在树形结构中增加Else If逻辑块,所述增加Else逻辑块的按钮用于在树形结构中增加Else逻辑块的按钮。所述删除按钮用于删除树形结构中的该If逻辑块以及该If逻辑块下的逻辑块。例如,图7中,当检测到删除按钮(Remove)被按下时,删除第一预设区域(Project  Program所在的区域)中的If逻辑块以及该If逻辑块下的Move逻辑块及两个Waypoint逻辑块。
图8为本发明实施例提供的控制机器人的方法中,基础条件逻辑块中的Move逻辑块的配置界面图。具体的,在编辑界面的第二预设区域中,这里,所述第二预设区域为Move Condition所在的区域。在所述第二预设区域中,Move逻辑块的配置界面中,包含了Move逻辑块的可选的参数。在所述第二预设区域还包括:翻转按钮(Reversal)、删除按钮(Remove)以及确认按钮(Confirm)。所述清空按钮用于清空所述逻辑块的参数输入框中的用户输入的内容。所述确认按钮用于将Move逻辑块对应的程序逻辑转换为机器人能够识别的指令。
图9为本发明实施例提供的控制机器人的方法中,基础条件逻辑块中的Waypoint逻辑块的配置界面图。具体的,在编辑界面的第二预设区域中,这里,所述第二预设区域为Waypoint Condition所在的区域。在所述第二预设区域中,包括:在前增加逻辑块按钮(Add before)和在后增加逻辑块按钮(Add after)、拖拽按钮(Set Waypoint)以及移动按钮(Move here)。所述Add before按钮用于在树形结构中该Waypoint的逻辑块之前加一个Waypoint的逻辑块,所述Add before按钮用于在树形结构中该Waypoint的逻辑块后加一个Waypoint的逻辑块,所述Set Waypoint用于拖拽仿真图中的机器人,所述Move here按钮用于将仿真图中的机器人移动到目标位置。这里,仿真图是图9中所显示的机器人仿真图。
下来介绍本发明实施例中的树形结构的程序逻辑(XML语言源代码)与脚本语言代码的对应关系。
以图3中所示的树形结构为例。其中,
Loop逻辑块对应的XML语言源代码为:
<model logic="Loop"row_number="0"logic_mark="3"mode_mark="1">
<attribute mode="Always"/>
</model>
其中,row_number="0",对应的基础条件逻辑块显示界面中的Loop逻辑块的位置,logic_mark="3"表示Loop逻辑块用3来表示,mode_mark="1"对应 配置界面中的always选项。
Loop逻辑块对应的脚本语言Script代码为:
setRunLine(0)
while(true)do
end
Set逻辑块对应的XML语言源代码为:
Figure PCTCN2017102475-appb-000001
Set逻辑块对应的脚本语言Script代码为:
setRunLine(1)
var_bool_1=not var_bool_1
其中,row_number="1",对应的基础条件逻辑块显示界面中的Set逻辑块的位置,logic_mark="12"表示Set逻辑块用12来表示,mode_mark="6"对应配置界面中的Set Variable选项。
If逻辑块对应的XML语言源代码为:
Figure PCTCN2017102475-appb-000002
Figure PCTCN2017102475-appb-000003
If逻辑块对应的脚本语言源代码为:
setRunLine(2)
if(var_bool_1)then
end
其中,row_number="2",对应的基础条件逻辑块显示界面中的If逻辑块的位置,logic_mark="4"表示If逻辑块用4来表示,mode_mark="4"对应配置界面中的Input condition,0bda7cec17f14c4e9f814b50b22a9c0d对应配置界面中的var_bool_1。
Move和Waypoint逻辑块对应的XML语言源代码为:
Figure PCTCN2017102475-appb-000004
Figure PCTCN2017102475-appb-000005
Move和Waypoint逻辑块对应的脚本语言源代码为:
Figure PCTCN2017102475-appb-000006
其中,在"Move"row_number="3"logic_mark="10"mode_mark="1"中,row_number="3"表示Move逻辑块在对应的基础条件逻辑块显示界面中的位置,logic_mark="10"表示Move逻辑块用10来表示,mode_mark="4"对应配置界面中的Move Joint。
在<model logic="Waypoint"row_number="4"logic_mark="11">中,row_number="4"表示Waypoint逻辑块在对应的基础条件逻辑块显示界面中的位置,logic_mark="11"表示Waypoint逻辑块用11来表示。
在<model logic="Waypoint"row_number="5"logic_mark="11">中,row_number="5"表示Waypoint逻辑块在对应的基础条件逻辑块显示界面中的位置,logic_mark="11"表示Waypoint逻辑块用11来表示。
Else逻辑块对应的XML语言源代码为:
<model logic="Else"row_number="6"logic_mark="6">
</model>
Else逻辑块对应的脚本语言源代码为:
setRunLine(6)
else
其中,Else"row_number="6"表示Else逻辑块在对应的基础条件逻辑块显示界面中的位置,logic_mark="6"表示Else逻辑块用6来表示。
本发明实施例还提供了一种控制机器人的装置。
参见图10,图10为本发明实施例提供的控制机器人的装置的结构示意图,包括:
第一显示单元1010,用于显示预先设置的逻辑块;其中,每个逻辑块对应一条控制逻辑语句;
获取单元1020,用于获取用户选择的逻辑块;
第二显示单元1030,用于按用户确定的顺序,以树形结构显示用户选择的逻辑块;
第三显示单元1040,用于针对用户选择的每个逻辑块,显示该逻辑块对应的逻辑块配置界面;
接收单元1050,用于接收用户通过所述逻辑块配置界面选择的该逻辑块 对应的配置参数;
转换单元1060,用于按照用户选择的配置参数,生成该逻辑块对应的程序逻辑,并将该逻辑块对应的程序逻辑转换为机器人能够识别的指令;
控制单元1070,用于将针对每个逻辑块转换的所述指令发送给机器人,对机器人进行控制。
进一步,所述装置还包括:
划分单元,用于将所述逻辑块根据预设条件被划分为基础条件逻辑块和高级条件逻辑块,其中,所述预设条件包括所述逻辑块被选择的频率或者编辑所述逻辑块对应的控制逻辑语句的难易程度;
所述第一显示单元,包括:
第一显示子单元,用于按用户指令显示编程界面;
第二显示子单元,用于当检测到所述编程界面中的基础条件逻辑块选项按钮被按下,则在所述编程界面中显示基础条件逻辑块;
第三显示子单元,用于当检测到所述编程界面中的高级条件逻辑块选项按钮被按下,则在所述编程界面中显示高级条件逻辑块。
进一步,所述第二显示单元,包括:
第四显示子单元,用于按用户选择逻辑块的顺序,在所述编程界面的第一预设区域中,以树形结构由上至下显示用户选择的逻辑块;
第五显示子单元,用于当检测到所述编程界面中的任一个逻辑块编辑按钮被按下,则执行该逻辑块编辑按钮对应的编辑操作,在所述树形结构中增加逻辑块或删除逻辑块或移动逻辑块在树形结构中的位置;所述逻辑块编辑按钮为:增加按钮或删除按钮或移动按钮。
进一步,所述第三显示单元具体用于:
在所述编程界面的第二预设区域中,显示逻辑块配置界面;所述逻辑块配置界面中包含该逻辑块所有可选的参数,和/或该逻辑块的参数输入框。
更进一步,所述转换单元,包括:
第一转换单元,用于当检测到所述逻辑块配置界面中的确认按钮被按下,则按照用户选择的配置参数,生成该逻辑块对应的XML语言源代码;
第二转换单元,用于将该逻辑块对应的XML语言源代码转换为机器人能 够识别的脚本语言代码。
应用上述各个实施例,从显示的逻辑块中,获得用户所选择的逻辑块,根据用户选择的逻辑块生成树形结构,在每个逻辑块对应的配置界面,选择每个逻辑块的配置参数,生成树形结构中的逻辑块对应的程序逻辑,将树形结构对应的程序逻辑转换为机器人能够识别的指令,实现对机器人的控制。这样,简化了控制机器人的方法,使得非专业人员在短时间内掌握控制机器人的方法。
对于装置实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。

Claims (11)

  1. 一种控制机器人的方法,其特征在于,包括:
    显示预先设置的逻辑块;其中,每个逻辑块对应一条控制逻辑语句;
    获取用户选择的逻辑块;
    按用户确定的顺序,以树形结构显示用户选择的逻辑块;
    针对用户选择的每个逻辑块,显示该逻辑块对应的逻辑块配置界面;
    接收用户通过所述逻辑块配置界面选择的该逻辑块对应的配置参数;
    按照用户选择的配置参数,生成该逻辑块对应的程序逻辑,并将该逻辑块对应的程序逻辑转换为机器人能够识别的指令;
    将针对每个逻辑块转换的所述指令发送给机器人,对机器人进行控制。
  2. 根据权利要求1所述的方法,其特征在于,所述逻辑块根据预设条件被划分为基础条件逻辑块和高级条件逻辑块,其中,所述预设条件包括所述逻辑块被选择的频率或者编辑所述逻辑块对应的控制逻辑语句的难易程度;
    所述显示预先设置的逻辑块的步骤,包括:
    按用户指令显示编程界面;
    当检测到所述编程界面中的基础条件逻辑块选项按钮被按下,则在所述编程界面中显示基础条件逻辑块;
    当检测到所述编程界面中的高级条件逻辑块选项按钮被按下,则在所述编程界面中显示高级条件逻辑块。
  3. 根据权利要求2所述的方法,其特征在于,所述按用户确定的顺序,以树形结构显示用户选择的逻辑块的步骤,包括:
    按用户选择逻辑块的顺序,在所述编程界面的第一预设区域中,以树形结构由上至下显示用户选择的逻辑块;
    当检测到所述编程界面中的任一个逻辑块编辑按钮被按下,则执行该逻辑块编辑按钮对应的编辑操作,在所述树形结构中增加逻辑块或删除逻辑块在树形结构中的位置;所述逻辑块编辑按钮为:增加按钮或删除按钮。
  4. 根据权利要求2所述的方法,其特征在于,所述针对用户选择的每 个逻辑块,显示该逻辑块对应的逻辑块配置界面的步骤,包括:
    在所述编程界面的第二预设区域中,显示逻辑块配置界面;所述逻辑块配置界面中包含该逻辑块所有可选的参数,和/或该逻辑块的参数输入框。
  5. 根据权利要求2所述的方法,其特征在于,所述按照用户选择的配置参数,生成该逻辑块对应的程序逻辑,并将该逻辑块对应的程序逻辑转换为机器人能够识别的指令的步骤,包括:
    当检测到所述逻辑块配置界面中的确认按钮被按下,则按照用户选择的配置参数,生成该逻辑块对应的XML语言源代码;
    将该逻辑块对应的XML语言源代码转换为机器人能够识别的脚本语言代码。
  6. 根据权利要求2所述的方法,其特征在于:所述的编程界面集成于机器人示教器软件中。
  7. 一种控制机器人的装置,其特征在于,包括:
    第一显示单元,用于显示预先设置的逻辑块;其中,每个逻辑块对应一条控制逻辑语句;
    获取单元,用于获取用户选择的逻辑块;
    第二显示单元,用于按用户确定的顺序,以树形结构显示用户选择的逻辑块;
    第三显示单元,用于针对用户选择的每个逻辑块,显示该逻辑块对应的逻辑块配置界面;
    接收单元,用于接收用户通过所述逻辑块配置界面选择的该逻辑块对应的配置参数;
    转换单元,用于按照用户选择的配置参数,生成该逻辑块对应的程序逻辑,并将该逻辑块对应的程序逻辑转换为机器人能够识别的指令;
    控制单元,用于将针对每个逻辑块转换的所述指令发送给机器人,对机器人进行控制。
  8. 根据权利要求7所述的装置,其特征在于,所述装置还包括:
    划分单元,用于将所述逻辑块根据预设条件被划分为基础条件逻辑块 和高级条件逻辑块,其中,所述预设条件包括所述逻辑块被选择的频率或者编辑所述逻辑块对应的控制逻辑语句的难易程度;
    所述第一显示单元,包括:
    第一显示子单元,用于按用户指令显示编程界面;
    第二显示子单元,用于当检测到所述编程界面中的基础条件逻辑块选项按钮被按下,则在所述编程界面中显示基础条件逻辑块;
    第三显示子单元,用于当检测到所述编程界面中的高级条件逻辑块选项按钮被按下,则在所述编程界面中显示高级条件逻辑块。
  9. 根据权利要求8所述的方法,其特征在于,所述第二显示单元,包括:
    第四显示子单元,用于按用户选择逻辑块的顺序,在所述编程界面的第一预设区域中,以树形结构由上至下显示用户选择的逻辑块;
    第五显示子单元,用于当检测到所述编程界面中的任一个逻辑块编辑按钮被按下,则执行该逻辑块编辑按钮对应的编辑操作,在所述树形结构中增加逻辑块或删除逻辑块在树形结构中的位置;所述逻辑块编辑按钮为:增加按钮或删除按钮。
  10. 根据权利要求8所述的方法,其特征在于,所述第三显示单元具体用于:
    在所述编程界面的第二预设区域中,显示逻辑块配置界面;所述逻辑块配置界面中包含该逻辑块所有可选的参数,和/或该逻辑块的参数输入框。
  11. 根据权利要求8所述的方法,其特征在于,所述转换单元,包括:
    第一转换单元,用于当检测到所述逻辑块配置界面中的确认按钮被按下,则按照用户选择的配置参数,生成该逻辑块对应的XML语言源代码;
    第二转换单元,用于将该逻辑块对应的XML语言源代码转换为机器人能够识别的脚本语言代码。
PCT/CN2017/102475 2016-09-20 2017-09-20 一种控制机器人的方法及装置 WO2018054303A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610833829.9 2016-09-20
CN201610833829.9A CN106997285A (zh) 2016-09-20 2016-09-20 一种控制机器人的方法及装置

Publications (1)

Publication Number Publication Date
WO2018054303A1 true WO2018054303A1 (zh) 2018-03-29

Family

ID=59431144

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/102475 WO2018054303A1 (zh) 2016-09-20 2017-09-20 一种控制机器人的方法及装置

Country Status (2)

Country Link
CN (1) CN106997285A (zh)
WO (1) WO2018054303A1 (zh)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106997285A (zh) * 2016-09-20 2017-08-01 遨博(北京)智能科技有限公司 一种控制机器人的方法及装置
CN109690473B (zh) * 2017-09-11 2022-04-15 深圳配天智能技术研究院有限公司 一种图形化编程方法、装置、计算机存储介质及视觉系统
CN108268255A (zh) * 2018-02-11 2018-07-10 遨博(北京)智能科技有限公司 用于编程机器人的方法和装置
CN108673486A (zh) * 2018-05-05 2018-10-19 深圳市越疆科技有限公司 模块式关节机器人、控制方法和存储介质
CN108500967A (zh) * 2018-05-05 2018-09-07 深圳市越疆科技有限公司 控制方法、模块式关节机器人和存储介质
CN108762183A (zh) * 2018-05-05 2018-11-06 深圳市越疆科技有限公司 芯片式驱控一体结构
CN109032571A (zh) * 2018-08-28 2018-12-18 苏州艾利特机器人有限公司 一种机器人工艺程序生成方法
CN109036046A (zh) * 2018-09-05 2018-12-18 南京阿波罗机器人科技有限公司 一种stem触屏可编程电子积木控制器
CN109048928B (zh) * 2018-10-25 2021-09-21 遨博(北京)智能科技有限公司 一种机器人控制程序的生成方法及装置
CN111387878B (zh) * 2020-03-09 2022-10-14 美智纵横科技有限责任公司 一种控制方法、终端设备、扫地机和计算机存储介质
CN113515313B (zh) * 2020-11-09 2024-04-19 苏州如林自动化软件科技有限公司 运动控制卡配置方法、计算机设备、运动控制方法及系统
CN112698823A (zh) * 2020-12-31 2021-04-23 佛山冠湾智能科技有限公司 一种图形化的机器人编程交互系统及方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101460991A (zh) * 2006-04-11 2009-06-17 因文西斯系统公司 策略编辑器人机界面
CN103019697A (zh) * 2012-11-22 2013-04-03 福建天晴数码有限公司 一种lua脚本的编辑插件
CN103500100A (zh) * 2013-10-09 2014-01-08 周宗煜 智能汇编开发工具
CN104407861A (zh) * 2014-11-20 2015-03-11 杭州电子科技大学 一种ePLC图编程平台中组合指令的实现方法
CN106997285A (zh) * 2016-09-20 2017-08-01 遨博(北京)智能科技有限公司 一种控制机器人的方法及装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7668608B2 (en) * 2006-09-01 2010-02-23 Fisher-Rosemount Systems, Inc. Graphical programming language object editing and reporting tool
US9256219B2 (en) * 2009-08-11 2016-02-09 Fisher-Rosemount Systems, Inc. System configuration using templates

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101460991A (zh) * 2006-04-11 2009-06-17 因文西斯系统公司 策略编辑器人机界面
CN103019697A (zh) * 2012-11-22 2013-04-03 福建天晴数码有限公司 一种lua脚本的编辑插件
CN103500100A (zh) * 2013-10-09 2014-01-08 周宗煜 智能汇编开发工具
CN104407861A (zh) * 2014-11-20 2015-03-11 杭州电子科技大学 一种ePLC图编程平台中组合指令的实现方法
CN106997285A (zh) * 2016-09-20 2017-08-01 遨博(北京)智能科技有限公司 一种控制机器人的方法及装置

Also Published As

Publication number Publication date
CN106997285A (zh) 2017-08-01

Similar Documents

Publication Publication Date Title
WO2018054303A1 (zh) 一种控制机器人的方法及装置
US20160284232A1 (en) System and method for teaching programming of devices
CN104424338B (zh) web系统的自动生成装置和自动生成方法
WO2019114636A1 (zh) 编程玩具的反向编程的方法及系统、设备、介质
CN109710357B (zh) 一种基于Unity3D引擎实现服务器操作的方法及系统
CN106774028B (zh) 一种基于时间轴的机器人控制方法与装置
KR20170102486A (ko) 로봇의 동작프로그램 생성방법 및 로봇의 동작프로그램 생성장치
CN105739974A (zh) 一种图形化编程控制电子积木的方法
JP2006510496A (ja) ロボットを制御するためのシステム及び方法
WO2017152703A1 (zh) 三维标签实现方法和装置
CN107240334A (zh) 一种编程学习系统及其方法
JP5026925B2 (ja) 制御プログラム作成装置および制御プログラム作成方法
WO2018107318A1 (zh) 一种可视化装修设计方法及其装置、机器人
US20210260753A1 (en) Training processing device, intermediation device, training system, and training processing method
Lim Live programming for robotic fabrication
Lewis et al. Usability of the remote console for virtual reality telerehabilitation: formative evaluation
JP2009070181A (ja) 動作プログラム作成支援システム
KR20170065405A (ko) 원형 또는 폐곡선 형태의 도형을 이용한 반복적 루프 구조를 이용한 시인화와 조합 방식을 통한 그래픽스 기반 컴퓨터 언어 설계 및 사용자 인터페이스 장치
JPH10291183A (ja) ロボット言語処理装置
JP2003039359A (ja) ロボット制御装置
TWI336852B (en) Method for editing plc program
KR20190067450A (ko) 로봇의 직접교시 방법
CN104883599B (zh) 一种控制方法及装置
TW200918908A (en) Program planning method of a programmable IC test machine
TWI416295B (zh) 機械裝置動作編輯系統及其方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17852371

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17852371

Country of ref document: EP

Kind code of ref document: A1