CN103499972A - Subsumption hierarchical structure-based universal robot multi-scene control method - Google Patents

Subsumption hierarchical structure-based universal robot multi-scene control method Download PDF

Info

Publication number
CN103499972A
CN103499972A CN201310461873.8A CN201310461873A CN103499972A CN 103499972 A CN103499972 A CN 103499972A CN 201310461873 A CN201310461873 A CN 201310461873A CN 103499972 A CN103499972 A CN 103499972A
Authority
CN
China
Prior art keywords
instruction
control method
socket
priority
hierarchical structure
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201310461873.8A
Other languages
Chinese (zh)
Other versions
CN103499972B (en
Inventor
申富饶
干强
赵金熙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University
Original Assignee
Nanjing University
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 Nanjing University filed Critical Nanjing University
Priority to CN201310461873.8A priority Critical patent/CN103499972B/en
Publication of CN103499972A publication Critical patent/CN103499972A/en
Application granted granted Critical
Publication of CN103499972B publication Critical patent/CN103499972B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Manipulator (AREA)

Abstract

本发明公开了一种包容式层次型多场景服务机器人控制方法,用于在多个场景下,利用优先级机制和禁止机制,通过键盘指令、语音指令、套接字(Socket)指令和邮件指令控制服务机器人,并具有简单的避障行走功能。本发明的显著优点是每种控制方式以层次化结构并行执行,层次之间使用简单的优先级机制和禁止机制进行协调,因此实时性好;这种控制方法是软件设计,与机器人平台无关,因此可移植性好;没有设置主控模块,增加新功能不需要重新编写已有模块,因此可扩展性好;协调机制简单,相比复杂的主控模块对处理器要求低,因此硬件成本降低,易于普及。

The invention discloses an inclusive hierarchical multi-scenario service robot control method, which is used in multiple scenarios, using a priority mechanism and a prohibition mechanism, through keyboard instructions, voice instructions, socket (Socket) instructions and mail instructions Control the service robot and have simple obstacle avoidance walking function. The remarkable advantage of the present invention is that each control method is executed in parallel in a hierarchical structure, and a simple priority mechanism and a prohibition mechanism are used for coordination between the layers, so the real-time performance is good; this control method is software design and has nothing to do with the robot platform. Therefore, the portability is good; there is no main control module, and the addition of new functions does not require rewriting existing modules, so the scalability is good; the coordination mechanism is simple, and the processor requirements are lower than the complex main control module, so the hardware cost is reduced. , easy to popularize.

Description

一种基于包容式层次结构的通用机器人多场景控制方法A Multi-scenario Control Method for General Robots Based on Inclusive Hierarchy

技术领域technical field

本发明涉及机器人控制领域,特别是一种基于包容式层次结构的通用机器人多场景控制方法。The invention relates to the field of robot control, in particular to a multi-scene control method for a general robot based on an inclusive hierarchical structure.

背景技术Background technique

我国《国家中长期科学和技术发展规划纲要(2006~2020年)》中提到,“智能服务机器人是在非结构环境下为人类提供必要服务的多种高技术集成的智能化装备”。my country's "National Medium and Long-Term Science and Technology Development Plan (2006-2020)" mentioned that "intelligent service robots are intelligent equipment integrated with various high technologies that provide necessary services for humans in an unstructured environment."

随着机器人技术的发展,机器人控制方法也在不断发展变化。传统的控制方法采用“感知→计划→行动”(“Sense→Plan→Act”)框架,先由传感器感知周围环境、接收不同类型的指令,然后将信息送到主控模块进行综合分析,最后得出下一步的行动交由相应模块执行。比如Technological University of the Mixteca的Felipe Trujillo-Romero等人提出的一种多模式(multimodal)机器人控制系统,该系统首先从摄像头和麦克风获取图像和语音信息,经过识别之后送入主控模块,然后主控模块使用投票算法决定下一步的行为,最后驱动马达执行。近几年国内外著名研究机构提出的HERB,ARMAR-III,PengPengII等机器人都是使用这种框架,并且取得了不错的智能效果。With the development of robot technology, the method of robot control is also constantly evolving and changing. The traditional control method adopts the framework of "Sense→Plan→Act" ("Sense→Plan→Act"). First, the sensor perceives the surrounding environment, receives different types of instructions, and then sends the information to the main control module for comprehensive analysis. The next action is handed over to the corresponding module for execution. For example, Felipe Trujillo-Romero of Technological University of the Mixteca and others proposed a multimodal robot control system. The system first obtains image and voice information from the camera and microphone, and sends them to the main control module after identification, and then the main control module The control module uses a voting algorithm to determine the next behavior, and finally drives the motor to execute. In recent years, HERB, ARMAR-III, PengPengII and other robots proposed by famous research institutions at home and abroad all use this framework, and have achieved good intelligent results.

但是“感知→计划→行动”(“Sense→Plan→Act”)框架不太适合作为服务机器人的控制系统。主要有三个原因:But the framework of "Sense→Plan→Act" ("Sense→Plan→Act") is not suitable as a control system for service robots. There are three main reasons:

1、当添加或删除传感器以及辅助函数模块时,需要重新设计主控模块中的综合分析算法。这使得更新已有机器人系统变得代价高昂。1. When adding or deleting sensors and auxiliary function modules, it is necessary to redesign the comprehensive analysis algorithm in the main control module. This makes updating existing robotic systems expensive.

2、服务机器人主要用来接收用户命令并执行,不需要有很强的自主能力,但是要求很好的实时性。然而随着机器人传感器和辅助函数模块的不断增加,主控模块的综合分析算法会变得很复杂,将影响服务机器人的实时性。2. The service robot is mainly used to receive and execute user commands. It does not need to have strong autonomy, but requires good real-time performance. However, with the continuous increase of robot sensors and auxiliary function modules, the comprehensive analysis algorithm of the main control module will become very complicated, which will affect the real-time performance of the service robot.

3、复杂的主控模块对处理器要求会很高,这将提高服务机器人的硬件成本,影响服务机器人的推广。3. The complex main control module will have high requirements on the processor, which will increase the hardware cost of the service robot and affect the promotion of the service robot.

MIT的Brooks曾经提出一种包容式层次架构(subsumption)来克服“感知→计划→行动”Brooks of MIT once proposed an inclusive hierarchy (subsumption) to overcome "perception→plan→action"

(“Sense→Plan→Act”)框架的缺点。在包容式层次架构(subsumption)中,机器人控制系统划分层次将任务分解并行处理,层次之间使用简单的抑制机制(suppression andinhibition)进行协调,没有主控模块。使用包容式层次架构的机器人有Myrmix等,拥有很高的实时性能。Drawbacks of the (“Sense → Plan → Act”) framework. In the inclusive hierarchical architecture (subsumption), the robot control system is divided into layers to decompose tasks into parallel processing, and a simple suppression mechanism (suppression and inhibition) is used to coordinate between layers without a main control module. Robots using an inclusive hierarchical architecture include Myrmix, etc., which have high real-time performance.

但是包容式层次架构(subsumption)存在两个主要缺点:But subsumption has two major disadvantages:

1、当系统层次增多时,很难设计抑制机制将任务很好地分解并行。1. When the system level increases, it is difficult to design a suppression mechanism to decompose and parallelize tasks well.

2、从电路层面控制机器人,因此机器人控制系统不具备可移植性。2. The robot is controlled from the circuit level, so the robot control system is not portable.

近年来,许多机器人公司(如日本Vstone株式会社,北京博创兴盛科技有限公司等)已经将硬件层面的控制抽象成为C/C++语言的接口,这为机器人控制系统与机器人硬件平台分离,实现机器人系统的可移植性提供了技术支持。In recent years, many robot companies (such as Japan's Vstone Co., Ltd., Beijing Bochuang Xingsheng Technology Co., Ltd., etc.) have abstracted the control at the hardware level into a C/C++ language interface, which separates the robot control system from the robot hardware platform and realizes robot control. System portability provides technical support.

发明内容Contents of the invention

发明目的:本发明所要解决的技术问题是针对现有技术的不足,提供一种基于包容式层次结构的通用机器人多场景控制方法。Purpose of the invention: The technical problem to be solved by the present invention is to provide a multi-scene control method for a general robot based on an inclusive hierarchical structure for the deficiencies of the prior art.

为了解决上述技术问题,本发明公开了一种包容式层次型多场景服务机器人控制方法,用于在多个场景下,利用优先级机制和禁止机制,通过键盘指令、语音指令、套接字(Socket)指令和邮件指令控制服务机器人,并具有简单的避障行走功能,包括以下步骤:In order to solve the above technical problems, the present invention discloses an inclusive and hierarchical multi-scenario service robot control method, which is used in multiple scenarios, using a priority mechanism and a prohibition mechanism, through keyboard commands, voice commands, sockets ( Socket) command and mail command to control the service robot, and has a simple obstacle avoidance walking function, including the following steps:

(1)启动机器人平台,启动外接或者嵌入式的计算机,将摄像头、麦克风连接计算机;(1) Start the robot platform, start the external or embedded computer, and connect the camera and microphone to the computer;

(2)将计算机接入网络,并作为服务器端与客户端建立socket连接;(2) Connect the computer to the network, and establish a socket connection with the client as the server;

(3)创建四个指令队列,用于存放四个场景下的控制指令;(3) Create four command queues for storing control commands in four scenarios;

(4)定义四个指令队列的优先级;(4) Define the priority of the four instruction queues;

(5)启动四个控制模块用于接收指令;(5) Start four control modules to receive instructions;

(6)控制模块将接收到的指令装入对应的指令队列;(6) The control module loads the received command into the corresponding command queue;

(7)从四个指令队列中取出优先级最高的指令;(7) Take out the instruction with the highest priority from the four instruction queues;

(8)识别指令;(8) Identification instructions;

(9)执行指令,返回步骤(6)。(9) Execute the command and return to step (6).

其中步骤(8)进一步包括以下步骤:Wherein step (8) further comprises the following steps:

(81)如果指令无法识别,则在控制界面给出“Unknown Command(无法识别的命令)”提示并且丢弃;(81) If the command is unrecognizable, give an "Unknown Command (unrecognized command)" prompt on the control interface and discard it;

(82)如果指令可以识别,则进入步骤(9)(82) If the instruction can be identified, then enter step (9)

其中步骤(9)进一步包括以下步骤:Wherein step (9) further comprises the following steps:

(91)如果指令无法执行,则在控制界面给出“Obstacle ahead(前方出现障碍物)”(91) If the command cannot be executed, "Obstacle ahead" will be given on the control interface

提示并且丢弃;prompt and discard;

(92)如果指令可以执行,执行结束后返回步骤(6)。(92) If the instruction can be executed, return to step (6) after the execution is completed.

在上述方法中,机器人平台指提供硬件层面的控制的C/C++语言接口的所有机器人。In the above method, the robot platform refers to all robots that provide C/C++ language interface for hardware level control.

在上述方法中,外接或者嵌入式的计算机指:安装windows操作系统、摄像头和麦克风驱动程序、微软语音识别软件,并具有网络连接功能的计算机。In the above method, an external or embedded computer refers to a computer with a Windows operating system, camera and microphone drivers, Microsoft voice recognition software, and a network connection function installed.

在上述方法中,四个控制场景分别指:直接操作外接或嵌入式计算机(记为场景-0)、与机器人在同一个房间(记为场景-1)、与机器人在同一幢房屋(记为场景-2)、房屋外可以上网的世界各地(记为场景-3)。In the above method, the four control scenarios refer to: direct operation of an external or embedded computer (denoted as scene-0), being in the same room with the robot (denoted as scene-1), and being in the same house with the robot (denoted as scene-0). Scenario-2), all parts of the world with Internet access outside the house (denoted as Scenario-3).

在上述方法中,四种控制方式分别指:键盘指令、语音指令、套接字(Socket)指令、邮件指令。In the above method, the four control modes respectively refer to: keyboard commands, voice commands, socket commands, and mail commands.

在上述方法中,取出优先级最高的指令由优先级机制完成,实现的效果是:指令队列之间的优先级由使用者定义,使用者定义为高的指令队列优先级高;同一指令队列内部的优先级由时间顺序决定,先入队的指令优先级高。In the above method, the command with the highest priority is taken out by the priority mechanism, and the achieved effect is: the priority between command queues is defined by the user, and the priority of the command queue defined by the user is high; The priority of the command is determined by the order of time, and the command that enters the queue first has the highest priority.

在上述方法中,四个控制模块分别指:键盘接收模块、语音识别模块、套接字(Socket)通信模块、邮件接收模块。In the above method, the four control modules respectively refer to: a keyboard receiving module, a speech recognition module, a socket (Socket) communication module, and a mail receiving module.

在上述方法中,控制模块的启动方式是:以独立线程的形式并并发或者并行执行。In the above method, the control module is started in the form of independent threads and executed concurrently or in parallel.

在上述方法中,识别指令指:查找当前指令在系统中的处理方式,如果没有定义处理方式,则无法识别。In the above method, identifying the instruction refers to finding the processing method of the current instruction in the system. If the processing method is not defined, it cannot be recognized.

在上述方法中,执行指令包括调用服务软件执行指令和驱动马达执行指令。服务软件包括:天气预报、邮件发送、来访通知。驱动马达包括:前进、向左走、向右走、左转、右转、后退。In the above method, executing the instruction includes calling service software to execute the instruction and driving a motor to execute the instruction. Service software includes: weather forecast, email sending, and visitor notification. The drive motor includes: forward, go left, go right, turn left, turn right, back.

在上述方法中,避障行走功能由障碍检测模块和禁止机制完成,当障碍检测模块输出障碍物信息,会触发禁止机制,使得马达无法行动。In the above method, the obstacle avoidance walking function is completed by the obstacle detection module and the prohibition mechanism. When the obstacle detection module outputs obstacle information, the prohibition mechanism will be triggered, so that the motor cannot move.

本发明克服传统“感知→计划→行动”(“Sense→Plan→Act”)架构在服务机器人应用中的缺点,引入包容式层次结构(subsumption)技术,将机器人控制系统进行层次化设计,使用简单的协调机制,取消主控模块的设置,同时也克服包容式层次结构(subsumption)中抑制机制难以设计、可移植性差的缺点,提出一种在多种场景下都可以控制,使用优先级机制和禁止机制两种简单的协调机制,具有较好实时性、可移植性和可扩展性的服务机器人控制方法。The present invention overcomes the shortcomings of the traditional "Sense→Plan→Act" architecture in the application of service robots, introduces subsumption technology, and designs the robot control system in a hierarchical manner, which is easy to use The coordination mechanism of the subsumption cancels the setting of the main control module. At the same time, it also overcomes the shortcomings of difficult design and poor portability of the suppression mechanism in the inclusive hierarchy (subsumption). Prohibition mechanism, two simple coordination mechanisms, a service robot control method with good real-time performance, portability and scalability.

有益效果:本发明的显著优点是每种控制方式以层次化结构并行执行,层次之间使用简单的优先级机制和禁止机制进行协调,因此实时性好;这种控制方法是软件设计,与机器人平台无关,因此可移植性好;没有设置主控模块,增加新功能不需要重新编写已有模块,因此可扩展性好;协调机制简单,相比复杂的主控模块对处理器要求低,因此硬件成本降低,易于普及。Beneficial effect: the significant advantage of the present invention is that each control method is executed in parallel in a hierarchical structure, and a simple priority mechanism and a prohibition mechanism are used for coordination between the layers, so the real-time performance is good; this control method is a software design, which is similar to that of a robot The platform is independent, so the portability is good; there is no main control module, adding new functions does not need to rewrite the existing modules, so the scalability is good; the coordination mechanism is simple, and the processor requirements are lower than the complex main control module, so The cost of hardware is reduced, and it is easy to popularize.

附图说明Description of drawings

下面结合附图和具体实施方式对本发明做更进一步的具体说明,本发明的上述和/或其他方面的优点将会变得更加清楚。The advantages of the above and/or other aspects of the present invention will become clearer as the present invention will be further described in detail in conjunction with the accompanying drawings and specific embodiments.

图1是本发明的架构图。Fig. 1 is a structure diagram of the present invention.

图2是本发明的工作运行流程图。Fig. 2 is a working flow chart of the present invention.

图3是语音识别模块示意图。Fig. 3 is a schematic diagram of the speech recognition module.

图4是socket通信模块示意图。Fig. 4 is a schematic diagram of the socket communication module.

图5是邮件接收模块示意图。Fig. 5 is a schematic diagram of the mail receiving module.

图6是障碍检测模块示意图。Fig. 6 is a schematic diagram of an obstacle detection module.

图7是优先级机制工作图。Figure 7 is a working diagram of the priority mechanism.

图8是禁止机制工作图。Figure 8 is a working diagram of the prohibition mechanism.

具体实施方式Detailed ways

图1是本发明的架构图。(以优先级设置为场景-0高于场景-1高于场景-2高于场景-3为例)Fig. 1 is a structure diagram of the present invention. (Taking priority setting as scene-0 higher than scene-1 higher than scene-2 higher than scene-3 as an example)

本发明将控制方式设计为对应场景的四个层次:The present invention designs the control mode into four levels corresponding to the scene:

(1)键盘控制对应直接操作机器人的场景-0。由键盘接收信息,将键盘指令装入指令队列-0;键盘接收模块的实现方式是:使用scanf()函数从控制台读取用户的键盘输入,封装成文本格式的指令,调用指令队列-0的push函数将键盘指令装入队列。(1) Keyboard control corresponds to scene-0 of directly operating the robot. The keyboard receives the information, and puts the keyboard command into the command queue-0; the implementation of the keyboard receiving module is: use the scanf() function to read the user's keyboard input from the console, encapsulate it into a text format command, and call the command queue-0 The push function queues keyboard commands.

(2)语音控制对应与机器人在同一个房间的场景-1。由麦克风接收信息,在语音识别模块将语音指令装入指令队列-1;如图3所示,语音识别模块的实现方式是:安装Microsoft Speech SDK5.1以及中文语言包,使用Microsoft Speech SDK5.1自带的语音识别函数编写语音监听器,调用CComPtr<ISpRecoResult>中的GetText()函数对监听到的语音信息转换为文字信息,对文字信息提取关键字,封装成文本格式的指令,调用指令队列-1的push函数将语音指令装入队列。(2) Voice control corresponds to scene-1 where the robot is in the same room. The information is received by the microphone, and the voice command is loaded into the command queue-1 in the voice recognition module; as shown in Figure 3, the implementation of the voice recognition module is: install Microsoft Speech SDK5.1 and Chinese language pack, use Microsoft Speech SDK5.1 The built-in speech recognition function writes a speech listener, calls the GetText() function in CComPtr<ISpRecoResult> to convert the monitored speech information into text information, extracts keywords from the text information, encapsulates them into text format instructions, and calls the instruction queue The push function of -1 puts voice commands into the queue.

(3)套接字(Socket)控制对应与机器人在同一幢房屋的场景-2。由套接字(Socket)接收信息,套接字(Socket)通信模块将套接字(Socket)指令装入指令队列-2;如图4所示,套接字(Socket)通信模块的实现方式是:计算机作为套接字(Socket)通信的服务端通过设置服务器地址、绑定套接字(bind函数)、监听端口(listen函数)与客户端建立连接(accept函数),然后接收来自客户端的套接字(Socket)信息(recv函数),再对套接字(Socket)信息提取关键字,封装成文本格式的指令,调用指令队列-2的push函数将Socket指令装入队列。(3) Socket control corresponds to scene-2 where the robot is in the same house. The socket (Socket) receives information, and the socket (Socket) communication module loads the socket (Socket) instruction into the instruction queue-2; as shown in Figure 4, the implementation of the socket (Socket) communication module Yes: The computer communicates as a socket (Socket) server by setting the server address, binding the socket (bind function), and listening to the port (listen function) to establish a connection with the client (accept function), and then receive the message from the client Socket (Socket) information (recv function), then extract keywords from the socket (Socket) information, encapsulate it into a text format command, call the push function of command queue-2 to load the Socket command into the queue.

(4)邮件控制对应可以联网的世界各地的场景-3。由邮件系统接收信息,邮件控制模块将邮件指令,装入指令队列-3;如图5所示,邮件控制模块的实现方式是:安装并注册Jmail4.4组件,通过Jmail4.4组件的Connect()函数连接邮件服务器,从Messages成员的邮件列表中,根据上一次邮件数量与这一次邮件数量之差,获取指定邮箱的未读邮件,再对邮件内容提取关键字,封装成文本格式的指令,装入指令队列-3。(4) Mail control corresponds to scenario-3 around the world that can be networked. Receiving information by the mail system, the mail command is loaded into the command queue-3 by the mail control module; as shown in Figure 5, the implementation mode of the mail control module is: install and register the Jmail4. ) function connects to the mail server, and from the mailing list of the Messages member, according to the difference between the number of last mail and the number of this time, obtains the unread mail of the specified mailbox, and then extracts keywords from the mail content, and encapsulates it into an instruction in text format. Load instruction queue-3.

