[go: up one dir, main page]

CN115316887B - Robot control method, robot, and computer-readable storage medium - Google Patents

Robot control method, robot, and computer-readable storage medium Download PDF

Info

Publication number
CN115316887B
CN115316887B CN202211269360.2A CN202211269360A CN115316887B CN 115316887 B CN115316887 B CN 115316887B CN 202211269360 A CN202211269360 A CN 202211269360A CN 115316887 B CN115316887 B CN 115316887B
Authority
CN
China
Prior art keywords
robot
path
edge
local planning
frame
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.)
Active
Application number
CN202211269360.2A
Other languages
Chinese (zh)
Other versions
CN115316887A (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.)
Hangzhou Huacheng Software Technology Co Ltd
Original Assignee
Hangzhou Huacheng Software Technology Co Ltd
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 Hangzhou Huacheng Software Technology Co Ltd filed Critical Hangzhou Huacheng Software Technology Co Ltd
Priority to CN202211269360.2A priority Critical patent/CN115316887B/en
Publication of CN115316887A publication Critical patent/CN115316887A/en
Application granted granted Critical
Publication of CN115316887B publication Critical patent/CN115316887B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A47FURNITURE; DOMESTIC ARTICLES OR APPLIANCES; COFFEE MILLS; SPICE MILLS; SUCTION CLEANERS IN GENERAL
    • A47LDOMESTIC WASHING OR CLEANING; SUCTION CLEANERS IN GENERAL
    • A47L11/00Machines for cleaning floors, carpets, furniture, walls, or wall coverings
    • A47L11/24Floor-sweeping machines, motor-driven
    • AHUMAN NECESSITIES
    • A47FURNITURE; DOMESTIC ARTICLES OR APPLIANCES; COFFEE MILLS; SPICE MILLS; SUCTION CLEANERS IN GENERAL
    • A47LDOMESTIC WASHING OR CLEANING; SUCTION CLEANERS IN GENERAL
    • A47L11/00Machines for cleaning floors, carpets, furniture, walls, or wall coverings
    • A47L11/40Parts or details of machines not provided for in groups A47L11/02 - A47L11/38, or not restricted to one of these groups, e.g. handles, arrangements of switches, skirts, buffers, levers
    • A47L11/4011Regulation of the cleaning machine by electric means; Control systems and remote control systems therefor
    • AHUMAN NECESSITIES
    • A47FURNITURE; DOMESTIC ARTICLES OR APPLIANCES; COFFEE MILLS; SPICE MILLS; SUCTION CLEANERS IN GENERAL
    • A47LDOMESTIC WASHING OR CLEANING; SUCTION CLEANERS IN GENERAL
    • A47L11/00Machines for cleaning floors, carpets, furniture, walls, or wall coverings
    • A47L11/40Parts or details of machines not provided for in groups A47L11/02 - A47L11/38, or not restricted to one of these groups, e.g. handles, arrangements of switches, skirts, buffers, levers
    • A47L11/4061Steering means; Means for avoiding obstacles; Details related to the place where the driver is accommodated
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05DSYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
    • G05D1/00Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
    • G05D1/02Control of position or course in two dimensions
    • G05D1/021Control of position or course in two dimensions specially adapted to land vehicles
    • G05D1/0212Control of position or course in two dimensions specially adapted to land vehicles with means for defining a desired trajectory
    • G05D1/0214Control of position or course in two dimensions specially adapted to land vehicles with means for defining a desired trajectory in accordance with safety or protection criteria, e.g. avoiding hazardous areas
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05DSYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
    • G05D1/00Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
    • G05D1/02Control of position or course in two dimensions
    • G05D1/021Control of position or course in two dimensions specially adapted to land vehicles
    • G05D1/0268Control of position or course in two dimensions specially adapted to land vehicles using internal positioning means
    • G05D1/0274Control of position or course in two dimensions specially adapted to land vehicles using internal positioning means using mapping information stored in a memory device
    • AHUMAN NECESSITIES
    • A47FURNITURE; DOMESTIC ARTICLES OR APPLIANCES; COFFEE MILLS; SPICE MILLS; SUCTION CLEANERS IN GENERAL
    • A47LDOMESTIC WASHING OR CLEANING; SUCTION CLEANERS IN GENERAL
    • A47L2201/00Robotic cleaning machines, i.e. with automatic control of the travelling movement or the cleaning operation
    • AHUMAN NECESSITIES
    • A47FURNITURE; DOMESTIC ARTICLES OR APPLIANCES; COFFEE MILLS; SPICE MILLS; SUCTION CLEANERS IN GENERAL
    • A47LDOMESTIC WASHING OR CLEANING; SUCTION CLEANERS IN GENERAL
    • A47L2201/00Robotic cleaning machines, i.e. with automatic control of the travelling movement or the cleaning operation
    • A47L2201/04Automatic control of the travelling movement; Automatic obstacle detection
    • AHUMAN NECESSITIES
    • A47FURNITURE; DOMESTIC ARTICLES OR APPLIANCES; COFFEE MILLS; SPICE MILLS; SUCTION CLEANERS IN GENERAL
    • A47LDOMESTIC WASHING OR CLEANING; SUCTION CLEANERS IN GENERAL
    • A47L2201/00Robotic cleaning machines, i.e. with automatic control of the travelling movement or the cleaning operation
    • A47L2201/06Control of the cleaning action for autonomous devices; Automatic detection of the surface condition before, during or after cleaning

