本发明的实施方式Embodiments of the present invention
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the present application, and are not used to limit the present application.
本申请的主要解决方案是:The main solution of this application is:
获取扫地机器人在行进过程中障碍物的图像信息;Obtain the image information of the obstacles in the sweeping robot's traveling process;
根据所述障碍物的图像信息获取障碍物的类别、位置和深度信息;Acquiring the category, location and depth information of the obstacle according to the image information of the obstacle;
根据所述障碍物类别、位置和深度信息控制扫地机器人执行自动避障操作。According to the obstacle category, position and depth information, the sweeping robot is controlled to perform an automatic obstacle avoidance operation.
目前的扫地机器人无法识别障碍物类别以针对不同类别的障碍物执行相应的避障操作,且通常通过激光测距等方式确定扫地机器人与障碍物的距离来执行避障操作,存在避障效果不佳的问题。因而,本申请提出一种扫地机器人控制方法、扫地机器人及计算机可读存储介质,通过获取扫地机器人在行进过程中障碍物的图像信息来获取障碍物的类别、位置和深度信息,在根据不同障碍物的类别、位置和深度信息控制扫地机器人执行自动避障操作,不仅能够识别障碍物类别,且能根据障碍物的位置与深度信息执行自动避障,提高了扫地机器人自动避障的效果。Current sweeping robots cannot recognize obstacle types to perform corresponding obstacle avoidance operations for different types of obstacles, and usually use laser ranging and other methods to determine the distance between the sweeping robot and the obstacle to perform obstacle avoidance operations, and there is no obstacle avoidance effect. Good question. Therefore, this application proposes a cleaning robot control method, a cleaning robot, and a computer-readable storage medium, which can obtain the category, position, and depth information of the obstacle by acquiring the image information of the obstacle during the travel of the cleaning robot. The category, position and depth information of the object controls the sweeping robot to perform automatic obstacle avoidance operations, which can not only identify the obstacle category, but also perform automatic obstacle avoidance based on the position and depth information of the obstacle, which improves the automatic obstacle avoidance effect of the sweeping robot.
参照图1,图1为本申请实施例方案涉及的硬件运行环境的扫地机器人结构示意图。Referring to FIG. 1, FIG. 1 is a schematic diagram of the structure of the sweeping robot in the hardware operating environment involved in the solution of the embodiment of the application.
本申请实施例扫地机器人可以与PC、智能手机及平板电脑等终端设备连接,所述连接可以是无线连接也可以是有线连接。The sweeping robot in the embodiment of the present application may be connected to terminal devices such as PCs, smart phones, and tablet computers, and the connection may be a wireless connection or a wired connection.
如图1所示,该扫地机器人可以包括:通信总线1002,处理器1001,例如CPU,用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。As shown in FIG. 1, the cleaning robot may include: a communication bus 1002, a processor 1001, such as a CPU, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to implement connection and communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a magnetic disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
在一实施例中,扫地机器人还可以包括摄像头、RF(Radio Frequency,射频)电路,传感器、音频电路、WiFi模块等等。其中,传感器比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示屏的亮度,接近传感器可在移动终端移动到耳边时,关闭显示屏和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别移动终端姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;当然,移动终端还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器、温度传感器等其他传感器,在此不再赘述。In an embodiment, the sweeping robot may further include a camera, an RF (Radio Frequency, radio frequency) circuit, a sensor, an audio circuit, a WiFi module, and so on. Among them, sensors such as light sensors, motion sensors and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display screen according to the brightness of the ambient light, and the proximity sensor can turn off the display screen and/or when the mobile terminal is moved to the ear. Backlight. As a kind of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in various directions (usually three-axis), and can detect the magnitude and direction of gravity when it is stationary. It can be used to identify the application of the mobile terminal's posture (such as horizontal and vertical screen switching, Related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, percussion), etc.; of course, the mobile terminal can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, temperature sensor, etc. , I won’t repeat it here.
本领域技术人员可以理解,图1中示出的终端结构并不构成对扫地机器人的限定,可以包括比图示更多或更少的部件,或组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the terminal structure shown in FIG. 1 does not constitute a limitation on the sweeping robot, and may include more or less components than shown in the figure, or combine certain components, or arrange different components.
如图1所示,作为一种计算机存储介质的存储器1005中可以包括操作系统、网络通信模块、用户接口模块以及扫地机器人控制方法程序。As shown in FIG. 1, a memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a cleaning robot control method program.
在图1所示的扫地机器人中,网络接口1004主要用于连接后台服务器,与后台服务器进行数据通信;用户接口1003主要用于连接客户端(用户端),与客户端进行数据通信;而处理器1001可以用于调用存储器1005中存储的扫地机器人控制方法程序,并执行以下操作:In the sweeping robot shown in FIG. 1, the network interface 1004 is mainly used to connect to the back-end server and communicate with the back-end server; the user interface 1003 is mainly used to connect to the client (user side) and communicate with the client; The device 1001 can be used to call the cleaning robot control method program stored in the memory 1005, and perform the following operations:
获取扫地机器人在行进过程中障碍物的图像信息;Obtain the image information of the obstacles in the sweeping robot's traveling process;
根据所述障碍物的图像信息获取障碍物的类别、位置和深度信息;Acquiring the category, location and depth information of the obstacle according to the image information of the obstacle;
根据所述障碍物类别、位置和深度信息控制扫地机器人执行自动避障操作。According to the obstacle category, position and depth information, the sweeping robot is controlled to perform an automatic obstacle avoidance operation.
在一实施例中,处理器1001可以调用存储器1005中存储的扫地机器人控制方法程序,还执行以下操作:In an embodiment, the processor 1001 may call the cleaning robot control method program stored in the memory 1005, and also perform the following operations:
若所述障碍物的类别为第一类,则基于所述位置与深度信息控制扫地机器人执行自动避障操作;If the category of the obstacle is the first category, control the sweeping robot to perform an automatic obstacle avoidance operation based on the position and depth information;
若所述障碍物的类别为第二类,则基于所述位置与深度信息控制扫地机器人在执行自动避障操作后输出报警信息;If the category of the obstacle is the second category, control the sweeping robot to output alarm information after performing automatic obstacle avoidance operations based on the position and depth information;
若所述障碍物的类别为第三类,则基于所述位置与深度信息控制扫地机器人不执行避障操作。If the category of the obstacle is the third category, the sweeping robot is controlled not to perform the obstacle avoidance operation based on the position and depth information.
在一实施例中,处理器1001可以调用存储器1005中存储的扫地机器人控制程序,还执行以下操作:In an embodiment, the processor 1001 may call the cleaning robot control program stored in the memory 1005, and also perform the following operations:
若所述障碍物的类别为第一类,则根据障碍物的位置与深度信息,确定扫地机器人的转向距离信息、转向方向信息及转向角度信息;If the category of the obstacle is the first category, determine the steering distance information, steering direction information, and steering angle information of the sweeping robot according to the position and depth information of the obstacle;
根据所述扫地机器人转向距离信息、转向方向信息及转向角度信息确定避障路线;Determining the obstacle avoidance route according to the turning distance information, turning direction information, and turning angle information of the sweeping robot;
控制扫地机器人按照所述避障路线执行自动避障操作。Control the sweeping robot to perform an automatic obstacle avoidance operation according to the obstacle avoidance route.
在一实施例中,处理器1001调用存储器1005中存储的扫地机器人控制程序,并执行以下操作:In an embodiment, the processor 1001 calls the cleaning robot control program stored in the memory 1005, and performs the following operations:
若所述障碍物的类别为第二类,则基于所述位置与深度信息控制扫地机器人执行自动避障操作;If the category of the obstacle is the second category, control the sweeping robot to perform an automatic obstacle avoidance operation based on the position and depth information;
在扫地机器人执行自动避障操作后,控制扫地机器人输出报警信息,并将所述第二类障碍物的类别与位置及所述报警信息发送至远程终端;After the sweeping robot performs the automatic obstacle avoidance operation, control the sweeping robot to output alarm information, and send the category and location of the second type of obstacle and the alarm information to the remote terminal;
判断与所述类别与位置信息对应的预设时间内是否接收到远程终端发送的处理信息;Judging whether the processing information sent by the remote terminal is received within a preset time corresponding to the category and location information;
若未接收到,则控制扫地机器人再次向远程终端发送报警信息,直至接收到所述处理信息。If not received, control the cleaning robot to send alarm information to the remote terminal again until the processing information is received.
在一实施例中,处理器1001可以调用存储器1005中存储的扫地机器人控制程序,还执行以下操作:In an embodiment, the processor 1001 may call the cleaning robot control program stored in the memory 1005, and also perform the following operations:
若所述障碍物的类别为第三类,则根据扫地机器人的动力参数及形态参数判断扫地机器人是否需要执行避障操作;If the category of the obstacle is the third category, judge whether the sweeping robot needs to perform obstacle avoidance operations according to the power parameters and morphological parameters of the sweeping robot;
若不需要,则基于所述位置与深度信息控制扫地机器人不执行避障操作。If it is not required, the sweeping robot is controlled not to perform obstacle avoidance operations based on the position and depth information.
在一实施例中,处理器1001可以调用存储器1005中存储的扫地机器人控制程序,还执行以下操作:利用障碍物检测网络识别所述图像信息中障碍物的类别信息与坐标信息;In an embodiment, the processor 1001 may call the cleaning robot control program stored in the memory 1005, and also perform the following operations: use an obstacle detection network to identify the category information and coordinate information of the obstacle in the image information;
基于所述坐标信息,利用预设深度摄像头识别所述图像信息中障碍物位置信息与深度信息。Based on the coordinate information, a preset depth camera is used to identify obstacle position information and depth information in the image information.
在一实施例中,处理器1001可以调用存储器1005中存储的扫地机器人控制程序,还执行以下操作:将所述图像信息输入障碍物检测网络,判断检测网络提取的所述障碍物的特征信息是否与训练好的障碍物检测模型相匹配;In an embodiment, the processor 1001 may call a control program of the sweeping robot stored in the memory 1005, and also perform the following operations: input the image information into the obstacle detection network, and determine whether the characteristic information of the obstacle extracted by the detection network is Match with the trained obstacle detection model;
若匹配,则获取所述障碍物检测网络识别的障碍物类别与障碍物检测框的坐标信息。If they match, the obstacle category identified by the obstacle detection network and the coordinate information of the obstacle detection frame are acquired.
在一实施例中,所述获取所述障碍物检测网络识别到的障碍物类别与障碍物检测框的坐标信息的步骤之后,还包括,处理器1001可以调用存储器1005中存储的扫地机器人控制程序,还执行以下操作:In an embodiment, after the step of obtaining the obstacle category and the coordinate information of the obstacle detection frame recognized by the obstacle detection network, the method further includes that the processor 1001 may call the sweeping robot control program stored in the memory 1005 , And also do the following:
基于障碍物检测框的坐标信息确定障碍物在预设深度摄像头采集的图像信息中的位置;Determine the position of the obstacle in the image information collected by the preset depth camera based on the coordinate information of the obstacle detection frame;
基于所述障碍物在预设深度摄像头采集的图像信息中的位置,获取障碍物的位置与深度信息。Obtain the position and depth information of the obstacle based on the position of the obstacle in the image information collected by the preset depth camera.
参照图2,图2为本申请扫地机器人控制方法的第一实施例流程图,本实施例中,所述扫地机器人控制方法包括以下步骤:Referring to Fig. 2, Fig. 2 is a flowchart of a first embodiment of a cleaning robot control method according to the present application. In this embodiment, the cleaning robot control method includes the following steps:
步骤S10:获取扫地机器人在行进过程中障碍物的图像信息;Step S10: Obtain image information of obstacles during the traveling of the sweeping robot;
所述扫地机器人包括图像采集模块,所述图像采集模块包括摄像头,利用摄像头实时采集扫地机器人在行进过程中的周围环境的环境图像信息,通过判断环境图像信息中是否存在障碍物,从而获取扫地机器人在行进过程中障碍物的图像信息。而判断环境图像信息中是否存在障碍物的方法可以采用类似于人脸识别一类的图像识别技术,通过训练障碍物检测网络,将采集的环境图像信息输入训练好的障碍物检测网络,当对采集的环境图像信息进行特征提取时,若提取的特征信息能与训练好的障碍物检模型匹配,则采集的环境图像信息中存在障碍物,若提取的特征信息能与训练好的障碍物检网络匹配,则采集的环境图像信息中不存在障碍物。在判断采集的环境图像信息中是否存在障碍物之后,若存在,则获取存在障碍物的图像信息作为扫地机器人在行进过程中障碍物的图像信息,通过训练好的障碍物检测网络进一步识别障碍物的类别等相关信息。The sweeping robot includes an image acquisition module, the image acquisition module includes a camera, the camera is used to collect real-time environmental image information of the surrounding environment of the sweeping robot in the process of traveling, and the sweeping robot is obtained by judging whether there are obstacles in the environmental image information Image information of obstacles in the process of traveling. The method of judging whether there are obstacles in the environmental image information can use image recognition technology similar to face recognition. By training the obstacle detection network, the collected environmental image information is input into the trained obstacle detection network. When feature extraction is performed on the collected environmental image information, if the extracted feature information can match the trained obstacle detection model, then there are obstacles in the collected environmental image information. If the extracted feature information can match the trained obstacle detection model If the network matches, there are no obstacles in the collected environmental image information. After judging whether there are obstacles in the collected environmental image information, if so, obtain the image information of the obstacles as the image information of the obstacles in the process of the sweeping robot during the travel, and further identify the obstacles through the trained obstacle detection network The category and other related information.
步骤S20:根据所述障碍物的图像信息获取障碍物的类别、位置和深度信息;Step S20: Obtain the category, position and depth information of the obstacle according to the image information of the obstacle;
获取障碍物的图像信息后,利用障碍物检测网络识别所述图像信息中障碍物的类别信息与坐标信息,基于所述坐标信息,利用预设深度摄像头识别所述图像信息中障碍物位置信息与深度信息。具体地,将所述障碍物的图像信息输入所述障碍物检测网络,在判断摄像头采集的图像信息中存在障碍物时,获取所述障碍物检测网络识别的障碍物类别信息与障碍物检测框的坐标信息。在判断摄像头采集的图像信息中是否存在障碍物之前,需要训练障碍物检测网络,在一实施例中,具体的训练过程如下:采集大量需要避障的障碍物的图片(如:10000张),通过分割工具表示出需要标注的障碍物的轮廓得到标注后的标注图片,并在标注后保存为对应的json格式的文件。在保存的json格式的文件中为标注图片生成相应的检测框四个顶点的坐标信息与标注图像中的障碍物类别信息。在标注过程中,从物体类别为0时开始依次增加进行标注,直到所有的识别类别都别标注。在标注完成后,将json格式的文件转换为训练障碍物检测网络用的xml格式文件,并最终转换成障碍物网络模型能够识别训练的record文件。在完成格式转换后,将格式转换后的文件送入障碍物检模型进行训练并配置参数,根据图片数量完成训练步数的设置。当通过所述参数设置训练格式转换后的文件中障碍物图片至损失降到0.1且不再衰减时,停止训练。将训练好的名转换为可进行障碍物检测的文件。而障碍物检测网络的训练过程实质上就是特征提取过程,并在提取特征后在网络中不断预测,将将预测值和真实值对比从而优化参数,最终实现准确预测物体和位置信息的能力。在训练得到障碍物检测网络后,将实时采集的图像数据输入障碍物检测网络,障碍物检测网络通过提取数据图像中的障碍物特征,输出物体类别、检测框顶点坐标及置信度等信息。当置信度超达到预设置信度时,就可以判断实时采集的图像信息中存在障碍物,在存在障碍物时,通过障碍物检测网络输出障碍物相应的检测框的坐标信息与类别信息。基于障碍物检测框的坐标信息确定障碍物在预设深度摄像头采集的图像信息中的位置,从而根据障碍物在预设深度摄像头采集的图像信息中的位置,获取与所述位置对应的障碍物的深度信息。其中,预设深度摄像头可以是TOF(Time of
flight,飞行时间)摄像头,也可以是双目立体摄像头,还可以是单目结构光摄像头等可以获取物体深度信息的深度摄像头。以TOF(Time of
flight,飞行时间)摄像头为例,通过给目标连续发送光脉冲,然后用传感器接收从物体返回的光,通过探测这些发射和接收光脉冲的飞行时间差或相位差来得到目标物距离,并根据目标物体距离生成相应的深度信息。而发射光脉冲进行扫描获取深度信息的方式可以是点式扫描的方式,通过逐点扫描的方式获取被目标三维几何结构,也可以是面式扫描的方式,通过拍摄一张场景图片即可实时获取整个场景的表面几何结构信息。本实施例中,可以是采用面式扫描的方式,先采集一张场景图像,将场景图像送入检测网络进行检测,在场景图像中存在障碍物时,再基于检测网络输出的检测信息,利用TOF(Time of
flight,飞行时间)摄像头进一步获取障碍物的深度信息。After obtaining the image information of the obstacle, the obstacle detection network is used to identify the category information and coordinate information of the obstacle in the image information, and based on the coordinate information, the preset depth camera is used to identify the obstacle position information and the obstacle position information in the image information. In-depth information. Specifically, the image information of the obstacle is input into the obstacle detection network, and when it is determined that there is an obstacle in the image information collected by the camera, the obstacle category information and the obstacle detection frame recognized by the obstacle detection network are obtained. The coordinate information. Before judging whether there are obstacles in the image information collected by the camera, it is necessary to train the obstacle detection network. In one embodiment, the specific training process is as follows: Collect a large number of pictures of obstacles that need to be avoided (for example: 10,000), Use the segmentation tool to show the outline of the obstacle that needs to be labeled to obtain the labeled image, and save it as a corresponding json format file after labeling. Generate the coordinate information of the four vertices of the corresponding detection frame and the obstacle category information in the annotated image in the saved json format file for the annotated image. In the labeling process, the labeling is increased in order from the time when the object category is 0, until all the recognition categories are labeled. After the annotation is completed, the json format file is converted into an xml format file for training the obstacle detection network, and finally converted into a record file that the obstacle network model can recognize and train. After the format conversion is completed, the converted file is sent to the obstacle detection model for training and the parameters are configured, and the number of training steps is set according to the number of pictures. When the obstacle picture in the file after the training format conversion is set by the parameters until the loss drops to 0.1 and no longer attenuates, the training is stopped. Convert the trained name into a file that can be used for obstacle detection. The training process of the obstacle detection network is essentially a feature extraction process. After the features are extracted, the network is continuously predicted. The predicted value is compared with the real value to optimize the parameters, and finally the ability to accurately predict the object and location information is realized. After the obstacle detection network is trained, the real-time collected image data is input to the obstacle detection network. The obstacle detection network extracts obstacle features in the data image to output information such as object category, vertex coordinates of the detection frame, and confidence. When the confidence level exceeds the preset confidence level, it can be judged that there is an obstacle in the image information collected in real time. When there is an obstacle, the coordinate information and category information of the detection frame corresponding to the obstacle are output through the obstacle detection network. Determine the position of the obstacle in the image information collected by the preset depth camera based on the coordinate information of the obstacle detection frame, so as to obtain the obstacle corresponding to the position according to the position of the obstacle in the image information collected by the preset depth camera In-depth information. Among them, the preset depth camera can be TOF (Time of
flight, flight time) camera, it can also be a binocular stereo camera, or a monocular structured light camera and other depth cameras that can obtain object depth information. ToF (Time of
flight, flight time) camera as an example, by continuously sending light pulses to the target, and then using the sensor to receive the light returned from the object, by detecting the flight time difference or phase difference between these transmitted and received light pulses to obtain the target distance, and according to the target The object distance generates corresponding depth information. The way to send light pulses to scan to obtain depth information can be point scanning, point-by-point scanning to obtain the three-dimensional geometric structure of the target, or surface scanning, which can be real-time by taking a picture of the scene Obtain the surface geometry information of the entire scene. In this embodiment, the method of surface scanning may be adopted. First, a scene image is collected, and the scene image is sent to the detection network for detection. When there are obstacles in the scene image, the detection information output by the detection network is used. TOF (Time of
flight, flight time) The camera further obtains the depth information of the obstacle.
步骤S30:根据所述障碍物类别、位置和深度信息控制扫地机器人执行自动避障操作;Step S30: Control the sweeping robot to perform an automatic obstacle avoidance operation according to the obstacle category, position and depth information;
根据检测网络输出的障碍物类别、位置和深度信息控制扫地机器人自动执行相应的避障操作。在执行相应的避障操作之前,可以根据障碍物类别、位置和深度信息先判断障碍物是否为需要避障的障碍物,若为不需要避障的障碍物(如,矮台阶等),则继续沿当前障碍物方向执行原定的清扫任务,若为需要避障的障碍物,则判断障碍物是否为可避障类型的障碍物,如果为可避障类型的障碍物,则控制扫地机器人执行自动避障操作,若所述障碍物为不可避障的障碍物,则重新规划清扫路线不执行自动避障操作;当障碍物为可避障类型的障碍物,还可以进一步判断障碍物是否为需要清扫的障碍物,若为需要清扫的障碍物,则直接执行清扫操作而不执行自动避障操作,若为需要清扫的障碍物,则判断扫地机器人是否能够自主清扫,若能够自主清扫,则控制扫地机器人自主清扫,若不能清扫,则控制扫地机器人接收终端设备发送的清扫指令进行清扫,当没有接收到终端设备的清扫指令或根据终端设备的清扫指令无法清扫或无法根据终端设备的清扫指令进行清扫时,则向终端设备发送提示信息,以供终端设备侧用户及时处理。在确定扫地机器人需要对障碍物进行避障且能够避障时,根据障碍物类别对应的位置和深度信息可以为扫地机器人规划相应的避障路线。而避障路线的规划,可以以避障的安全性、避障时间、避障路线等为基准,在规划的多条避障路线中选出一条既能保证避障的安全系数又能保证避障后按照原定清扫轨迹进行清扫且避障时的转向时间最短的避障路线。当然,也可以是将规划的多条避障路线发送至终端设备,在终端设备指定相应的避障路线后,控制扫地机器人按照终端设备侧用户指定的避障路线执行避障操作。According to the obstacle category, position and depth information output by the detection network, the sweeping robot is controlled to automatically perform corresponding obstacle avoidance operations. Before performing the corresponding obstacle avoidance operation, you can first judge whether the obstacle is an obstacle that needs to be avoided based on the obstacle type, position and depth information. If it is an obstacle that does not need to be avoided (such as a low step, etc.), then Continue to perform the original cleaning task along the direction of the current obstacle. If it is an obstacle that needs to be avoided, judge whether the obstacle is an obstacle avoidable type, if it is an obstacle avoidable type, control the sweeping robot Perform automatic obstacle avoidance operation. If the obstacle is an unavoidable obstacle, re-plan the cleaning route and do not perform automatic obstacle avoidance operation; when the obstacle is an obstacle avoidable type, it can be further judged whether the obstacle is The obstacle that needs to be cleaned, if it is an obstacle that needs to be cleaned, it will directly perform the cleaning operation without automatic obstacle avoidance operation, if it is an obstacle that needs to be cleaned, it will judge whether the sweeping robot can clean autonomously, if it can clean autonomously, then Control the sweeping robot to clean autonomously. If it cannot clean, it will control the sweeping robot to receive the cleaning instruction sent by the terminal device to clean. When the cleaning instruction of the terminal device is not received or the cleaning instruction of the terminal device cannot be cleaned or cannot be cleaned according to the cleaning instruction of the terminal device When cleaning, prompt information is sent to the terminal device for timely processing by the terminal device side user. When it is determined that the sweeping robot needs to avoid obstacles and can avoid obstacles, the corresponding obstacle avoidance route can be planned for the sweeping robot according to the position and depth information corresponding to the obstacle category. The planning of obstacle avoidance routes can be based on obstacle avoidance safety, obstacle avoidance time, obstacle avoidance routes, etc., and one of the planned obstacle avoidance routes can be selected to ensure the safety factor of obstacle avoidance and ensure the avoidance of obstacles. After the obstacle is cleared, follow the original cleaning trajectory and the obstacle avoidance route with the shortest turning time when avoiding the obstacle. Of course, multiple planned obstacle avoidance routes can also be sent to the terminal device, and after the terminal device specifies the corresponding obstacle avoidance route, the sweeping robot is controlled to perform the obstacle avoidance operation according to the obstacle avoidance route specified by the user on the terminal device side.
通过获取扫地机器人在行进过程中障碍物的图像信息,根据所述障碍物的图像信息获取障碍物的类别、位置和深度信息,再根据所述障碍物类别、位置和深度信息控制扫地机器人执行自动避障操作,可以针对于不同类别的障碍物执行相应的自动避障操作,并且可以针对于不同位置与深度信息的障碍物执行自动避障操作,以提高自动避障的准确性,提高自动避障的效率与效果。Obtain the image information of the obstacle during the travel of the sweeping robot, obtain the category, position and depth information of the obstacle according to the image information of the obstacle, and then control the sweeping robot to perform automatic execution according to the obstacle category, position and depth information. Obstacle avoidance operations can perform corresponding automatic obstacle avoidance operations for different types of obstacles, and perform automatic obstacle avoidance operations for obstacles with different position and depth information, so as to improve the accuracy of automatic obstacle avoidance and improve automatic avoidance. The efficiency and effectiveness of barriers.
参照图3,图3为本申请扫地机器人控制方法的第二实施例流程图,本实施例中,所述扫地机器人控制方法包括以下步骤:Referring to Fig. 3, Fig. 3 is a flowchart of a second embodiment of a cleaning robot control method according to the present application. In this embodiment, the cleaning robot control method includes the following steps:
步骤S11:获取扫地机器人在行进过程中障碍物的图像信息;Step S11: Obtain image information of obstacles during the traveling of the sweeping robot;
步骤S12:根据所述障碍物的图像信息获取障碍物的类别、位置和深度信息;Step S12: Obtain the category, position and depth information of the obstacle according to the image information of the obstacle;
步骤S13:若所述障碍物的类别为第一类,则基于所述位置与深度信息控制扫地机器人执行自动避障操作;Step S13: If the category of the obstacle is the first category, control the sweeping robot to perform an automatic obstacle avoidance operation based on the position and depth information;
步骤S14:若所述障碍物的类别为第二类,则基于所述位置与深度信息控制扫地机器人在执行自动避障操作后输出报警信息;Step S14: if the category of the obstacle is the second category, based on the position and depth information, control the sweeping robot to output alarm information after performing the automatic obstacle avoidance operation;
步骤S15:若所述障碍物的类别为第三类,则基于所述位置与深度信息控制扫地机器人不执行避障操作。Step S15: If the category of the obstacle is the third category, control the sweeping robot not to perform obstacle avoidance operations based on the position and depth information.
本实施例提供一种较优的实施方案,在获取扫地机器人在行进过程中障碍物的图像信息后,根据所述障碍物的图像信息获取障碍物的类别、位置和深度信息。根据障碍物的类别,当障碍物为不同类别时,基于不同类别的障碍物,结合障碍物的位置与深度信息执行不同的避障操作。因而在基于不同类别的障碍物执行不同的避障操作之前,需要对障碍物进行分类。所述分类的方式可以是根据障碍物是否为需要避障的障碍物、是否为可以避障的障碍物、是否为需要清扫的障碍物以及是否为扫地机器人能够清扫的障碍物等作为分类条件,对障碍物分类。本实施例中一种较优的分类方式,将扫地机器人需要避障且能够避障的障碍物作为第一类障碍物,将扫地机器人需要避障且需要清扫但扫地机器人不能清扫的障碍物作为第二类障碍物,将扫地机器人不需要避障但需要清扫且能够清扫的障碍物作为第三类障碍物。在对障碍物进行分类后,若所述障碍物的类别为第一类,则根据障碍物的位置与深度信息,确定扫地机器人的转向距离信息、转向方向信息及转向角度信息;根据所述扫地机器人转向距离信息、转向方向信息及转向角度信息确定避障路线;控制扫地机器人按照所述避障路线执行自动避障操作。其中,根据障碍物的位置与深度信息将障碍物相对于扫地机器人正前方的最短距离确定转向距离信息,根据碍物的位置与深度信息判断障碍物的左右两边的区域是否可供当前机器人避障以及机器人是否完成左右两边的区域的清扫确定转向方向信息,根据障碍物的位置与深度信息将能够有效避开障碍物继续沿原定清扫任务指定的清扫路线进行清扫的最佳避障角度确定转向角度信息。在确定转向距离信息、转向方向信息及转向角度信息后,就可以依据这些信息规划避障路线,从而控制扫地机器人以规划的避障路线执行自动避障操作;若所述障碍物的类别为第二类,则基于所述位置与深度信息控制扫地机器人执行自动避障操作;在扫地机器人执行避障操作后,由于无法对第二类障碍物执行清扫操作,因而需要通知终端设备侧的用户来进行处理。此时,在扫地机器人执行自动避障操作后,控制扫地机器人输出报警信息,若所述输出报警信息可以有两种方式:第一种,由扫地机器人通过自身的报警器以音频形式输出的方式,第二种,将报警信息输出至终端设备的方式。当然,还可以是两种方式的结合,在采用第二种方式时,将所述第二类障碍物的类别与位置及所述报警信息发送至终端;通过记录扫地机器人发送报警信息的时间,判断与所述类别与位置信息对应的预设时间内是否接收到终端发送的处理信息;若未接收到,则控制扫地机器人再次向终端发送报警信息,直至接收到所述处理信息时停止发送报警信息。若所述障碍物的类别为第三类,基于所述位置与深度信息控制扫地机器人不执行避障操作。在基于所述位置与深度信息控制扫地机器人不执行避障操作之前,根据扫地机器人的动力参数及形态参数结合障碍物的位置与深度信息判断扫地机器人是否需要执行避障操作。具体地,根据障碍物的位置与深度信息,若扫地机器人可以跨上当前第三类障碍物,则根据扫地机器人的形态参数(如高度,是否具有可供抬步的支撑脚等)可以判断扫地机器人当前是否能够跨上当前障碍物,继续执行原定清扫任务执行的清扫路线进行清扫。在扫地机器人工作一段时间后,根据扫地机器人的动力参数(如剩余电量、输出功率等)判断扫地机器人在当前动力参数下是否能够跨上当前障碍物,继续执行原定清扫任务执行的清扫路线进行清扫。当两种参数均满足条件时,即能够提供充足的动力且具有能跨上第三类障碍物的形态时,扫地机器人可以直接跨上第三类障碍物而无需执行自动避障操作。This embodiment provides a better implementation solution. After acquiring the image information of the obstacle during the traveling of the sweeping robot, the category, position, and depth information of the obstacle are acquired according to the image information of the obstacle. According to the types of obstacles, when the obstacles are of different types, based on different types of obstacles, different obstacle avoidance operations are performed based on the location and depth information of the obstacles. Therefore, before performing different obstacle avoidance operations based on different types of obstacles, it is necessary to classify the obstacles. The classification method can be based on whether the obstacle is an obstacle that needs to be avoided, whether it is an obstacle that can be avoided, whether it is an obstacle that needs to be cleaned, whether it is an obstacle that can be cleaned by a sweeping robot, etc., as classification conditions, Classify obstacles. In this embodiment, a better classification method takes the obstacles that the robot sweeping needs to avoid and can avoid obstacles as the first type of obstacles, and the obstacles that the sweeping robot needs to avoid obstacles and need to be cleaned but cannot be cleaned by the sweeping robot are regarded as the first type of obstacles. Obstacles of the second type, the obstacles that the sweeping robot does not need to avoid obstacles but need to be cleaned and can be cleaned are regarded as the third type of obstacles. After the obstacles are classified, if the category of the obstacle is the first type, the steering distance information, steering direction information, and steering angle information of the sweeping robot are determined according to the position and depth information of the obstacle; according to the sweeping robot The robot steering distance information, steering direction information, and steering angle information determine the obstacle avoidance route; the sweeping robot is controlled to perform automatic obstacle avoidance operations according to the obstacle avoidance route. Among them, according to the position and depth information of the obstacle, the shortest distance of the obstacle relative to the front of the sweeping robot is determined to determine the steering distance information. According to the position and depth information of the obstacle, it is judged whether the area on the left and right sides of the obstacle can be used for the current robot to avoid obstacles. And whether the robot has completed the cleaning of the left and right areas to determine the steering direction information. According to the position and depth information of the obstacle, it will be able to effectively avoid the obstacle and continue to clean along the cleaning route specified by the original cleaning task to determine the best obstacle avoidance angle to determine the steering Angle information. After determining the steering distance information, steering direction information, and steering angle information, the obstacle avoidance route can be planned based on these information, so as to control the sweeping robot to perform automatic obstacle avoidance operations on the planned obstacle avoidance route; if the obstacle category is the first In the second category, the sweeping robot is controlled to perform automatic obstacle avoidance operations based on the position and depth information; after the sweeping robot performs the obstacle avoidance operation, because the second category of obstacles cannot be cleaned, the user on the terminal device side needs to be notified to come To process. At this time, after the sweeping robot performs the automatic obstacle avoidance operation, the sweeping robot is controlled to output alarm information. If the alarm information is output, there are two ways: the first is the way that the sweeping robot outputs in the form of audio through its own alarm , The second way is to output the alarm information to the terminal device. Of course, it can also be a combination of the two methods. When the second method is used, the category and location of the second type of obstacle and the alarm information are sent to the terminal; by recording the time when the sweeping robot sends the alarm information, Determine whether the processing information sent by the terminal is received within the preset time corresponding to the category and location information; if not, control the sweeping robot to send alarm information to the terminal again, and stop sending the alarm until the processing information is received information. If the category of the obstacle is the third category, the sweeping robot is controlled not to perform the obstacle avoidance operation based on the position and depth information. Before controlling the sweeping robot not to perform obstacle avoidance operations based on the position and depth information, it is determined whether the sweeping robot needs to perform obstacle avoidance operations according to the power parameters and morphological parameters of the sweeping robot combined with the position and depth information of the obstacle. Specifically, according to the position and depth information of the obstacle, if the sweeping robot can step up to the current third type of obstacle, the sweeping robot can be judged according to the morphological parameters of the sweeping robot (such as height, whether it has supporting feet for lifting, etc.) Whether the robot can step over the current obstacle and continue to perform the cleaning route of the original cleaning task. After the sweeping robot has worked for a period of time, judge whether the sweeping robot can step over the current obstacle under the current power parameters according to the power parameters of the sweeping robot (such as remaining power, output power, etc.), and continue to perform the cleaning route performed by the original cleaning task Clean up. When the two parameters meet the conditions, that is, it can provide sufficient power and has a form capable of stepping over the third type of obstacle, the sweeping robot can directly step over the third type of obstacle without performing automatic obstacle avoidance operations.
本实施例通过获取扫地机器人在行进过程中障碍物的图像信息,根据所述障碍物的图像信息获取障碍物的类别、位置和深度信息,若所述障碍物的类别为第一类,则基于所述位置与深度信息控制扫地机器人执行自动避障操作,若所述障碍物的类别为第二类,则基于所述位置与深度信息控制扫地机器人在执行自动避障操作后输出报警信息,若所述障碍物的类别为第三类,则基于所述位置与深度信息控制扫地机器人不执行避障操作,针对不同类别的障碍物,根据合其位置与深度信息,执行相应的自动避障操作,不仅能防止漏扫且能报警通知终端侧用户来处理,能够有效提高避障效率效果。In this embodiment, by acquiring the image information of the obstacle during the travel of the sweeping robot, the category, position, and depth information of the obstacle are acquired according to the image information of the obstacle. If the category of the obstacle is the first type, it is based on The position and depth information controls the sweeping robot to perform automatic obstacle avoidance operations. If the category of the obstacle is the second type, the sweeping robot is controlled based on the position and depth information to output alarm information after performing the automatic obstacle avoidance operation, if If the category of the obstacle is the third category, based on the position and depth information, the sweeping robot is controlled not to perform obstacle avoidance operations. For different types of obstacles, perform corresponding automatic obstacle avoidance operations according to their position and depth information. , It can not only prevent missed scanning, but also alarm and notify the terminal user to deal with it, which can effectively improve the efficiency of obstacle avoidance.
此外,本申请实施例还提供一种扫地机器人,所述扫地机器人包括存储器、处理器及存储在所述处理器上并可在处理器上运行的扫地机器人控制程序,所述处理器执行所述扫地机器人控制程序时实现如上所述扫地机器人控制方法的步骤。In addition, an embodiment of the present application also provides a cleaning robot. The cleaning robot includes a memory, a processor, and a cleaning robot control program stored on the processor and running on the processor, and the processor executes the The cleaning robot control program implements the steps of the cleaning robot control method as described above.
此外,本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有扫地机器人控制程序,所述扫地机器人控制程序被处理器执行时实现如上所述的扫地机器人控制方法的步骤。In addition, an embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a cleaning robot control program, and the cleaning robot control program is executed by a processor to realize the above-mentioned cleaning robot control Method steps.
需要说明的是,在本文中,术语“包括”或“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that in this article, the term "include" or "include" or any other variants thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, It also includes other elements that are not explicitly listed, or elements inherent to the process, method, article, or system. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, article, or system that includes the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the foregoing embodiments of the present application are for description only, and do not represent the superiority or inferiority of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,电视,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better.的实施方式。 Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM) as described above. , Magnetic disk, optical disk), including several instructions to make a terminal device (can be a mobile phone, a computer, a server, a TV, or a network device, etc.) execute the method described in each embodiment of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only the preferred embodiments of this application, and do not limit the scope of this application. Any equivalent structure or equivalent process transformation made using the content of the description and drawings of this application, or directly or indirectly used in other related technical fields , The same reason is included in the scope of patent protection of this application.