在图1所示的机器人控制系统中,优先级机制一共存在三处。第一处是指令队列-0对于指令队列-1的阻塞,只要指令队列-0有指令输出,指令队列-1就被阻塞,指令队列-0的指令被优先送入识别。第二处是指令队列-0和1对于指令队列-2的阻塞,只要指令队列-0或1有指令输出,指令队列-2就被阻塞,指令队列0或1的指令被优先送入识别。第三处是指令队列-0、1和2对于指令队列-3的阻塞,只要指令队列-0、1或2有指令输出,指令队列3就被阻塞,指令队列0、1或2的指令被优先送入识别。In the robot control system shown in Figure 1, there are three priority mechanisms. The first is the blocking of command queue-0 to command queue-1. As long as command queue-0 has command output, command queue-1 will be blocked, and the commands of command queue-0 will be prioritized for identification. The second is the blockage of instruction queue-0 and 1 to instruction queue-2. As long as there are instructions output from instruction queue-0 or 1, instruction queue-2 will be blocked, and the instructions of instruction queue 0 or 1 will be prioritized for identification. The third place is the blocking of instruction queue-0, 1 and 2 for instruction queue-3, as long as there are instructions output in instruction queue-0, 1 or 2, instruction queue 3 will be blocked, and the instructions of instruction queue 0, 1 or 2 will be blocked. Priority feed into identification.