Landscapes

  • Engineering & Computer Science (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Aviation & Aerospace Engineering (AREA)
  • Remote Sensing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Control Of Position, Course, Altitude, Or Attitude Of Moving Bodies (AREA)
  • Manipulator (AREA)

Abstract

本申请公开了一种机器人控制方法、机器人及计算机可读存储介质。该方法包括:获取由环境地图点云转换的栅格地图,在栅格地图中提取墙面信息;基于墙面信息,生成规划沿边起始点,并在栅格地图中生成若干局部规划路径框;控制机器人从规划沿边起始点开始,沿规划沿边起始点所在的当前局部规划路径框的边框进行沿边运动,直至遍历当前局部规划路径框的边框上的所有路径点后,对当前局部规划路径框的内部路径点进行全覆盖遍历;控制机器人从当前局部规划路径框移动至下一个局部规划路径框,直至遍历所有局部规划路径框的边框路径点以及内部路径点。本申请可以控制机器人在局部规划路径框区域内快速开展全覆盖清扫,提高机器人的清扫效率。

Figure 202211269360

The application discloses a robot control method, a robot and a computer-readable storage medium. The method includes: obtaining a grid map converted from the point cloud of the environmental map, extracting wall information from the grid map; generating a planning edge starting point based on the wall information, and generating several local planning path boxes in the grid map; Control the robot to start from the starting point of the planning along the edge, and move along the border of the current local planning path frame where the starting point of the planning along the edge is located, until after traversing all the path points on the border of the current local planning path frame, the current local planning path frame The internal waypoints are fully covered and traversed; the robot is controlled to move from the current local planning path frame to the next local planning path frame until it traverses all the border path points and internal path points of the local planning path frame. This application can control the robot to quickly carry out full-coverage cleaning in the area of the local planning path frame, and improve the cleaning efficiency of the robot.

Figure 202211269360

Description

机器人控制方法、机器人及计算机可读存储介质Robot control method, robot and computer readable storage medium

技术领域technical field

本申请涉及扫地机器人技术领域,具体涉及一种机器人控制方法、机器人及计算机可读存储介质。The present application relates to the technical field of sweeping robots, in particular to a robot control method, a robot and a computer-readable storage medium.

背景技术Background technique

随着生活水平的日益提高以及家用服务机器人技术的飞快发展,扫地机器人越来越多地进入到家庭生活中。这种机器人通常具备有可以自主转动的底部驱动轮以及滚刷,边刷,吸尘装置等,能够对地表面进行清洁工作。With the improvement of living standards and the rapid development of household service robot technology, sweeping robots have increasingly entered family life. This kind of robot is usually equipped with a bottom drive wheel that can rotate autonomously, a rolling brush, a side brush, a dust suction device, etc., and can clean the ground surface.

通常根据机器人的运行状态可以将其分为无规划随机游走式和全覆盖规划清扫式,由于前者随机游走式清扫效率较低已被逐渐淘汰,后者全覆盖清扫式已经成为扫地机器人的主流方法。但是随着深入研究发现,全覆盖清扫更适合比较空旷的区域,相对比较隐蔽的例如墙角,桌角等死角灰尘更容易堆积。于是人们提出了一种在全覆盖清扫之前的特定清扫模式“沿边清扫”。Usually, according to the operating status of the robot, it can be divided into random walk without planning and full-coverage planning sweeping. The former random walk has been gradually eliminated due to its low cleaning efficiency, and the latter full-coverage sweeping has become the preferred choice of sweeping robots. Mainstream method. However, with in-depth research, it has been found that full-coverage cleaning is more suitable for relatively open areas, and relatively hidden corners such as corners, table corners and other dead corners are more likely to accumulate dust. So people proposed a specific cleaning mode "sweeping along the edge" before full coverage cleaning.

通常沿边清扫是通过使用沿墙传感器将扫地机器人控制在墙面特定距离处,并通过碰撞传感器实现机器人的遇障转向,以达到使扫地机器人一直沿着墙面清扫的效果。但当待清扫区域非常大时,扫地机器人需要花费大量的时间才能完成整个区域的沿边清扫流程,不利于快速开展全覆盖清扫流程,一旦沿边区域围成的待清扫区域过大也不利于进行合理的全覆盖路径规划。Usually, cleaning along the edge is to control the sweeping robot at a certain distance from the wall by using the sensor along the wall, and realize the steering of the robot when encountering obstacles through the collision sensor, so as to achieve the effect of cleaning the sweeping robot along the wall all the time. However, when the area to be cleaned is very large, it takes a lot of time for the sweeping robot to complete the cleaning process along the entire area, which is not conducive to the rapid full-coverage cleaning process. Once the area to be cleaned surrounded by the edge area is too large, it is not conducive to reasonable cleaning. full coverage path planning.

发明内容Contents of the invention

本申请提出了一种机器人控制方法、机器人及计算机可读存储介质,以使机器人快速开展全覆盖清扫,提高机器人的清扫效率。The present application proposes a robot control method, a robot and a computer-readable storage medium, so as to enable the robot to quickly carry out full-coverage cleaning and improve the cleaning efficiency of the robot.

为解决上述技术问题,本申请采用的一个技术方案是:提供一种机器人控制方法,该方法包括:In order to solve the above technical problems, a technical solution adopted by the present application is to provide a robot control method, the method comprising:

获取由环境地图点云转换的栅格地图,在栅格地图中提取墙面信息;基于墙面信息,生成规划沿边起始点,并在栅格地图中生成若干局部规划路径框,其中,规划沿边起始点位于其中一个局部规划路径框的与墙面信息的墙面平行的一条边的中点;控制机器人从规划沿边起始点开始,沿规划沿边起始点所在的当前局部规划路径框的边框进行沿边运动,直至遍历当前局部规划路径框的边框上的所有路径点后,对当前局部规划路径框的内部路径点进行全覆盖遍历;控制机器人从当前局部规划路径框移动至下一个局部规划路径框,以对下一个局部规划路径框进行路径跟踪,直至遍历所有局部规划路径框的边框路径点以及内部路径点。Obtain the grid map converted from the point cloud of the environmental map, and extract the wall information from the grid map; based on the wall information, generate the starting point of the planning edge, and generate several local planning path boxes in the grid map, where the planning edge The starting point is located at the midpoint of a side parallel to the wall surface of one of the local planning path frames; the control robot starts from the starting point of the planned edge, and proceeds along the border of the current local planning path box where the starting point of the planned edge is located. Movement until all the path points on the border of the current local planning path frame are traversed, and the internal path points of the current local planning path frame are fully covered; the robot is controlled to move from the current local planning path frame to the next local planning path frame, To track the path of the next local planning path box until traversing all the border path points and internal path points of the local planning path box.

其中,在栅格地图中提取墙面信息之后,在栅格地图中生成若干局部规划路径框之前,机器人控制方法还包括:Wherein, after extracting the wall surface information in the grid map, before generating several local planning path frames in the grid map, the robot control method also includes:

在栅格地图中提取障碍物位置;基于障碍物位置在栅格地图中生成若干局部规划路径框,其中,若干局部规划路径框的边框以及内部区域均不存在障碍物。Obstacle positions are extracted from the grid map; several local planning path boxes are generated in the grid map based on the obstacle positions, wherein there are no obstacles in borders and internal areas of the several local planning path boxes.

其中,障碍物包括充电桩;基于墙面信息,生成规划沿边起始点,包括:Among them, the obstacles include charging piles; based on the wall information, the starting point along the planned edge is generated, including:

基于墙面信息,以及充电桩的位置生成规划沿边起始点;其中,规划沿边起始点为与墙面相距第一预设距离的若干栅格点中,与充电桩的相对距离小于等于第二预设距离的至少一个栅格点。Based on the wall surface information and the position of the charging pile, the planning edge starting point is generated; wherein, the planning edge starting point is a number of grid points that are at a first preset distance from the wall, and the relative distance from the charging pile is less than or equal to the second preset distance. at least one grid point with a given distance.

其中,沿规划沿边起始点所在的当前局部规划路径框的边框进行沿边运动,包括:Wherein, the edge-to-edge motion is performed along the border of the current local planning path frame where the starting point of the planned edge-to-edge is located, including:

在控制机器人沿当前局部规划路径框的边框进行沿边运动的过程中,获取运动方向上的障碍物感知距离;在障碍物感知距离小于第三预设距离时,触发遇障固定动作;在机器人执行遇障固定动作的过程中,监测机器人与墙面的侧向距离;在侧向距离小于第四预设距离时,退出遇障固定动作,并基于当前位置继续执行沿边运动。In the process of controlling the robot to move along the border of the current local planning path frame, the obstacle perception distance in the direction of motion is obtained; when the obstacle perception distance is less than the third preset distance, the obstacle-encountering fixed action is triggered; when the robot executes During the obstacle-encounter fixing action, the lateral distance between the robot and the wall is monitored; when the lateral distance is less than the fourth preset distance, the obstacle-encounter fixing action is exited, and the edge-to-edge movement is continued based on the current position.

其中,遇障固定动作为:控制机器人沿第一方向旋转,并记录第一旋转角度;在第一旋转角度达到第一预设角度时,控制机器人沿第二方向旋转,并记录第二旋转角度;在第二旋转角度达到第二预设角度时,控制机器人停止旋转;第一方向与第二方向为两个相反的方向。Among them, the action of fixing an obstacle is: control the robot to rotate in the first direction, and record the first rotation angle; when the first rotation angle reaches the first preset angle, control the robot to rotate in the second direction, and record the second rotation angle ; When the second rotation angle reaches the second preset angle, the robot is controlled to stop rotating; the first direction and the second direction are two opposite directions.

其中,基于当前位置继续执行沿边运动,包括:Among them, based on the current position, continue to perform edge motion, including:

判断机器人的当前位置是否处于当前局部规划路径框的边框上;若是,则从当前位置开始继续执行沿边运动;若否,则获取当前局部规划路径框的边框上与当前位置距离最小的跟踪路径点,并将机器人从当前位置调度到跟踪路径点,从跟踪路径点开始继续执行沿边运动。Determine whether the current position of the robot is on the border of the current local planning path frame; if so, continue to perform edge-to-edge motion from the current position; if not, obtain the tracking path point on the border of the current local planning path frame with the smallest distance from the current position , and dispatch the robot from the current position to the tracking waypoint, and continue to perform edge-to-edge motion from the tracking waypoint.

其中,将机器人从当前位置调度到跟踪路径点,包括:Among them, the robot is dispatched from the current position to the tracking waypoint, including:

获取机器人从当前位置调度到跟踪路径点的调度路径;按照调度路径将机器人从当前位置调度到跟踪路径点,并将调度路径上的路径点标记为已遍历点。Obtain the scheduling path of the robot from the current location to the tracking waypoint; dispatch the robot from the current location to the tracking waypoint according to the scheduling path, and mark the waypoints on the scheduling path as traversed points.

其中,控制机器人从当前局部规划路径框移动至下一个局部规划路径框,以对下一个局部规划路径框进行路径跟踪,包括:Among them, the robot is controlled to move from the current local planning path frame to the next local planning path frame to perform path tracking on the next local planning path frame, including:

获取当前局部规划路径框与其余局部规划路径框的相对距离;将与当前局部规划路径框的相对距离最小的局部规划路径框,作为当前局部规划路径框的下一个局部规划路径框;获取下一个局部规划路径框与墙面信息的墙面平行的两个边框,并计算两个边框中与墙面的相对距离;在两个边框中相对距离小的一个边框的中点,设置新的规划沿边起始点;控制机器人从新的规划沿边起始点开始,沿下一个局部规划路径框的边框进行沿边运动。Obtain the relative distance between the current local planning path frame and other local planning path frames; use the local planning path frame with the smallest relative distance to the current local planning path frame as the next local planning path frame of the current local planning path frame; obtain the next The local planning path frame is parallel to the two borders of the wall information of the wall, and the relative distance between the two borders and the wall is calculated; at the midpoint of the border with the smaller relative distance among the two borders, a new planning edge is set Starting point; the robot is controlled to start from the new planning edge starting point, and move along the edge along the border of the next local planning path box.

为解决上述技术问题,本申请采用的一个技术方案是:提供一种机器人,该机器人包括处理器及与处理器连接的存储器,存储器中存储有程序数据,处理器执行存储器存储的程序数据,以执行实现:获取由环境地图点云转换的栅格地图,在栅格地图中提取墙面信息;基于墙面信息,生成规划沿边起始点,并在栅格地图中生成若干局部规划路径框,其中,规划沿边起始点位于其中一个局部规划路径框的与墙面信息的墙面平行的一条边的中点;控制机器人从规划沿边起始点开始,沿规划沿边起始点所在的当前局部规划路径框的边框进行沿边运动,直至遍历当前局部规划路径框的边框上的所有路径点后,对当前局部规划路径框的内部路径点进行全覆盖遍历;控制机器人从当前局部规划路径框移动至下一个局部规划路径框,以对下一个局部规划路径框进行路径跟踪,直至遍历所有局部规划路径框的边框路径点以及内部路径点。In order to solve the above-mentioned technical problems, a technical solution adopted by the present application is to provide a robot, the robot includes a processor and a memory connected to the processor, program data is stored in the memory, and the processor executes the program data stored in the memory to Execution implementation: Obtain the grid map converted from the point cloud of the environmental map, extract wall information from the grid map; generate planning edge starting points based on the wall information, and generate several local planning path boxes in the grid map, among which , the starting point of the planned edge is located at the midpoint of a side parallel to the wall surface of the wall information of one of the local planning path frames; The border moves along the edge until all the path points on the border of the current local planning path frame are traversed, and the internal path points of the current local planning path frame are fully covered; the robot is controlled to move from the current local planning path frame to the next local planning Path box, to track the path of the next local planning path box until traversing all the border path points and internal path points of the local planning path box.

为解决上述技术问题,本申请采用的另一个技术方案是:提供一种计算机可读存储介质,其内部存储有程序指令,程序指令被执行以实现:获取由环境地图点云转换的栅格地图,在栅格地图中提取墙面信息;基于墙面信息,生成规划沿边起始点,并在栅格地图中生成若干局部规划路径框,其中,规划沿边起始点位于其中一个局部规划路径框的与墙面信息的墙面平行的一条边的中点;控制机器人从规划沿边起始点开始,沿规划沿边起始点所在的当前局部规划路径框的边框进行沿边运动,直至遍历当前局部规划路径框的边框上的所有路径点后,对当前局部规划路径框的内部路径点进行全覆盖遍历;控制机器人从当前局部规划路径框移动至下一个局部规划路径框,以对下一个局部规划路径框进行路径跟踪,直至遍历所有局部规划路径框的边框路径点以及内部路径点。In order to solve the above technical problems, another technical solution adopted by the present application is to provide a computer-readable storage medium, which stores program instructions inside, and the program instructions are executed to realize: obtaining the grid map converted from the point cloud of the environmental map , extract the wall information in the grid map; based on the wall information, generate the starting point of the planned edge, and generate several local planning path boxes in the grid map, where the starting point of the planned edge is located between one of the local planning path boxes and The midpoint of a side parallel to the wall in the wall information; the control robot starts from the starting point of the planned edge, moves along the border of the current local planning path box where the starting point of the planning edge is located, until it traverses the border of the current local planning path box After all the path points on the above path, the internal path points of the current local planning path box are fully covered and traversed; the robot is controlled to move from the current local planning path box to the next local planning path box, so as to perform path tracking on the next local planning path box , until the border path points and internal path points of all local planning path boxes are traversed.

本申请的有益效果是:区别于现有技术的情况,本申请通过环境点云转换的栅格地图提取墙面信息,再基于墙面信息生成规划起始点,并在栅格地图上生成若干局部规划路径框,并控制机器人从规划起始点沿局部规划路径框的边框进行沿边运动,直至遍历当前局部规划路径框的边框上的所有路径点后,对当前局部规划路径框的内部路径点进行全覆盖遍历清扫,再控制机器人移动至下一个局部规划路径框重复上述动作。本申请在沿边区域围成的待清扫区域过大时,通过设置若干局部规划路径框使机器人在当前局部规划路径框沿边结束后能快速地对当前局部规划路径框的区域进行全覆盖清扫,相较于现有技术中完成整个区域的沿边才能开始全覆盖清扫的方法,本申请的机器人控制方法有利于进行合理地全覆盖路径规划,提高机器人的清扫效率,且在较复杂环境和空旷环境下依然适用。The beneficial effects of this application are: different from the situation of the prior art, this application extracts the wall information through the grid map converted from the environmental point cloud, and then generates the planning starting point based on the wall information, and generates several local areas on the grid map Plan the path frame, and control the robot to move along the border of the local planning path frame from the starting point of planning, until after traversing all the path points on the border of the current local planning path frame, complete the internal path points of the current local planning path frame Cover and traverse the cleaning, and then control the robot to move to the next local planning path frame to repeat the above actions. In this application, when the area to be cleaned surrounded by the border area is too large, by setting a number of local planning path frames, the robot can quickly clean the area of the current local planning path frame after the end of the current local planning path frame. Compared with the method in the prior art that completes the entire area along the edge to start full-coverage cleaning, the robot control method of the present application is conducive to reasonable full-coverage path planning, improving the cleaning efficiency of the robot, and can be used in more complex environments and open environments. still apply.

附图说明Description of drawings

图1是本申请机器人控制方法第一实施例的流程示意图;Fig. 1 is a schematic flow chart of the first embodiment of the robot control method of the present application;

图2是本申请栅格地图一实施例的示意图;Fig. 2 is a schematic diagram of an embodiment of the grid map of the present application;

图3是本申请机器人控制方法第二实施例的流程示意图;Fig. 3 is a schematic flow chart of the second embodiment of the robot control method of the present application;

图4是图1中步骤S103中一具体实施例的流程示意图;Fig. 4 is a schematic flow chart of a specific embodiment in step S103 in Fig. 1;

图5是图4中步骤S304中一具体实施例的流程示意图;Fig. 5 is a schematic flow chart of a specific embodiment in step S304 in Fig. 4;

图6是图5中步骤S403中一具体实施例的流程示意图;FIG. 6 is a schematic flow diagram of a specific embodiment in step S403 in FIG. 5;

图7是图1中步骤S104中一具体实施例的流程示意图;Fig. 7 is a schematic flow chart of a specific embodiment in step S104 in Fig. 1;

图8是本申请机器人一实施例的结构示意图;Fig. 8 is a schematic structural view of an embodiment of the robot of the present application;

图9是本申请计算机可读存储介质一实施例的结构示意图。FIG. 9 is a schematic structural diagram of an embodiment of a computer-readable storage medium of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

随着家用服务机器人技术的飞快发展,越来越多的扫地机器人进入家庭生活中,当前机器人在进行清扫时其运行状态可以划分为无规划随机游走式及全覆盖规划清扫式,但无规划随机游走式清扫效率较低被逐渐淘汰,在机器人的全覆盖清扫式中,全覆盖清扫式更适合比较空旷的区域,相对比较隐蔽的例如墙角,桌角等死角灰尘更容易堆积。于是又在全覆盖清扫式之前的提出一种特定清扫模式沿边清扫,但待清扫区域非常大时,机器人需要花费大量的时间才能完成整个区域的沿边清扫流程,不利于快速开展全覆盖清扫流程,一旦沿边区域围成的待清扫区域过大也不利于进行合理的全覆盖路径规划。With the rapid development of household service robot technology, more and more sweeping robots have entered family life. The current operating status of robots can be divided into random walk without planning and full-coverage planning cleaning, but there is no planning. The low efficiency of random walking cleaning has been gradually eliminated. In the full-coverage cleaning of the robot, the full-coverage cleaning is more suitable for relatively open areas, and dust is easier to accumulate in relatively hidden corners such as wall corners and table corners. Therefore, before the full-coverage cleaning type, a specific cleaning mode was proposed to clean along the edge. However, when the area to be cleaned is very large, it takes a lot of time for the robot to complete the edge-side cleaning process of the entire area, which is not conducive to the rapid development of the full-coverage cleaning process. Once the area to be cleaned surrounded by the border area is too large, it is not conducive to reasonable full-coverage path planning.

为了解决提高机器人的清扫效率,快速开展全覆盖清扫流程,本申请首先提出一种机器人控制方法,请参阅图1,图1是本申请机器人控制方法第一实施例的流程示意图。如图1所示,该机器人控制方法具体包括步骤S101至步骤S104:In order to solve the problem of improving the cleaning efficiency of the robot and quickly carry out the full-coverage cleaning process, the present application first proposes a robot control method, please refer to FIG. 1 , which is a schematic flow diagram of the first embodiment of the robot control method of the present application. As shown in Figure 1, the robot control method specifically includes steps S101 to S104:

步骤S101:获取由环境地图点云转换的栅格地图,在栅格地图中提取墙面信息。Step S101: Obtain a grid map converted from the point cloud of the environmental map, and extract wall information from the grid map.

机器人在接收到沿边清扫指令,机器人使能自身的激光雷达传感器,具体可以为激光直接成型(Laser Direct Structuring,LDS)雷达传感器,机器人并且同步开启同步定位与地图绘制(Simultaneous Localization And Mapping,SLAM)模块。After the robot receives the edge cleaning command, the robot enables its own lidar sensor, which can be a Laser Direct Structuring (LDS) radar sensor, and the robot simultaneously turns on Simultaneous Localization And Mapping (SLAM) module.

其中,SLAM可以描述为:机器人在未知环境中从一个未知位置开始移动,在移动过程中根据位置估计和地图进行自身定位,同时在自身定位的基础上建造增量式地图,实现机器人的自主定位和导航。定位是指机器人必须知道自己在环境中位置。建图是指机器人必须记录环境中特征的位置。SLAM是指机器人在定位的同时建立环境地图。Among them, SLAM can be described as: the robot starts to move from an unknown position in an unknown environment, locates itself according to position estimation and maps during the movement process, and builds an incremental map on the basis of its own positioning to realize the autonomous positioning of the robot and navigation. Localization means that the robot must know where it is in the environment. Mapping means that the robot must record the location of features in the environment. SLAM refers to the establishment of a map of the environment by the robot while positioning.

在本实施例中,机器人可以通过激光雷达传感器及SLAM模块采集自身环境地图的点云信息,并将点云信息转化为栅格地图。In this embodiment, the robot can collect the point cloud information of its own environment map through the lidar sensor and the SLAM module, and convert the point cloud information into a grid map.

请参阅图2,图2是本申请栅格地图一实施例的示意图。如图2所示。Please refer to FIG. 2 . FIG. 2 is a schematic diagram of an embodiment of a grid map of the present application. as shown in picture 2.

机器人在获取栅格地图后,可以在栅格地图中进行墙面信息提取。如图2所示,在栅格地图中,A则为栅格地图中的墙面信息,图中B和C则为栅格地图中障碍物。After the robot obtains the grid map, it can extract wall information from the grid map. As shown in Figure 2, in the grid map, A is the wall information in the grid map, and B and C in the figure are obstacles in the grid map.

在构建的栅格地图中,存在可提取的墙面信息时,为了后续规划沿边路径能够有效进行,可以获取墙面信息的墙面与构建的栅格地图坐标系的夹角,根据夹角矫正栅格地图,使栅格地图能够平行或垂直于地图坐标系。若不存在可提取的墙面信息,则默认机器人的当前角度为初始规划角度。In the constructed grid map, when there is wall information that can be extracted, in order to make the subsequent planning along the edge path effective, the angle between the wall surface of the wall information and the coordinate system of the constructed grid map can be obtained, and corrected according to the angle Raster map, which enables the raster map to be parallel or perpendicular to the map coordinate system. If there is no wall information that can be extracted, the current angle of the robot will be the initial planning angle by default.

步骤S102:基于墙面信息,生成规划沿边起始点,并在栅格地图中生成若干局部规划路径框,其中,规划沿边起始点位于其中一个局部规划路径框的与墙面信息的墙面平行的一条边的中点。Step S102: Based on the wall information, generate the starting point of the planning along the edge, and generate several local planning path boxes in the grid map, wherein the planning edge starting point is located in one of the local planning path boxes parallel to the wall in the wall information Midpoint of an edge.

若栅格地图中存在可提取的墙面信息时,机器人在提取获取墙面信息后,基于墙面信息的坐标生成一个规划沿边起始点,规划沿边起始点可以基于墙面信息的位置信息获取,在本实施例中,规划沿边起始点与墙面的距离可以为机器人直径的一半,也可以是其他预设数值,在此不作限定。If there is extractable wall information in the grid map, after extracting the wall information, the robot generates a planning edge starting point based on the coordinates of the wall information. The planning edge starting point can be obtained based on the position information of the wall information. In this embodiment, the distance between the planned starting point along the edge and the wall may be half the diameter of the robot, or other preset values, which are not limited herein.

在基于墙面信息生成规划沿边起始点时,规划沿边起始点的选取可以尽可能靠近在机器人的充电桩附近。如图2所示,若障碍物B为充电桩,规格沿边起始点则可以在障碍物B附近的栅格进行选择。规划沿边起始点的位置靠近机器人的充电桩可以使机器人沿边清扫结束后回到充电桩附近,从而可以对机器人进行快速充电,提高机器人的清扫效率。When the starting point of planning along the edge is generated based on the wall information, the selection of the starting point of planning along the edge can be as close as possible to the charging pile of the robot. As shown in Figure 2, if obstacle B is a charging pile, the starting point along the edge of the specification can be selected in the grid near obstacle B. Planning the starting point along the edge to be close to the charging pile of the robot can make the robot return to the vicinity of the charging pile after cleaning along the edge, so that the robot can be charged quickly and the cleaning efficiency of the robot can be improved.

机器人获取到沿边起始点后,在栅格地图生成若干个局部规划路径框,其中,局部规划路径框可以为一个矩形框。在本实施例中,若干个局部规划路径框各自相邻组成了网状的全局规划沿边路径。在本实施例中,局部规划路径框的边长为4.5m。若基于待清扫区域生成的栅格地图的面积小于预设的局部规划路径框的面积时,在栅格地图中要生成至少一个局部规划路径框,在其他实施例中,可以基于栅格地图的面积在栅格地图中生成相应数量的局部规划路径框,在此不作限制。After the robot acquires the starting point along the edge, several local planning path frames are generated on the grid map, wherein the local planning path frame can be a rectangular frame. In this embodiment, several locally planned path frames are adjacent to each other to form a networked global planned edge-along path. In this embodiment, the side length of the local planning path frame is 4.5m. If the area of the grid map generated based on the area to be cleaned is less than the area of the preset local planning path frame, at least one local planning path frame will be generated in the grid map. In other embodiments, it can be based on the area of the grid map The area generates a corresponding number of local planning path boxes in the grid map, which is not limited here.

在其他实施例中,局部规划路径框的边长可以根据实际需要设置,局部规划路径框还可以为其他形状,在此不作限定。In other embodiments, the side length of the local planning path frame can be set according to actual needs, and the local planning path frame can also be in other shapes, which are not limited here.

在生成局部规划路径时需要保证生成的规划沿边起始点要与其中一个局部规划路径框的某条边的中点重合,且规划沿边起始点在的这条边要与墙面信息的墙面平行。因此在生成若干个局部规划路径框时可以首先生成规划沿边起始点所在的局部规划路径框,再生成其他各自相邻的若干个局部规划路径框。When generating a local planning path, it is necessary to ensure that the starting point of the generated planning edge coincides with the midpoint of a side of one of the local planning path boxes, and the side where the starting point of the planning edge is located must be parallel to the wall surface of the wall information . Therefore, when generating several local planning path frames, the local planning path frame where the starting point of the planning edge is located may be generated first, and then other adjacent local planning path frames are generated.

若栅格地图中不存在可提取的墙面信息,则以机器人当前位置作为规划沿边起始点。If there is no extractable wall information in the grid map, the current position of the robot is used as the starting point for planning along the edge.

步骤S103:控制机器人从规划沿边起始点开始,沿规划沿边起始点所在的当前局部规划路径框的边框进行沿边运动,直至遍历当前局部规划路径框的边框上的所有路径点后,对当前局部规划路径框的内部路径点进行全覆盖遍历。Step S103: Control the robot to start from the starting point of the planned edge, and move along the border of the current local planning path frame where the starting point of the planning edge is located, until after traversing all the path points on the border of the current local planning path frame, the current local planning The internal path points of the path box are traversed with full coverage.

在栅格地图中建立若干个局部规划路径框后,则将机器人调度到规划沿边起始点,并将扫地机切换为规划沿边状态State_EW_plan。当前状态下可以控制机器人沿当前局部规划路径框的边框沿边进行沿边运动。After several local planning path boxes are established in the grid map, the robot is dispatched to the starting point of the planned edge, and the sweeper is switched to the planned edge state State_EW_plan. In the current state, the robot can be controlled to move along the edge along the border of the current local planning path frame.

此过程中,机器人的规划模块会实时下发当前局部规划路径框的局部段路径使机器人沿边前行,并且会实时记录机器人所有经过的局部路径点,直到遍历当前局部规划路径框的边框上的所有路径点后,此时机器人认为当前局部规划路径框围成的区域为可清扫区域,再对当前局部规划路径框的内部路径点进行全覆盖遍历,以使机器人对当前局部规划路径框内的所有区域进行全覆盖清扫。During this process, the planning module of the robot will issue the local section path of the current local planning path frame in real time to make the robot move along the edge, and will record all the local path points passed by the robot in real time until it traverses the border of the current partial planning path frame. After all the path points, the robot considers the area enclosed by the current local planning path frame as the area that can be cleaned, and then performs a full coverage traversal of the internal path points of the current local planning path frame, so that the robot can fully understand the current local planning path frame. Full coverage cleaning of all areas.

步骤S104:控制机器人从当前局部规划路径框移动至下一个局部规划路径框,以对下一个局部规划路径框进行路径跟踪,直至遍历所有局部规划路径框的边框路径点以及内部路径点。Step S104: Controlling the robot to move from the current local planning path frame to the next local planning path frame, so as to perform path tracking on the next local planning path frame until traversing all border path points and internal path points of the local planning path frame.

机器人对规划沿边起始点的当前局部规划路径框内的所有区域进行全覆盖清扫,控制从当前局部规划路径框移动至下一个局部规划路径框,以对下一个局部规划路径框进行路径跟踪,直至遍历所有局部规划路径框的边框路径点以及内部路径点,完成对整个区域的全覆盖清扫。The robot performs full-coverage cleaning on all areas within the current local planning path frame at the starting point of the planning edge, and controls the movement from the current local planning path frame to the next local planning path frame to track the path of the next local planning path frame until It traverses the border waypoints and internal waypoints of all local planning path boxes to complete the full-coverage cleaning of the entire area.

本申请的机器人控制方法在复杂环境或者空旷场景无法从栅格地图中提取墙面信息的情况下,依然可以根据若干个局部规划路径框进行沿边清扫,此时规划的路径根据机器人当前的位置与朝向确定,生成预设固定边长的局部规划路径框矩形框,可以确保在任何场景下机器人都能正常地开展沿边清扫。同时,在某一个局部规划路径框的边缘及区域内清扫完成后,机器人可以直接调度到下一个局部规划路径框的沿边点,而无需再进行找边的操作,从而提高机器人的清扫效率。The robot control method of this application can still clean along the edge according to several local planning path frames when the wall information cannot be extracted from the grid map in a complex environment or an open scene. At this time, the planned path is based on the current position of the robot and The orientation is determined, and a local planning path frame rectangular frame with a preset fixed side length is generated, which can ensure that the robot can normally clean along the side in any scene. At the same time, after cleaning the edge and area of a certain local planning path frame, the robot can be directly dispatched to the edge point of the next local planning path frame without the need to find the edge, thereby improving the cleaning efficiency of the robot.

区别于现有技术,本申请通过环境点云转换的栅格地图提取墙面信息,再基于墙面信息生成规划起始点,并在栅格地图上生成若干局部规划路径框,并控制机器人从规划起始点沿局部规划路径框的边框进行沿边运动,直至遍历当前局部规划路径框的边框上的所有路径点后,对当前局部规划路径框的内部路径点进行全覆盖遍历清扫,再控制机器人移动至下一个局部规划路径框重复上述动作。本申请在沿边区域围成的待清扫区域过大时,通过设置若干局部规划路径框使机器人在当前局部规划路径框沿边结束后能快速地对当前局部规划路径框的区域进行全覆盖清扫,相较于现有技术中完成整个区域的沿边才能开始全覆盖清扫的方法,本申请的机器人控制方法有利于进行合理地全覆盖路径规划,提高机器人的清扫效率,且在较复杂环境和空旷环境下依然适用。Different from the existing technology, this application extracts the wall information through the grid map converted from the environmental point cloud, and then generates the planning starting point based on the wall information, and generates several local planning path frames on the grid map, and controls the robot to start from the planning The starting point moves along the border of the local planning path frame until all path points on the border of the current local planning path frame are traversed, and then the internal path points of the current local planning path frame are fully covered and traversed, and then the robot is controlled to move to Repeat the above actions for the next local planning path frame. In this application, when the area to be cleaned surrounded by the border area is too large, by setting a number of local planning path frames, the robot can quickly clean the area of the current local planning path frame after the end of the current local planning path frame. Compared with the method in the prior art that completes the entire area along the edge to start full-coverage cleaning, the robot control method of the present application is conducive to reasonable full-coverage path planning, improving the cleaning efficiency of the robot, and can be used in more complex environments and open environments. still apply.

可选地,请参阅图3,图3是本申请机器人控制方法第二实施例的流程示意图。如图3所示,该机器人控制方法具体包括步骤S201至步骤S206:Optionally, please refer to FIG. 3 , which is a schematic flowchart of a second embodiment of the robot control method of the present application. As shown in Figure 3, the robot control method specifically includes steps S201 to S206:

步骤S201:获取由环境地图点云转换的栅格地图,在栅格地图中提取墙面信息。Step S201: Obtain a grid map converted from the point cloud of the environmental map, and extract wall information from the grid map.

步骤S201与步骤S101一致,不再赘述。Step S201 is the same as step S101 and will not be repeated here.

步骤S202:在栅格地图中提取障碍物位置。Step S202: Obstacle locations are extracted from the grid map.

机器人在生成栅格地图后,要从栅格地图中提取障碍物的位置。在栅格地图中,除了存在墙面信息的墙面外,还会存在一些特定的障碍物,机器人在这些特定障碍物的位置上是不能通行的,例如图2中的障碍物B和障碍物C。因此在生成局部规划路劲框之前,要提取地图中障碍物位置。After the robot generates the grid map, it needs to extract the position of the obstacle from the grid map. In the grid map, in addition to the walls with wall information, there will be some specific obstacles, and the robot cannot pass through the positions of these specific obstacles, such as obstacle B and obstacle B in Figure 2 c. Therefore, before generating the local planning road frame, it is necessary to extract the obstacle position in the map.

步骤S203:基于障碍物位置在栅格地图中生成若干局部规划路径框,其中,若干局部规划路径框的边框以及内部区域均不存在障碍物。Step S203: Generate several local planning path frames in the grid map based on the obstacle positions, wherein, there are no obstacles in the borders and inner areas of the several partial planning path frames.

在获取障碍物位置后,在栅格地图中生成若干局部规划路径框就需要对若干局部规划路径框的边框进行规划,使若干局部规划路径框的边框以及内部区域均不存在障碍物。即,生成的若干局部规划路径框以及内部区域中不能存在如图2所示的障碍物B和障碍物C。After obtaining the position of obstacles, generating several local planning path boxes in the grid map requires planning the borders of several local planning path boxes, so that there are no obstacles in the borders and internal areas of several local planning path boxes. That is, the obstacles B and C shown in FIG. 2 cannot exist in the generated local planning path frames and the inner areas.

生成若干局部规划路径框的边框,其若干局部规划路径框的边框以及内部区域均不存在障碍物可以防止机器人在进行清扫发生碰撞,或造成卡困风险,从而提高机器人的清扫效率。The borders of several local planning path frames are generated, and there are no obstacles in the borders and internal areas of the several local planning path frames, which can prevent the robot from colliding during cleaning, or cause the risk of getting stuck, thereby improving the cleaning efficiency of the robot.

步骤S204:基于墙面信息,生成规划沿边起始点,并在栅格地图中生成若干局部规划路径框,其中,规划沿边起始点位于其中一个局部规划路径框的与墙面信息的墙面平行的一条边的中点。Step S204: Based on the wall surface information, generate the planning edge starting point, and generate several local planning path boxes in the grid map, wherein the planning edge starting point is located in one of the local planning path boxes parallel to the wall surface of the wall information Midpoint of an edge.

如上文所述,机器人在栅格地图中可以基于墙面信息生成规划起始点并在栅格地图中生成若干局部规划路径框,其中,规划沿边起始点位于其中一个局部规划路径框的与墙面信息的墙面平行的一条边的中点。As mentioned above, the robot can generate planning starting points based on wall information in the grid map and generate several local planning path boxes in the grid map, where the planning edge starting point is located at the edge of one of the local planning path boxes and the wall The information is the midpoint of an edge parallel to the wall.

当栅格地图中存在的障碍物包括充电桩时,规划沿边起始点可以设置于充电桩附近,从而使机器人在沿边运动结束时回到充电桩附近进行快速充电,提高机器人的清扫效率。When the obstacles in the grid map include charging piles, the starting point of the planning edge can be set near the charging piles, so that the robot returns to the vicinity of the charging piles for fast charging at the end of the edge movement, improving the cleaning efficiency of the robot.

在本实施例中可以通过如下方法实现基于墙面信息生成规划沿边起始点这一步骤,具体包括:In this embodiment, the step of generating and planning the starting point along the edge based on wall information can be realized by the following method, which specifically includes:

基于墙面信息,以及充电桩的位置生成规划沿边起始点;其中,规划沿边起始点为与墙面相距第一预设距离的若干栅格点中,与充电桩的相对距离小于等于第二预设距离的至少一个栅格点。Based on the wall surface information and the position of the charging pile, the planning edge starting point is generated; wherein, the planning edge starting point is a number of grid points that are at a first preset distance from the wall, and the relative distance from the charging pile is less than or equal to the second preset distance. at least one grid point with a given distance.

本实施例中在生成规划起始点时可以基于墙面信息以及充电桩的位置生成规划沿边起始点。规划沿边起始点可以与墙面相距第一预设距离,第一预设距离可以为机器人机身的半径,第二预设距离可以基于实际需求进行设置,在此不作限定。In this embodiment, when generating the planning starting point, the planning edge starting point may be generated based on the wall surface information and the position of the charging pile. The starting point of the planned edge can be a first preset distance from the wall, the first preset distance can be the radius of the robot body, and the second preset distance can be set based on actual needs, which is not limited here.

步骤S205:控制机器人从规划沿边起始点开始,沿规划沿边起始点所在的当前局部规划路径框的边框进行沿边运动,直至遍历当前局部规划路径框的边框上的所有路径点后,对当前局部规划路径框的内部路径点进行全覆盖遍历。Step S205: Control the robot to start from the starting point of the planned edge, and move along the border of the current local planning path frame where the starting point of the planning edge is located, until after traversing all the path points on the border of the current local planning path frame, the current local planning The internal path points of the path box are traversed with full coverage.

步骤S205与步骤S103一致,不再赘述。Step S205 is consistent with step S103 and will not be repeated here.

步骤S206:控制机器人从当前局部规划路径框移动至下一个局部规划路径框,以对下一个局部规划路径框进行路径跟踪,直至遍历所有局部规划路径框的边框路径点以及内部路径点。Step S206: Controlling the robot to move from the current local planning path frame to the next local planning path frame, so as to perform path tracking on the next local planning path frame until traversing all border path points and internal path points of the local planning path frame.

步骤S206与步骤S104一致,不再赘述。Step S206 is the same as step S104 and will not be repeated here.

可选地,控制机器人在局部规划路径的边框进行沿边运动的方法如图4所示,图4是图1中步骤S103中一具体实施例的流程示意图。本实施例可通过如图4所示的方法实现步骤S103中沿规划沿边起始点所在的当前局部规划路径框的边框进行沿边运动的步骤,该实施例具体包括步骤S301至步骤S304:Optionally, the method for controlling the robot to move along the border of the local planning path is shown in FIG. 4 , which is a schematic flowchart of a specific embodiment in step S103 in FIG. 1 . In this embodiment, the step of moving along the edge along the border of the current local planning path frame where the starting point of the planned edge is located in step S103 can be realized by the method shown in FIG. 4 , and this embodiment specifically includes steps S301 to S304:

步骤S301:在控制机器人沿当前局部规划路径框的边框进行沿边运动的过程中,获取运动方向上的障碍物感知距离。Step S301: In the process of controlling the robot to move along the border of the current local planning path frame, obtain the obstacle perception distance in the moving direction.

在控制机器人沿当前局部规划路径框的边框进行沿边运动的过程中,机器人使能RGB结构光或线激光传感器与沿墙传感器,开启感知模块,并设置第三预设距离Forward_th,实时计算机器人与障碍物之间的障碍物感知距离,记为d_forward。In the process of controlling the robot to move along the border of the current local planning path frame, the robot enables the RGB structured light or line laser sensor and the sensor along the wall, turns on the perception module, and sets the third preset distance Forward_th to calculate the distance between the robot and The obstacle perception distance between obstacles, denoted as d_forward.

步骤S302:在障碍物感知距离小于第三预设距离时,触发遇障固定动作。Step S302: when the obstacle sensing distance is less than the third preset distance, an obstacle-encounter fixing action is triggered.

当机器人在沿当前局部规划路径框的边框进行沿边运动时,在沿边运动时突然遇到新增障碍物,实时计算机器人与障碍物之间的障碍物感知距离d_forward,若障碍物感知距离d_forward小于第三预设距离Forward_th,认为前方有障碍物,此时机器人接收避障指令,触发遇障固定动作。其中,遇障固定动作是机器人事先预设好的一个避障动作,可以是一个绕障碍物的一个圆周运动,也可以是其他运动,在此不作限定。When the robot is moving along the edge of the current local planning path frame, and suddenly encounters a new obstacle when moving along the edge, calculate the obstacle perception distance d_forward between the robot and the obstacle in real time. If the obstacle perception distance d_forward is less than The third preset distance, Forward_th, is that there is an obstacle ahead. At this time, the robot receives an obstacle avoidance command and triggers a fixed action when encountering an obstacle. Among them, the obstacle-encounter fixed action is an obstacle-avoiding action preset by the robot, which may be a circular movement around the obstacle, or other movements, which are not limited here.

具体地,遇障固定动作还包括:控制机器人沿第一方向旋转,并记录第一旋转角度;在第一旋转角度达到第一预设角度时,控制机器人沿第二方向旋转,并记录第二旋转角度;在第二旋转角度达到第二预设角度时,控制机器人停止旋转;第一方向与第二方向为两个相反的方向。Specifically, the action of fixing an obstacle also includes: controlling the robot to rotate in the first direction, and recording the first rotation angle; when the first rotation angle reaches the first preset angle, controlling the robot to rotate in the second direction, and recording the second rotation angle; Rotation angle; when the second rotation angle reaches the second preset angle, the robot is controlled to stop rotating; the first direction and the second direction are two opposite directions.

在本实施例中,在触发遇障固定动作的同时,控制机器人开始逆时针旋转,并记录第一旋转角度,当第一预设角度到达90度时开始顺时针旋转,并记录第二旋转角度,当第二预设角度到达90度时停止旋转。In this embodiment, while triggering the action of fixing an obstacle, the robot is controlled to rotate counterclockwise and record the first rotation angle, and when the first preset angle reaches 90 degrees, it starts to rotate clockwise and records the second rotation angle , when the second preset angle reaches 90 degrees, the rotation will stop.

步骤S303:在机器人执行遇障固定动作的过程中,监测机器人与墙面的侧向距离。Step S303: During the process of the robot performing the action of fixing an obstacle, monitor the lateral distance between the robot and the wall.

在机器人执行遇障固定动作的过程中,即在机器人进行旋转的过程中,利用沿墙传感器实时检测机器人与墙面的侧向距离。During the process of the robot performing fixed actions when encountering obstacles, that is, during the rotation process of the robot, the sensor along the wall is used to detect the lateral distance between the robot and the wall in real time.

步骤S304:在侧向距离小于第四预设距离时,退出遇障固定动作,并基于当前位置继续执行沿边运动。Step S304: When the lateral distance is less than the fourth preset distance, exit the action of fixing an obstacle, and continue to perform edge-to-edge motion based on the current position.

机器人在遇障固定动作的过程中,若侧向距离小于第四预设距离,则立即退出遇障固定动作,并基于机器人的当前位置继续执行沿边运动。During the obstacle-encountering fixation process, if the lateral distance is less than the fourth preset distance, the robot immediately exits the obstacle-encounter fixation action, and continues to perform edge-to-edge movement based on the current position of the robot.

区别于现有技术,本申请的机器人控制方法能够在进行在沿当前局部规划路径框的边框进行沿边运动进行及时避障处理,可以极大程度的避免扫地机器人被临时障碍物、人或宠物干扰,且本申请能够实时监测机器人与墙面的侧向距离,能够及时退出固定避障动作,从而提高机器人的清扫效率。Different from the prior art, the robot control method of the present application can move along the border of the current local planning path frame for timely obstacle avoidance processing, which can greatly prevent the sweeping robot from being interfered by temporary obstacles, people or pets , and the application can monitor the lateral distance between the robot and the wall in real time, and can exit the fixed obstacle avoidance action in time, thereby improving the cleaning efficiency of the robot.

可选地,图5是图4中步骤S304中一具体实施例的流程示意图。本实施例可通过如图5所示的方法实现步骤S304中基于当前位置继续执行沿边运动的步骤,该实施例具体包括步骤S401至步骤S404:Optionally, FIG. 5 is a schematic flowchart of a specific embodiment of step S304 in FIG. 4 . In this embodiment, the step of continuing to move along the edge based on the current position in step S304 can be realized through the method shown in FIG. 5 , and this embodiment specifically includes steps S401 to S404:

步骤S401:判断机器人的当前位置是否处于当前局部规划路径框的边框上。Step S401: Determine whether the current position of the robot is on the border of the current local planning path frame.

机器人在退出遇障固定动作后,会判断机器人的当前位置是否处于当前局部规划路径框的边框上,即判断机器人是否处于规划沿边状态State_EW_plan。After the robot exits the fixed action when encountering an obstacle, it will judge whether the current position of the robot is on the border of the current local planning path frame, that is, judge whether the robot is in the planning edge state State_EW_plan.

若是,则进入步骤S402;若否,则进入步骤S403;If yes, enter step S402; if not, enter step S403;

步骤S402:从当前位置开始继续执行沿边运动。Step S402: Continue to perform sideways motion from the current position.

机器人若处于规划沿边状态State_EW_plan,则机器人从当前位置开始继续执行沿边运动。If the robot is in the planned edge state State_EW_plan, the robot will continue to perform edge motion from the current position.

步骤S403:获取当前局部规划路径框的边框上与当前位置距离最小的跟踪路径点,并将机器人从当前位置调度到跟踪路径点,从跟踪路径点开始继续执行沿边运动。Step S403: Obtain the tracking path point on the border of the current local planning path frame with the smallest distance from the current position, and dispatch the robot from the current position to the tracking path point, and continue to perform edge-to-edge motion from the tracking path point.

机器人在退出遇障固定动作后,判断机器人不处于规划沿边状态,则获取前局部规划路径框的边框上与当前位置距离最小的跟踪路径点M,并切换机器人的状态为实体沿边状态State_EW_real,并记录下机器人利用传感器开始沿边的初始角度init_Real,机器人处于实体沿边状态State_EW_real时,是利用机器人的侧向距离传感器控制机器人进行沿边运动。此时将机器人从当前位置调度到与当前位置距离最小的跟踪路径点M,从与当前位置距离最小的跟踪路径点M开始继续执行沿边运动。After the robot exits the obstacle-encountered fixed action, it judges that the robot is not in the planned edge state, then obtains the tracking path point M with the smallest distance from the current position on the border of the previous local planning path frame, and switches the state of the robot to the entity edge state State_EW_real, and Record the initial angle init_Real at which the robot uses the sensor to start along the edge. When the robot is in the physical edge state State_EW_real, it uses the robot's lateral distance sensor to control the robot to move along the edge. At this time, the robot is dispatched from the current position to the tracking path point M with the smallest distance from the current position, and continues to perform edge-to-edge motion from the tracking path point M with the smallest distance to the current position.

在机器人处于实体沿边状态State_EW_real,将机器人从当前位置调度到跟踪路径点时,在此运行的路径上,若调度过程中遇到障碍物同样要进行前文的遇障固定动作,且在退出遇障固定动作后,要对机器人的当前位置进行两次判断,第一次判断机器人是否处于当前局部规划路径框外,若处于当前局部规划路径框外则通过两点调度将机器人调度返回跟踪路径点M。第二次判断机器人是否处于当前局部规划路径框的边框路径上,若机器人的当前位置与当前局部规划路径框的边框的距离满足第五预设阈值,则将机器人的实体沿边状态State_EW_real改为规划沿边状态State_EW_plan,使机器人从当前的路径跟踪点M开始继续执行沿边运动。When the robot is in the entity edge state State_EW_real, when the robot is dispatched from the current position to the tracking waypoint, on this running path, if an obstacle is encountered during the dispatching process, the above-mentioned obstacle-encountering fixed action must be performed, and when exiting the obstacle After the fixed action, the current position of the robot needs to be judged twice. The first time is to judge whether the robot is outside the current local planning path frame. If it is outside the current local planning path frame, the robot is scheduled to return to the tracking path point M through two-point scheduling. . It is judged for the second time whether the robot is on the border path of the current local planning path frame. If the distance between the robot’s current position and the border of the current local planning path frame meets the fifth preset threshold, change the robot’s entity edge state State_EW_real to planning The edge state State_EW_plan enables the robot to continue to perform edge motion from the current path tracking point M.

此外,机器人在处于实体沿边状态State_EW_real,是通过沿墙传感器或者激光传感器的距离信息控制机器人沿墙进行运动。当机器人在实体沿边状态State_EW_real进行遇障固定动作时,机器人计算当前旋转角度与初始角度init_Real的差值,判断差值是否大于360度,若大于则判断机器人偏离墙面异常旋转一周,此时,控制机器人从当前位置调度到跟踪路径点M。In addition, when the robot is in the entity edge state State_EW_real, the robot is controlled to move along the wall through the distance information of the sensor along the wall or the laser sensor. When the robot is in the solid edge state State_EW_real and performs an obstacle-fixing action, the robot calculates the difference between the current rotation angle and the initial angle init_Real, and judges whether the difference is greater than 360 degrees. If it is greater, it judges that the robot has deviated from the wall and rotated abnormally for one week. At this time, The control robot dispatches from the current position to track the waypoint M.

可选地,请参阅图6,图6是图5中步骤S403中一具体实施例的流程示意图。本实施例可通过如图6所示的方法实现步骤S403中将机器人从当前位置调度到跟踪路径点的步骤,该实施例具体包括步骤S501至步骤S502:Optionally, please refer to FIG. 6 , which is a schematic flowchart of a specific embodiment of step S403 in FIG. 5 . In this embodiment, the step of dispatching the robot from the current position to the tracking path point in step S403 can be realized through the method shown in FIG. 6 , and this embodiment specifically includes steps S501 to S502:

步骤S501:获取机器人从当前位置调度到跟踪路径点的调度路径。Step S501: Obtain the dispatching path of the robot dispatched from the current position to the tracked waypoint.

当机器人从实体沿边状态State_EW_real改为规划沿边状态State_EW_plan后,机器人从当前的路径跟踪点M开始继续执行沿边运动时,此时需要更新机器人遍历的当前局部规划路径边框的路径点,因此需要获取机器人从遇障固定动作结束后的当前位置调度到跟踪路径点M的调度路径。When the robot changes from the entity edge state State_EW_real to the planned edge state State_EW_plan, and the robot continues to perform edge motion from the current path tracking point M, it is necessary to update the path points of the current local planning path border traversed by the robot, so it is necessary to obtain the robot Dispatch from the current location after the obstacle-fixed action to track the dispatch path of waypoint M.

步骤S502:按照调度路径将机器人从当前位置调度到跟踪路径点,并将调度路径上的路径点标记为已遍历点。Step S502: dispatch the robot from the current position to the tracking waypoint according to the dispatching route, and mark the waypoints on the dispatching route as traversed points.

机器人将按照调度路径将机器人从当前位置调度到跟踪路径点M,并且机器人更新当前轨迹跟踪点为跟踪路径点M,并且将当前局部规划路径边框上从规划沿边起始点到跟踪路径点M点之前的所有路径点为标记为已遍历点。The robot will dispatch the robot from the current position to the tracking path point M according to the scheduling path, and the robot will update the current trajectory tracking point to the tracking path point M, and set the current local planning path border from the starting point of the planning edge to the tracking path point M before All waypoints of are marked as traversed.

区别于现有技术,本申请的机器人控制方法在沿边运动过程中出现异常,机器人可以自主回到当前局部规划路径边框上继续之前的沿边运动,并不需要机器人重新开始沿边运动,从而提升了机器人的清扫效率并且避免了重复清扫的情况,也提高了本申请机器人沿局部规划路径框的边框进行沿边运动的鲁棒性。Different from the prior art, the robot control method of the present application is abnormal in the process of moving along the edge, and the robot can autonomously return to the border of the current local planning path to continue the previous edge-moving without requiring the robot to start moving along the edge again, thereby improving the robot It improves the cleaning efficiency and avoids repeated cleaning, and also improves the robustness of the robot in this application to move along the border of the local planning path frame.

且本申请的机器人控制方法在沿边运动结束条件判断上采用与规划相结合的方式,通过使机器人遍历相应局部规划路径框的边框路径点才认为沿边运动结束,本申请的机器人控制方法可以更精确地控制机器人沿边运动的结束条件,避免过早或过晚地结束机器人沿边运动,从而达到提升机器人的覆盖率与工作效率。In addition, the robot control method of the present application adopts a method of combining planning with the judging of the end condition of the edge motion. By making the robot traverse the border path points of the corresponding local planning path frame, it is considered that the edge motion ends. The robot control method of the present application can be more accurate. Control the end conditions of the robot's edge-to-edge movement accurately, avoid ending the robot's edge-to-edge movement too early or too late, so as to improve the coverage and work efficiency of the robot.

可选地,请参阅图7,图7中图1中步骤S104中一具体实施例的流程示意图。如图7所示,本实施例可通过如图7所示的方法实现步骤S104中控制机器人从当前局部规划路径框移动至下一个局部规划路径框,以对下一个局部规划路径框进行路径跟踪的步骤,该实施例具体包括步骤S601至步骤S605:Optionally, please refer to FIG. 7 , which is a schematic flowchart of a specific embodiment of step S104 in FIG. 1 . As shown in FIG. 7 , in this embodiment, the method shown in FIG. 7 can be used to control the robot to move from the current local planning path frame to the next local planning path frame in step S104, so as to perform path tracking on the next local planning path frame. The steps, this embodiment specifically includes step S601 to step S605:

步骤S601:获取当前局部规划路径框与其余局部规划路径框的相对距离。Step S601: Obtain the relative distance between the current local planning path frame and other local planning path frames.

机器人完成对当前局部规划路径框的全覆盖清扫时,则获取当前局部规划路径框与其余局部规划路径框的相对距离。When the robot completes the full-coverage cleaning of the current local planning path frame, it obtains the relative distance between the current local planning path frame and other local planning path frames.

步骤S602:将与当前局部规划路径框的相对距离最小的局部规划路径框,作为当前局部规划路径框的下一个局部规划路径框。Step S602: Use the local planning path frame with the smallest relative distance to the current local planning path frame as the next local planning path frame of the current local planning path frame.

机器人将与当前局部规划路径框的相对距离最小的局部规划路径框,作为当前局部规划路径框的下一个局部规划路径框。The robot takes the local planning path frame with the smallest relative distance to the current local planning path frame as the next local planning path frame of the current local planning path frame.

步骤S603:获取下一个局部规划路径框与墙面信息的墙面平行的两个边框,并计算两个边框中与墙面的相对距离。Step S603: Obtain two borders parallel to the wall in the next local planning path frame and the wall information, and calculate the relative distance between the two borders and the wall.

机器人获取下一个局部规划路径框与墙面信息的墙面平行的两个边框,并计算两个边框中与墙面的相对距离。The robot obtains the next local planning path frame and the two borders parallel to the wall in the wall information, and calculates the relative distance between the two borders and the wall.

步骤S604:在两个边框中相对距离小的一个边框的中点,设置新的规划沿边起始点。Step S604: Set a new planning edge starting point at the midpoint of a frame with a smaller relative distance among the two frames.

机器人选取在两个边框中相对距离小的一个边框的中点,将其设置新的规划沿边起始点。The robot selects the midpoint of the frame with the smaller relative distance between the two frames, and sets it as the new starting point of the planned edge.

步骤S605:控制机器人从新的规划沿边起始点开始,沿下一个局部规划路径框的边框进行沿边运动。Step S605: The robot is controlled to start from the new starting point of the planned edge, and move along the edge along the border of the next local planned path frame.

控制机器人从新的规划沿边起始点开始,沿下一个局部规划路径框的边框进行沿边运动,重复前文中的步骤,直至当前栅格地图中不存在可到达的局部规划路径框后认为当前区域全覆盖式清扫已完成。Control the robot to start from the new planning edge starting point, move along the border of the next local planning path box, repeat the steps in the previous article, until there is no reachable local planning path box in the current grid map, the current area is considered to be fully covered Cleaning has been completed.

区别于现有技术,本申请的机器控制方法在某一个局部规划路径框清扫完之后,机器人可以直接调度到下一个局部规划路径框的规划沿边点,且无需再进行找边的操作,可以提高机器人的清扫效率。Different from the prior art, in the machine control method of the present application, after a certain local planning path frame is cleaned, the robot can be directly dispatched to the planned edge point of the next local planning path frame, and there is no need to perform edge finding operations, which can improve The cleaning efficiency of the robot.

可选地,本申请进一步提出一种机器人,请参阅图8,图8是本申请机器人一实施例的结构示意图,该机器人200包括处理器201及与处理器201连接的存储器202,其中,存储器202中存储有程序数据,处理器201执行存储器202存储的程序数据,以执行实现上述各方法实施例中的步骤。Optionally, the present application further proposes a robot, please refer to FIG. 8, which is a schematic structural diagram of an embodiment of the robot of the present application. The robot 200 includes a processor 201 and a memory 202 connected to the processor 201, wherein the memory Program data is stored in the memory 202, and the processor 201 executes the program data stored in the memory 202 to implement the steps in the foregoing method embodiments.

处理器201还可以称为CPU(Central Processing Unit,中央处理单元)。处理器201可能是一种集成电路芯片,具有信号的处理能力。处理器201还可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 201 may also be referred to as a CPU (Central Processing Unit, central processing unit). The processor 201 may be an integrated circuit chip with signal processing capabilities. The processor 201 can also be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components . A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.

存储器202用于存储处理器201运行所需的程序数据。The memory 202 is used to store program data required by the processor 201 to run.

处理器201还用于执行存储器202存储的程序数据以实现上述机器人控制方法。The processor 201 is also used to execute the program data stored in the memory 202 to realize the above robot control method.

可选地,本申请进一步提出一种计算机可读存储介质。请参阅图9,图9是本申请计算机可读存储介质一实施例的结构示意图。Optionally, the present application further provides a computer-readable storage medium. Please refer to FIG. 9 . FIG. 9 is a schematic structural diagram of an embodiment of a computer-readable storage medium of the present application.

本申请实施例的计算机可读存储介质300内部存储有程序指令310,程序指令310被执行以实现上述机器人控制方法。The computer-readable storage medium 300 of the embodiment of the present application stores program instructions 310 inside, and the program instructions 310 are executed to implement the robot control method described above.

其中,程序指令310可以形成程序文件以软件产品的形式存储在上述存储介质中,以使得一台电子设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施方式方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质,或者是计算机、服务器、手机、平板等终端设备。Among them, the program instruction 310 can form a program file and be stored in the above-mentioned storage medium in the form of a software product, so that an electronic device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) executes various All or part of the steps of the method of implementation. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, and other media that can store program codes. , or terminal devices such as computers, servers, mobile phones, and tablets.

