Robot escape method, device, processor and robot
By obtaining the historical running trajectory of the sweeping robot and the driving position and angle of entering narrow areas, and determining and controlling the position and angle of the robot's driving out, the problem of the robot being unable to escape on its own in narrow areas is solved, and an efficient and autonomous escape and improved user experience is achieved.
Patent Information
- Application Number
- CN202210988109.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-17
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2042-08-17
AI Technical Summary
The existing sweeping robots cannot get out of trouble on their own in narrow areas, resulting in the termination of cleaning and requiring human help, affecting efficiency and user experience.
By obtaining the robot's historical trajectory and the entry position and angle of entering the narrow area, the robot's exit position and angle of driving out of the preset narrow passage is determined, and the robot's exit position and angle can be controlled to drive out of the narrow area based on these parameters.
It realizes the robot's independent escape from difficulties in narrow areas, improves the cleaning efficiency and user experience, and solves the problem that the robot cannot escape from difficulties by itself.
Smart Images

Figure CN115237142B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of robots, and in particular, to a method and device for a robot to escape from a predicament, a processor, and a robot. Background Technique
[0002] With the acceleration of the pace of life, in order to save the time for household cleaning, floor-sweeping robots have entered thousands of households and become a powerful assistant for household cleaning. The floor-sweeping robot uses the sensor devices carried by it to sense the environment it is in, plans a suitable cleaning strategy, and realizes the cleaning of the household floor.
[0003] In the real household environment, there are a large number of complex areas and corners, such as various chairs and various stacked bracket furniture in the family. Conventional floor-sweeping robots will judge whether they can enter the bottom of the chair or these bracket areas by collision. Especially when the horizontal distance between the chair legs or brackets is close to the width or diameter of the floor-sweeping robot, the floor-sweeping robot may enter the bottom of the chair or bracket but cannot come out. At this time, the floor-sweeping robot will be stuck in these areas and cannot find a strategy to escape by itself, resulting in the termination of cleaning, and then it can only alarm and wait for human help, resulting in very poor cleaning efficiency and user experience.
[0004] Therefore, the existing designed robots (including floor-sweeping robots) cannot escape from a predicament in a narrow area. Summary of the Invention
[0005] The main purpose of the present application is to provide a method and device for a robot to escape from a predicament, a processor, and a robot, so as to solve the problem that the robot cannot escape from a predicament in a narrow area in the prior art.
[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a robot escape method is provided, comprising: obtaining the robot's historical running trajectory, the historical running trajectory is the running trajectory of the robot before the current moment, the robot has entered a narrow area at the current moment, the narrow area is surrounded by multiple obstacle points, a narrow passage is formed between two adjacent obstacle points, and multiple obstacle points are located on one obstacle or on multiple obstacles; obtaining the robot's entry position and entry angle when entering the narrow area from a preset narrow passage, wherein the entry position is the two obstacle points of the preset narrow passage. and the historical running trajectory, the entry angle is the angle between the entry direction of the robot and a vertical line, and the vertical line is perpendicular to the line connecting the two obstacle points; according to the entry position and the entry angle, the exit position and exit angle of the robot when it exits the narrow area from the preset narrow channel are determined, the exit position is the intersection position of the trajectory of the robot when it exits the narrow area and the line connecting the two obstacle points of the preset narrow channel, and the exit angle is the angle between the exit direction of the robot and the vertical line; based on the exit position and the exit angle, the robot is controlled to exit the narrow area.
[0007] Optionally, based on the entry position and the entry angle, the exit position and the exit angle of the robot from the preset narrow channel out of the narrow area are determined, including: determining an exit reference position and an exit reference angle, wherein a first distance is equal to a second distance, the first distance is the distance between the entry position and a first obstacle point, the second distance is the distance between the exit reference position and a second obstacle point, and the exit reference angle is equal to the entry angle; determining that an optimal exit position is within a neighborhood of the exit reference position, and determining that an optimal exit angle is within a neighborhood of the exit reference angle.
[0008] Optionally, determining that the optimal exit position is within the neighborhood of the exit reference position and the optimal exit angle is within the neighborhood of the exit reference angle includes: when the robot successfully exits the narrow area at the exit reference position and the exit reference angle, determining the optimal exit position as the exit reference position and the optimal exit angle as the exit reference angle; when the robot fails to exit the narrow area at the exit reference position and the exit reference angle, performing the predetermined steps at least once to enable the robot to exit the narrow area, where the predetermined steps are to select a position within the neighborhood of the exit reference position as the current exit position and select an angle within the neighborhood of the exit reference angle as the current exit angle; taking the exit position selected when the predetermined steps are performed for the last time as the optimal exit position and taking the exit angle selected when the predetermined steps are performed for the last time as the optimal exit angle.
[0009] Optionally, the distance between the first obstacle point and the entry position is less than the distance between the second obstacle point and the entry position.
[0010] Optionally, according to the entry position and the entry angle, determining the exit position and the exit angle for the robot to exit the narrow area from the preset narrow passage includes: obtaining the trapped duration; when the trapped duration is greater than a predetermined duration, determining the exit position and the exit angle for the robot to exit the narrow area from the preset narrow passage according to the entry position and the entry angle.
[0011] Optionally, obtaining the entry angle for the robot to enter the narrow area from the preset narrow passage includes: selecting a first point and a second point within the neighborhood of the entry position on the historical movement trajectory; obtaining a first slope of the line connecting the first point and the second point; obtaining a second slope of the line connecting two obstacle points of the preset narrow passage; determining a third slope of the perpendicular line according to the second slope; determining the entry angle according to the first slope and the third slope.
[0012] Optionally, the first point and the second point are on the same side of the entry position, or the first point and the second point are on both sides of the entry position.
[0013] Optionally, the robot is a floor cleaning robot.
[0014] According to another aspect of the present application, a robot escape device is provided, comprising: a first acquisition unit, used to acquire the robot's historical running trajectory, the historical running trajectory is the robot's running trajectory before the current moment, the robot has entered a narrow area at the current moment, the narrow area is surrounded by a plurality of obstacle points, a narrow passage is formed between two adjacent obstacle points, and a plurality of the obstacle points are located on one obstacle or on a plurality of obstacles; a second acquisition unit, used to acquire the robot's entry position and entry angle when entering the narrow area from a preset narrow passage, wherein the entry position is the connection of two obstacle points of the preset narrow passage. The intersection position of the line and the historical running trajectory, the entry angle is the angle between the entry direction of the robot and the vertical line, and the vertical line is perpendicular to the line connecting the two obstacle points; a determination unit is used to determine the exit position and exit angle of the robot from the preset narrow channel to the narrow area according to the entry position and the entry angle, the exit position is the intersection position of the trajectory of the robot leaving the narrow area and the line connecting the two obstacle points of the preset narrow channel, and the exit angle is the angle between the exit direction of the robot and the vertical line; a control unit is used to control the robot to exit the narrow area based on the exit position and the exit angle.
[0015] According to another aspect of the present application, a processor is provided, wherein the processor is used to run a program, wherein the program executes any one of the methods when running.
[0016] According to another aspect of the present application, a robot is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of the methods described.
[0017] By applying the technical solution of the present application, the robot's historical running trajectory is obtained to obtain the robot's entry position and entry angle from a preset narrow passage into a narrow area, and then the robot's exit position and exit angle from the preset narrow passage out of the narrow area are determined based on the entry position and entry angle. Finally, based on the exit position and exit angle, the robot is controlled to exit the narrow area. This solution determines the exit position and exit angle based on the entry position and entry angle, allowing the robot to exit the narrow area smoothly. This solves the problem of the robot being unable to escape from a narrow area and improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 A flow chart of a robot escape method according to an embodiment of the present application is shown;
[0020] Figure 2 A schematic diagram of driving out of a narrow area according to an embodiment of the present application is shown;
[0021] Figure 3 A schematic diagram of a robot escape device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0022] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the 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 the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] It should be understood that when an element (such as a layer, film, region, or substrate) is described as being "on" another element, the element may be directly on the other element, or there may be intermediate elements. Moreover, in the specification and claims, when an element is described as being "connected" to another element, the element may be "directly connected" to the other element, or "connected" to the other element through a third element.
[0026] As introduced in the background technology, in the prior art, robots are unable to escape from narrow areas. To solve the problem that robots are unable to escape from narrow areas, the embodiments of the present application provide a robot escape method, device, processor and robot.
[0027] According to an embodiment of the present application, a method for a robot to escape from a predicament is provided.
[0028] Figure 1 is a flowchart of the method for a robot to escape from a predicament according to an embodiment of the present application. As Figure 1 shown, the method includes the following steps:
[0029] Step S101, obtain the historical running trajectory of the robot. The above historical running trajectory is the running trajectory of the above robot before the current moment. The above robot has entered a narrow area at the above current moment. The above narrow area is surrounded by a plurality of obstacle points. A narrow passage is formed between two adjacent above obstacle points. The plurality of above obstacle points are located on one obstacle or a plurality of obstacles;
[0030] Step S102, obtain the driving-in position and driving-in angle of the above robot from a preset narrow passage into the above narrow area. Wherein, the above driving-in position is the intersection position of the connection line of two obstacle points of the above preset narrow passage and the above historical running trajectory, and the above driving-in angle is the included angle between the entering direction of the above robot and the perpendicular line. The above perpendicular line is perpendicular to the connection line of the two above obstacle points;
[0031] Step S103, determine the driving-out position and driving-out angle of the above robot from the above preset narrow passage out of the above narrow area according to the above driving-in position and the above driving-in angle. The above driving-out position is the intersection position of the trajectory of the above robot driving out of the above narrow area and the connection line of the two obstacle points of the above preset narrow passage, and the above driving-out angle is the included angle between the driving-out direction of the above robot and the perpendicular line;
[0032] Step S104, control the above robot to drive out of the above narrow area based on the above driving-out position and the above driving-out angle.
[0033] As Figure 2 shown, the connection line of obstacle point A and obstacle point B is L1, the perpendicular line is L2, the historical running trajectory is S, the intersection of the historical running trajectory and the connection line L1 of obstacle point A and obstacle point B is O, the driving-in angle is α, and the driving-out position is O'.
[0034] Specifically, the narrow area is, for example, the bottom of a chair, the bottom of a bracket; the narrow passage is, for example, the passage between two legs of a chair.
[0035] Specifically, the above robot is a sweeping robot. Improve the cleaning efficiency.
[0036] In the above solution, by obtaining the historical operation trajectory of the robot, the driving-in position and driving-in angle of the robot entering the narrow area from the preset narrow passage are obtained. Then, according to the driving-in position and driving-in angle, the driving-out position and driving-out angle of the robot driving out of the narrow area from the preset narrow passage are determined. Finally, based on the driving-out position and driving-out angle, the robot is controlled to drive out of the narrow area. This solution determines the driving-out position and driving-out angle according to the driving-in position and driving-in angle, enabling the robot to drive out of the narrow area smoothly. It solves the problem that the robot cannot escape from the narrow area and improves the user experience.
[0037] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0038] In an embodiment of the present application, determining the driving-out position and driving-out angle of the robot driving out of the narrow area from the preset narrow passage according to the above driving-in position and the above driving-in angle includes: determining a driving-out reference position and a driving-out reference angle, where the first distance is equal to the second distance, the first distance is the distance between the driving-in position and the first obstacle point, the second distance is the distance between the driving-out reference position and the second obstacle point, and the driving-out reference angle is equal to the driving-in angle; determining that the optimal driving-out position is within the neighborhood of the driving-out reference position and determining that the optimal driving-out angle is within the neighborhood of the driving-out reference angle. That is, the driving-out reference position is determined according to the distance information, the driving-out reference angle is determined to be equal to the driving-in angle, then the optimal driving-out position is determined within the neighborhood of the driving-out reference position, the optimal driving-out angle is determined within the neighborhood of the driving-out reference angle, and then, based on the optimal driving-out position and the optimal driving-out angle, the robot is controlled to drive out of the narrow area.
[0039] In one embodiment of the present application, determining that the optimal exit position is within the neighborhood of the exit reference position, and determining that the optimal exit angle is within the neighborhood of the exit reference angle, comprises: when the robot successfully exits the narrow area at the exit reference position and the exit reference angle, determining the optimal exit position as the exit reference position, and determining the optimal exit angle as the exit reference angle; when the robot fails to successfully exit the narrow area at the exit reference position and the exit reference angle, executing a predetermined step at least once so that the robot exits the narrow area, the predetermined step being selecting a position within the neighborhood of the exit reference position as the current exit position, and selecting an angle within the neighborhood of the exit reference angle as the current exit angle; using the exit position selected when the predetermined step is last executed as the optimal exit position, and using the exit angle selected when the predetermined step is last executed as the optimal exit angle. That is, when the robot fails to successfully drive out of the narrow area at the driving-out reference position and the driving-out reference angle, the optimal driving-out position and the optimal driving-out angle are determined through continuous iteration.
[0040] In one embodiment of the present application, the distance between the first obstacle point and the entry position is smaller than the distance between the second obstacle point and the entry position. This arrangement makes it easier to escape.
[0041] In one embodiment of the present application, the exit position and the exit angle of the robot from the preset narrow passage to the narrow area are determined based on the entry position and the entry angle, including: obtaining the trapped time; when the trapped time is greater than the predetermined time, determining the exit position and the exit angle of the robot from the preset narrow passage to the narrow area based on the entry position and the entry angle. That is, the step of determining the exit position and the exit angle of the robot from the preset narrow passage to the narrow area based on the entry position and the entry angle is performed only when it is determined that the robot is indeed trapped in a narrow area based on the trapped time.
[0042] In one embodiment of the present application, obtaining the entry angle of the robot from the preset narrow passage into the narrow area includes: selecting a first point and a second point in the neighborhood of the entry position on the historical running trajectory; obtaining a first slope of the line connecting the first point and the second point; obtaining a second slope of the line connecting the two obstacle points of the preset narrow passage; determining a third slope of the vertical line according to the second slope; and determining the entry angle according to the first slope and the third slope. Figure 2 As shown, the first point is O1, the second point is O2, and according to the method of approximate slope, two points near O are selected, such as the coordinate O of the intersection point O one second before the intersection point O is generated.2 (O 2x ,O 2y ), the coordinates O of the phase point one second after it is generated 1 (O 1x ,O 1y ), according to the slope calculation formula, the slope of the straight line O1O2 is Similarly, according to the coordinates of points A and B, calculate the slope k of the AB line AB , the slope of the perpendicular line AB is Then the angle between the straight line O1O2 and the perpendicular line AB (i.e. L1) is
[0043] In an embodiment of the present application, the first point and the second point are located on the same side of the driving-in position, or the first point and the second point are located on both sides of the driving-in position.
[0044] The embodiment of the present application also provides a robot escape device. It should be noted that the robot escape device of the embodiment of the present application can be used to execute the robot escape method provided in the embodiment of the present application. The robot escape device provided in the embodiment of the present application is introduced below.
[0045] Figure 3 Schematic diagram of a robot escape device according to an embodiment of the present application. Figure 3 As shown, the device comprises:
[0046] A first acquisition unit 10 is used to acquire a historical running trajectory of the robot, wherein the historical running trajectory is the running trajectory of the robot before the current moment, and the robot has entered a narrow area at the current moment, wherein the narrow area is surrounded by a plurality of obstacle points, a narrow passage is formed between two adjacent obstacle points, and the plurality of obstacle points are located on one obstacle or on a plurality of obstacles;
[0047] A second acquisition unit 20 is used to acquire an entry position and an entry angle of the robot from the preset narrow passage into the narrow area, wherein the entry position is the intersection of a line connecting two obstacle points of the preset narrow passage and the historical running trajectory, and the entry angle is the angle between the entry direction of the robot and a vertical line, wherein the vertical line is perpendicular to the line connecting the two obstacle points;
[0048] The determination unit 30 is used to determine the exit position and exit angle of the robot from the preset narrow passage out of the narrow area according to the entry position and the entry angle, wherein the exit position is the intersection position of the trajectory of the robot out of the narrow area and the line connecting the two obstacle points of the preset narrow passage, and the exit angle is the angle between the exit direction of the robot and the vertical line;
[0049] A control unit 40, configured to control the robot to drive out of the narrow area based on the above-mentioned driving-out position and the above-mentioned driving-out angle.
[0050] Specifically, the narrow area is, for example, the bottom of a chair or the bottom of a bracket; the narrow passage is, for example, the passage between two legs of a chair.
[0051] Specifically, the above-mentioned robot is a floor cleaning robot. The cleaning efficiency is improved.
[0052] In the above solution, the first acquisition unit acquires the historical running trajectory of the robot, the second acquisition unit acquires the driving-in position and the driving-in angle of the robot when entering the narrow area from the preset narrow passage, the determination unit determines the driving-out position and the driving-out angle of the robot when driving out of the narrow area from the preset narrow passage according to the driving-in position and the driving-in angle, and the control unit controls the robot to drive out of the narrow area based on the driving-out position and the driving-out angle. This solution determines the driving-out position and the driving-out angle according to the driving-in position and the driving-in angle, so that the robot can drive out of the narrow area smoothly. The problem that the robot cannot escape from the narrow area is solved, and the user experience is improved.
[0053] In an embodiment of the present application, the determination unit includes a first determination module and a second determination module. The first determination module is configured to determine a driving-out reference position and a driving-out reference angle. Wherein, the first distance is equal to the second distance. The above-mentioned first distance is the distance between the driving-in position and the first obstacle point, the above-mentioned second distance is the distance between the driving-out reference position and the second obstacle point, and the above-mentioned driving-out reference angle is equal to the driving-in angle; the second determination module is configured to determine that the optimal driving-out position is within the neighborhood of the driving-out reference position, and determine that the optimal driving-out angle is within the neighborhood of the driving-out reference angle. That is, the driving-out reference position is determined according to the distance information, the driving-out reference angle is determined to be equal to the driving-in angle, then the optimal driving-out position is determined within the neighborhood of the driving-out reference position, and the optimal driving-out angle is determined within the neighborhood of the driving-out reference angle. Then, the robot is controlled to drive out of the narrow area based on the optimal driving-out position and the optimal driving-out angle.
[0054] In an embodiment of the present application, the second determination module includes a determination sub-module, an execution sub-module, and a processing sub-module.
[0055] The determination sub-module is configured to, when the robot successfully drives out of the narrow area with the above-mentioned driving-out reference position and the above-mentioned driving-out reference angle, determine that the above-mentioned optimal driving-out position is the above-mentioned driving-out reference position, and determine that the above-mentioned optimal driving-out angle is the above-mentioned driving-out reference angle.
[0056] The execution sub-module is used to execute the predetermined steps at least once when the robot fails to drive out of the narrow area with the above-mentioned driving reference position and the above-mentioned driving reference angle, so that the robot drives out of the narrow area. The predetermined steps are to select a position within the neighborhood of the driving reference position as the current driving-out position, and to select an angle within the neighborhood of the driving reference angle as the current driving-out angle;
[0057] The processing sub-module is used to take the driving-out position selected when the above-mentioned predetermined steps are executed last time as the above-mentioned optimal driving-out position, and take the driving-out angle selected when the above-mentioned predetermined steps are executed last time as the above-mentioned optimal driving-out angle. That is, when the robot fails to drive out of the narrow area with the above-mentioned driving reference position and the above-mentioned driving reference angle, the optimal driving-out position and the optimal driving-out angle are determined through continuous iteration.
[0058] In an embodiment of the present application, the distance between the above-mentioned first obstacle point and the driving-in position is less than the distance between the above-mentioned second obstacle point and the driving-in position. Such a setting makes it easier to get out of trouble.
[0059] In an embodiment of the present application, the determination unit includes a first acquisition module and a third determination module. The first acquisition module is used to acquire the trapped duration; the third determination module is used to determine the driving-out position and the driving-out angle of the robot driving out of the narrow area from the above-mentioned preset narrow channel according to the above-mentioned driving-in position and the above-mentioned driving-in angle when the above-mentioned trapped duration is greater than a preset duration. That is, when it is determined according to the trapped duration that the robot is indeed trapped in the narrow area, the step of determining the driving-out position and the driving-out angle of the robot driving out of the narrow area from the above-mentioned preset narrow channel according to the above-mentioned driving-in position and the above-mentioned driving-in angle is executed.
[0060] In an embodiment of the present application, the second acquisition unit includes a selection module, a second acquisition module, a third acquisition module, a fourth determination module, and a fifth determination module. The selection module is used to select a first point and a second point within the neighborhood of the driving-in position on the above-mentioned historical running trajectory; the second acquisition module is used to acquire the first slope of the line connecting the above-mentioned first point and the above-mentioned second point; the third acquisition module is used to acquire the second slope of the line connecting the two obstacle points of the above-mentioned preset narrow channel; the fourth determination module is used to determine the third slope of the above-mentioned perpendicular line according to the above-mentioned second slope; the fifth determination module is used to determine the above-mentioned driving-in angle according to the above-mentioned first slope and the above-mentioned third slope. As Figure 2 shown, the first point is O1, the second point is O2. According to the method of approximate slope, two points near O are selected, such as the coordinates O of one second before the intersection point O is generated 2 (O 2x ,O 2y ), and the coordinates O of one second after the intersection point is generated 1 (O1x ,O 1y ), according to the slope calculation formula, the slope of the straight line O1O2 is Similarly, according to the coordinates of points A and B, calculate the slope k of the AB line AB , the slope of the perpendicular line AB is Then the angle between the straight line O1O2 and the perpendicular line AB (i.e. L1) is
[0061] In an embodiment of the present application, the first point and the second point are located on the same side of the driving-in position, or the first point and the second point are located on both sides of the driving-in position.
[0062] In a specific embodiment of the present application, the robot is a sweeping robot.
[0063] The robot escape device includes a processor and a memory. The first acquisition unit, the second acquisition unit, the determination unit and the control unit are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
[0064] The processor contains a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the robot can be driven out of the narrow area smoothly by adjusting the kernel parameters.
[0065] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0066] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the robot escape method.
[0067] An embodiment of the present invention provides a processor, which is used to run a program, wherein the robot escape method is executed when the program is running.
[0068] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the program executes any one of the above methods when running.
[0069] An embodiment of the present invention provides a robot, including: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include those for executing any of the above methods.
[0070] An embodiment of the present invention provides a device, which includes a processor, a memory, and a program stored on the memory and executable on the processor. When the processor executes the program, it implements at least the following steps:
[0071] Step S101: Obtain the historical running trajectory of the robot. The historical running trajectory is the running trajectory of the robot before the current moment. The robot has entered a narrow area at the current moment. The narrow area is enclosed by multiple obstacle points, and a narrow passage is formed between two adjacent obstacle points. The multiple obstacle points are located on one obstacle or multiple obstacles;
[0072] Step S102: Obtain the driving-in position and driving-in angle of the robot entering the narrow area from a preset narrow passage. The driving-in position is the intersection position of the line connecting two obstacle points of the preset narrow passage and the historical running trajectory, and the driving-in angle is the included angle between the entering direction of the robot and the perpendicular line. The perpendicular line is perpendicular to the line connecting the two obstacle points;
[0073] Step S103: Determine the driving-out position and driving-out angle of the robot driving out of the narrow area from the preset narrow passage according to the driving-in position and the driving-in angle. The driving-out position is the intersection position of the trajectory of the robot driving out of the narrow area and the line connecting the two obstacle points of the preset narrow passage, and the driving-out angle is the included angle between the driving-out direction of the robot and the perpendicular line;
[0074] Step S104: Control the robot to drive out of the narrow area based on the driving-out position and the driving-out angle.
[0075] The device in this article can be a server, a PC, a PAD, a mobile phone, etc.
[0076] The present application also provides a computer program product, which, when executed on a data processing device, is adapted to execute a program initialized with at least the following method steps:
[0077] Step S101: Obtain the historical operation trajectory of the robot. The above historical operation trajectory is the operation trajectory of the robot before the current moment. The robot has entered a narrow area at the current moment. The narrow area is enclosed by multiple obstacle points. A narrow passage is formed between two adjacent obstacle points. The multiple obstacle points are located on one obstacle or multiple obstacles.
[0078] Step S102: Obtain the entry position and entry angle of the robot entering the narrow area from a preset narrow passage. Among them, the entry position is the intersection position of the line connecting two obstacle points of the preset narrow passage and the historical operation trajectory, and the entry angle is the included angle between the entry direction of the robot and the perpendicular line. The perpendicular line is perpendicular to the line connecting the two obstacle points.
[0079] Step S103: Determine the exit position and exit angle of the robot exiting the narrow area from the preset narrow passage according to the entry position and the entry angle. The exit position is the intersection position of the trajectory of the robot exiting the narrow area and the line connecting two obstacle points of the preset narrow passage, and the exit angle is the included angle between the exit direction of the robot and the perpendicular line.
[0080] Step S104: Control the robot to exit the narrow area based on the exit position and the exit angle.
[0081] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0082] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram can be realized by computer program instructions, and the combination of processes and / or blocks in the flowchart and / or block diagram can also be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for realizing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0083] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction means that implements the function specified in one or more of the procedures Figure 1 one or more of the procedures and / or blocks Figure 1 one or more of the blocks
[0084] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable apparatus provide steps for implementing the function specified in one or more of the procedures Figure 1 one or more of the procedures and / or blocks Figure 1 one or more of the blocks
[0085] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0086] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM) and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
[0087] Computer-readable media includes both permanent and non-permanent, removable and non-removable media implemented by any method or technology for storing information. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0088] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0089] In order to better support this solution, the following specific embodiments are used for illustration.
[0090] Example
[0091] This embodiment relates to a specific method for determining whether a sweeping robot is out of trouble, including the following steps:
[0092] Step S1: Establish a two-dimensional rectangular coordinate system for the location of the family;
[0093] According to the sweeper's cleaning map and its detection radar, the cleaning area map and the size of the cleaning area can be accurately divided and positioned. For example, a corner or any other fixed position in the house can be selected as the origin of the rectangular coordinate system, so that the position coordinates of obstacles in the cleaning area can be confirmed.
[0094] Step S2: the sweeping machine enters the sweeping area;
[0095] Step S21: Record the walking path before entering the narrow area (i.e., the historical running trajectory);
[0096] The sweeper is actually cleaning (its cleaning track can be displayed on the actual map and can also be recorded). Figure 2 As shown, its walking trajectory before entering the narrow area is a curve S;
[0097] Step S22: Finding the entry position and angle of a narrow area (equivalent to a narrow area);
[0098] Step S221: Determine the entry position;
[0099] like Figure 2 As shown in FIG. 1 , when the robot vacuum cleaner enters a narrow area, it is assumed that a narrow passage is formed between AB, and curve S is the entry path. The straight line AB and curve S have a focus at O. According to the rectangular coordinate system in the home in step S1, the coordinate point of O at this time is determined to be (O x ,O y );
[0100] Step S222: determining the driving angle of the sweeping machine;
[0101] like Figure 2 As shown, according to the entry position O determined in step S221, two points near O are selected according to the approximate slope method, such as the coordinate O of the intersection point O one second before the intersection point O is generated. 2 (O 2x ,O 2y ), the coordinates O of the phase point one second after it is generated 1 (O 1x ,O 1y ), according to the slope calculation formula, the slope of the straight line O1O2 is Similarly, according to the coordinates of points A and B, calculate the slope k of the AB line AB , the slope of the perpendicular line AB is Then the angle between the straight line O1O2 and the perpendicular line AB is
[0102] Step S3: escape strategy after the sweeping robot enters a narrow area;
[0103] Step S31: Setting the escape mode;
[0104] The sweeping robot enters a certain area and cannot leave the area within a period of time t. At this time, the sweeping robot sets the escape mode and tries to leave the area instead of directly alarming.
[0105] Step S32: the sweeping machine starts to get out of trouble;
[0106] Step S321: driving out position and driving out angle;
[0107] like Figure 2 As shown, when the sweeper enters a narrow area, the intersection point it enters is O. Since entering and exiting the narrow area are in different directions, the coordinates are transformed symmetrically according to the coordinates of O, and the intersection point O' is found. The logical relationship is that the coordinates of O' satisfy the relationship O'A = OB (the coordinates of O' are easy to find from the coordinates of points AB and O). The exit angle is consistent with the entry angle, which is also α.
[0108] Step S322: The sweeping robot formally attempts to escape
[0109] Step S3221, as Figure 2 As shown, with O' as the reference point, keep the sweeper at an angle of α to the vertical line AB and start to get out of trouble. If the sweeper can get out directly, the sweeper is successfully out of trouble.
[0110] Step S3222: It cannot come out directly. Taking O' as the reference point, keep the sweeper at an angle α with the perpendicular line to AB, and start to make small displacement attempts at both ends of O'. The displacement logic is as follows: Assume that when coming out, the sweeper first collides with the side of point A. Then the displacement direction of the sweeper is the direction of O'B, that is, moving towards point B. Keep the sweeper at an angle α with the perpendicular line to AB. The distance moved towards point B can be based on the width le of the sweeper (the diameter for a circular sweeper) and the length l of AB. For example, the size of each displacement is The larger the value of n, the more times of movement. The logic for stopping the movement is that as long as the sweeper does not collide with point B in the moving direction (i.e., the obstacle point in the moving direction) when attempting to come out. If it collides with point B, the algorithm automatically increases the value of n and repeats S3222 again until the sweeper can get out of this narrow area.
[0111] Step S4: The sweeper gets out of trouble, marks the complex area, and determines the cleaning strategy.
[0112] Through the above steps, the sweeping robot gets out of the narrow area, marks this place as a complex area. The next time it comes to this area, it can make multiple collision attempts. When it is still the same as when marked Figure 1 consistent, the sweeper will no longer enter for cleaning. When it is the same as when marked Figure 1 consistent, then perform normal cleaning on this place.
[0113] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0114] 1) The robot escape method of the present application obtains the historical running trajectory of the robot, obtains the driving-in position and driving-in angle of the robot entering the narrow area from the preset narrow passage, then determines the driving-out position and driving-out angle of the robot driving out of the narrow area from the preset narrow passage according to the driving-in position and driving-in angle, and finally controls the robot to drive out of the narrow area based on the driving-out position and driving-out angle. This solution determines the driving-out position and driving-out angle according to the driving-in position and driving-in angle, enabling the robot to drive out of the narrow area smoothly. It solves the problem that the robot cannot escape from the narrow area and improves the user experience.
[0115] 2) The robot escape device of the present application, the first acquisition unit acquires the historical running trajectory of the robot, the second acquisition unit acquires the driving-in position and driving-in angle of the robot entering the narrow area from the preset narrow passage, the determination unit determines the driving-out position and driving-out angle of the robot driving out of the narrow area from the preset narrow passage according to the driving-in position and driving-in angle, and the control unit controls the robot to drive out of the narrow area based on the driving-out position and driving-out angle. This solution determines the driving-out position and driving-out angle according to the driving-in position and driving-in angle, enabling the robot to drive out of the narrow area smoothly. It solves the problem that the robot cannot escape from the narrow area and improves the user experience.
[0116] The above are only the preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.
Claims
1. A method for a robot to escape from a predicament, characterized in that, it includes: Obtain the historical running trajectory of the robot, where the historical running trajectory is the running trajectory of the robot before the current moment. The robot has entered a narrow area at the current moment. The narrow area is surrounded by multiple obstacle points, and a narrow passage is formed between two adjacent obstacle points. The multiple obstacle points are located on one obstacle or multiple obstacles; Obtain the driving-in position and driving-in angle of the robot entering the narrow area from a preset narrow passage. Among them, the driving-in position is the intersection position of the line connecting two obstacle points of the preset narrow passage and the historical running trajectory, and the driving-in angle is the included angle between the entering direction of the robot and the perpendicular line, and the perpendicular line is perpendicular to the line connecting the two obstacle points; According to the driving-in position and the driving-in angle, determine the driving-out position and driving-out angle of the robot driving out of the narrow area from the preset narrow passage. The driving-out position is the intersection position of the trajectory of the robot driving out of the narrow area and the line connecting two obstacle points of the preset narrow passage, and the driving-out angle is the included angle between the driving-out direction of the robot and the perpendicular line; Based on the driving-out position and the driving-out angle, control the robot to drive out of the narrow area.
2. The method according to claim 1, characterized in that, determining the driving-out position and driving-out angle of the robot driving out of the narrow area from the preset narrow passage according to the driving-in position and the driving-in angle includes: Determine the driving-out reference position and driving-out reference angle. Among them, the first distance is equal to the second distance. The first distance is the distance between the driving-in position and the first obstacle point, and the second distance is the distance between the driving-out reference position and the second obstacle point. The driving-out reference angle is equal to the driving-in angle; Determine that the optimal driving-out position is within the neighborhood of the driving-out reference position, and determine that the optimal driving-out angle is within the neighborhood of the driving-out reference angle.
3. The method according to claim 2, characterized in that, determining that the optimal driving-out position is within the neighborhood of the driving-out reference position, and determining that the optimal driving-out angle is within the neighborhood of the driving-out reference angle includes: When the robot successfully drives out of the narrow area with the driving-out reference position and the driving-out reference angle, determine that the optimal driving-out position is the driving-out reference position, and determine that the optimal driving-out angle is the driving-out reference angle; When the robot fails to drive out of the narrow area with the driving-out reference position and the driving-out reference angle, execute the predetermined step at least once to enable the robot to drive out of the narrow area. The predetermined step is to select a position within the neighborhood of the driving-out reference position as the current driving-out position, and select an angle within the neighborhood of the driving-out reference angle as the current driving-out angle; Take the driving-out position selected when the predetermined step is executed last time as the optimal driving-out position, and take the driving-out angle selected when the predetermined step is executed last time as the optimal driving-out angle.
4. The method according to claim 2 or 3, It is characterized in that The distance between the first obstacle point and the driving-in position is smaller than the distance between the second obstacle point and the driving-in position.
5. The method according to any one of claims 1 to 3, It is characterized in that Determining, according to the entry position and the entry angle, an exit position and an exit angle of the robot from the preset narrow passage out of the narrow area, including: Get the trapped time; When the trapped time is longer than a predetermined time, the exit position and the exit angle of the robot when it exits the narrow area from the preset narrow passage are determined according to the entry position and the entry angle.
6. The method according to any one of claims 1 to 3, It is characterized in that Obtaining the entry angle of the robot from the preset narrow passage into the narrow area includes: Selecting a first point and a second point in a neighborhood of the entry position on the historical running trajectory; Obtaining a first slope of a line connecting the first point and the second point; Obtaining a second slope of a line connecting two obstacle points of the preset narrow passage; determining a third slope of the vertical line according to the second slope; The approach angle is determined as a function of the first slope and the third slope.
7. The method according to claim 6, It is characterized in that The first point and the second point are located on the same side of the driving-in position, or the first point and the second point are located on both sides of the driving-in position.
8. The method according to any one of claims 1 to 3, It is characterized in that The robot is a sweeping robot.
9. A robot escape device, It is characterized in that include: A first acquisition unit is used to acquire a historical running trajectory of the robot, wherein the historical running trajectory is the running trajectory of the robot before a current moment, and the robot has entered a narrow area at the current moment, wherein the narrow area is surrounded by a plurality of obstacle points, a narrow passage is formed between two adjacent obstacle points, and the plurality of obstacle points are located on one obstacle or on a plurality of obstacles; A second acquisition unit is used to acquire an entry position and an entry angle of the robot entering the narrow area from a preset narrow passage, wherein the entry position is an intersection position of a line connecting two obstacle points of the preset narrow passage and the historical running trajectory, and the entry angle is an angle between an entry direction of the robot and a vertical line, wherein the vertical line is perpendicular to a line connecting the two obstacle points; a determination unit, configured to determine, according to the entry position and the entry angle, an exit position and an exit angle of the robot from the preset narrow passage to the narrow area, wherein the exit position is a position of an intersection of a trajectory of the robot exiting the narrow area and a line connecting two obstacle points of the preset narrow passage, and the exit angle is an angle between an exit direction of the robot and a vertical line; A control unit is used to control the robot to drive out of the narrow area based on the driving-out position and the driving-out angle.
10. A processor, It is characterized in that The processor is used to run a program, wherein the program executes the method according to any one of claims 1 to 8 when running.
11. A robot, characterized in that, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include those for executing the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Escape method of sweeping robot
CN110464262A
Robot control method and device, robot and storage medium
CN111984014A