图2是本发明的工作运行流程图。Fig. 2 is a working flow chart of the present invention.

步骤S01:启动机器人平台,启动外接或者嵌入式的计算机,将摄像头、麦克风连接计算机。Step S01: Start the robot platform, start the external or embedded computer, and connect the camera and microphone to the computer.

在本步骤中,机器人外界或嵌入式计算机需要安装windows操作系统、摄像头和麦克风驱动程序、微软语音识别软件的计算机。In this step, the external or embedded computer of the robot needs to install the windows operating system, camera and microphone drivers, and a computer with Microsoft speech recognition software.

步骤S02:将计算机接入网络,并作为服务器端与客户端建立socket连接。Step S02: Connect the computer to the network, and establish a socket connection with the client as the server.

在本步骤中计算机作为服务器端,房屋内其他控制端作为客户端,建立一对多的socket连接。In this step, the computer is used as the server, and other control terminals in the house are used as clients to establish a one-to-many socket connection.

步骤S03:创建四个指令队列,对应四个控制场景下的控制方式。Step S03: Create four command queues corresponding to the control modes in the four control scenarios.

在本步骤中,指令队列的创建方式是:新建四个C++模板类queue,queue模板的元素是文本格式的指令。In this step, the instruction queue is created by creating four C++ template class queues, and the elements of the queue templates are instructions in text format.