本实施例计算机可读存储介质300可以是但不局限于U盘、SD卡、PD光驱、移动硬盘、大容量软驱、闪存、多媒体记忆卡、服务器等。The computer-readable storage medium 300 of this embodiment may be, but not limited to, a USB flash drive, an SD card, a PD optical drive, a mobile hard disk, a large-capacity floppy drive, a flash memory, a multimedia memory card, a server, and the like.

在一个实施例中,提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。电子设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该电子设备执行上述各方法实施例中的步骤。In one embodiment there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the electronic device executes the steps in the foregoing method embodiments.

另外,上述功能如果以软件功能的形式实现并作为独立产品销售或使用时,可存储在一个移动终端可读取存储介质中,即,本申请还提供一种存储有程序数据的存储装置,所述程序数据能够被执行以实现上述实施例的方法,该存储装置可以为如U盘、光盘、服务器等。也就是说,本申请可以以软件产品的形式体现出来,其包括若干指令用以使得一台智能终端执行各个实施例所述方法的全部或部分步骤。In addition, if the above-mentioned functions are implemented in the form of software functions and sold or used as independent products, they can be stored in a storage medium that can be read by a mobile terminal, that is, the application also provides a storage device that stores program data, so The above program data can be executed to implement the methods of the above embodiments, and the storage device can be, for example, a U disk, an optical disk, a server, and the like. That is to say, the present application may be embodied in the form of a software product, which includes several instructions for enabling an intelligent terminal to execute all or part of the steps of the method described in each embodiment.

