CN107053214B - A robot battle device and control method based on somatosensory control - Google Patents
A robot battle device and control method based on somatosensory control Download PDFInfo
- Publication number
- CN107053214B CN107053214B CN201710026359.XA CN201710026359A CN107053214B CN 107053214 B CN107053214 B CN 107053214B CN 201710026359 A CN201710026359 A CN 201710026359A CN 107053214 B CN107053214 B CN 107053214B
- Authority
- CN
- China
- Prior art keywords
- robot
- kinect
- control
- player
- information
- 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.)
- Expired - Fee Related
Links
- 230000003238 somatosensory effect Effects 0.000 title claims abstract description 35
- 238000000034 method Methods 0.000 title claims abstract description 27
- 230000009471 action Effects 0.000 claims abstract description 63
- 230000033001 locomotion Effects 0.000 claims abstract description 21
- 239000000284 extract Substances 0.000 claims abstract description 8
- 238000004891 communication Methods 0.000 claims description 9
- 230000008569 process Effects 0.000 claims description 7
- 230000000087 stabilizing effect Effects 0.000 claims description 6
- 210000000988 bone and bone Anatomy 0.000 claims description 5
- 230000000694 effects Effects 0.000 claims description 3
- 230000003993 interaction Effects 0.000 abstract description 5
- 230000001276 controlling effect Effects 0.000 description 8
- 230000000875 corresponding effect Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 230000008859 change Effects 0.000 description 4
- 230000001960 triggered effect Effects 0.000 description 3
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 206010048909 Boredom Diseases 0.000 description 1
- 210000000784 arm bone Anatomy 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012856 packing Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B25—HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
- B25J—MANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
- B25J13/00—Controls for manipulators
- B25J13/08—Controls for manipulators by means of sensing devices, e.g. viewing or touching devices
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F9/00—Games not otherwise provided for
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B25—HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
- B25J—MANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
- B25J9/00—Programme-controlled manipulators
- B25J9/16—Programme controls
- B25J9/1602—Programme controls characterised by the control system, structure, architecture
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/011—Arrangements for interaction with the human body, e.g. for user immersion in virtual reality
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/103—Static body considered as a whole, e.g. static pedestrian or occupant recognition
Landscapes
- Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Theoretical Computer Science (AREA)
- Robotics (AREA)
- Mechanical Engineering (AREA)
- Multimedia (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Manipulator (AREA)
- Toys (AREA)
Abstract
Description
技术领域technical field
本发明涉及人机交互自动控制的研究领域,特别涉及一种基于体感控制的机器人对战装置及控制方法。The invention relates to the research field of automatic control of human-computer interaction, in particular to a robot battle device and control method based on somatosensory control.
背景技术Background technique
目前市场上大部分的对战游戏主要软件游戏,或者是手柄遥控的对战游戏。软件游戏的操作方式主要是通过键盘和鼠标等外设进行操作;而手柄遥控则是通过遥控器。这些种类的对战游戏,玩家只是通过敲击按键进行击打,没有真实的战斗体验,且长时间游戏容易劳累身体,产生厌倦感。Most of the battle games currently on the market are mainly software games, or battle games with remote control of the handle. The operation mode of the software game is mainly through peripherals such as keyboard and mouse; while the remote control of the handle is through the remote control. In these types of battle games, players just tap the buttons to fight, without any real combat experience, and the long-term game is easy to tire the body and produce a sense of boredom.
Kinec t是一种3D体感摄影机,同时具有即使动态捕捉、影像识别、麦克风输入、语音识变等功能。微软公司推出的Kinect装置在人体跟踪以及姿态评估方面有着出色的表现,同时微软公司还推出了Kinect for Windows SDK开发工具包,配合此工具包可以利用Kinect的体感技术,获取人体深度信息,通过识别人体动作和手势,来理解操作者的意图,从而利用计算机对机器人进行有效的操作。Kinec t is a 3D somatosensory camera with functions such as real-time motion capture, image recognition, microphone input, and voice recognition. The Kinect device launched by Microsoft has excellent performance in human body tracking and attitude assessment. Human body movements and gestures to understand the operator's intentions, so as to use the computer to effectively operate the robot.
使用Kinect设备的体感控制系统来操控机器人对战,增加了游戏操作的多样性和游戏的娱乐性,同时这种操作方式更符合未来机器人发展的趋势之一。其体现了人机交互的理念,使玩家真正体验到“战斗”的快感。该体感控制的战车机器人对战装置,允许两个玩家可以分别选择控制机器人部分、或者控制车子部分,双人配合进行对战游戏。Using the somatosensory control system of the Kinect device to control the robot battle increases the diversity of game operations and the entertainment of the game. At the same time, this operation method is more in line with one of the future trends in robot development. It embodies the concept of human-computer interaction, allowing players to truly experience the thrill of "combat". The somatosensory-controlled chariot robot battle device allows two players to choose to control the robot part or the car part respectively, and two players cooperate to play a battle game.
发明内容Contents of the invention
本发明的主要目的在于克服现有技术的缺点与不足,提供一种基于体感控制的机器人对战装置及控制方法,通过Kinect装置可以实现对战车机器人的控制。The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art, to provide a robot fighting device and control method based on somatosensory control, through which the control of the chariot robot can be realized through the Kinect device.
为了达到上述目的,本发明采用以下技术方案:In order to achieve the above object, the present invention adopts the following technical solutions:
本发明提供了一种基于体感控制的机器人对战装置及控制方法,包括战车机器人,还包括用于识别玩家动作并采集动作信息的Kinect装置以及接收Kinect装置采集的动作信息并依据该动作信息对战车机器人进行控制的控制装置;所述Kinect装置包括Kinect感应器、用于动作识别的Kinect体感摄像头、深度传感器以及PC端,所述Kinect感应器、Kinect体感摄像头以及深度传感器均与PC端连接,所述控制装置包括WIFI模块,所述Kinect装置通过WIFI模块与控制装置通信;所述控制装置设置在战车机器人内。The present invention provides a robot combat device based on somatosensory control and a control method, including a chariot robot, and a Kinect device for recognizing player actions and collecting action information, and receiving the action information collected by the Kinect device, and according to the action information. The control device that the chariot robot controls; the Kinect device includes a Kinect sensor, a Kinect somatosensory camera for motion recognition, a depth sensor and a PC terminal, and the Kinect sensor, Kinect somatosensory camera and a depth sensor are all connected to the PC terminal , the control device includes a WIFI module, and the Kinect device communicates with the control device through the WIFI module; the control device is arranged in the chariot robot.
作为优选的技术方案,所述控制装置包括单片机、电源模块、通讯模块、电机驱动模块以及功能按键模块,所述电源模块、通讯模块、电机驱动模块以及功能按键模块均与单片机连接。As a preferred technical solution, the control device includes a single-chip microcomputer, a power supply module, a communication module, a motor drive module and a function key module, and the power supply module, the communication module, the motor drive module and the function key module are all connected to the single-chip microcomputer.
作为优选的技术方案,所述战车机械人包括电机和舵机,所述单片机设定两个用于控制电机的I/O口,通过改变两个I/O口的高低电平以及方波占空比来控制一个电机的正转、反转以及转速;所述单片机上还设有一个用于控制舵机的I/O口,在舵机的工作周期内,通过改变该I/O口高低电平占空比来控制舵机从0°~180°的转动。As a preferred technical solution, the chariot robot includes a motor and a steering gear, and the single-chip microcomputer sets two I/O ports for controlling the motor. By changing the high and low levels of the two I/O ports and the square wave The duty cycle is used to control the forward rotation, reverse rotation and speed of a motor; the single chip microcomputer is also provided with an I/O port for controlling the steering gear, and in the working cycle of the steering gear, by changing the I/O port The high and low level duty cycle is used to control the rotation of the servo from 0° to 180°.
作为优选的技术方案,所述电源模块采用7.4V充电电池及稳压芯片对控制装置进行供电。As a preferred technical solution, the power supply module uses a 7.4V rechargeable battery and a voltage stabilizing chip to supply power to the control device.
作为优选的技术方案,所述战车机器人上设有多个微动开关和多颗LED灯,所述多个微动开关和多颗LED灯均与控制装置连接,当微动开关被击打一次时,LED灯熄灭一颗,当LED灯全部熄灭时,则WIFI模块断开Kinect装置与控制装置的连接。As a preferred technical solution, the chariot robot is provided with a plurality of micro switches and a plurality of LED lights, and the plurality of micro switches and a plurality of LED lights are all connected to the control device. Once, one LED light goes out, and when all the LED lights go out, the WIFI module disconnects the connection between the Kinect device and the control device.
本发明还提供了一种基于体感控制的机器人对战装置的控制方法,包括下述步骤:The present invention also provides a control method of a robot combat device based on somatosensory control, comprising the following steps:
1)将Kinect装置与主机服务器计算机相连,使之能采集到Kinect体感前的玩家身体动作,并用Kinect装置实时采集玩家的动作信息;1) the Kinect device is connected with the host server computer, so that it can collect the player's body motion before the Kinect somatosensory, and use the Kinect device to collect the player's motion information in real time;
2)开启战车机器人的电源,使战车机器人身上的客户端单片机与主机服务器计算机PC机建立起连接;2) Turn on the power supply of the chariot robot, so that the client single-chip microcomputer on the chariot robot is connected with the host server computer PC;
3)PC机则通过Kinect体感摄像头读取到的玩家各关节的位置信息进行分析处理,获得有效的关节角度或者姿势意图,解析动作信息,读取控制战车机器人所需的控制信息;3) The PC analyzes and processes the position information of each player's joints read by the Kinect somatosensory camera, obtains effective joint angles or posture intentions, analyzes motion information, and reads the control information required to control the chariot robot;
4)PC机通过无线WIFI模块与客户端单片机建立的连接,发送控制信息给单片机;4) The PC establishes a connection with the client MCU through the wireless WIFI module, and sends control information to the MCU;
5)单片机接收PC机实时采集到控制信息,通过特定的算法对控制信息进行解析,之后单片机根据得到的信息驱动电机驱动电路以及舵机驱动电路,通过改变电机驱动输入的PWM波占空比改变电机的转速,通过改变舵机输入的PWM波占空比改变舵机的转动角度,实现对战车机器人的操控。5) The single-chip microcomputer receives the control information collected by the PC in real time, and analyzes the control information through a specific algorithm, and then the single-chip microcomputer drives the motor drive circuit and the steering gear drive circuit according to the obtained information, and changes the duty cycle of the PWM wave input by the motor drive. The rotation speed of the motor can be changed by changing the duty cycle of the PWM wave input by the steering gear to change the rotation angle of the steering gear to realize the control of the chariot robot.
作为优选的技术方案,步骤3)具体为:As a preferred technical solution, step 3) is specifically:
Kinect装置开始识别并捕捉Kinect体感摄像头前方1~3米范围内的玩家骨骼,并采集玩家身体动作,Kinect装置可以映射出Kinect体感摄像头范围内的3D情景图,并给出三维空间坐标;Kinect装置通过空间定位获得玩家有效的关节角度或者识别姿势意图,解析动作信息,读取控制战车机器人所需的控制信息;其中读取的信息包括:控制机器人的玩家的双手共六个关节的角度、腰部转动方向以及上半身倾斜角度;控制小车的玩家的双手的相对位置,具体为双手手掌之间的连线与水平线之间的角度;前者采集到的信息控制机器人的动作,后者采集到的信息则控制小车的前进、后退、转弯以及车速。The Kinect device begins to recognize and capture the player's skeleton within 1-3 meters in front of the Kinect somatosensory camera, and collects the player's body movements. The Kinect device can map out the 3D scene map within the range of the Kinect somatosensory camera and give three-dimensional space coordinates; the Kinect device Obtain the effective joint angle of the player or recognize the gesture intention through spatial positioning, analyze the action information, and read the control information required to control the chariot robot; the information read includes: the angles of the six joints of the hands of the player controlling the robot, The rotation direction of the waist and the tilt angle of the upper body; the relative position of the hands of the player controlling the car, specifically the angle between the line between the palms of both hands and the horizontal line; the information collected by the former controls the movement of the robot, and the information collected by the latter Then control the forward, backward, turning and speed of the car.
作为优选的技术方案,步骤4)具体为:As a preferred technical solution, step 4) is specifically:
当单片机在完成初始化并通过WIFI模块建立单片机与PC机的连接后,此时单片机则处于等待接收PC机的控制数据的状态;When the single-chip microcomputer is initialized and the connection between the single-chip microcomputer and the PC is established through the WIFI module, the single-chip microcomputer is in the state of waiting to receive the control data of the PC;
当数据通过WIFI模块发送给单片机,单片机将接收到的信息进行解析,提取出所需要的舵机与电机的控制信息,具体包括9个舵机的角度控制信息和2个电机的控制信息;单片机通过改变输出口的PWM占空比,来改变每个舵机转动的角度,通过舵机不同角度的不同组合,呈现出战车机器人不同的动作,所以只要给每个舵机输入特定的角度,就能让机器人做出预期动作;单片机不停更新Kinect装置所采集到的玩家动作信息,在更新延迟不大的情况下,就能达到战车机器人动作和玩家同步的效果;同时通过电机驱动模块,控制改变电机的转速以及转向,当两个驱动轮的转速存在转速差时,就能使小车实现转弯功能,转速差越大,转弯幅度越大,改变电机转向,就能实现前进后退功能。When the data is sent to the single-chip microcomputer through the WIFI module, the single-chip microcomputer will analyze the received information and extract the control information of the required steering gear and motor, including the angle control information of 9 steering gears and the control information of 2 motors; Change the PWM duty cycle of the output port to change the rotation angle of each steering gear. Through different combinations of different angles of the steering gear, different actions of the chariot robot are presented, so as long as you input a specific angle for each steering gear, it will The robot can make expected actions; the single-chip microcomputer keeps updating the player's action information collected by the Kinect device. In the case of a small update delay, the effect of synchronizing the action of the chariot robot with the player can be achieved; at the same time, through the motor drive module, Control changes the speed and steering of the motor. When there is a speed difference between the two driving wheels, the car can turn.
9、根据权利要求6所述基于体感控制的机器人对战装置的控制方法,其特征在于,在战车机器人上安装了5盏LED灯作为战车机器人的生命条,当装置进入正常工作状态时,微动开关处于可感应状态,同时5颗LED灯全亮,当其中任一个微动开关感应到触碰时,就会熄灭一颗LED灯,当5颗led灯全灭时,客户端单片机就会断开与服务器计算机的连接,数据无法传输,玩家也就无法操作战车机器人。9. The control method of the robot battle device based on somatosensory control according to claim 6, characterized in that 5 LED lights are installed on the chariot robot as the life bar of the chariot robot, when the device enters the normal working state, The micro switch is in the sensing state, and all 5 LED lights are on at the same time. When any one of the micro switches senses a touch, it will turn off one LED light. When all 5 LED lights are off, the client MCU will The connection to the server computer will be disconnected, data cannot be transmitted, and the player cannot operate the tank robot.
10、根据权利要求6所述基于体感控制的机器人对战装置的控制方法,其特征在于,所述战车机器人装置是采用7.4V充电电池及稳压芯片对各模块及元器件进行供电。10. The control method of the robot combat device based on somatosensory control according to claim 6, wherein the chariot robot device uses a 7.4V rechargeable battery and a voltage stabilizing chip to supply power to each module and components.
本发明与现有技术相比,具有如下优点和有益效果:Compared with the prior art, the present invention has the following advantages and beneficial effects:
1、本发明Kinect装置通过WIFI模块实现与控制装置的连接,当Kinect装置将采集到玩家的动作进行解析,得到所需的动作关节信息后,再通过无线通讯模块将信号发至控制装置中的单片机;单片机根据接收自通讯模块的信号,并进行数据处理后,控制舵机和电机的转动以控制战车机器人的动作。1. The Kinect device of the present invention realizes the connection with the control device through the WIFI module. When the Kinect device analyzes the actions collected by the player and obtains the required action joint information, the signal is sent to the control device through the wireless communication module. Single-chip microcomputer: The single-chip microcomputer controls the rotation of the steering gear and the motor to control the action of the chariot robot according to the signal received from the communication module and after data processing.
2、本发明使用电脑-人机交互模块获取玩家动作信号,对原始玩家动作进行采集和信息提取后,从而实现对战车机器人的控制。2. The present invention uses the computer-human-computer interaction module to obtain player action signals, collects the original player actions and extracts information, thereby realizing the control of the chariot robot.
3、本发明Kinect的体感控制改变乐以往游戏的单一操作,使人机交互的理念更加彻底地展现出来,使玩家真正投入到“战斗”之中。两个玩家可以分别选择控制机器人部分、或者控制车子部分,双人配合进行对战游戏。控制机器人的玩家可以做出上半身动作,使机器人模仿;控制车子部分的玩家可以通过模拟开车姿势来控制车的前进、后退以及转弯等,实现机器人的移动功能。两个玩家之间相互配合,一起战斗。3. The somatosensory control of the Kinect of the present invention changes the single operation of the previous games, and makes the concept of human-computer interaction more thoroughly displayed, so that players can really put themselves into the "battle". Two players can choose to control the robot part or the car part respectively, and the two players cooperate to play the battle game. The player who controls the robot can make upper body movements to make the robot imitate; the player who controls the car part can control the forward, backward and turning of the car by simulating the driving posture, so as to realize the mobile function of the robot. The two players cooperate with each other and fight together.
附图说明Description of drawings
图1是本发明基于体感控制的机器人对战装置的电路结构框图;Fig. 1 is the circuit structure block diagram of the robot battle device based on somatosensory control of the present invention;
图2(a)是本发明Arduino mega 2560最小系统电路原理图;Fig. 2 (a) is the minimum system circuit schematic diagram of Arduino mega 2560 of the present invention;
图2(b)是本发明电机驱动模块电路原理图;Fig. 2 (b) is the schematic diagram of the motor drive module circuit of the present invention;
图2(c)是本发明5V、3V稳压模块电路原理图;Fig. 2 (c) is the circuit principle diagram of 5V, 3V voltage stabilizing module of the present invention;
图2(d)是本发明WIFI模块以及各电路接口所对应的芯片引脚的电路原理图;Fig. 2 (d) is the circuit schematic diagram of the chip pin corresponding to the WIFI module of the present invention and each circuit interface;
图3是本发明基于体感控制的机器人对战装置单片机的工作流程图;Fig. 3 is the working flow chart of the single-chip microcomputer of the robot fighting device based on somatosensory control in the present invention;
图4是本发明机器人对战装置控制方法的流程图。Fig. 4 is a flow chart of the control method of the robot fighting device of the present invention.
具体实施方式Detailed ways
下面结合实施例及附图对本发明作进一步详细的描述,但本发明的实施方式不限于此。The present invention will be further described in detail below in conjunction with the embodiments and the accompanying drawings, but the embodiments of the present invention are not limited thereto.
实施例Example
如图1、图2(a)-图2(d)所示,本实施例一种基于体感控制的机器人对战装置,包括战车机器人、用于识别玩家动作并采集动作信息的Kinect装置以及接收Kinect装置采集的动作信息并依据该动作信息对战车机器人进行控制的控制装置;所述Kinect装置包括Kinect感应器、用于动作识别的摄像头、深度传感器以及PC端,所述Kinect感应器、摄像头以及深度传感器均与PC端连接,所述控制装置包括WIFI模块,所述Kinect装置通过WIFI模块与控制装置通信;所述控制装置设置在战车机器人内。As shown in Fig. 1, Fig. 2 (a) - Fig. 2 (d), a kind of robot battle device based on somatosensory control in this embodiment includes a chariot robot, a Kinect device for recognizing player actions and collecting action information, and a receiver The action information that Kinect device gathers and controls the chariot robot according to this action information; Described Kinect device comprises Kinect sensor, camera for motion recognition, depth sensor and PC end, described Kinect sensor, camera And the depth sensor is connected with the PC end, the control device includes a WIFI module, and the Kinect device communicates with the control device through the WIFI module; the control device is arranged in the chariot robot.
所述Kinect感应器采用Kinect Xbox one,所述深度传感器嵌入在Kinect感应器内部。The Kinect sensor adopts Kinect Xbox one, and the depth sensor is embedded inside the Kinect sensor.
所述WIFI模块采用ESP8266WIFI模块,实现上位机(电脑、PC机)与下位机(单片机)之间数据的无线传输。The WIFI module adopts the ESP8266 WIFI module to realize the wireless transmission of data between the upper computer (computer, PC) and the lower computer (single-chip microcomputer).
所述控制装置包括单片机、电源模块、通讯模块、电机驱动模块以及功能按键模块,所述电源模块、通讯模块、电机驱动模块以及功能按键模块均与单片机连接。The control device includes a single-chip microcomputer, a power supply module, a communication module, a motor drive module and a function key module, and the power supply module, the communication module, the motor drive module and the function key module are all connected to the single-chip microcomputer.
所述战车机械人包括电机和舵机,所述单片机设定两个用于控制电机的I/O口,通过改变两个I/O口的高低电平以及方波占空比来控制一个电机的正转、反转以及转速;所述单片机上还设有一个用于控制舵机的I/O口,在舵机的工作周期内,通过改变该I/O口高低电平占空比来控制舵机从0°~180°的转动。The chariot robot includes a motor and a steering gear. The single-chip microcomputer sets two I/O ports for controlling the motor, and controls one by changing the high and low levels of the two I/O ports and the square wave duty cycle Forward rotation, reverse rotation and speed of the motor; the single-chip microcomputer is also provided with an I/O port for controlling the steering gear. In the working cycle of the steering gear, by changing the high and low level duty cycle of the I/O To control the rotation of the steering gear from 0° to 180°.
所述单片机采用Arduino mega 2560单片机,以Arduino mega 2560单片机作为主控芯片实现对电脑实时采集到并传来的动作数据进行解析。The single-chip microcomputer adopts the Arduino mega 2560 single-chip microcomputer, and uses the Arduino mega 2560 single-chip microcomputer as the main control chip to realize analyzing the action data collected and transmitted by the computer in real time.
所述电机驱动模块采用L298P,通过L298P驱动电机进相应的动作。The motor drive module adopts L298P, and drives the motor to perform corresponding actions through the L298P.
所述电源模块采用7.4V充电电池及稳压芯片对控制装置进行供电,可以给控制装置提供稳定的电压,保证机器人对战装置可以持续工作。The power supply module uses a 7.4V rechargeable battery and a voltage stabilizing chip to supply power to the control device, which can provide a stable voltage to the control device and ensure that the robot battle device can continue to work.
所述战车机器人上设有多个微动开关和多颗LED灯,所述多个微动开关和多颗LED灯均与控制装置连接,当微动开关被击打一次时,LED灯熄灭一颗,当LED灯全部熄灭时,则WIFI模块断开Kinect装置与控制装置的连接。The chariot robot is provided with a plurality of micro switches and a plurality of LED lights, and the plurality of micro switches and a plurality of LED lights are connected to the control device. When the micro switch is hit once, the LED lights go out One, when all the LED lights are off, the WIFI module disconnects the Kinect device from the control device.
所述的对战机器人的工作电压在7.4VDC~8.6VDC;Kinect装置的工作电压为220V。The working voltage of the fighting robot is 7.4VDC~8.6VDC; the working voltage of the Kinect device is 220V.
所述的AT系列单片机控制单元由ATMEL公司产生的MEGA2560单片机及其外围电路构成。Described AT series single-chip microcomputer control unit is made of MEGA2560 single-chip microcomputer and its peripheral circuit produced by ATMEL company.
本实施例的机器人对战装置的工作过程如下:The working process of the robot fighting device of the present embodiment is as follows:
参见图3并结合图2,当ATmega2560单片机在完成初始化后,单片机上的ESP8255WIFI模块通过初始化设置将会建立单片机与Kinect装置连接的PC机的联系,此时WIFI模块作为客户端,PC机作为服务器;无线通讯建立完成后,Kinect装置将开始识别玩家的动作,并采集有效信息,通过一定处理后,将数据通过WIFI模块发送给单片机。单片机将接收到的信息进行解析,提取出所需要的舵机与电机的控制信息,解析以及信息提取的过程采用常规的手段。同时,设定两个输出I/O口,通过改变两个I/O口的高低电平以及方波占空比来控制一个电机的正转、反转以及转速。设定一个输出I/O口,在舵机的工作周期内,改变高低电平占空比来控制舵机从0°~180°的转动。Kinect装置采集的电机信息可包含正反转与转速;采集的舵机信息可包含机器人每个关机的舵机角度。单片机将处理后的信息输出在驱动电路后,即可控制战车的移动和机器人的动作。此外,在机器人身体部位安装了若干个微动开关,当微动开关被击打到时,战车上的5颗LED灯则会灭掉一颗。当灯全部熄灭时,则WIFI模块将会断开与PC机的联系,机器人将无法接收到信息,而玩家也无法通过Kinect装置控制战车机器人。Referring to Figure 3 and combined with Figure 2, when the ATmega2560 MCU is initialized, the ESP8255WIFI module on the MCU will establish the connection between the MCU and the PC connected to the Kinect device through the initialization settings. At this time, the WIFI module is used as the client, and the PC is used as the server. ; After the wireless communication is established, the Kinect device will start to recognize the player's actions and collect valid information. After certain processing, the data will be sent to the MCU through the WIFI module. The single-chip microcomputer analyzes the received information, and extracts the required control information of the steering gear and the motor. The process of analysis and information extraction adopts conventional means. At the same time, set two output I/O ports, and control the forward rotation, reverse rotation and speed of a motor by changing the high and low levels of the two I/O ports and the square wave duty cycle. Set an output I/O port. During the working cycle of the steering gear, change the high and low level duty cycle to control the rotation of the steering gear from 0° to 180°. The motor information collected by the Kinect device can include forward and reverse rotation and rotational speed; the collected steering gear information can include the steering gear angle of each shutdown of the robot. After the single-chip microcomputer outputs the processed information to the drive circuit, it can control the movement of the chariot and the action of the robot. In addition, several micro switches are installed on the body of the robot. When the micro switches are hit, one of the five LED lights on the chariot will be turned off. When all the lights are off, the WIFI module will disconnect from the PC, the robot will not be able to receive information, and the player will not be able to control the chariot robot through the Kinect device.
如图4所示,本实施例基于体感控制的机器人对战装置的控制方法,包括下述步骤:As shown in Figure 4, the control method of the robot combat device based on somatosensory control in this embodiment includes the following steps:
接通Kinect装置电源,将Kinect装置与主机服务器计算机相连,完成Kinect装置的初始化,同时打开战车机器人的电源开关,初始化单片机,使客户端单片机与PC机建立连接。Turn on the power supply of the Kinect device, connect the Kinect device to the host server computer, complete the initialization of the Kinect device, and turn on the power switch of the chariot robot at the same time, initialize the single-chip microcomputer, and establish a connection between the client single-chip microcomputer and the PC.
完成连接之后,Kinect装置就开始识别并捕捉体感摄像头前方大约1~3米范围内的玩家骨骼,并采集玩家身体动作。PC机则通过Kinect体感摄像头读取到的玩家各个骨骼关节的位置信息进行分析处理。Kinect装置可以映射出摄像头范围内的3D情景图,并给出三维空间坐标。Kinect装置通过空间定位就可以获得玩家有效的关节角度或者识别姿势意图,解析动作信息,读取控制战车机器人所需的控制信息。其中读取的信息包括:控制机器人的玩家的双手共六个关节的角度、腰部转动方向以及上半身倾斜角度;控制小车的玩家的双手的相对位置,具体为双手手掌之间的连线与水平线之间的角度。前者采集到的信息控制机器人的动作,后者采集到的信息则控制小车的前进、后退、转弯以及车速。After the connection is completed, the Kinect device begins to recognize and capture the player's skeleton within about 1 to 3 meters in front of the somatosensory camera, and collect the player's body movements. The PC analyzes and processes the position information of each bone joint of the player read by the Kinect somatosensory camera. The Kinect device can map a 3D scene map within the range of the camera and give three-dimensional space coordinates. The Kinect device can obtain the effective joint angle of the player or recognize the gesture intention through spatial positioning, analyze the action information, and read the control information required to control the chariot robot. The information read includes: the angles of the six joints of the hands of the player controlling the robot, the direction of waist rotation, and the inclination angle of the upper body; the relative position of the hands of the player controlling the car, specifically the line between the palms of both hands and the horizontal line angle between. The information collected by the former controls the movement of the robot, while the information collected by the latter controls the forward, backward, turning and speed of the car.
解析动作信息解析动作是将获取的位置信息,通过下述的方法,比如相对位置的比较、角度的测量比较、时间参量的设定等,来判断玩家的动作意图。Analyzing action information Analyzing action is to judge the player's action intention by using the obtained position information through the following methods, such as comparison of relative positions, measurement and comparison of angles, setting of time parameters, etc.
根据自己所需要采集的动作特点来设定特定的动作模型,若检测到的动作特点符合设定的动作模型,则触发相应的执行程序。如:Set a specific action model according to the action characteristics that you need to collect. If the detected action characteristics conform to the set action model, the corresponding execution program will be triggered. like:
1.检测手举起:取肩部到头部的高度作为一个单位,若手掌位置高于头部一个或以上的单位,则视为玩家双手举起。1. Detection of raised hands: Take the height from the shoulders to the head as a unit. If the palm is higher than the head by one or more units, it is considered that the player's hands are raised.
2.检测手臂平举:取身体平面作为一个坐标参考系,若手臂骨骼与竖直轴所成的角度为90°±10°时,则视为玩家手臂平举。2. Detect arm raising: Take the body plane as a coordinate reference system. If the angle formed by the arm bone and the vertical axis is 90°±10°, it is considered as the player’s arm raising.
3.检测出拳动作:设定一个时间参量。取肩部长度作为一个长度单位,若在此时间内,手掌与肩部的距离从一个单位增加到大于或等于两个长度单位,则视为玩家有出拳动作。3. Detect punch action: set a time parameter. Take the length of the shoulder as a length unit. If the distance between the palm and the shoulder increases from one unit to greater than or equal to two length units within this period, it is considered that the player has punched.
本实施例总,其他动作也按照动作特点建立动作模型。In this embodiment, other actions are also established according to action characteristics.
采集到所需要的控制信息后,PC机通过WIFI模块与客户端单片机建立起的连接发送已打包封装好的控制信息给单片机。After collecting the required control information, the PC sends the packaged and packaged control information to the microcontroller through the connection established between the WIFI module and the client microcontroller.
当单片机在完成初始化并通过WIFI模块建立单片机与服务器计算机的连接后,此时单片机则处于等待接收服务器计算机的控制数据的状态。当数据通过WIFI模块发送给单片机。单片机将接收到的信息进行解析,提取出所需要的舵机与电机的控制信息。具体包括9个舵机的角度控制信息和2个电机的控制信息。单片机通过改变输出口的PWM占空比,来改变每个舵机转动的角度。每个舵机不同角度的不同组合,就可以呈现出机器人不同的动作。所以只要给每个舵机输入特定的角度,就能让机器人做出预期动作。单片机不停更新Kinect装置所采集到的玩家动作信息,在更新延迟不大的情况下,就能达到机器人动作和玩家同步的效果。另外,通过电机驱动模块,可以改变电机的转速以及转向。当两个驱动轮的转速存在转速差时,就能使小车实现转弯功能。转速差越大,转弯幅度越大,改变电机转向,就能实现前进后退功能。When the single-chip microcomputer is initialized and the connection between the single-chip microcomputer and the server computer is established through the WIFI module, the single-chip microcomputer is in a state of waiting to receive control data from the server computer. When the data is sent to the MCU through the WIFI module. The single-chip microcomputer analyzes the received information and extracts the required control information of the steering gear and motor. Specifically, it includes the angle control information of 9 steering gears and the control information of 2 motors. The single-chip microcomputer changes the rotation angle of each servo by changing the PWM duty cycle of the output port. Different combinations of different angles of each servo can present different movements of the robot. So as long as you input a specific angle to each servo, you can make the robot make the desired action. The single-chip microcomputer continuously updates the player's action information collected by the Kinect device. In the case of a small update delay, the effect of synchronizing the robot's action with the player can be achieved. In addition, through the motor drive module, the speed and direction of the motor can be changed. When there is a speed difference between the speeds of the two driving wheels, the car can be turned. The larger the speed difference, the larger the turning range, and the forward and backward functions can be realized by changing the direction of the motor.
上述单片机将接收到的信息进行解析,提取出所需要的舵机与电机的控制信息具体为:The above-mentioned single-chip microcomputer analyzes the received information, and extracts the required steering gear and motor control information as follows:
(1)PC端将数据打包,发送给单片机,具体的打包方式为:数据判别符+技能判定数据+舵机和电机控制信息+校检位。(1) The PC side packs the data and sends it to the microcontroller. The specific packing method is: data discriminator + skill judgment data + steering gear and motor control information + check digit.
(2)数据判别符作为数据组包头,提醒单片机接收信息;技能判定数据也为两位的16进制的数据,包含不能的技能种类,若技能被触发,则跳过剩下的数据而直接执行技能程序;若为非技能指令,则解析舵机和电机控制信息,将所需要的9个舵机角度和2个电机的控制信息分别转化为两位的16进制,并按一定的顺序排列;校检位则是将除数据判别符外的16进制数据累加求和后取256的余数,将余数作为校检位。(2) The data discriminator is used as the header of the data group to remind the MCU to receive information; the skill judgment data is also two-digit hexadecimal data, including the types of skills that cannot be used. If the skill is triggered, the remaining data will be skipped and executed directly Skill program; if it is a non-skill command, analyze the steering gear and motor control information, convert the required 9 steering gear angles and 2 motor control information into two-digit hexadecimal, and arrange them in a certain order The check digit is to take the remainder of 256 after accumulating and summing the hexadecimal data except the data discriminator, and use the remainder as the check digit.
(3)单片机接收到一段有效信息后,将除校检位的数据累加求和后取256的余数,与数据中的校检位比较,若校检位不正确,则不解析此信息,接收下一条信息;若校检位正确,则提取技能数据或者舵机与电机的控制数据,进行逆向解码后化为10进制的控制信息,进而控制电路。(3) After the single-chip microcomputer receives a piece of valid information, it accumulates and sums the data except the check digit and takes the remainder of 256, and compares it with the check digit in the data. If the check digit is incorrect, it does not analyze the information and receives The next piece of information; if the check digit is correct, extract the skill data or the control data of the steering gear and the motor, perform reverse decoding and convert it into decimal control information, and then control the circuit.
此外,在机器人的身体部位安装了若干微动开关,此微动开关作为机器人被击打时的触碰点。小车后部有5颗LED灯,作为机器人的生命值。当装置进入正常工作状态时,微动开关处于可感应状态,同时5颗LED灯全亮。当其中任一个微动开关感应到触碰时,就会熄灭一颗led灯。当5颗LED灯全灭时,客户端单片机就会断开与PC机的连接,数据无法传输,玩家也就无法通过Kinect体感控制战车机器人了。In addition, a number of micro switches are installed on the body parts of the robot, and these micro switches are used as touch points when the robot is hit. There are 5 LED lights at the rear of the car, which are used as the life value of the robot. When the device enters the normal working state, the micro switch is in the sensing state, and all 5 LED lights are on at the same time. When any one of the micro switches senses a touch, it turns off an led light. When the 5 LED lights are all off, the client MCU will disconnect from the PC, the data cannot be transmitted, and the player cannot control the chariot robot through Kinect somatosensory.
触发动作指令时,玩家只需要做出相应技能的设定动作。当计算机成功识别出此动作位技能动作时,就会发送特定的技能指令给单片机,单片机就会执行相应的程序命令,使机器人做出事先设定的技能动作。When the action command is triggered, the player only needs to make the set action of the corresponding skill. When the computer successfully recognizes the action as a skill action, it will send a specific skill command to the single-chip microcomputer, and the single-chip microcomputer will execute the corresponding program command to make the robot perform the skill action set in advance.
上述实施例为本发明较佳的实施方式,但本发明的实施方式并不受上述实施例的限制,其他的任何未背离本发明的精神实质与原理下所作的改变、修饰、替代、组合、简化,均应为等效的置换方式,都包含在本发明的保护范围之内。The above-mentioned embodiment is a preferred embodiment of the present invention, but the embodiment of the present invention is not limited by the above-mentioned embodiment, and any other changes, modifications, substitutions, combinations, Simplifications should be equivalent replacement methods, and all are included in the protection scope of the present invention.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710026359.XA CN107053214B (en) | 2017-01-13 | 2017-01-13 | A robot battle device and control method based on somatosensory control |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710026359.XA CN107053214B (en) | 2017-01-13 | 2017-01-13 | A robot battle device and control method based on somatosensory control |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107053214A CN107053214A (en) | 2017-08-18 |
CN107053214B true CN107053214B (en) | 2023-09-05 |
Family
ID=59599340
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710026359.XA Expired - Fee Related CN107053214B (en) | 2017-01-13 | 2017-01-13 | A robot battle device and control method based on somatosensory control |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107053214B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107908288A (en) * | 2017-11-30 | 2018-04-13 | 沈阳工业大学 | A kind of quick human motion recognition method towards human-computer interaction |
CN108481348A (en) * | 2018-03-14 | 2018-09-04 | 合肥工业大学 | Hexapod Robot control system based on Arduino platforms |
EP3779630A4 (en) * | 2018-03-27 | 2021-08-11 | Zhongqian You | Robot avoidance control method and related apparatus |
CN108594865A (en) * | 2018-05-17 | 2018-09-28 | 广州悦享环球文化科技有限公司 | A kind of control robot imaging system and method |
WO2020133628A1 (en) * | 2018-12-29 | 2020-07-02 | 深圳市工匠社科技有限公司 | Humanoid robotic arm somatosensory control system and related product |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103399637A (en) * | 2013-07-31 | 2013-11-20 | 西北师范大学 | Man-computer interaction method for intelligent human skeleton tracking control robot on basis of kinect |
CN203941451U (en) * | 2014-04-15 | 2014-11-12 | 桂林电子科技大学 | Based on the automatic obstacle avoidance trolley of gesture identification |
CN104971502A (en) * | 2015-07-22 | 2015-10-14 | 黑龙江大学 | Multi-driving autonomous networked boxing model robot system and control method thereof |
CN205323228U (en) * | 2015-12-15 | 2016-06-22 | 广州大学 | Brain wave and acceleration of gravity vehicle actuated control's fought robot toy |
CN106313072A (en) * | 2016-10-12 | 2017-01-11 | 南昌大学 | Humanoid robot based on leap motion of Kinect |
CN206393653U (en) * | 2017-01-13 | 2017-08-11 | 广州大学 | A kind of robot battle device based on motion sensing control |
-
2017
- 2017-01-13 CN CN201710026359.XA patent/CN107053214B/en not_active Expired - Fee Related
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103399637A (en) * | 2013-07-31 | 2013-11-20 | 西北师范大学 | Man-computer interaction method for intelligent human skeleton tracking control robot on basis of kinect |
CN203941451U (en) * | 2014-04-15 | 2014-11-12 | 桂林电子科技大学 | Based on the automatic obstacle avoidance trolley of gesture identification |
CN104971502A (en) * | 2015-07-22 | 2015-10-14 | 黑龙江大学 | Multi-driving autonomous networked boxing model robot system and control method thereof |
CN205323228U (en) * | 2015-12-15 | 2016-06-22 | 广州大学 | Brain wave and acceleration of gravity vehicle actuated control's fought robot toy |
CN106313072A (en) * | 2016-10-12 | 2017-01-11 | 南昌大学 | Humanoid robot based on leap motion of Kinect |
CN206393653U (en) * | 2017-01-13 | 2017-08-11 | 广州大学 | A kind of robot battle device based on motion sensing control |
Also Published As
Publication number | Publication date |
---|---|
CN107053214A (en) | 2017-08-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107053214B (en) | A robot battle device and control method based on somatosensory control | |
CN103399637B (en) | Based on the intelligent robot man-machine interaction method of kinect skeleton tracing control | |
CN202150897U (en) | Body feeling control game television set | |
US9229528B2 (en) | Input apparatus using connectable blocks, information processing system, information processor, and information processing method | |
US20080291160A1 (en) | System and method for recognizing multi-axis gestures based on handheld controller accelerometer outputs | |
CN203300127U (en) | Children teaching and monitoring robot | |
CN206577357U (en) | A kind of Chinese chess Chinese-chess robot | |
CN103550923B (en) | A wireless intelligent referee system and its method for realizing intelligent referee scoring | |
CN106426206A (en) | Wrestling robot, control equipment and game system | |
CN104971502A (en) | Multi-driving autonomous networked boxing model robot system and control method thereof | |
CN1996205A (en) | Method and system for dynamic motion capture and peripheral device interaction | |
CN201220098Y (en) | Head type controller for capturing and following virtual or remote target | |
CN111228791A (en) | Real person AR shooting game equipment, and shooting fighting system and method based on AR technology | |
CN107803018A (en) | Game playing by machine system based on Chinese chess | |
CN102921170A (en) | First-person shooter game (FPS) motion sensing game gun based on personal computer (PC) game platform | |
CN105582669A (en) | Motion sensing game bracelet system based on motion template feature matching | |
CN106502416B (en) | A kind of driving simulation system and its control method of intelligent recognition bimanual input | |
CN106512391B (en) | A kind of bimanual input recognition methods and the driving simulation system based on it, method | |
CN206393653U (en) | A kind of robot battle device based on motion sensing control | |
CN204798854U (en) | Robot fights ring toy | |
CN105137850A (en) | Laser shoot vehicle, and countermeasure system and countermeasure method based on vehicle | |
WO2021232698A1 (en) | Vision guidance-based mobile gaming system and mobile gaming response method | |
CN108032313A (en) | The manipulator of intelligent terminal touch screen game is automatically performed based on bionic principle | |
CN206431577U (en) | A kind of dolly body-sensing battle device based on AR virtual controllings | |
CN103331023A (en) | Brain wave mind-controlled game machine |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20230905 |