步骤S04:定义四个指令队列的优先级。Step S04: Define the priorities of the four instruction queues.

在本步骤中,优先级的确定方式为:指令队列之间的优先级由使用者定义,使用者定义为高的指令队列优先级高。In this step, the priority is determined as follows: the priority among the command queues is defined by the user, and the priority of the command queue defined by the user is high.

步骤S05:启动四个控制模块用于接收指令。Step S05: Start four control modules for receiving instructions.

在本步骤中,控制模块的启动方式是:使用pthread_create函数创建四个线程,每个控制模块以独立线程的形式并并发或者并行执行。In this step, the starting method of the control module is: use the pthread_create function to create four threads, and each control module is executed concurrently or in parallel in the form of an independent thread.

步骤S06:控制模块将接收到的指令装入对应的指令队列。Step S06: The control module loads the received command into the corresponding command queue.

在本步骤中,指令入队的方式是:控制模块使用queue模板的push函数将指令装入对应的指令队列。In this step, the way of enqueueing the instruction is: the control module uses the push function of the queue template to load the instruction into the corresponding instruction queue.

步骤S07:从四个指令队列中取出优先级最高的指令。Step S07: Take out the instruction with the highest priority from the four instruction queues.

在本步骤中,如图7所示,四个指令队列在优先级机制的协调下,最高优先级的指令即为第一个取出的指令,使用queue模板pop函数取出指令。In this step, as shown in Figure 7, under the coordination of the priority mechanism of the four instruction queues, the instruction with the highest priority is the first fetched instruction, and the pop function of the queue template is used to fetch the instruction.

