Robot escape method and device, robot and storage medium
By detecting signals and calculating spacing when a robot encounters a boundary, the robot can maintain passivity in narrow channels, reduce the risk of being trapped, and achieve efficient escape.
Patent Information
- Application Number
- CN202510396458.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-07-25
AI Technical Summary
Robots are prone to falling into narrow channels or dead ends in unknown or dynamically changing environments. The lack of global maps makes it impossible to identify potential trap areas in advance, increasing the risk of being trapped.
By detecting the first and second encounter boundary signals when encountering boundaries, determining the attitude, and calculating the front boundary spacing, adjusting the direction in place to try or avoid movement, using a trap detection mechanism and a trapped strategy, including a narrow channel passage module and a escape execution module.
Improves the passing and probability of escape of robots in narrow channels, reduces the risk of being trapped, ensures coverage of work areas and avoids omissions.
Smart Images

Figure CN120370925A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of robot technology, and in particular to a robot escape method, device, robot and storage medium. Background Art
[0002] In the field of robotics, robot navigation and obstacle avoidance is a complex and challenging problem, especially in unknown or dynamically changing environments. Robots usually rely on sensor data and algorithms to achieve autonomous movement, but due to the lack of environmental maps (i.e., the "no map" state), robots cannot identify and avoid potential trap areas in advance, such as narrow corners or dead ends. This limitation makes it easy for robots to get into trouble during operation, especially in complex indoor environments.
[0003] The inventors found that there are at least the following problems in the related art: due to the lack of a global map, the robot cannot identify potential trap areas in the environment (such as narrow corners or dead ends) in advance, which makes it easy for it to enter these areas and get trapped. In order to maintain a certain passability in narrow passages, the robot usually needs to make a trade-off between obstacle avoidance and forward movement. This trade-off may cause the robot to enter corners more easily, increasing the risk of being trapped. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a robot escape method, device, robot and storage medium. By combining the robot's operating data, a trapped detection mechanism is designed that enables the robot in a "no map" state to maintain passability in narrow passages, and an escape strategy for trapped corners is proposed to increase the robot's escape probability and reduce the risk of being trapped.
[0005] To solve the above technical problems, an embodiment of the present invention provides a robot escape method, which is applied to a robot moving in a working area surrounded by boundaries, comprising: determining a first posture and a second posture of the robot by sequentially detecting a first boundary encounter signal and a second boundary encounter signal when the robot encounters a boundary and performs a turning operation; calculating the distance between the front boundaries by the first posture and the second posture; when the distance between the front boundaries is greater than the width of the robot, adjusting the direction on the spot to try to move between the front boundaries; when the distance between the front boundaries is not greater than the width of the robot, adjusting the direction on the spot to avoid moving between the front boundaries.
[0006] An embodiment of the present invention also provides a robot escape device, comprising: a trapped detection module, used to determine the first posture and the second posture of the robot through the first boundary encounter signal and the second boundary encounter signal detected in sequence during the process of the robot encountering the boundary and performing a turning operation; a boundary calculation module, used to calculate the distance between the front boundaries through the first posture and the second posture; a narrow channel passage module, used to adjust the direction on the spot to try to move between the front boundaries when the distance between the front boundaries is greater than the width of the robot; and an escape execution module, used to adjust the direction on the spot to avoid moving between the front boundaries when the distance between the front boundaries is not greater than the width of the robot.
[0007] An embodiment of the present invention also provides a robot, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned robot escape method.
[0008] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, which implements the above-mentioned robot escape method when executed by a processor.
[0009] In the embodiment of the present invention applied to a robot moving in a working area surrounded by boundaries, a trapped detection mechanism capable of maintaining passability in narrow passages is designed by combining the robot's operating data, and an escape strategy in trapped corners is proposed. A robot escape detection and escape strategy based on the robot's motion state and environmental scene is proposed. The robot's first posture and second posture are determined by the first boundary encounter signal and the second boundary encounter signal detected in sequence during the robot's encounter and steering operation; the spacing between the front boundaries is calculated by the first posture and the second posture; if the spacing between the front boundaries is greater than the robot width, the direction is adjusted on the spot to try to move between the front boundaries; if the spacing between the front boundaries is not greater than the robot width, the direction is adjusted on the spot to avoid moving between the front boundaries, so as to increase the robot's escape probability and reduce the risk of being trapped. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0011] Figure 1 is a flow chart of a robot escape method provided according to an embodiment of the present invention;
[0012] Figure 2 is a schematic diagram of the details of the robot posture change when escaping from a same angle according to an embodiment of the present invention;
[0013] Figure 3a is a schematic diagram of a robot posture change when escaping from a corner according to an embodiment of the present invention;
[0014] Figure 3b is a schematic diagram of a robot posture change when escaping from a corner according to an embodiment of the present invention;
[0015] Figure 3c is a schematic diagram of a robot posture change when escaping from a corner according to an embodiment of the present invention;
[0016] Figure 4 is a schematic diagram of the change of the robot posture when escaping from an angle according to an embodiment of the present invention;
[0017] Figure 5 is a schematic structural diagram of a robot escape device according to another embodiment of the present invention;
[0018] Figure 6 It is a schematic structural diagram of a robot according to another embodiment of the present invention. DETAILED DESCRIPTION
[0019] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.
[0020] An embodiment of the present invention relates to a method for a robot to escape from a predicament, which can be applied to a robot moving within a working area surrounded by a boundary. The robot may include electronic devices such as a chip, a microcontroller unit (MCU), electronic components, and a terminal. In this embodiment, a detection and escape strategy for the robot to escape from a predicament based on the motion state of the robot and the environmental scenario is proposed. During the process that the robot encounters the boundary and executes a turning operation, the first boundary encounter signal and the second boundary encounter signal detected in sequence are used to determine the first posture and the second posture of the robot; the distance between the front boundaries is calculated through the first posture and the second posture; when the distance between the front boundaries is greater than the width of the robot, the direction is adjusted in place to attempt to move between the front boundaries; when the distance between the front boundaries is not greater than the width of the robot, the direction is adjusted in place to avoid moving between the front boundaries. The implementation details of the method for the robot to escape from a predicament in this embodiment are specifically described below. The following content is only the implementation details provided for convenient understanding and is not necessary for implementing this solution.
[0021] An embodiment of the present invention provides a robot. A robot moving within a working area surrounded by a boundary can be an automatic lawn mower, also known as a lawn mowing robot, an intelligent lawn mower, etc., which is a device capable of automatically mowing the lawn in a random path. The robot moves within a preset working area, and the working area is provided with a boundary.
[0022] When the robot walks to the edge area of the working area, the robot will encounter the boundary of the working area if it continues to walk. It can be understood that, on the one hand, the boundary can be a real physical boundary line, then the robot needs to be configured with a signal station that provides signals for the boundary line. The boundary line is connected to the signal station interface, and the signal station can input a DC pulse signal into the boundary line, and the current on the boundary line generates a magnetic field. The magnetic field direction is detected by the boundary sensor to judge whether it encounters the boundary line. Further, the magnetic field generated within the working area surrounded by the boundary line is different from the magnetic field direction outside the working area. On the other hand, the robot can also judge whether it is located within the working area. The boundary line can also be a virtual boundary line relying on positioning technology, and the robot can judge whether it encounters the boundary line according to its own positioning and the position of the virtual boundary line.
[0023] The robot mentioned in this embodiment can be an intelligent lawn mower that mows the lawn in a preset working area. Its working area includes a boundary that restricts the working area. Inside the boundary is the lawn that needs to be operated, and outside the boundary is an area without a lawn or a lawn area that does not need to be mowed, such as the lawn of a neighbor's house. The boundary of the working area of the lawn mowing robot needs to be preset in advance. When the robot recognizes that it has crossed the boundary during internal work, it can automatically turn around and leave the boundary and return inside to achieve the function of prohibiting crossing the boundary.
[0024] In this embodiment, the robot includes two boundary sensors for detecting boundary signals. Among them, the boundary signals include out-of-bounds signals, cross-boundary signals, and in-bounds signals. The out-of-bounds signal includes both boundary sensors detecting out-of-bounds signals; the cross-boundary signal includes clockwise cross-boundary and counterclockwise cross-boundary. The clockwise cross-boundary includes the first boundary sensor detecting an out-of-bounds signal and the second boundary sensor detecting an in-bounds signal. The counterclockwise cross-boundary includes the first sensor detecting an out-of-bounds signal and the second boundary sensor detecting an in-bounds signal. The in-bounds signal includes both boundary sensors detecting in-bounds signals. In this embodiment, the encountered boundary signals include out-of-bounds signals and cross-boundary signals, which are used to indicate the situation where the robot encounters a boundary line, such as the body being above the boundary line or the body leaving the boundary line, etc.
[0025] In this embodiment, the first sensor is the boundary sensor on the left side of the robot body, and the second sensor is the boundary sensor on the right side of the robot body.
[0026] As Figure 1 shown, in step 101, during the process of the robot encountering a boundary and performing a turning operation, the first encountered boundary signal and the second encountered boundary signal detected in sequence are used to determine the first posture and the second posture of the robot.
[0027] In one example, the turning operation of the robot after encountering a boundary may include rotating in place by a preset angle. The robot encountering a boundary includes detecting an out-of-bounds signal or a cross-boundary signal. The preset angle includes a random angle or a fixed angle. When an out-of-bounds signal is detected, it rotates randomly in place in a direction into the bounds and then rotates in the same direction by the preset angle; when a clockwise cross-boundary signal is detected, it rotates clockwise into the bounds and then rotates clockwise by the preset angle; when a counterclockwise cross-boundary signal is detected, it rotates counterclockwise into the bounds and then rotates counterclockwise by the preset angle.
[0028] In one example, the above step 101 may specifically be: determining the first posture through the first encountered boundary signal detected by the boundary sensor during the process of the robot encountering a boundary and performing a turning operation, and determining the rotation direction according to the first encountered boundary signal; determining the second posture according to the second encountered boundary signal detected by the boundary sensor during the process of the robot rotating along the rotation direction. For example: As Figure 2As shown, when the robot walks straight and encounters a boundary line, it then performs a turning operation. When the robot performs the turning operation, it first rotates in place until it is inside the boundary. At this time, a boundary encounter signal is detected, and the robot is at position 1 (the robot is in the first posture at this time); then it rotates a preset angle in the same direction. When a boundary encounter signal is detected again during the rotation process (before the preset angle of rotation is completed), that is, when the robot is at position 2 (the robot is in the second posture at this time), it is determined that the robot is at the corner of the boundary and needs to escape from trouble. In step 102, the distance between the centers of the two boundary sensors on the front side of the fuselage at the two positions can be calculated through the first posture and the second posture, that is, through the robot poses at position 1 and position 2.
[0029] In step 102, the distance between the front boundaries is calculated through the first posture and the second posture;
[0030] Since at the boundary corner, the distance to the boundary line is relatively close, and the robot will encounter the boundary line twice when turning. By calculating the distance between the center positions of the sensors corresponding to the two poses (the first pose and the second pose) when encountering the boundary line twice, the distance between the front boundaries can be obtained. For example, step 102 can be: According to the position change relationship of the sensor center in the first posture and the second posture, calculate the distance between the sensor centers in the first posture and the second posture to obtain the distance between the front boundaries. Specifically, as Figure 2 shown, two boundary sensors are arranged on the left and right sides of the front side of the fuselage. The pose of the robot is the center of the two rear wheels. After the robot encounters the boundary line (detects an out-of-bounds signal), the robot rotates clockwise or counterclockwise in place to position 1 (detects a cross-boundary signal), and then continues to rotate a preset angle in the same direction until it is inside the boundary. Normally, after the robot rotates the preset angle, the front of the vehicle points to the working area and it can continue to walk; when in a bad corner, such as Figure 2 , when the robot detects a cross-boundary signal again during the process of rotating a preset angle in the same direction, that is, when it is at position 2, it is determined that it is in a bad corner and needs to escape from trouble. Through the robot poses at position 1 and position 2, the distance between the centers of the two boundary sensors on the front side of the fuselage at the two positions is calculated.
[0031] It is not difficult to find that the distance between the front boundaries is mainly used to determine whether the front is a narrow passage that the robot can pass through or a corner that the robot cannot pass through. That is, when the distance between the front boundaries is greater than the width of the robot, it means that it can continue to move forward. Then in step 103, the direction is adjusted in place to try to move towards the space between the front boundaries and continue to move towards the corner. When the distance between the front boundaries is not greater than the width of the robot, it means that it is blocked and the robot needs to escape from trouble. Then in step 104, the direction is adjusted in place to avoid moving towards the space between the front boundaries.
[0032] There are generally two scenarios where the robot is trapped in a corner: same corner and multiple corners. In the same corner scenario, the robot sways left and right in a certain corner and is unable to escape; in the multiple corner scenario, the robot moves back and forth between two or more corners and is unable to escape.
[0033] For the same corner, the robot may not be able to escape from the corner through the conventional operation mechanism, which can be divided into normal escape and strategic escape. Among them, strategic escape is designed for scenes that are difficult to escape from normally.
[0034] For normal escape, when the robot detects that it has rotated from an out-of-bounds signal or a cross-bounds signal to an in-bounds signal, if the rotation angle exceeds 120°, it can be considered a normal escape. However, normal escape requires the robot to rotate from the outside to the inside of a boundary near the end point. The robot's initial state often cannot meet this condition, and it occurs less frequently, so more strategies are needed to escape.
[0035] For strategic escape, Figure 3a As shown in the figure, the robot is constantly adjusting its orientation at positions a and b. It cannot escape from the corner normally, so it needs to escape from the same corner. An example of escaping from the same corner strategy is as follows:
[0036] like Figure 3b As shown, the robot goes straight to position A and encounters the boundary, and rotates (rotates in place) to position B and encounters the boundary again, that is, at this time the robot rotates from direction a to direction b. Two boundary sensors are set on the robot. When one is detected inside the boundary line and the other is outside the boundary line, a cross-boundary signal is generated; when both are outside the boundary line, an out-of-bounds signal is generated; when both sensors detect inside the boundary line, an in-bounds signal is generated. Calculate the distance d1 between the centers of the two boundary sensors of the robot when the boundary or out-of-bounds signals (i.e., cross-boundary signals or out-of-bounds signals) are detected twice. The following formula can be obtained:
[0037]
[0038] d1=hypot(sx1-sx2,sy1-sy2)
[0039] Among them, the posture of the robot at position a is (x1, y1, yaw1); x1 is the horizontal coordinate of the robot at position a, y1 is the vertical coordinate of the robot at position a, and yaw1 is the direction of the robot at position a; the posture of the robot at position b is (x2, y2, yaw2), x2 is the horizontal coordinate of the robot at position b, y2 is the vertical coordinate of the robot at position b, and yaw2 is the direction of the robot at position b; the distance between the center of the two boundary sensors and the center of motion of the robot is s, and the centers of the two boundary sensors are located directly in front of the center of motion of the robot, and hypot() means calculating the length of the hypotenuse of a right triangle.
[0040] In one example, adjusting the direction in place to attempt to move between the front boundaries may be: obtaining the midline of the steering angle formed between the orientation of the robot in the first posture and the orientation of the robot in the second posture; adjusting the direction in place to make the moving direction of the robot point to the midline of the steering angle to attempt to move between the front boundaries. Specifically, for example:
[0041] If the distance d1 between the front boundaries is greater than the width d2 of the robot, rotate in the opposite direction to the middle direction yaw between the two detected boundaries to attempt to pass through, such as Figure 3b in the c direction in; The calculation formula for the middle direction yaw of the boundary is as follows:
[0042] yaw = (yaw1 + yaw2) / 2
[0043] where yaw1 is the orientation direction of the first posture of the robot, and yaw2 is the orientation direction of the second posture of the robot.
[0044] When the distance between the front boundaries is greater than the width of the robot, in step 103, adjust the direction in place to attempt to move between the front boundaries.
[0045] In one example, adjusting the direction in place to avoid moving between the front boundaries may be: obtaining the current working area range through the distance between the front boundaries and the front boundaries; adjusting the direction in place to make the robot rotate in the same rotation direction until it points to the current working area range, and then continue to rotate in the same rotation direction by a preset angle, and ensure that the robot always points to the current working area range to avoid moving between the front boundaries. Among them, the preset angle can be a random angle or a fixed angle. For example Figure 3b in the example shown, if the distance d1 between the front boundaries is less than or equal to the width d2 of the robot, keep the robot rotating in the direction from a->b until it is inside the boundary, and then continue to rotate by a preset angle and go straight, such as Figure 3b going straight in the d direction in.
[0046] In one example, during the process of adjusting the direction in place to avoid moving between the front boundaries, the angle at which the robot rotates in the same rotation direction is greater than 120 degrees.
[0047] When the distance d1 between the front boundaries is detected to be greater than the width of the robot multiple times, approach the corner end point until the last time it is detected that d1 is less than or equal to the width of the machine, and the robot exits from the corner. It can prevent misdetection in a narrow passage from causing the robot to not pass through the narrow passage, and at the same time ensure the coverage rate of the working area and reduce the uncut grass areas that are missed. For example Figure 3c, through the above escape steps, the robot enters the corner from the f direction for the first time, and runs through the same corner escape strategy again. During this period, the robot goes straight, encounters the boundary at position C, and rotates (rotates in place) to position D and encounters the boundary again. The robot adjusts its direction in place between c and d until it detects that the corner is impassable, and then continues to rotate until it detects the in-bounds signal (both sensors are in the boundary), then goes straight, escapes, and escapes from the e direction. Or after turning to the in-bounds / cross-bounds signal, it continues to rotate by a preset angle (a random angle or a fixed angle), then goes straight, and escapes.
[0048] In one example, the operation of the robot after encountering a boundary may also include first retreating a preset distance, and then rotating in place by a preset angle. That is, after detecting a cross-border signal, stop moving forward, retreat a preset distance, rotate in place until it faces the working area, and then rotate in place by a preset angle. When an out-of-bounds signal is detected, stop moving forward, retreat a preset distance, and start detecting boundary signals at the same time. When no cross-border signal is detected, the robot rotates in place in a random direction to within the boundary, and then rotates by a preset angle. If it is already within the boundary, it directly rotates by a preset angle; when a cross-border signal is detected, stop retreating, spin in place to within the boundary, and then rotate by a preset angle. In this embodiment, the preset angle of the above rotation can be a random angle or a fixed angle, and this application does not limit it.
[0049] If the robot is trapped in the same corner multiple times, it may be because it performed a backward operation before encountering a boundary and performed a turning operation, resulting in retreating to the original position. In this case, the escape strategy can be: by comparing the first posture of the robot when encountering a boundary and performing a turning operation, and the second posture of the robot when encountering a boundary and performing a turning operation last time, the robot's position difference before and after escape is obtained; if the robot's position difference before and after escape is not greater than the preset position change threshold, then after calculating the distance between the front boundaries, adjust the direction on the spot to avoid moving between the front boundaries. For example:
[0050] When the robot goes out of the boundary and moves backward, Figure 3cDuring the process of moving forward in the f direction and trying to get out of the boundary, it retreated to the original position, manifested as swaying left and right in place, moving forward and backward, and then swaying in place again, resulting in being unable to get out of this corner. At this time, it is necessary to detect whether the position of the robot has changed after two direction adjustments. The position difference of the robot before and after getting out of trouble twice is error_dis. If error_dis is less than the threshold d3, it is considered that the two times of getting out of trouble occur at the same position. Although the center distance d1 of the sensor is greater than the body width d2 at this time, it is still necessary to execute getting out of trouble and get out from the e position; if error_dis is greater than the threshold d3, it is considered that the two times of getting out of trouble do not occur at the same position. At this time, d1 is greater than the body width d2, and it can enter this direction and move forward from the f position. In this embodiment, the threshold d3 is set to 0.5m. In other embodiments, it can be set according to the actual situation such as the size of the robot and the size of the working area. The present application does not limit the specific value of d3. The specific calculation formula of error_dis is as follows:
[0051] error_dis = hypot(x3 - x4, y3 - y4)
[0052] Among them, the pose of the robot at position b is (x3, y3, yaw3); x3 is the abscissa of the robot at position b, y3 is the ordinate of the robot at position b, and yaw3 is the orientation direction of the robot at position b; the pose of the robot at position d is (x4, y4, yaw4); x4 is the abscissa of the robot at position d, y4 is the ordinate of the robot at position d, and yaw4 is the orientation direction of the robot at position d.
[0053] If only the same-angle getting-out-of-trouble method is used, in Figure 4 At the multi-corners of the dead-end shape, when the robot gets out of trouble from the corner where position a is located, it may enter position b through direction c, and get out of trouble from the corner where position b is located and enter position a, resulting in the phenomenon that the robot repeatedly executes the same-angle getting-out-of-trouble at positions a and b, but actually cannot get out of trouble. At this time, it is necessary to adopt a different-angle getting-out-of-trouble strategy.
[0054] For the different-corner getting-out-of-trouble strategy, when the robot performs a turning operation for the Nth time when encountering a boundary, if the distance between the current position and the position where the robot performed a turning operation when encountering a boundary for the (N - 2)th time is less than a preset different-angle distance threshold, and the distance between the position where the robot performed a turning operation when encountering a boundary for the (N - 1)th time and the position where the robot performed a turning operation when encountering a boundary for the (N - 2)th time is greater than the different-angle distance threshold, then adjust the direction in place to avoid moving towards the position where the robot performed a turning operation when encountering a boundary for the (N - 1)th time, where N is a positive integer and N is greater than 2. Among them, the position where the robot performs a turning operation when encountering a boundary for the Nth time is different from the position where the robot performs a turning operation when encountering a boundary for the (N - 1)th time. Take Figure 4 The situation shown as an example (in this example, N = 3):
[0055] The inspection robot escapes from the trap at a different corner the second time from the first time, and escapes from the trap at the same corner the third time as the first time. That is, it escapes from the trap at position a for the first time and at position b for the second time. If the robot moves in the e direction, it successfully escapes from the trap. Otherwise, the third movement will turn back to position a along the c direction. At this time, the robot needs to determine that it is at a different corner. After the third straight-line movement is completed, it is judged whether it is at the same corner by the distance between the two positions and the threshold D MAX The size relationship of, that is, to judge whether the distance d4 between the second and the first corner escapes is greater than the threshold D MAX , and whether the distance d4 between the second and the first corner escapes is less than the threshold D MAX . If both are satisfied, it means that the robot is trapped in multiple corners and needs to adopt a different-corner escape strategy. In this embodiment, the threshold D MAX is set to 0.5m, or it can be determined according to the actual situation. This application does not limit the specific value of D MAX .
[0056] The specific calculation formulas for the distance d4 between the second and the first corner escapes and the distance d4 between the second and the first corner escapes are as follows:
[0057] d4 = hypot(x2 - x1, y2 - y1)
[0058] d5 = hypot(x3 - x1, y3 - y1)
[0059] Among them, the pose (x1, y1, yaw1) of the robot that escapes from the corner for the first time at position a is the first time; the pose (x2, y2, yaw2) of the robot that escapes from the corner at position b is the second time; the pose (x3, y3, yaw3) of the robot that escapes from the corner at position a for the second time is the third time. x1 is the abscissa of the robot at position a, y1 is the ordinate of the robot at position a, and yaw1 is the orientation direction of the robot at position a; x2 is the abscissa of the robot at position b, y2 is the ordinate of the robot at position b, and yaw2 is the orientation direction of the robot at position b; x3 is the abscissa of the robot at position c, y3 is the ordinate of the robot at position c, and yaw3 is the orientation direction of the robot at position c.
[0060] Subsequently, the escape direction is selected, and the direction is adjusted in place to avoid moving towards the position where the robot executed the turning operation when encountering the boundary for the (N - 1)th time. The specific method can be: the robot obtains the heading angle before each escape, and finally rotates to a direction different from the heading angle when entering the corner to leave. That is, the robot can automatically obtain the traveling direction when detecting the out-of-bounds signal or the cross-boundary signal for the Nth time, and select a direction that is neither the same as nor close to the forward and reverse directions of the traveling direction to leave; at Figure 4In the example shown, the robot will rotate in the same direction as the direction it turned when entering the third escape position, that is, from b to a, and maintain the rotation direction until it is within the boundary, and after rotating by a preset angle, the robot will go straight in the direction of d and successfully escape from the corner. In this embodiment, the preset angle of rotation can be a random angle or a fixed angle, which is not limited in this application.
[0061] In this embodiment, a robot escape detection and escape strategy based on the robot motion state and environmental scene is proposed. The first and second postures of the robot are determined by sequentially detecting the first and second boundary encounter signals during the robot encountering the boundary and performing the turning operation; the spacing between the front boundaries is calculated by the first and second postures; when the spacing between the front boundaries is greater than the width of the robot, the direction is adjusted on the spot to try to move between the front boundaries; when the spacing between the front boundaries is not greater than the width of the robot, the direction is adjusted on the spot to avoid moving between the front boundaries.
[0062] The steps of the above method are divided only for clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this application; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this application.
[0063] Another embodiment of the present invention relates to a robot escape device, such as Figure 5 As shown, it includes: a trapped detection module 401, which is used to determine the first posture and the second posture of the robot through the first boundary encounter signal and the second boundary encounter signal detected in sequence during the robot encountering the boundary and performing the turning operation; a boundary calculation module 402, which is used to calculate the distance between the front boundaries through the first posture and the second posture; a narrow channel passage module 403, which is used to adjust the direction on the spot to try to move to the front boundaries when the distance between the front boundaries is greater than the robot width; an escape execution module 404, which is used to adjust the direction on the spot to avoid moving to the front boundaries when the distance between the front boundaries is not greater than the robot width.
[0064] In one example, the first posture and the second posture of the robot are determined in sequence by detecting a first boundary signal and a second boundary signal when the robot encounters a boundary and performs a turning operation, including: determining the first posture by detecting a first boundary signal by a boundary sensor when the robot encounters a boundary and performs a turning operation, and determining the rotation direction according to the first boundary signal; determining the second posture according to a second boundary signal detected by the boundary sensor when the robot rotates along the rotation direction.
[0065] In one example, calculating the distance between the front boundaries by using the first posture and the second posture includes: calculating the distance between the sensor center in the first posture and the second posture according to the position change relationship between the sensor center in the first posture and the second posture to obtain the distance between the front boundaries.
[0066] In one example, the robot escape device also includes: an anti-repeated escape module, which is used to compare the first posture of the robot when it encounters a boundary and performs a turning operation, and the second posture of the robot when it encounters a boundary and performs a turning operation last time, to obtain the position difference before and after the robot escapes; if the position difference before and after the robot escapes is not greater than a preset position change threshold, then after calculating the distance between the front boundaries, the direction is adjusted on the spot to avoid moving between the front boundaries.
[0067] In one example, the device also includes: an out-of-angle escape module, which is used to adjust the direction on the spot to avoid moving to the position where the robot encounters the boundary for the Nth time to perform a turning operation, if the distance between the current position and the position where the robot encounters the boundary for the N-2th time to perform a turning operation is less than a preset out-of-angle distance threshold, and the distance between the position where the robot encounters the boundary for the N-1th time to perform a turning operation and the position where the robot encounters the boundary for the N-2th time to perform a turning operation is greater than the out-of-angle distance threshold; wherein N is a positive integer and is greater than 2; wherein the position where the turning operation is performed when the Nth time the boundary is encountered is different from the position where the turning operation is performed when the boundary is encountered for the N-1th time.
[0068] In one example, adjusting the direction in place to attempt to move between the boundaries ahead includes: obtaining a center line of the steering angle through a steering angle formed between the orientation of the robot in a first posture and the orientation of the robot in a second posture; and adjusting the direction in place to direct the robot's movement direction toward the center line of the steering angle to attempt to move between the boundaries ahead.
[0069] In one example, adjusting the direction on the spot to avoid moving between the front boundaries includes: obtaining the current working area range through the spacing between the front boundaries and the front boundaries; adjusting the direction on the spot to make the robot rotate in the same direction until it points to the current working area range, and then continuing to rotate in the same direction for a preset angle, and ensuring that the robot always points to the current working area range to avoid moving between the front boundaries.
[0070] In one example, the robot rotates more than 120 degrees while maintaining the same rotational direction while adjusting its direction in place to avoid moving between the front boundaries.
[0071] In this embodiment, a robot escape detection and escape strategy based on the robot motion state and environmental scene is proposed. The first and second postures of the robot are determined by sequentially detecting the first and second boundary encounter signals during the robot encountering the boundary and performing the turning operation; the spacing between the front boundaries is calculated by the first and second postures; when the spacing between the front boundaries is greater than the width of the robot, the direction is adjusted on the spot to try to move between the front boundaries; when the spacing between the front boundaries is not greater than the width of the robot, the direction is adjusted on the spot to avoid moving between the front boundaries.
[0072] It is not difficult to find that this embodiment is a device embodiment corresponding to the above method embodiment, and this embodiment can be implemented in conjunction with the above method embodiment. The relevant technical details mentioned in the above method embodiment are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above method embodiment.
[0073] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other units in this embodiment.
[0074] Another embodiment of the present invention relates to a robot, such as Figure 6 As shown, it includes at least one processor 501; and a memory 502 that is communicatively connected to the at least one processor; wherein the memory 502 stores instructions that can be executed by the at least one processor 501, and the instructions are executed by the at least one processor 501 so that the at least one processor 501 can execute the robot escape method as described above.
[0075] Among them, the memory 502 and the processor 501 are connected in a bus manner. The bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors 501 and the memory 502 together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art, and thus will not be further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a component or multiple components, such as multiple receivers and transmitters, and provides a unit for communicating with various other devices on the transmission medium. The data processed by the processor 501 is transmitted on the wireless medium through the antenna. Further, the antenna also receives data and transmits the data to the processor 501.
[0076] The processor 501 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. The memory 502 can be used to store the data used by the processor 501 when executing operations.
[0077] Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the above method embodiments are implemented.
[0078] That is, those skilled in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by instructing relevant hardware through a program. The program is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: various media that can store program codes such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.
[0079] Those of ordinary skill in the art can understand that the above embodiments are specific embodiments for implementing the present invention, and in practical applications, various changes can be made in form and details without departing from the spirit and scope of the present invention.
Claims
1. A method for a robot to escape from trouble, characterized in that, Applicable to robots moving within a work area enclosed by boundaries, including: Determining a first posture and a second posture of the robot by sequentially detecting a first boundary encounter signal and a second boundary encounter signal during a process in which the robot encounters a boundary and performs a turning operation; Calculate the distance between the front boundaries by using the first posture and the second posture; When the distance between the front boundaries is greater than the width of the robot, adjusting the direction on the spot to try to move between the front boundaries; When the spacing between the front boundaries is not greater than the width of the robot, the direction is adjusted on the spot to avoid moving between the front boundaries.
2. The robot escape method according to claim 1, characterized in that: The first posture and the second posture of the robot are determined by sequentially detecting a first boundary encounter signal and a second boundary encounter signal during the process of the robot encountering a boundary and performing a turning operation, including: Determine the first posture by detecting the first boundary encounter signal by the boundary sensor of the robot during the process of the robot encountering a boundary and performing a turning operation, and determine the rotation direction according to the first boundary encounter signal; The second posture is determined according to the second boundary signal detected by the boundary sensor of the robot during the process of the robot rotating along the rotation direction.
3. The robot escape method according to claim 1, characterized in that: The calculating the distance between the front boundaries by using the first posture and the second posture includes: According to the position change relationship of the center of the boundary sensor of the robot in the first posture and the second posture, the distance between the center of the boundary sensor in the first posture and the second posture is calculated to obtain the spacing between the front boundaries.
4. The robot escape method according to claim 1, characterized in that: The method further comprises: By comparing the first posture of the robot when it encounters a boundary and performs a turning operation, and the second posture of the robot when it encounters a boundary and performs a turning operation last time, the position difference of the robot before and after it escapes from the trap is obtained; If the position difference of the robot before and after escaping is not greater than a preset position change threshold, after calculating the distance between the front boundaries, the direction of the robot is adjusted on the spot to avoid moving between the front boundaries.
5. The robot escape method according to claim 1, characterized in that: The method further comprises: When the robot encounters a boundary for the Nth time and performs a turning operation, if the distance between the current position and the position where the robot encounters the boundary for the N-2th time and performs a turning operation is less than a preset different angle distance threshold, and the distance between the position where the robot encounters the boundary for the N-1st time and performs a turning operation is greater than the different angle distance threshold, then the direction is adjusted on the spot to avoid moving to the position where the robot encounters the boundary for the N-1st time and performs a turning operation; Wherein, N is a positive integer and is greater than 2; The position where the turning operation is performed when the boundary is encountered for the Nth time is different from the position where the turning operation is performed when the boundary is encountered for the N-1th time.
6. The robot escape method according to claim 1, characterized in that: The adjusting direction on the spot to try to move between the front boundaries includes: Obtaining a midline of the steering angle through a steering angle formed between the orientation of the robot in the first posture and the orientation of the robot in the second posture; By adjusting the direction on the spot, the robot is made to move in the direction of the center line of the steering angle to try to move between the front boundaries.
7. The robot escape method according to claim 1, characterized in that: The adjusting direction in situ to avoid moving between the front boundaries includes: Obtaining the current working area range through the distance between the front boundaries and the front boundary; By adjusting the direction on the spot, the robot is made to rotate in the same direction until it points to the current working area, and then continues to rotate in the same direction for a preset angle, ensuring that the robot always points to the current working area to avoid moving toward the front boundary.
8. A robot escape device, characterized in that: include: A trapped detection module, used for determining a first posture and a second posture of the robot through a first boundary encounter signal and a second boundary encounter signal detected in sequence during a process in which the robot encounters a boundary and performs a turning operation; A boundary calculation module, used for calculating the distance between the front boundaries through the first posture and the second posture; A narrow channel passage module, used for adjusting the direction on the spot to try to move between the front boundaries when the distance between the front boundaries is greater than the width of the robot; The escape execution module is used to adjust the direction on the spot to avoid moving between the front boundaries when the distance between the front boundaries is not greater than the width of the robot.
9. A robot, characterized in that, include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the robot escape method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, the robot escape method according to any one of claims 1 to 7 is implemented.