此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本申请的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。In addition, the terms "first" and "second" are used for descriptive purposes only, and cannot be interpreted as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of these features. In the description of the present application, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.

流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的机构、片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。Any process or method descriptions described in flowcharts or otherwise herein may be understood to represent a mechanism, segment or portion of code comprising one or more executable instructions for implementing specific logical functions or steps of a process , and the scope of preferred embodiments of the present application includes additional implementations in which functions may be performed out of the order shown or discussed, including in substantially simultaneous fashion or in reverse order depending on the functions involved, which shall It should be understood by those skilled in the art to which the embodiments of the present application belong.

在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(可以是个人计算机,服务器,网络设备或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。The logic and/or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium, For the use of instruction execution systems, devices or equipment (which may be personal computers, servers, network equipment or other systems that can fetch instructions from instruction execution systems, devices or devices and execute instructions), or in combination with these instruction execution systems, devices or devices And use. For the purposes of this specification, a "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use in or in conjunction with an instruction execution system, device or device. More specific examples (non-exhaustive list) of computer-readable media include the following: electrical connection with one or more wires (electronic device), portable computer disk case (magnetic device), random access memory (RAM), Read Only Memory (ROM), Erasable and Editable Read Only Memory (EPROM or Flash Memory), Fiber Optic Devices, and Portable Compact Disc Read Only Memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program can be printed, since the program can be read, for example, by optically scanning the paper or other medium, followed by editing, interpretation or other suitable processing if necessary. The program is processed electronically and stored in computer memory.

以上所述仅为本申请的实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above is only an embodiment of the application, and does not limit the patent scope of the application. Any equivalent structure or equivalent process conversion made by using the specification and drawings of the application, or directly or indirectly used in other related technologies fields, are all included in the scope of patent protection of this application in the same way.

Claims (9)

1.一种机器人控制方法,其特征在于,所述机器人控制方法包括:1. A robot control method, characterized in that, the robot control method comprises: 获取由环境地图点云转换的栅格地图,在所述栅格地图中提取墙面信息;Obtain a grid map converted from the point cloud of the environmental map, and extract wall information from the grid map; 在所述栅格地图中提取障碍物位置;extracting obstacle positions in the grid map; 基于所述障碍物位置在所述栅格地图中生成若干局部规划路径框,其中,所述若干局部规划路径框的边框以及内部区域均不存在障碍物;generating several local planning path frames in the grid map based on the obstacle positions, wherein there are no obstacles in borders and internal areas of the several partial planning path frames; 基于所述墙面信息,生成规划沿边起始点,并在所述栅格地图中生成若干局部规划路径框,其中,所述规划沿边起始点位于其中一个局部规划路径框的与所述墙面信息的墙面平行的一条边的中点;Based on the wall information, generate a planning edge starting point, and generate several local planning path boxes in the grid map, wherein the planning edge starting point is located in one of the local planning path boxes and the wall information The midpoint of a parallel side of the wall; 控制所述机器人从所述规划沿边起始点开始,沿所述规划沿边起始点所在的当前局部规划路径框的边框进行沿边运动,直至遍历所述当前局部规划路径框的边框上的所有路径点后,对所述当前局部规划路径框的内部路径点进行全覆盖遍历;Controlling the robot to start from the starting point of the planned edge, and move along the border of the current local planning path frame where the starting point of the planning edge is located, until after traversing all the path points on the border of the current local planning path frame , performing a full-coverage traversal on the internal path points of the current local planning path frame; 其中,所述沿所述规划沿边起始点所在的当前局部规划路径框的边框进行沿边运动包括:Wherein, said moving along the edge along the frame of the current local planning path frame where the starting point of the planned edge is located includes: 在所述机器人在退出遇障固定动作后,判断所述机器人的当前位置是否处于所述当前局部规划路径框的边框;若否,则获取所述当前局部规划路径框的边框上与所述当前位置距离最小的跟踪路径点,并将所述机器人从所述当前位置调度到所述跟踪路径点,从所述跟踪路径点开始继续执行沿边运动;After the robot exits the action of fixing an obstacle, it is judged whether the current position of the robot is in the border of the current local planning path frame; The tracking path point with the smallest position distance, and dispatching the robot from the current position to the tracking path point, and continuing to perform sideways motion from the tracking path point; 其中,所述将所述机器人从所述当前位置调度到所述跟踪路径点,包括:获取所述机器人从所述当前位置调度到所述跟踪路径点的调度路径;按照所述调度路径将所述机器人从所述当前位置调度到所述跟踪路径点,并将所述调度路径上的路径点标记为已遍历点;Wherein, the dispatching of the robot from the current position to the tracking waypoint includes: obtaining a dispatching path for dispatching the robot from the current position to the tracking waypoint; The robot is dispatched from the current position to the tracking path point, and the path point on the dispatch path is marked as a traversed point; 控制所述机器人从所述当前局部规划路径框移动至下一个局部规划路径框,以对所述下一个局部规划路径框进行路径跟踪,直至遍历所有局部规划路径框的边框路径点以及内部路径点。Controlling the robot to move from the current local planning path frame to the next local planning path frame, so as to perform path tracking on the next local planning path frame until traversing the border path points and internal path points of all local planning path frames . 2.根据权利要求1所述的机器人控制方法,其特征在于,2. The robot control method according to claim 1, wherein: 所述障碍物包括充电桩;The obstacle includes a charging pile; 所述基于所述墙面信息,生成规划沿边起始点,包括:The generating planning edge starting point based on the wall surface information includes: 基于所述墙面信息,以及所述充电桩的位置生成所述规划沿边起始点;其中,所述规划沿边起始点为与所述墙面相距第一预设距离的若干栅格点中,与所述充电桩的相对距离小于等于第二预设距离的至少一个栅格点。Generate the planned starting point along the edge based on the wall information and the position of the charging pile; wherein, the planned starting point along the edge is a number of grid points at a first preset distance from the wall, and The relative distance of the charging pile is less than or equal to at least one grid point of the second preset distance. 3.根据权利要求1所述的机器人控制方法,其特征在于,3. The robot control method according to claim 1, wherein: 所述沿所述规划沿边起始点所在的当前局部规划路径框的边框进行沿边运动,包括:The edge-to-edge movement along the border of the current local planning path frame where the starting point of the planned edge-to-edge is located includes: 在控制所述机器人沿当前局部规划路径框的边框进行沿边运动的过程中,获取运动方向上的障碍物感知距离;In the process of controlling the robot to move along the border of the current local planning path frame, obtaining the obstacle perception distance in the moving direction; 在所述障碍物感知距离小于第三预设距离时,触发所述遇障固定动作;When the obstacle sensing distance is less than a third preset distance, triggering the obstacle-encounter fixing action; 在所述机器人执行所述遇障固定动作的过程中,监测所述机器人与所述墙面的侧向距离;monitoring the lateral distance between the robot and the wall during the process of the robot performing the action of fixing the obstacle; 在所述侧向距离小于第四预设距离时,退出所述遇障固定动作,并基于当前位置继续执行沿边运动。When the lateral distance is less than the fourth preset distance, exit the action of fixing an obstacle, and continue to perform sideways motion based on the current position. 4.根据权利要求3所述的机器人控制方法,其特征在于,4. The robot control method according to claim 3, wherein: 所述遇障固定动作为:控制所述机器人沿第一方向旋转,并记录第一旋转角度;在所述第一旋转角度达到第一预设角度时,控制所述机器人沿第二方向旋转,并记录第二旋转角度;在所述第二旋转角度达到第二预设角度时,控制所述机器人停止旋转;The action of fixing an obstacle is: controlling the robot to rotate in a first direction, and recording a first rotation angle; when the first rotation angle reaches a first preset angle, controlling the robot to rotate in a second direction, And record the second rotation angle; when the second rotation angle reaches a second preset angle, control the robot to stop rotating; 所述第一方向与所述第二方向为两个相反的方向。The first direction and the second direction are two opposite directions. 5.根据权利要求3所述的机器人控制方法,其特征在于,5. The robot control method according to claim 3, wherein: 所述基于当前位置继续执行沿边运动,包括:The step of continuing to move along the edge based on the current position includes: 判断所述机器人的当前位置是否处于所述当前局部规划路径框的边框上;judging whether the current position of the robot is on the border of the current local planning path frame; 若是,则从所述当前位置开始继续执行沿边运动;If so, continue to perform edge-to-edge motion from the current position; 若否,则获取所述当前局部规划路径框的边框上与所述当前位置距离最小的跟踪路径点,并将所述机器人从所述当前位置调度到所述跟踪路径点,从所述跟踪路径点开始继续执行沿边运动。If not, then obtain the tracking path point on the border of the current local planning path frame with the smallest distance from the current position, and dispatch the robot from the current position to the tracking path point, from the tracking path Point to continue to perform edge motion. 6.根据权利要求5所述的机器人控制方法,其特征在于,6. The robot control method according to claim 5, wherein: 所述将所述机器人从所述当前位置调度到所述跟踪路径点,包括:Said dispatching said robot from said current location to said tracking waypoint comprises: 获取所述机器人从所述当前位置调度到所述跟踪路径点的调度路径;Acquiring a dispatch path of the robot dispatched from the current position to the tracking waypoint; 按照所述调度路径将所述机器人从所述当前位置调度到所述跟踪路径点,并将所述调度路径上的路径点标记为已遍历点。dispatching the robot from the current position to the tracking waypoint according to the dispatching path, and marking the waypoints on the dispatching path as traversed points. 7.根据权利要求1所述机器人控制方法,其特征在于,7. The robot control method according to claim 1, wherein: 所述控制所述机器人从所述当前局部规划路径框移动至下一个局部规划路径框,以对所述下一个局部规划路径框进行路径跟踪,包括:The controlling the robot to move from the current local planning path frame to the next local planning path frame to perform path tracking on the next local planning path frame includes: 获取所述当前局部规划路径框与其余局部规划路径框的相对距离;Obtain the relative distance between the current local planning path frame and other local planning path frames; 将与所述当前局部规划路径框的相对距离最小的局部规划路径框,作为所述当前局部规划路径框的下一个局部规划路径框;taking the local planning path frame with the smallest relative distance to the current local planning path frame as the next local planning path frame of the current local planning path frame; 获取所述下一个局部规划路径框与所述墙面信息的墙面平行的两个边框,并计算所述两个边框中与所述墙面的相对距离;Obtaining two borders parallel to the wall in the next local planning path frame and the wall information, and calculating the relative distance between the two borders and the wall; 在所述两个边框中相对距离小的一个边框的中点,设置新的规划沿边起始点;At the midpoint of a frame with a smaller relative distance among the two frames, set a new planning starting point along the edge; 控制所述机器人从所述新的规划沿边起始点开始,沿所述下一个局部规划路径框的边框进行沿边运动。The robot is controlled to start from the new planned edge-along starting point, and move along the edge along the frame of the next local planned path frame. 8.一种机器人,其特征在于,所述机器人包括处理器以及与所述处理器连接的存储器,其中,所述存储器中存储有程序数据,所述处理器执行所述存储器存储的所述程序数据,以执行实现:8. A robot, characterized in that the robot comprises a processor and a memory connected to the processor, wherein program data is stored in the memory, and the processor executes the program stored in the memory data, to implement: 获取由环境地图点云转换的栅格地图,在所述栅格地图中提取墙面信息;Obtain a grid map converted from the point cloud of the environmental map, and extract wall information from the grid map; 在所述栅格地图中提取障碍物位置;extracting obstacle positions in the grid map; 基于所述障碍物位置在所述栅格地图中生成若干局部规划路径框,其中,所述若干局部规划路径框的边框以及内部区域均不存在障碍物;generating several local planning path frames in the grid map based on the obstacle positions, wherein there are no obstacles in borders and internal areas of the several partial planning path frames; 基于所述墙面信息,生成规划沿边起始点,并在所述栅格地图中生成若干局部规划路径框,其中,所述规划沿边起始点位于其中一个局部规划路径框的与所述墙面信息的墙面平行的一条边的中点;Based on the wall information, generate a planning edge starting point, and generate several local planning path boxes in the grid map, wherein the planning edge starting point is located in one of the local planning path boxes and the wall information The midpoint of a parallel side of the wall; 控制所述机器人从所述规划沿边起始点开始,沿所述规划沿边起始点所在的当前局部规划路径框的边框进行沿边运动,直至遍历所述当前局部规划路径框的边框上的所有路径点后,对所述当前局部规划路径框的内部路径点进行全覆盖遍历;Controlling the robot to start from the starting point of the planned edge, and move along the border of the current local planning path frame where the starting point of the planning edge is located, until after traversing all the path points on the border of the current local planning path frame , performing a full-coverage traversal on the internal path points of the current local planning path frame; 其中,所述沿所述规划沿边起始点所在的当前局部规划路径框的边框进行沿边运动包括:Wherein, said moving along the edge along the frame of the current local planning path frame where the starting point of the planned edge is located includes: 在所述机器人在退出遇障固定动作后,判断所述机器人的当前位置是否处于所述当前局部规划路径框的边框;若否,则获取所述当前局部规划路径框的边框上与所述当前位置距离最小的跟踪路径点,并将所述机器人从所述当前位置调度到所述跟踪路径点,从所述跟踪路径点开始继续执行沿边运动;After the robot exits the action of fixing an obstacle, it is judged whether the current position of the robot is in the border of the current local planning path frame; The tracking path point with the smallest position distance, and dispatching the robot from the current position to the tracking path point, and continuing to perform sideways motion from the tracking path point; 其中,所述将所述机器人从所述当前位置调度到所述跟踪路径点,包括:获取所述机器人从所述当前位置调度到所述跟踪路径点的调度路径;按照所述调度路径将所述机器人从所述当前位置调度到所述跟踪路径点,并将所述调度路径上的路径点标记为已遍历点;Wherein, the dispatching of the robot from the current position to the tracking waypoint includes: obtaining a dispatching path for dispatching the robot from the current position to the tracking waypoint; The robot is dispatched from the current position to the tracking path point, and the path point on the dispatch path is marked as a traversed point; 控制所述机器人从所述当前局部规划路径框移动至下一个局部规划路径框,以对所述下一个局部规划路径框进行路径跟踪,直至遍历所有局部规划路径框的边框路径点以及内部路径点。Controlling the robot to move from the current local planning path frame to the next local planning path frame, so as to perform path tracking on the next local planning path frame until traversing the border path points and internal path points of all local planning path frames . 9.一种计算机可读存储介质,其特征在于,其内部存储有程序指令,所述程序指令被执行以实现:9. A computer-readable storage medium, characterized in that it stores program instructions inside, and the program instructions are executed to realize: 获取由环境地图点云转换的栅格地图,在所述栅格地图中提取墙面信息;Obtain a grid map converted from the point cloud of the environmental map, and extract wall information from the grid map; 在所述栅格地图中提取障碍物位置;extracting obstacle positions in the grid map; 基于所述障碍物位置在所述栅格地图中生成若干局部规划路径框,其中,所述若干局部规划路径框的边框以及内部区域均不存在障碍物;generating several local planning path frames in the grid map based on the obstacle positions, wherein there are no obstacles in borders and internal areas of the several partial planning path frames; 基于所述墙面信息,生成规划沿边起始点,并在所述栅格地图中生成若干局部规划路径框,其中,所述规划沿边起始点位于其中一个局部规划路径框的与所述墙面信息的墙面平行的一条边的中点;Based on the wall information, generate a planning edge starting point, and generate several local planning path boxes in the grid map, wherein the planning edge starting point is located in one of the local planning path boxes and the wall information The midpoint of a parallel side of the wall; 控制机器人从所述规划沿边起始点开始,沿所述规划沿边起始点所在的当前局部规划路径框的边框进行沿边运动,直至遍历所述当前局部规划路径框的边框上的所有路径点后,对所述当前局部规划路径框的内部路径点进行全覆盖遍历;Control the robot to start from the starting point of the planned edge, and move along the border of the current local planning path frame where the starting point of the planning edge is located, until after traversing all the path points on the border of the current local planning path frame, to Perform full coverage traversal of the internal path points of the current local planning path frame; 其中,所述沿所述规划沿边起始点所在的当前局部规划路径框的边框进行沿边运动包括:Wherein, said moving along the edge along the frame of the current local planning path frame where the starting point of the planned edge is located includes: 在所述机器人在退出遇障固定动作后,判断所述机器人的当前位置是否处于所述当前局部规划路径框的边框;若否,则获取所述当前局部规划路径框的边框上与所述当前位置距离最小的跟踪路径点,并将所述机器人从所述当前位置调度到所述跟踪路径点,从所述跟踪路径点开始继续执行沿边运动;After the robot exits the action of fixing an obstacle, it is judged whether the current position of the robot is in the border of the current local planning path frame; The tracking path point with the smallest position distance, and dispatching the robot from the current position to the tracking path point, and continuing to perform sideways motion from the tracking path point; 其中,所述将所述机器人从所述当前位置调度到所述跟踪路径点,包括:获取所述机器人从所述当前位置调度到所述跟踪路径点的调度路径;按照所述调度路径将所述机器人从所述当前位置调度到所述跟踪路径点,并将所述调度路径上的路径点标记为已遍历点;Wherein, the dispatching of the robot from the current position to the tracking waypoint includes: obtaining a dispatching path for dispatching the robot from the current position to the tracking waypoint; The robot is dispatched from the current position to the tracking path point, and the path point on the dispatch path is marked as a traversed point; 控制所述机器人从所述当前局部规划路径框移动至下一个局部规划路径框,以对所述下一个局部规划路径框进行路径跟踪,直至遍历所有局部规划路径框的边框路径点以及内部路径点。Controlling the robot to move from the current local planning path frame to the next local planning path frame, so as to perform path tracking on the next local planning path frame until traversing the border path points and internal path points of all local planning path frames .
CN202211269360.2A 2022-10-17 2022-10-17 Robot control method, robot, and computer-readable storage medium Active CN115316887B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211269360.2A CN115316887B (en) 2022-10-17 2022-10-17 Robot control method, robot, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211269360.2A CN115316887B (en) 2022-10-17 2022-10-17 Robot control method, robot, and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN115316887A CN115316887A (en) 2022-11-11
CN115316887B true CN115316887B (en) 2023-02-28

Family

ID=83915209

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211269360.2A Active CN115316887B (en) 2022-10-17 2022-10-17 Robot control method, robot, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN115316887B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116098043A (en) * 2023-02-22 2023-05-12 深圳市正浩创新科技股份有限公司 Irrigation device control method, irrigation device control device, irrigation device and medium
CN118946781B (en) * 2023-03-09 2025-08-22 汤恩智能科技(上海)有限公司 Robot path planning method, system, robot and storage medium
WO2025073081A1 (en) * 2023-10-03 2025-04-10 汤恩智能科技(上海)有限公司 Robot, method for controlling robot to travel along wall, system, and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102138769A (en) * 2010-01-28 2011-08-03 深圳先进技术研究院 Cleaning robot and cleaning method thereby
CN109540155A (en) * 2019-02-01 2019-03-29 西安全志科技有限公司 A kind of path planning and navigation method, computer installation and the computer readable storage medium of sweeping robot
CN110398964A (en) * 2019-07-16 2019-11-01 浙江大学 A low energy loss robot full coverage path planning method and system
CN111830970A (en) * 2020-06-12 2020-10-27 珠海市一微半导体有限公司 An area cleaning planning method, chip and robot for robot walking along the edge
CN112438658A (en) * 2019-08-29 2021-03-05 华南师范大学 Cleaning area dividing method for cleaning robot and cleaning robot
CN113317733A (en) * 2021-06-04 2021-08-31 深圳飞鼠动力科技有限公司 Path planning method and cleaning robot
CN114442625A (en) * 2022-01-24 2022-05-06 中国地质大学(武汉) Environment map construction method and device based on multi-strategy joint control agent
CN114431771A (en) * 2021-12-31 2022-05-06 浙江大华技术股份有限公司 Sweeping method of sweeping robot and related device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106272420B (en) * 2016-08-30 2019-07-02 北京小米移动软件有限公司 Robot and robot control method
CN107518833A (en) * 2017-10-12 2017-12-29 南京中高知识产权股份有限公司 A kind of obstacle recognition method of sweeping robot
CN108196555B (en) * 2018-03-09 2019-11-05 珠海市一微半导体有限公司 The control method that autonomous mobile robot is walked along side
CN110192812A (en) * 2019-05-15 2019-09-03 深圳市银星智能科技股份有限公司 It is a kind of to follow clean method and clean robot along side
CN111399516B (en) * 2020-03-31 2021-07-02 深圳市银星智能科技股份有限公司 Robot path planning method and device and robot
CN111728535B (en) * 2020-06-22 2021-12-28 上海高仙自动化科技发展有限公司 Method and device for generating cleaning path, electronic equipment and storage medium
CN112462768B (en) * 2020-11-25 2024-03-29 深圳拓邦股份有限公司 Mobile robot navigation map creation method and device and mobile robot

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102138769A (en) * 2010-01-28 2011-08-03 深圳先进技术研究院 Cleaning robot and cleaning method thereby
CN109540155A (en) * 2019-02-01 2019-03-29 西安全志科技有限公司 A kind of path planning and navigation method, computer installation and the computer readable storage medium of sweeping robot
CN110398964A (en) * 2019-07-16 2019-11-01 浙江大学 A low energy loss robot full coverage path planning method and system
CN112438658A (en) * 2019-08-29 2021-03-05 华南师范大学 Cleaning area dividing method for cleaning robot and cleaning robot
CN111830970A (en) * 2020-06-12 2020-10-27 珠海市一微半导体有限公司 An area cleaning planning method, chip and robot for robot walking along the edge
CN113317733A (en) * 2021-06-04 2021-08-31 深圳飞鼠动力科技有限公司 Path planning method and cleaning robot
CN114431771A (en) * 2021-12-31 2022-05-06 浙江大华技术股份有限公司 Sweeping method of sweeping robot and related device
CN114442625A (en) * 2022-01-24 2022-05-06 中国地质大学(武汉) Environment map construction method and device based on multi-strategy joint control agent

Also Published As

Publication number Publication date
CN115316887A (en) 2022-11-11

Similar Documents

Publication Publication Date Title
CN115316887B (en) Robot control method, robot, and computer-readable storage medium
US20240419170A1 (en) Robot-Assisted Processing of a Surface Using a Robot
JP7374547B2 (en) Exploration methods, devices, mobile robots and storage media
CN108366343B (en) A smart way for robots to monitor pets
CN113741438A (en) Path planning method and device, storage medium, chip and robot
CN108196555A (en) The control method that autonomous mobile robot is walked along side
CN108415432B (en) Robot positioning method based on straight edge
CN108508891A (en) A kind of method of robot reorientation
CN110554700A (en) method for identifying room and door of mobile robot
CN114431771B (en) Sweeping method of sweeping robot and related device
CN111552290B (en) A method for a robot to find a straight line along a wall and a cleaning method
JP7281707B2 (en) Mobile robot and control method
CN114942644A (en) Method for controlling robot to clean and robot
CN114610042A (en) Robot path dynamic planning method, device and robot
CN119744375B (en) Robot, robot moving method, robot system and computer storage medium
WO2024067852A1 (en) Ground medium detection method and apparatus and cleaning device
CN112137512B (en) Sweeping robot sweeping area detection method, device, equipment, system and medium
CN116243710A (en) Autonomous stair climbing control method for robot, robot and storage medium
CN114690771A (en) Path planning method and device for robot
CN116449816A (en) Motion control method for searching charging seat signal, chip and robot
CN112022011A (en) Control method, equipment, system and storage medium of sweeping robot
CN116540689B (en) A method for edge control of a robot, a chip, and a robot
CN111435243B (en) Space map generation method and device for sweeping robot and sweeping robot
CN112137528A (en) Method, device, equipment and storage medium for detecting cleaning area of sweeping robot
CN118550305B (en) A control method for robot edge cleaning, robot and storage medium

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