步骤S08:识别指令。Step S08: Identify the instruction.

在本步骤中,查找当前指令在系统中的处理方式,如果没有定义处理方式,则进入步骤S09;否则进入步骤S10。In this step, search the processing mode of the current command in the system, if no processing mode is defined, go to step S09; otherwise, go to step S10.

步骤S09:给出在控制界面给出“Unknown Command”的提示,并丢弃,返回步骤S07。Step S09: Give the prompt of "Unknown Command" on the control interface, discard it, and return to step S07.

步骤S10:判断指令是否能执行。Step S10: Determine whether the instruction can be executed.

在本步骤中,如果当前指令是驱动马达,并且障碍检测模块输出无法执行的信息,则触发如图8所示禁止机制禁止驱动马达,进入步骤S11;否则进入步骤S12。In this step, if the current command is to drive the motor, and the obstacle detection module outputs information that cannot be executed, trigger the prohibition mechanism shown in Figure 8 to prohibit the drive of the motor, and proceed to step S11; otherwise, proceed to step S12.

步骤S11:在控制界面给出“Obstacle ahead”提示,并丢弃,返回步骤S07。Step S11: Give an "Obstacle ahead" prompt on the control interface, discard it, and return to step S07.

步骤S12:执行指令,并返回步骤S07。Step S12: execute the instruction, and return to step S07.

如图1所示,机器人行为可以包括服务软件模块,包括:天气预报、邮件发送、来访通知。As shown in Figure 1, the robot behavior can include service software modules, including: weather forecast, email sending, and visitor notification.

天气预报的实现方式是:使用gethostbyname()函数获取名为www.webxml.com.cn的天气预报网站的地址,与该天气预报网站建立Socket连接,使用send()函数向该天气预报网站发送请求报文,传入城市码作为参数,计算所需天气信息在返回报文(recv函数)中的偏移量,从而获取天气预报,再使用Microsoft SDK5.1中的Speak函数进行天气预报的朗读。The way to implement the weather forecast is: use the gethostbyname() function to obtain the address of the weather forecast website named www.webxml.com.cn, establish a Socket connection with the weather forecast website, and use the send() function to send a request to the weather forecast website Message, the city code is passed in as a parameter, and the offset of the required weather information in the returned message (recv function) is calculated to obtain the weather forecast, and then the Speak function in Microsoft SDK5.1 is used to read the weather forecast.

邮件发送的实现方式是:安装Jmail4.4组件,使用Jmail4.4中快速发邮件的函数SendMail,将发件人邮箱、收件人邮箱、邮件主题、正文、SMTP服务器以参数形式传入。The way to send mail is: install Jmail4.4 component, use the function SendMail in Jmail4.4 to quickly send mail, and pass in the sender's mailbox, recipient's mailbox, mail subject, body, and SMTP server as parameters.

来访通知的实现方式是:安装Jmail4.4组件和OpenCV2.3.1库,使用OpenCV2.3.1库中的拍照函数cvCaptureFromCAM()对来访者拍照,使用Jmail4.4中发带附件邮件的函数Send(),将发件人邮箱、收件人邮箱、邮件主题、正文、SMTP服务器以成员变量的形式传入,将拍摄的来访者照片以附件形式(AddAttachment函数)传入。The way to realize the visitor notification is: install the Jmail4.4 component and the OpenCV2.3.1 library, use the camera function cvCaptureFromCAM() in the OpenCV2.3.1 library to take photos of the visitors, and use the function Send() in Jmail4.4 to send emails with attachments, Pass in the sender's mailbox, recipient's mailbox, email subject, text, and SMTP server as member variables, and pass in the photo of the visitor as an attachment (AddAttachment function).

驱动马达模块的作用是屏蔽机器人平台细节,实现系统的可移植性。具体的实现方式是:将每个马达动作转换为具体机器人平台的接口调用序列。我们已经实现的机器人系统的马达动作包括:前进、向左走、向右走、左转、右转、后退。每个行动的实现方式均为调用机器人平台提供的C/C++语言的马达接口。以Robovie_X机器人为例,每个行动的实现均为先使用VSRC003_LoadMotion()函数载入马达接口,再使用VSRC003_PlayMotion()函数执行动作。指令—动作—接口的对应表为:The function of the drive motor module is to shield the details of the robot platform and realize the portability of the system. The specific implementation method is: converting each motor action into an interface call sequence of a specific robot platform. The motor actions of the robot system we have implemented include: forward, walk left, walk right, turn left, turn right, and back. Each action is implemented by calling the motor interface of the C/C++ language provided by the robot platform. Taking the Robovie_X robot as an example, the implementation of each action is to first use the VSRC003_LoadMotion() function to load the motor interface, and then use the VSRC003_PlayMotion() function to execute the action. The command-action-interface correspondence table is:

指令instruction 动作action 接口interface forwardforward 前进go ahead Go_Forward(advanced).txtGo_Forward(advanced).txt goleftgo left 向左走turn left Side step left(1step).txtSide step left(1step).txt gorightgo right 向右走go right Side step right(1step).txtSide step right(1step).txt turnleftturn left 左转Turn left Turn in place left.txtTurn in place left.txt turnrightturn right 右转Turn right Turn in place right.txtTurn in place right.txt

backback 后退step back Walk backwards.txtWalk backwards.txt

本发明移植方式如下:The transplantation mode of the present invention is as follows:

移植条件为机器人平台提供C/C++语言接口。The porting condition provides C/C++ language interface for the robot platform.

当本发明移植到新机器人平台R时,将现有的马达动作:前进、向左走、向右走、左转、右转、后退,分别转换为R机器人的马达接口调用序列。例如,当R机器人是人形机器人,则将“前进”动作转换为R机器人“抬腿”和“放腿”接口的交替调用;当R机器人是蜘蛛型机器人,则将“前进”动作转换为R机器人“爬行”接口的多次调用。When the present invention is transplanted to the new robot platform R, the existing motor actions: forward, walk to the left, walk to the right, turn left, turn right, back, respectively converted into the motor interface call sequence of the R robot. For example, when the R robot is a humanoid robot, the "forward" action is converted into an alternate call of the R robot's "leg lift" and "leg release" interfaces; when the R robot is a spider-type robot, the "forward" action is converted into R Multiple calls of the robot's "crawling" interface.

经过实验验证,替换驱动马达模块中的调用接口之后,可以实现系统的移植。如图9是实验用的两种机器人平台(左图是Robovie-X,右图是VstoneTichno),下表是两组实验的硬件组合。After experimental verification, the transplantation of the system can be realized after replacing the calling interface in the drive motor module. Figure 9 shows the two robot platforms used in the experiment (the left picture is Robovie-X, and the right picture is VstoneTichno). The following table shows the hardware combinations of the two groups of experiments.

本发明还设计了避障行走功能,避免机器人行动时与障碍物碰撞。如图6所示,障碍检测模块的实现方式是:安装OpenCV2.3.1库,通过OpenCV2.3.1库函数cvCreateCameraCapture()获取视频再使用cvQueryFrame()函数抓取一帧图像,使用cvCvtColor()函数将拍摄的照片转化成灰度图像,经过平滑(cvSmooth函数)、抽取轮廓(extractContourImg函数)后,再将灰度图像转换为二值图像(cvThreshold函数),计算黑像素(障碍物)占图片总像素的百分比,如果计算结果大于阈值(多次实验之后确定6%较为合适),则判断存在障碍物,输出障碍物信息,激活禁止机制,所有送去驱动马达模块的指令都被丢弃,禁止执行。The invention also designs an obstacle-avoiding walking function to prevent the robot from colliding with obstacles when it moves. As shown in Figure 6, the implementation of the obstacle detection module is: install the OpenCV2.3.1 library, obtain the video through the OpenCV2.3.1 library function cvCreateCameraCapture(), then use the cvQueryFrame() function to capture a frame of image, and use the cvCvtColor() function to capture the video Convert the photo into a grayscale image, after smoothing (cvSmooth function) and extracting the contour (extractContourImg function), then convert the grayscale image into a binary image (cvThreshold function), and calculate the proportion of black pixels (obstacles) to the total pixels of the picture Percentage, if the calculation result is greater than the threshold (6% is more appropriate after multiple experiments), it is judged that there is an obstacle, the obstacle information is output, the prohibition mechanism is activated, all the instructions sent to the drive motor module are discarded, and execution is prohibited.

图8是禁止机制工作图。禁止机制的作用是禁止指令执行。如果高层模块没有输出信息,则禁止机制未激活,当前指令可以送入执行。如果高层模块输出信息,则禁止机制激活,当前指令被丢弃,禁止执行。Figure 8 is a working diagram of the prohibition mechanism. The function of the prohibition mechanism is to prohibit the execution of instructions. If no information is output by the high-level module, the inhibit mechanism is not activated and the current instruction can be sent for execution. If the high-level module outputs information, the prohibition mechanism is activated, the current instruction is discarded, and execution is prohibited.

在图1所示的机器人控制系统中,禁止机制一共存在一处。当障碍检测模块输出障碍物信息,则所有送去驱动马达模块的指令都被丢弃,禁止执行。In the robot control system shown in Figure 1, there is a total of prohibition mechanisms. When the obstacle detection module outputs obstacle information, all instructions sent to the drive motor module are discarded and prohibited from being executed.

本发明提供了一种基于包容式层次结构的通用机器人多场景控制方法,具体实现该技术方案的方法和途径很多,以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。本实施例中未明确的各组成部分均可用现有技术加以实现。The present invention provides a multi-scenario control method for a universal robot based on an inclusive hierarchical structure. There are many methods and approaches to specifically realize the technical solution. The above description is only a preferred embodiment of the present invention. Those of ordinary skill may make some improvements and modifications without departing from the principle of the present invention, and these improvements and modifications shall also be regarded as the protection scope of the present invention. All components that are not specified in this embodiment can be realized by existing technologies.

Claims (6)

1. many scenes of the all-purpose robot control method based on the containment type hierarchical structure, is characterized in that, comprises the steps:
(1) the people's platform that starts the machine, start external or Embedded computing machine, and camera, microphone are connected to computing machine;
(2) by the computing machine access network, and set up socket as server end and client and be connected;
(3) create four instruction queues, for depositing the steering order of keyboard, microphone, socket and mail;
(4) define the priority of four instruction queues, be followed successively by from high to low the steering order of keyboard, microphone, socket and mail;
(5) start four control modules for receiving instruction;
(6) four control modules are by the instruction the received corresponding instruction queue of packing into;
(7) take out the highest instruction of priority from four instruction queues;
(8) robot platform recognition instruction;
(9) the robot platform control is carried out instruction.
2. a kind of many scenes of all-purpose robot control method based on the containment type hierarchical structure according to claim 1, is characterized in that, step (8) is further comprising the steps:
(81) if the instruction None-identified provides prompting and abandons instruction at the control interface;
(82) if instruction can be identified, enter step (9).
3. a kind of many scenes of all-purpose robot control method based on the containment type hierarchical structure according to claim 2, is characterized in that, wherein step (9) is further comprising the steps:
(91) if instruction can't be carried out, at the control interface, provide prompting and abandon instruction;
(92) if instruction can be carried out, execution is returned to step (6) after finishing.
4. a kind of many scenes of all-purpose robot control method based on the containment type hierarchical structure according to claim 1, it is characterized in that, take out the highest instruction of priority and completed by priority mechanism, the priority of same instruction queue inside determines by time sequencing, and the instruction priority of first joining the team is high.
5. a kind of many scenes of all-purpose robot control method based on the containment type hierarchical structure according to claim 1, it is characterized in that, four control modules refer to respectively: keyboard receiver module, sound identification module, socket Socket communication module, mail reception module.
6. a kind of many scenes of all-purpose robot control method based on the containment type hierarchical structure according to claim 1, is characterized in that, the Starting mode of control module is: with form the concurrent or executed in parallel of separate threads.
CN201310461873.8A 2013-09-30 2013-09-30 A kind of many scenes of all-purpose robot control method based on containment type hierarchical structure Active CN103499972B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310461873.8A CN103499972B (en) 2013-09-30 2013-09-30 A kind of many scenes of all-purpose robot control method based on containment type hierarchical structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310461873.8A CN103499972B (en) 2013-09-30 2013-09-30 A kind of many scenes of all-purpose robot control method based on containment type hierarchical structure

Publications (2)

Publication Number Publication Date
CN103499972A true CN103499972A (en) 2014-01-08
CN103499972B CN103499972B (en) 2016-05-25

Family

ID=49865192

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310461873.8A Active CN103499972B (en) 2013-09-30 2013-09-30 A kind of many scenes of all-purpose robot control method based on containment type hierarchical structure

Country Status (1)

Country Link
CN (1) CN103499972B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106569613A (en) * 2016-11-14 2017-04-19 中国电子科技集团公司第二十八研究所 Multi-modal man-machine interaction system and control method thereof
CN108304714A (en) * 2017-01-13 2018-07-20 埃森哲环球解决方案有限公司 The integrated robotics of goal systems and access manage
CN109976338A (en) * 2019-03-14 2019-07-05 山东大学 A kind of multi-modal quadruped robot man-machine interactive system and method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050103767A1 (en) * 2001-01-25 2005-05-19 Lincoln Global, Inc. System and method providing automated welding notification
US20070078566A1 (en) * 2005-09-30 2007-04-05 Yulun Wang Multi-camera mobile teleconferencing platform
CN201237738Y (en) * 2008-08-01 2009-05-13 邓伟雄 Golf cart with intelligent automatic searching and tracing function
CN103293968A (en) * 2012-02-29 2013-09-11 陈瑞 Intelligent robot system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050103767A1 (en) * 2001-01-25 2005-05-19 Lincoln Global, Inc. System and method providing automated welding notification
US20070078566A1 (en) * 2005-09-30 2007-04-05 Yulun Wang Multi-camera mobile teleconferencing platform
CN201237738Y (en) * 2008-08-01 2009-05-13 邓伟雄 Golf cart with intelligent automatic searching and tracing function
CN103293968A (en) * 2012-02-29 2013-09-11 陈瑞 Intelligent robot system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李静等: "仿真机器人足球赛中团队协作方法的研究", 《计算机科学》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106569613A (en) * 2016-11-14 2017-04-19 中国电子科技集团公司第二十八研究所 Multi-modal man-machine interaction system and control method thereof
CN108304714A (en) * 2017-01-13 2018-07-20 埃森哲环球解决方案有限公司 The integrated robotics of goal systems and access manage
CN108304714B (en) * 2017-01-13 2021-10-26 埃森哲环球解决方案有限公司 Access management system, access management robot promotion system, and access management method
CN109976338A (en) * 2019-03-14 2019-07-05 山东大学 A kind of multi-modal quadruped robot man-machine interactive system and method

Also Published As

Publication number Publication date
CN103499972B (en) 2016-05-25

Similar Documents

Publication Publication Date Title
US11295760B2 (en) Method, apparatus, system and storage medium for implementing a far-field speech function
WO2020253388A1 (en) Machine learning-based e-mail message processing method, apparatus, medium, and electronic device
CN100543675C (en) The method of adjusting back based on the component interface realization event in the computer software
US9813371B2 (en) Method, sending terminal, receiving terminal, and system for classifying emails
CN105912092A (en) Voice waking up method and voice recognition device in man-machine interaction
CN109325715A (en) For receiving and dispatching method, user terminal, server and the vehicle of express delivery
CN105895093A (en) Voice information processing method and device
EP3857544B1 (en) Speaker awareness using speaker dependent speech model(s)
CN103499972B (en) A kind of many scenes of all-purpose robot control method based on containment type hierarchical structure
CN111443801B (en) Man-machine interaction method, device, equipment and storage medium
CN105335146B (en) The method and portable electronic device of management software data traffic
WO2018059328A1 (en) Terminal control method, terminal, and data storage medium
US20240430218A1 (en) Methods and apparatuses for group message processing, system, and computer medium
KR20210083222A (en) Method, apparatus, device and storage medium for processing voice data
CN109086276A (en) Data translating method, device, terminal and storage medium
WO2023011483A1 (en) Message sending method and apparatus, and electronic device
WO2020124389A1 (en) Apparatus in mobile terminal for identifying application program, and terminal
WO2013038732A1 (en) Image processing device, image processing method, control program, and recording medium
WO2021223681A1 (en) Intelligent reminding method and device
CN117292418A (en) Face recognition method and device
CN107302442A (en) A kind of meeting management system and conference management method
CN117789710A (en) Voice interaction method, device and equipment for vehicle and vehicle
CN110532033B (en) Data processing system and data processing method
CN107888478B (en) Voice information forwarding method, device and storage medium in instant messaging process
CN109408116A (en) A kind of service identification acquisition methods, device, equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant