Robot obstacle avoidance circle construction method based on line laser data
By using line laser data to mark the absolute coordinates of obstacles and generate circles around obstacles, the problem of line laser sensors identifying only partial contours of obstacles is solved, and the robot's ability to bypass obstacles is realized efficiently.
Patent Information
- Application Number
- CN202310902940.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-21
- Publication Date
- 2025-02-07
AI Technical Summary
When scanning obstacles, the linear laser sensor can only identify part of the outline of the obstacle, causing the robot to easily stay away from obstacles or scratch the obstacles when walking, and the leakage area is larger.
By starting the line laser sensor during the robot walking, obtaining line laser data and marking the absolute coordinates of the obstacle, filtering out the coordinates of the obstacle to be circulated, calculating the target center coordinates and target radius, generating a circle around the obstacle, so that the robot can follow the robot along the center along the center. This circle walks to get around obstacles.
It is achieved that even if the obstacle profile is incomplete, the robot can still effectively bypass the obstacle, reduce the probability of leakage sweeping and scratching, and improve the efficiency of walking around the obstacle.
Smart Images

Figure CN119396130A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of line laser navigation, and in particular to a method for constructing a robot obstacle avoidance circle based on line laser data. Background Art
[0002] The construction of a high-precision grid map by a single-line laser is a prerequisite for line laser obstacle avoidance. Generally, a sweeping robot obtains the position and size information of obstacles through a grid map to avoid or circumvent them. However, the line laser is emitted in the form of a light path and projected in front of the obstacle. The back of the obstacle can fall into the detection range, but it will be blocked and cannot be identified. Therefore, the sweeping robot can only mark part of the outline of the obstacle in a given walking direction, and then walk directly along the corresponding marked obstacle outline. The sweeping robot is prone to stay away from the obstacle to form a larger missed scanning area, or it is easy to scratch the obstacle. Summary of the invention
[0003] This application discloses a method for constructing a robot obstacle avoidance circle using line laser data. The specific technical solution is as follows: A robot obstacle avoidance circle construction method based on line laser data, a line laser sensor is installed on the front side of the robot body; the robot obstacle avoidance circle construction method comprises: step 1, during the robot walking process, starting the line laser sensor to emit a line laser obliquely downward in the robot walking direction, obtaining the line laser data, and then marking the absolute coordinates of the obstacle according to the line laser data; step 2, when the robot walks to the point where the minimum distance between the side of its body and the position point where the absolute coordinates of the obstacle are located reaches a preset obstacle avoidance distance, the coordinates of the obstacle to be avoided are selected from the marked absolute coordinates of the obstacle; step 3, based on the coordinates of the obstacle to be avoided, the target circle center coordinates and the target radius are calculated, and then the target circle center coordinates and the target radius are used to generate an obstacle avoidance circle, so that the robot walks along the obstacle avoidance circle until the obstacle is avoided.
[0004] By executing steps 1 to 3, when the robot walks to the point where the minimum distance between the side of its body and the position point where the absolute coordinates of the obstacle are located reaches the preset obstacle avoidance distance, the coordinates of the obstacle to be avoided are screened out, and the target circle center coordinates and the target radius are calculated based on the coordinates, an obstacle avoidance circle is generated, and the trajectory required for the robot to avoid the obstacle is formed. Even if the outline of the obstacle falling within the detection range of the line laser sensor is incomplete, the robot can still use the screened coordinates of the obstacle to be avoided to calculate and generate an obstacle avoidance circle, complete the positioning planning of the obstacle avoidance area within the detection range of the line laser sensor, so that the robot starts to walk along the obstacle avoidance circle and is closer to the obstacle surrounded by the obstacle avoidance circle, thereby reducing the untraversed area between the robot and the obstacle to be avoided (when the robot is a sweeping robot, it is regarded as reducing the missed scanning area), and reducing the probability of the robot's body side scratching the obstacle during the obstacle avoidance process.
[0005] Furthermore, in step 2, the absolute coordinates of the obstacle whose minimum distance from the robot's body side reaches the preset obstacle avoidance distance are marked as obstacle avoidance trigger coordinates, so that the position point where the obstacle avoidance trigger coordinates are located becomes the position point closest to the robot's body side in the obstacle contour; wherein, the position point where the obstacle absolute coordinates are located is used to connect to form the obstacle contour, and the obstacle coordinates to be avoided include the obstacle avoidance trigger coordinates. Then, the robot starts searching for the coordinates of the obstacle to be avoided from the position point where the obstacle avoidance trigger coordinates are located, so that the robot is relatively close to the obstacle when walking around the obstacle contour where the position point where the obstacle avoidance trigger coordinates are located.
[0006] Furthermore, in step 1, when the robot uses a line laser to detect the outline of the same obstacle during walking, the number of absolute coordinates of the obstacles marked by the robot in the same walking direction and their locations do not change with the change of the distance traveled by the robot.
[0007] Furthermore, the minimum distance between the side of the robot's body and the point where the absolute coordinates of the obstacle are located is used to represent the minimum spacing of the line between the edge of the robot on the side leaning toward the obstacle and the point where the absolute coordinates of the obstacle are located within the detection range of the line laser sensor, so that: when the distance between the point where the absolute coordinates of the obstacle are located and the alignment point is the smallest, the minimum distance between the side of the robot's body and the point where the absolute coordinates of the obstacle are located is the distance between the point where the absolute coordinates of the obstacle are located and the alignment point, wherein the intersection of the line between the center of the body and the point where the absolute coordinates of the obstacle are located and the edge of the robot on the side leaning toward the obstacle is recorded as the alignment point.
[0008] Further, in step 3, the method for calculating the target circle center coordinates and the target radius based on the coordinates of the obstacle to be circumvented includes: establishing a robot coordinate system with the robot body center as the origin and the straight line direction from the body center to the position point where the obstacle avoidance trigger coordinates are located as the positive direction of the horizontal coordinate axis; then transforming the coordinates of the obstacle to be circumvented into the robot coordinate system, and then extracting the maximum horizontal coordinate, the minimum horizontal coordinate, the maximum vertical coordinate, and the minimum vertical coordinate from the coordinates transformed into the robot coordinate system, wherein the obstacle avoidance trigger coordinates are transformed into the robot coordinate system. The horizontal coordinate is the minimum horizontal coordinate; then the difference between the maximum vertical coordinate and the minimum vertical coordinate is marked as the width of the obstacle to be circumvented; the sum of half of the width of the obstacle to be circumvented and the minimum horizontal coordinate is marked as the horizontal coordinate of the center of the target circle, and the sum of half of the width of the obstacle to be circumvented and the minimum vertical coordinate is marked as the vertical coordinate of the center of the target circle, forming the center coordinate of the obstacle circumventing circle; wherein the horizontal coordinate of the center of the target circle and the vertical coordinate of the center of the target circle form the target center coordinate; at the same time, the product of the square root of 2 and the width of the obstacle to be circumvented is marked as the target radius, forming the radius of the obstacle circumventing circle. In summary, the step 3 determines the coverage of the obstacle circumventing circle according to the maximum value information of the coordinates of the obstacle to be circumvented, and the distance between the obstacle circumventing circle calculated and generated based on the coordinates of the obstacle to be circumvented and the edge of the robot on the side of the obstacle to be circumvented can be made smaller, so that the robot starts to walk along the obstacle circumventing circle close to the obstacle to be circumvented, reducing the missed traversal area, and can also effectively reduce unnecessary avoidance, and improve the robot's obstacle circumventing walking efficiency.
[0009] Furthermore, before executing step 3, a minimum rectangular frame is set to surround the coordinates of the obstacle to be circumvented, and the obstacle circumvention circle generated in step 3 is executed to surround the minimum rectangular frame to surround the outline marked in the obstacle to be circumvented; wherein, the minimum rectangular frame has at least one corner point located on the edge of the obstacle circumvention circle. Therefore, the minimum rectangular frame provides a preliminary obstacle avoidance area for the robot, and then, on the basis of determining the minimum rectangular frame, the center (target center coordinates) and radius (target radius) of the obstacle circumvention circle are calculated using the coordinates of the obstacle to be circumvented, and then the obstacle circumvention circle generated in step 3 is executed to surround the minimum rectangular frame, and surround the outline of the obstacle to be circumvented detected by the line laser, thereby reducing the probability of the robot's body side scratching the obstacle to be circumvented when walking along the obstacle circumvention circle.
[0010] Furthermore, the minimum area rectangular frame has one side parallel to the horizontal axis of the robot coordinate system and one side parallel to the vertical axis of the robot coordinate system; the robot marks the difference between the maximum horizontal coordinate and the minimum horizontal coordinate as the length of the minimum area rectangular frame, and at the same time, the robot marks the difference between the maximum vertical coordinate and the minimum vertical coordinate as the width of the minimum area rectangular frame. Thus, the rectangle surrounding the coordinates of the obstacle to be circumvented is determined in the robot coordinate system.
[0011] Furthermore, the method for setting the minimum rectangular frame includes: the robot sets a straight line that passes through the coordinate position of the obstacle to be circumvented and is parallel to the longitudinal axis of the robot coordinate system as a first boundary, and then in the first boundary, marks a line segment between a point whose longitudinal coordinate is equal to the maximum longitudinal coordinate and a point whose longitudinal coordinate is equal to the minimum longitudinal coordinate as a first longitudinal edge; wherein both endpoints of the first longitudinal edge fall within the obstacle circumvention circle; the robot sets a straight line that is perpendicular to the transverse axis of the robot coordinate system and whose distance from the first boundary is the difference between the maximum transverse coordinate and the minimum transverse coordinate along the positive direction of the transverse axis of the robot coordinate system as a first second boundary, and then in the first and second boundaries, marks a line segment between a point whose longitudinal coordinate is equal to the maximum transverse coordinate and the minimum transverse coordinate. In the boundary, mark the line segment between the point whose ordinate is equal to the maximum ordinate and the point whose ordinate is equal to the minimum ordinate as the second longitudinal edge; connect the endpoint of the first longitudinal edge in the positive direction of the ordinate axis of the robot coordinate system and the endpoint of the second longitudinal edge in the positive direction of the ordinate axis of the robot coordinate system, and then mark the connected line segment as the first transverse edge; and connect the endpoint of the first longitudinal edge in the negative direction of the ordinate axis of the robot coordinate system and the endpoint of the second longitudinal edge in the negative direction of the ordinate axis of the robot coordinate system, and then mark the connected line segment as the second transverse edge; then mark the rectangle surrounded by the first longitudinal edge, the second longitudinal edge, the first transverse edge and the second transverse edge as the minimum rectangular frame. Ensure that the robot is relatively close to the obstacle when it initially walks around the obstacle, reduce the missed traversal area, and effectively reduce unnecessary avoidance.
[0012] Furthermore, in step 3, the method of generating an obstacle avoidance circle using the target circle center coordinates and the target radius includes: taking the target circle center coordinates as the center of the circle, rotating around the center of the circle for one circle according to the target radius to generate a circular trajectory, and then marking the circular trajectory as the obstacle avoidance circle; if the robot walks along the obstacle avoidance circle, the robot configures the target radius as the turning radius required for the robot to walk along the obstacle avoidance circle, and configures the target circle center coordinates as the turning center required for the robot to walk along the obstacle avoidance circle. The obstacle avoidance circle surrounds the coordinates of the obstacle to be avoided selected by the above technical solution, so that the robot walks along the contour of one side of the obstacle avoidance circle until it bypasses the obstacle to be avoided, thereby reducing the probability of collision between the robot and the obstacle to be avoided.
[0013] Furthermore, in step 2, the method of selecting the coordinates of the obstacle to be circumvented from the marked absolute coordinates of the obstacle includes: starting from the position point of the obstacle bypass trigger coordinate, traversing the position points of the obstacle absolute coordinates marked in step 1, calculating the distance between the position points of the two obstacle absolute coordinates traversed successively, and obtaining the distance between adjacent points; then storing the two points whose adjacent point distance is less than a preset threshold into the same point set, each point set is a set of the position points of the obstacle absolute coordinates contained in each obstacle; then marking the point set containing the position point of the obstacle bypass trigger coordinate as the point set to be circumvented, then marking the coordinates of all points in the point set to be circumvented as the coordinates of the obstacle to be circumvented, and determining to select the coordinates of the obstacle to be circumvented from the marked absolute coordinates of the obstacle. Obstacle attribution classification is achieved for the position points of the obstacle absolute coordinates marked in step 1, and the identification and positioning of the detected contours of at least two obstacles are preliminarily completed.
[0014] Furthermore, starting from the obstacle avoidance trigger coordinates, in the process of traversing the obstacle absolute coordinates marked in step 1 in different directions and calculating the distances of adjacent points, if the adjacent point distances calculated in all directions for the first time are greater than or equal to a preset threshold, the currently obtained point set including the obstacle avoidance trigger coordinates is marked as the obstacle avoidance point set, thereby improving the search efficiency of the obstacle coordinates to be avoided.
[0015] Furthermore, when the robot walks to the point where the minimum distance between the side of its body and the absolute coordinates of the obstacle reaches the preset obstacle avoidance distance, a candidate frame is set with the point where the obstacle avoidance trigger coordinates are located as the center of the rectangle, so that the coordinates of the obstacles to be avoided are screened out in the candidate frame and form a set of points to be avoided; wherein the detection range of the line laser sensor overlaps with the candidate frame, thereby narrowing the search range of the coordinates of the obstacles to be avoided.
[0016] Furthermore, the method for setting the candidate frame includes: taking the obstacle avoidance trigger coordinate location point as the center of the rectangle, marking the straight line direction from the robot's body center to the obstacle avoidance trigger coordinate location point as the first detection direction, and marking the vertical upward direction of the line connecting the robot's body center and the obstacle avoidance trigger coordinate location point as the second detection direction, and marking the vertical downward direction of the line connecting the robot's body center and the obstacle avoidance trigger coordinate location point as the third detection direction; setting the distance between the robot's body center and the obstacle avoidance trigger coordinate location point as the reference side length; starting from the center of the rectangle, in the first detection direction and its In the opposite direction, each longitudinal boundary is set at a distance of one body radius from the center of the rectangle and perpendicular to the first detection direction; starting from the center of the rectangle, in the second detection direction and the third detection direction, each transverse boundary is set at a distance of one body radius from the center of the rectangle and parallel to the first detection direction; then the rectangle formed by the intersection of each longitudinal boundary and each transverse boundary is marked as the candidate frame to enclose the absolute coordinates of the obstacle marked corresponding to at least one obstacle detected by the line laser sensor, and support the definition of a minimum area rectangular frame inside the candidate frame that encloses the location point of the coordinates of the obstacle to be circumvented. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flowchart of a method for constructing a robot obstacle avoidance circle based on line laser data provided by one embodiment of the present application.
[0018] Figure 2 The present invention provides a schematic side view of the layout of a line laser sensor in a robot according to an embodiment of the present application.
[0019] Figure 3 This is a schematic top view of a robot 100 using a line laser sensor to form a detection range 102 according to an embodiment of the present application. The walking direction of the robot 100 is indicated by the direction of the arrow P1.
[0020] Figure 4 This is a schematic diagram of a robot provided by an embodiment of the present application marking a partial outline of obstacle #1 detected by a line laser sensor onto a plane map.
[0021] Figure 5 This is a schematic diagram of an embodiment of the present application, in which a robot moves in the direction of arrow P1 and detects using a line laser sensor, and simultaneously marks obstacles #1 and #2 within the detection range of the line laser sensor. Figure 5 In the example, a candidate box 103 is used to surround all the marked black cells, wherein the white cell 104 adjacent to the black square is the center of the candidate box 103 .
[0022] Figure 6is a schematic diagram of an embodiment of the present application providing a robot selecting obstacle #1 from obstacle #1 and obstacle #2 as an obstacle to be circumvented in the current scene; Figure 6 In FIG. 1 , all the black cells and the white cells 104 marked in obstacle #1 constitute the outline of obstacle #1 marked by the robot.
[0023] Figure 7 FIG. 1 is a schematic diagram of using a rectangular frame ABCD to enclose the coordinates of the obstacle to be circumvented, provided in one embodiment of the present application.
[0024] Figure 8 1 is a schematic diagram of an obstacle avoidance circle 105 generated by a robot according to an embodiment of the present application. Implementation
[0025] In order to more clearly illustrate the present invention, specific embodiments are given below for further explanation. It should be understood that when used in the present application, the term "comprising" indicates the existence of described features, integral bodies, steps, operations, elements and / or components, but does not exclude the existence or addition of one or more other features, integral bodies, steps, operations, elements, components and / or their sets. It should also be understood that the term "and / or" used in the present application refers to any combination and all possible combinations of one or more of the items listed in association, and includes these combinations.
[0026] In the description of this application, the directions or positional relationships of "left", "right", "upper", and "lower" are based on the attached Figure 4 To Attachment Figure 8 It should be understood that these directional terms are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present application.
[0027] In the description of this application, "front" represents the direction of the transmitting probe of the line laser sensor, "front" is defined as the direction of travel of the machine, "rear" represents the direction opposite to "front", and "left" can represent the left side or the side adjacent to the direction of travel. Figure 4 To Attachment Figure 8 The left side of the obstacle indicated by "right" represents the right side or the side of the obstacle in the walking direction corresponding to "left". Figure 4 To Attachment Figure 8 Indicates the right side of the obstacle.
[0028] The present application discloses a method for constructing a robot obstacle avoidance circle based on line laser data. The execution subject of the method for constructing a robot obstacle avoidance circle can be a robot with data processing, network communication and program running functions. A line laser sensor is installed on the front side of the robot body, for example, Figure 2It is a side view schematic diagram of the arrangement of the line laser sensor provided by the present application in the robot. The line laser sensor can obtain the plane information of the object; the installation height of the line laser sensor in the body is about 45mm from the ground, so the output obstacle height information is up to 45mm; when the line laser hits the obstacle, the line laser sensor will output the three-dimensional coordinate information of the obstacle relative to the robot. The detection range of the line laser sensor is formed by a laser line rotating around its emission point in a plane at a certain angle, see Figures 2 to 3 The detection range of the line laser sensor is projected on the walking plane of the robot to form a triangular area 102, which is specifically formed by projecting a line laser emitted by the line laser sensor and tilted toward the ground onto the ground and marked in the grid map. However, the detection range of the line laser is limited, and it can only identify the outline of one side of the same obstacle during walking in one direction: the triangular area 102 encounters an obstacle during scanning the ground and the field of view changes so that the robot can perceive the three-dimensional coordinate information of the obstacle relative to the robot. When detecting the position of the obstacle, it is necessary to delete the point cloud data of the scanned ground part in advance.
[0029] Line laser sensors all emit lasers and form light spots on the detected objects, and obtain target information by detecting the echo signal of the emitted laser beam. When the robot detects the position of an obstacle in front of it, the laser reflected from the obstacle surface where the obstacle is located will be received by the camera installed in the line laser sensor. Since the laser light source is a linear light source, as the robot moves, the laser will illuminate the surface of the obstacle at a certain height. The laser hits the surface of the obstacle and then reflects to the camera. The distance of the obstacle can be calculated based on the returned laser, or the returned laser point cloud can be used for fitting processing to obtain straight line segments in various directions or contour lines of various curvatures that represent the position of the obstacle. Among them, when a vertical line laser is emitted, the obstacle information presented to the robot will become continuous points. These points are connected to form a line that presents the contour of the obstacle surface in the vertical direction, from which the height information and two-dimensional coordinate information of the laser point cloud can be extracted.
[0030] like Figure 1 As shown, the robot obstacle avoidance circle construction method based on line laser data includes: Step 1: When the robot is walking, start the line laser sensor to emit a line laser diagonally downward in the direction of the robot's walking, obtain line laser data, and then mark the absolute coordinates of the obstacle based on the line laser data, and then proceed to step 2. Figure 2 and Figure 3 It can be seen that the area between the line laser emitted by the line laser sensor and tilted toward the ground and the ground is represented by the triangle area 102 shown in the figure. Figure 4As shown, the outline of obstacle #1 that is biased toward the front side of the robot appears in the triangular area 102, and only the outline filled with black cells in the figure can be recognized by the robot. The line laser data is obtained, and it is determined that a part of obstacle #1 is detected. The absolute coordinates of the obstacle can be marked according to the currently obtained line laser data, which can be regarded as marking the specific position of the corresponding obstacle outline on the grid map, which is specifically the result of converting the position coordinates of the obstacle relative to the machine from the local coordinate system to the global coordinate system or the laser coordinate system; however, the other parts of obstacle #1 are not marked, which may be that part of the line laser is blocked by the outline surface of the obstacle facing the robot, and the back of the obstacle cannot reflect the line laser back to the sensor, that is, it is not detected by the line laser sensor and is not marked in the grid map. Therefore, when the robot only extracts a part of the outline grid position occupied by the obstacle during the execution of step 1, the corresponding marked obstacle absolute coordinates only represent the coordinate information of a part of the outline of the obstacle within the detection range of the line laser sensor.
[0031] In order to prevent the need for continuous coordinate system transformation operations due to position changes during the robot's walking process, it is necessary to first convert the line laser data into the absolute coordinates of the obstacle, so that the marked absolute coordinates of the obstacle are the obstacle contour coordinates in the laser coordinate system or the obstacle contour coordinates in the global coordinate system, so that it is not affected by the robot coordinate system with the robot's body center as the origin, and the actual physical position of the obstacle contour is obtained and can be marked in the grid map.
[0032] Step 2: When the robot walks to the point where the minimum distance between the side of its body and the absolute coordinates of the obstacle reaches the preset obstacle avoidance distance, the coordinates of the obstacle to be avoided are selected from the marked absolute coordinates of the obstacle; then step 3 is executed. The coordinates of the obstacle to be avoided selected in step 2 can be obtained by Figure 8 The black cells and white cells in are represented and can be marked as obstacle grids and are surrounded by a rectangular box ABCD.
[0033] When the distance between the robot's position and the obstacle's absolute coordinates reaches the distance required to trigger obstacle avoidance, the machine may collect new obstacles through the line laser sensor. The corresponding marked obstacle absolute coordinates may come from different obstacles. Before bypassing the obstacle, step 2 needs to distinguish the obstacle where the obstacle absolute coordinates are located, obtain the obstacle to be bypassed, and extract the complete obstacle coordinates to be bypassed in the candidate box surrounding all the obstacle absolute coordinates (or the grids where they are located) marked successively. This can form a set of obstacle points to be bypassed, or it can be regarded as an obstacle grid set.
[0034] Step 3: Calculate the target circle center coordinates and target radius based on the coordinates of the obstacle to be circumvented, and then use the target circle center coordinates and target radius to generate an obstacle circumvention circle, so that the robot walks along the obstacle circumvention circle until it bypasses the obstacle. If the robot obtains line laser data reflected from a new obstacle during its walking along the obstacle circumvention circle and marks the new obstacle absolute coordinates based on the data, then repeat step 2 to screen out the new obstacle coordinates to be circumvented, and repeat step 3 to generate a new obstacle circumvention circle, then the robot walks along the new obstacle circumvention circle until it bypasses the new obstacle, thereby achieving continuous obstacle circumvention operation.
[0035] In step 3, an obstacle avoidance circle can be determined based on the rectangular information surrounding / framing the coordinates of the obstacle to be avoided, so as to improve the coverage accuracy and completeness of the obstacle portion in the obstacle contour. Furthermore, in order to ensure that the robot walks along the obstacle avoidance circle as close as possible to the obstacle to be avoided, when the robot walks to the point where the minimum distance between the side of its body and the absolute coordinate of the obstacle reaches a preset obstacle avoidance distance, the coordinates of the intersection of the line connecting the center of the body and the absolute coordinate of the obstacle and the side of the body that is biased toward the obstacle are configured as necessary parameters for calculating the target circle center coordinates and the target radius, so that the intersection coordinates are located on the side of the obstacle avoidance circle that is biased toward the detection range of the robot or line laser sensor.
[0036] By executing steps 1 to 3, when the robot walks to the point where the minimum distance between the side of its body and the position point where the absolute coordinates of the obstacle are located reaches the preset obstacle avoidance distance, the coordinates of the obstacle to be avoided are screened out, and the target circle center coordinates and the target radius are calculated based on the coordinates, an obstacle avoidance circle is generated, and the trajectory required for the robot to avoid the obstacle is formed. Even if the outline of the obstacle falling within the detection range of the line laser sensor is incomplete, the robot can still use the screened coordinates of the obstacle to be avoided to calculate and generate an obstacle avoidance circle, complete the positioning planning of the obstacle avoidance area within the detection range of the line laser sensor, so that the robot starts to walk along the obstacle avoidance circle and is closer to the obstacle surrounded by the obstacle avoidance circle, thereby reducing the untraversed area between the robot and the obstacle to be avoided (when the robot is a sweeping robot, it is regarded as reducing the missed scanning area), and reducing the probability of the robot's body side scratching the obstacle during the obstacle avoidance process.
[0037] In the step 2, the absolute coordinates of the obstacle whose minimum distance from the side of the robot's body reaches the preset obstacle avoidance distance are marked as obstacle avoidance trigger coordinates, so that the position point where the obstacle avoidance trigger coordinates are located becomes the position point in the obstacle outline that is closest to the side of the robot's body. It can be understood that the absolute coordinates of the obstacle whose minimum distance from the side of the robot's body reaches the preset obstacle avoidance distance are marked as the position point where the obstacle avoidance trigger coordinates are located, as the obstacle avoidance trigger point of the robot; wherein the obstacle avoidance trigger coordinates include an obstacle avoidance trigger horizontal coordinate and an obstacle avoidance trigger vertical coordinate.
[0038] If the obstacle avoidance trigger coordinates are represented in the grid map, it is represented as Figures 5 to 8 The white cell 104 in the figure can also be understood as the minimum distance between the obstacle contour where the obstacle avoidance trigger coordinates are located and the side of the body is the preset obstacle avoidance distance, wherein the obstacle absolute coordinates are used to connect to the obstacle contour, and the grid of the corresponding coordinates can also be marked in the grid map as the obstacle grid, and the obstacle coordinates to be avoided include the obstacle avoidance trigger coordinates. When the robot recognizes the obstacle avoidance trigger coordinates, it starts to filter out the obstacle coordinates to be avoided from the marked obstacle absolute coordinates, which is also the starting point for the robot to perform the obstacle avoidance action. The robot then starts to search for the obstacle coordinates to be avoided from the location of the obstacle avoidance trigger coordinates, so that the robot is closer to the obstacle when walking around the obstacle contour where the obstacle avoidance trigger coordinates are located.
[0039] Preferably, in step 1, when the robot uses a line laser to detect the outline of the same obstacle during walking, the number of absolute coordinates of the obstacles marked by the robot in the same walking direction and their locations do not change with the change of the distance traveled by the robot.
[0040] See also Figure 4 and Figure 5 It can be seen that the robot 100 walks along the direction of arrow P1 and approaches obstacle #1. Figure 4 In the figure, the obstacle outline covered by the detection range 102 of the line laser sensor is filled with black cells, specifically in Figure 4 The left side outline of obstacle #1 is filled in the grid map in sequence. Each black cell is marked as an obstacle grid, and is a grid whose position information and marking type attributes are recognized by the robot. A total of 15 black cells are marked, that is, 15 obstacle grids are marked. The coordinates of each obstacle grid can be converted into the absolute coordinates of the obstacle through coordinate system conversion. Accordingly, the position point of the absolute coordinate of the obstacle can be represented by a black cell in the grid map. It can be understood that the coordinate value will change due to the coordinate system conversion, but the position point of the coordinate value or the grid position occupied before and after the coordinate system conversion does not change. There is a partial area in obstacle #1 that falls within the detection range 102 of the line laser sensor, but it cannot be recognized by the robot due to the height of the obstacle at the black cell.
[0041] Figure 5 The position to which the robot 100 moves along the direction of arrow P1 is relative to Figure 4 The robot 100 in FIG. 1 walks along the direction of arrow P1 to a position closer to obstacle #1; Figure 4 , Figure 5The detection range 102 of the centerline laser sensor covers the lower left outline of obstacle #2 and is filled with black cells.
[0042] Figure 4 The robot 100 is at a certain height occupied by the obstacle at the obstacle grid marked in obstacle #1. The installation height of the line laser sensor is preferably 45 mm, and the line laser sensor is configured to emit a line laser obliquely downward in the direction of the robot's walking. Figure 5 The robot 100 is relative to Figure 4 The robot 100 in the figure is closer to obstacles #1 and #2, but the high shielding effect of obstacle #1 causes the line laser sensor to be unable to project the line laser to Figure 5 If the detection range 102 of the line laser sensor is in the newly covered area within obstacle #1, the robot cannot collect the line laser data reflected from the newly covered area, nor can it mark the new obstacle grid within obstacle #1. Figure 5 The upper left corner of obstacle #1 that falls within detection range 102 is not filled with black cells and cannot be marked as an obstacle grid; Figure 5 When the robot 100 approaches obstacle #1 so that the minimum distance between the robot's body side (the right side contour of the robot's body) and the obstacle's absolute coordinate position point (the position point marked as an obstacle grid in the left side contour of obstacle #1) reaches the preset obstacle avoidance distance, there is a black cell in the left side contour of obstacle #1 that is configured as a white cell 104, and the position point filled with the white cell 104 (regarded as the center of the white cell 104) is the obstacle's absolute coordinate position point whose minimum distance from the robot's body side reaches the preset obstacle avoidance distance, so the white cell 104 is still marked as an obstacle grid. Figure 5 In the grid map of obstacle #1, the number of obstacle grids marked in the outline of obstacle #1 is still 15, which is Figure 4 The number and location of the obstacle grids marked in obstacle #1 have not changed. Figure 4 and Figure 5 From the number and location of cells marked as obstacle grids, it can be seen that when the robot is walking, when the robot uses line laser to detect the outline of the same obstacle, the number of absolute coordinates of obstacles marked by the robot in the same walking direction and their locations do not change with the change of the robot's walking distance.
[0043] Specifically, the minimum distance between the side of the robot's body and the point where the absolute coordinates of the obstacle are located is used to represent the minimum spacing of the line between the edge of the robot on the side that is biased toward the obstacle and the point where the absolute coordinates of the obstacle are located within the detection range of the line laser sensor, so that: when the distance between the point where the absolute coordinates of the obstacle are located and the alignment point is the minimum, the minimum distance between the side of the robot's body and the point where the absolute coordinates of the obstacle are located is the distance between the point where the absolute coordinates of the obstacle are located and the alignment point, wherein the intersection of the line between the center of the body and the point where the absolute coordinates of the obstacle are located and the edge of the robot on the side that is biased toward the obstacle is recorded as the alignment point, such as Figure 5 As shown, the center of the aircraft is represented by point O, and the position point where the absolute coordinates of the obstacle are located is represented by the position point filled with black cells and white cells 104 in the left outline of obstacle #1. Figure 5 The minimum distance between the edge of the robot on the side facing obstacle #1 and the point where the absolute coordinates of the obstacle are located is Figure 5 The distance between the edge of the robot on the side deviating from the obstacle #1 and the position point filled with the white cell 104. If the alignment point U is introduced, it is expressed as the distance between the alignment point U and the position point filled with the white cell 104. The position point filled with the white cell 104 belongs to the position point where the absolute coordinates of the obstacle are located, and is represented by the center of the white cell 104; the alignment point U is the intersection of the line connecting the body center O and the position point filled with the white cell 104 and the edge of the robot on the side deviating from the obstacle #1.
[0044] In some embodiments, Figure 5 As shown, the projection shape of the robot 100 on the walking surface is a circle, and the minimum distance between the robot's body side and the absolute coordinate position of the obstacle is the difference between the distance between the absolute coordinate position of the obstacle closest to the body center and the body center and the body radius. Figure 5 In the figure, the center of the robot is represented by point O, and the intersection of the line connecting the center of the robot and the position point filled in the white cell 104 and the edge of the robot on the side biased towards obstacle #1 is represented by alignment point U. Figure 5 The minimum distance between the edge of the robot on the side leaning towards the obstacle and the point where the absolute coordinates of the obstacle are located is Figure 5 The distance between the alignment point U and the position point filled with the white cell 104 is equal to the difference between the distance between the position point filled with the white cell 104 and the center O of the body and the radius of the body.
[0045] It should be noted that the absolute coordinates of the obstacle may be configured as the coordinates of the obstacle to be circumvented in step 2 and a coordinate system conversion will occur, but the position point of the absolute coordinates of the obstacle before and after the coordinate system conversion (the position occupied by the black cell or white cell filled with it) does not change, and it is also understood that the grid position occupied in the grid map does not change, but the coordinate value changes with the change of the coordinate system origin and the direction of the coordinate axis.
[0046] As an embodiment, in step 3, the method for calculating the target circle center coordinates and the target radius based on the coordinates of the obstacle to be circumvented includes: taking the robot body center as the origin, and taking the straight line direction from the body center to the position point where the obstacle circumvention trigger coordinates are located as the positive direction of the horizontal coordinate axis, establishing the robot coordinate system, such as Figure 8 As shown, the origin of the robot coordinate system is the body center O, and the positive direction of the X-axis of the robot coordinate system is the direction from the body center O to the center of the white cell 104 .
[0047] Then, the coordinates of the obstacle to be circumvented are converted to the robot coordinate system established above. Specifically, if the coordinates of the obstacle to be circumvented are set in the global coordinate system (existing in the grid map in the form of absolute coordinates), the robot converts the coordinates of the obstacle to be circumvented to the robot coordinate system based on the conversion matrix and translation vector between the global coordinate system and the robot coordinate system to obtain the relative coordinates of the obstacle to be circumvented. It should be noted that the conversion matrix between the global coordinate system and the robot coordinate system represents the rotation operation required to be performed from the global coordinate system to the robot coordinate system. The rotation angle required for the rotation operation is the angle between the positive direction of the horizontal axis of the global coordinate system and the positive direction of the horizontal axis of the robot coordinate system, preferably the angle between the straight line direction from the center of the body to the position of the obstacle trigger coordinate and the walking direction marked by the robot in the global coordinate system; as for how to substitute into the conversion matrix, it is a rotation matrix construction method familiar to those skilled in the art, which will not be repeated here. In addition, the translation vector between the global coordinate system and the robot coordinate system adopts the coordinate offset between the origin of the global coordinate system and the origin of the robot coordinate system, including the offset of the horizontal coordinate and the offset of the vertical coordinate.
[0048] Then, from the coordinates converted into the robot coordinate system, that is, from the relative coordinates to be avoided, the maximum horizontal coordinate, the minimum horizontal coordinate, the maximum vertical coordinate, and the minimum vertical coordinate are extracted, wherein the horizontal coordinate converted from the obstacle avoidance trigger coordinates into the robot coordinate system is the minimum horizontal coordinate, such as Figure 7 and 8As shown, the obstacle avoidance trigger coordinate position point is located in the cell 104. In the robot coordinate system, the horizontal coordinate of point B and the horizontal coordinate of point C are both the maximum horizontal coordinates; the center coordinate of the white cell (which can be understood as the grid coordinate of the white cell), the horizontal coordinate of point A and the horizontal coordinate of point D are all the minimum horizontal coordinates, so as to shorten the distance between the robot that subsequently performs obstacle avoidance and the obstacle where the white cell is located; the vertical coordinate of point D and the vertical coordinate of point C are both the maximum vertical coordinates; the vertical coordinate of point A and the vertical coordinate of point B are both the minimum vertical coordinates, thereby forming the corner points of the rectangle surrounding the relative coordinates of the obstacle to be avoided.
[0049] Then the difference between the maximum ordinate and the minimum ordinate is marked as the width of the obstacle to be circumvented, which can be expressed as Figures 4 to 6 The size of the outline of the black cell filled in obstacle #1 is used to plan the obstacle avoidance circle surrounding the obstacle avoidance area. Then the sum of half the width of the obstacle to be avoided and the minimum horizontal coordinate is marked as the horizontal coordinate of the center of the target circle, and the sum of half the width of the obstacle to be avoided and the minimum vertical coordinate is marked as the vertical coordinate of the center of the target circle to form the coordinates of the center of the obstacle avoidance circle. The distribution position of the center of the obstacle avoidance circle is shown as follows: Figure 8 As shown in the center S of the circle; if the coordinates of point A in the robot coordinate system are expressed as (Xmin, Ymin), the coordinates of point B in the robot coordinate system are expressed as (Xmax, Ymin), the coordinates of point D in the robot coordinate system are expressed as (Xmin, Ymax), and the coordinates of point C in the robot coordinate system are expressed as (Xmax, Ymax), then the width width of the obstacle to be circumvented is equal to Ymax-Ymin. Therefore, the coordinates of the center of the target circle are expressed as (Xmin+width / 2, Ymin+width / 2) in the robot coordinate system; at the same time, the product of the square root of 2 and the width width of the obstacle to be circumvented is marked as the target radius, which is equivalent to calculating the diagonal length of the target rectangle when the length and width of the target rectangle are both the width width of the obstacle to be circumvented, forming the radius of the obstacle circumvention circle. On this basis, a line segment with a length of the target radius is used, and one end of the line segment is rotatably set at the target center coordinate, and rotates around the point S where the target center coordinate is located. The other end of the line segment forms a closed circular trajectory as the obstacle circumvention circle, as shown in FIG. Figure 8 As shown in circle 105.
[0050] In summary, step 3 determines the coverage of the obstacle avoidance circle according to the maximum value information of the coordinates of the obstacle to be avoided. The distance between the obstacle avoidance circle calculated and generated based on the coordinates of the obstacle to be avoided and the edge of the robot on the side of the obstacle to be avoided can be made smaller, so that the robot can get close to the obstacle to be avoided when it starts to walk along the obstacle avoidance circle, thereby reducing the missed traversal area, effectively reducing unnecessary avoidance, and improving the robot's obstacle avoidance walking efficiency.
[0051] Before executing step 3, set a minimum rectangular frame that surrounds the coordinates of the obstacle to be circumvented, such as Figure 7 The rectangular box ABCD in the figure; the rectangular box with the smallest area surrounding the coordinates of the obstacle to be circumvented actually surrounds the outline of the obstacle to be circumvented detected by the line laser. Figure 6 and Figure 7 It can be seen that obstacle #1 filled with black cells and white cells (corresponding to the location of the obstacle avoidance trigger coordinates) is the obstacle to be avoided, and the area filled with black cells and white cells (corresponding to the location of the obstacle avoidance trigger coordinates) is the outline of the obstacle to be avoided detected by the line laser sensor. Among the rectangular boxes surrounding the areas of black cells and white cells (corresponding to the location of the obstacle avoidance trigger coordinates), the one with the smallest area is Figure 7 The rectangular box ABCD only surrounds the detected outline of an obstacle, where the detected outline can be marked in the grid map and filled with cells at a specific location.
[0052] In this embodiment, the obstacle avoidance circle generated in step 3 surrounds the minimum area rectangular frame to surround the marked outline of the obstacle to be avoided, that is, the minimum area rectangular frame surrounds the location point where the coordinates of the obstacle to be avoided are located. Among them, the minimum area rectangular frame has at least one corner point located on the edge of the obstacle avoidance circle. Preferably, the coordinate position of the obstacle to be circumvented does not exist at the corner point position of the minimum area rectangular frame. When the coordinate position of the obstacle to be circumvented does not appear at the corner point position of the minimum area rectangular frame, the coordinate position of the obstacle to be circumvented surrounded by the minimum area rectangular frame does not appear on the edge of the obstacle circumvention circle. Therefore, the minimum area rectangular frame provides a preliminary obstacle avoidance area for the robot. Then, on the basis of determining the minimum area rectangular frame, the center (target center coordinates) and radius (target radius) of the obstacle circumvention circle are calculated using the coordinates of the obstacle to be circumvented. The obstacle circumvention circle generated in step 3 is executed to surround the minimum area rectangular frame, and surround the outline of the obstacle to be circumvented detected by the line laser, thereby reducing the probability of the side of the robot body scratching the obstacle to be circumvented when the robot walks along the obstacle circumvention circle.
[0053] In some embodiments, Figure 8 The circle 105 in the figure just surrounds the rectangular frame ABCD, the corner points A and D of the rectangular frame ABCD are both located at the edges of the circle 105, and the circle 105 only surrounds the outline of an obstacle detected by the line laser. The black cells and white cells marked as obstacle grids in the rectangular frame ABCD do not appear at the four corner points of the rectangular frame ABCD. The black cells and white cells marked as obstacle grids do not appear at the edge of the circle 105. When the robot starts to walk along the arc AD, even if it is relatively close to the obstacle to be circumvented, the side of the robot will not scratch the obstacle to be circumvented.
[0054] In this embodiment, the rectangular frame with the smallest area has one side parallel to the horizontal axis of the robot coordinate system, and also has one side parallel to the vertical axis of the robot coordinate system; Figure 7 and Figure 8 As shown, the rectangular frame with the smallest area is rectangular frame ABCD, and the robot marks the difference between the maximum horizontal coordinate and the minimum horizontal coordinate as the length of the rectangular frame with the smallest area, and the difference between the maximum horizontal coordinate and the minimum horizontal coordinate is equal to the length of the line segment AB shown in the figure; at the same time, the robot marks the difference between the maximum vertical coordinate and the minimum vertical coordinate as the width of the rectangular frame with the smallest area, and the difference between the maximum vertical coordinate and the minimum vertical coordinate is equal to the length of the line segment AD shown in the figure. Thus, the rectangle surrounding the coordinates of the obstacle to be circumvented is determined in the robot coordinate system.
[0055] Specifically, the method for setting the minimum rectangular frame is as follows: Figure 7 and Figure 8 As shown, including: The robot sets the straight line passing through the coordinate position of the obstacle to be circumvented and parallel to the ordinate axis of the robot coordinate system as the first boundary, which corresponds to the straight line passing through the white cell 104 shown in the figure and parallel to the Y axis of the robot coordinate system; then in the first boundary, the line segment between the point whose ordinate is equal to the maximum ordinate and the point whose ordinate is equal to the minimum ordinate is marked as the first longitudinal edge, which corresponds to Figure 7 and Figure 8 In the first boundary, the point whose ordinate is equal to the maximum ordinate is point D, the point whose ordinate is equal to the minimum ordinate is point A, the first longitudinal edge is line segment AD, and the first longitudinal edge AD can be marked, wherein both endpoints of the first longitudinal edge fall on the edge of the obstacle avoidance circle, corresponding to Figure 8 In the embodiment, both end points of the first longitudinal side AD fall on the edge of the obstacle avoidance circle 105.
[0056] The robot sets a straight line perpendicular to the abscissa axis of the robot coordinate system and whose distance from the first boundary is the difference between the maximum abscissa and the minimum abscissa as the first second boundary along the positive direction of the abscissa axis of the robot coordinate system, corresponding to a straight line perpendicular to the X-axis and having a coordinate offset of (Xmax-Xmin) relative to the first longitudinal edge AD in the positive direction of the X-axis; and then, in the first second boundary, a line segment between a point whose longitudinal coordinate is equal to the maximum longitudinal coordinate and a point whose longitudinal coordinate is equal to the minimum longitudinal coordinate is marked as the second longitudinal edge, corresponding to Figure 7 and Figure 8 , in the first second boundary, the point whose ordinate is equal to the maximum ordinate is point C, the point whose ordinate is equal to the minimum ordinate is point B, the second longitudinal edge is line segment BC, the second longitudinal edge BC can be marked, and both endpoints of the second longitudinal edge do not fall on the edge of the obstacle avoidance circle but fall within the area surrounded by the obstacle avoidance circle; In addition, the endpoint of the first longitudinal edge in the positive direction of the longitudinal axis of the robot coordinate system is connected to the endpoint of the second longitudinal edge in the positive direction of the longitudinal axis of the robot coordinate system, and then the connected line segment is marked as the first transverse edge, corresponding to Figure 7 and Figure 8 , the endpoint of the first longitudinal side AD in the positive direction of the longitudinal axis of the robot coordinate system is point D, the endpoint of the second longitudinal side BC in the positive direction of the longitudinal axis of the robot coordinate system is point C, and the first transverse side CD is obtained by connecting point C and point D. In addition, the endpoint of the first longitudinal side in the negative direction of the longitudinal axis of the robot coordinate system and the endpoint of the second longitudinal side in the negative direction of the longitudinal axis of the robot coordinate system are connected, and the connected line segment is marked as the second transverse side, corresponding to Figure 7 and Figure 8 The endpoint of the second longitudinal side AD in the negative direction of the longitudinal axis of the robot coordinate system is point A, and the endpoint of the second longitudinal side BC in the negative direction of the longitudinal axis of the robot coordinate system is point B. Connect point A and point B to obtain the second transverse side AB.
[0057] Then the rectangle formed by the first longitudinal side, the second longitudinal side, the first transverse side and the second transverse side is marked as the rectangular frame with the smallest area, corresponding to Figure 7 and Figure 8 The rectangular box ABCD in the figure shows, schematically, the coordinates of the obstacle to be circumvented that falls within the rectangular box ABCD are (x_t, y_t), where Xmin is less than or equal to x_t, x_t is less than or equal to Xmax, Ymin is less than or equal to y_t, and y_t is less than or equal to Ymax.
[0058] In the rectangular frame ABCD, along the positive direction of the X-axis, the first longitudinal side AD is closer to the center of the body than the second longitudinal side BC. If it is confirmed that the outline of the obstacle to be circumvented is closer to the robot than the first longitudinal side AD, the robot will preferentially choose to walk along the arc of the obstacle circumvention circle 105 that is biased toward the first longitudinal side AD, to ensure that the robot is closer to the obstacle during the initial circumvention walking, thereby reducing the missed traversal area and effectively reducing unnecessary avoidance.
[0059] As an embodiment, in step 3, the method of generating an obstacle avoidance circle using the target circle center coordinates and the target radius includes: taking the target circle center coordinates as the center of the circle, rotating around the center of the circle for one circle according to the target radius to generate a circular trajectory, and then marking the circular trajectory as the obstacle avoidance circle; the obstacle avoidance circle surrounds the coordinates of the obstacle to be avoided selected in the above embodiment. By walking along the contour of one side of the obstacle avoidance circle, the robot can reduce the probability of collision between the robot and the obstacle to be avoided, and can smoothly avoid the obstacle to be avoided.
[0060] Implementable, such as Figure 8 As shown, a line segment with a length equal to the target radius is used, one end of the line segment is rotatably set at the position point S where the target circle center coordinates are located, and the line segment rotates around the position point S where the target circle center coordinates are located. The rotation trajectory of the other end of the line segment forms a closed circular trajectory, as shown in FIG. Figure 8 As shown in circle 105, as the obstacle avoidance circle, preferably, the coordinate position of the obstacle to be avoided does not appear on the edge of the obstacle avoidance circle, so that the arc edge of the obstacle avoidance circle is not occupied by the obstacle grid, so that the robot can walk along the left side contour of circle 105 to smoothly bypass obstacle #1, reducing the probability of collision between the side of the robot's body and obstacle #1.
[0061] It should be noted that if the robot walks along the obstacle circumvention circle, the robot configures the target radius as the turning radius required for the robot to walk along the obstacle circumvention circle, and configures the position point where the target circle center coordinates are located as the turning center required for the robot to walk along the obstacle circumvention circle. Therefore, the robot uses the circle as the obstacle circumvention area, and the robot walks along the obstacle circumvention circle by performing differential motion. The differential motion is that the speeds of the left and right driving wheels of the robot are inconsistent to generate a turning angle, which can guide the robot to approach the obstacle without deviating too much from the obstacle, and reduce unnecessary avoidance space for the obstacle that needs to be bypassed.
[0062] As an embodiment, in step 2, the method of selecting the coordinates of the obstacle to be circumvented from the marked absolute coordinates of the obstacle includes: Starting from the obstacle avoidance trigger coordinate position point, traverse the obstacle absolute coordinate position points marked in step 1, calculate the distance between the two obstacle absolute coordinate position points traversed successively, and obtain the adjacent point distance. Schematically, from Figure 5 The white cell 104 is used to traverse other black cells in sequence, and the distance between two adjacent cells marked as obstacle grids is calculated as the distance between the absolute coordinates of the two obstacles traversed successively, without making specific restrictions on the traversal direction.
[0063] Then, the two points whose adjacent point distance is less than the preset threshold are stored in the same point set. Each point set is a set of points where the absolute coordinates of the obstacle are located, which are contained in each obstacle. In order to distinguish at least one obstacle, in the process of traversing the points where the absolute coordinates of the obstacle are located, the point distances between the points are calculated in turn, recorded as the adjacent point distances, and the two points whose adjacent point distance is less than the preset threshold are stored in the same point set in real time. A set of all points contained in at least one obstacle can be obtained, corresponding to Figure 5 In the example, the set of black cells filled in the outline of obstacle #2 is recorded as the set of the absolute coordinates of the obstacles contained in obstacle #2, and the set of black cells and white cells 104 filled in the outline of obstacle #1 is recorded as the set of the absolute coordinates of the obstacles contained in obstacle #1, so as to classify the absolute coordinates of the obstacles marked in step 1, and preliminarily complete the identification and positioning of the detected outlines in obstacle #1 and obstacle #2.
[0064] Then mark the point set containing the obstacle avoidance trigger coordinates as the obstacle avoidance point set, mark the coordinates of all points in the obstacle avoidance point set as the obstacle coordinates to be avoided, and determine to select the obstacle coordinates to be avoided from the marked obstacle absolute coordinates. Figure 6 , the point containing the obstacle bypassing trigger coordinates is located in the white cell 104, and the point set containing the obstacle bypassing trigger coordinates is the set of the absolute coordinates of the obstacle contained in obstacle #1, which is specifically represented by the set of black cells and white cells 104 filled in the outline of obstacle #1. Preferably, after the set of points to be bypassed is determined, the remaining point sets can be retained or deleted. In the subsequent process of the robot walking along the obstacle bypassing circle surrounding the set of points to be bypassed, the coordinates of the new obstacle to be bypassed can be screened by executing steps 1 to 3 to generate an obstacle bypassing circle surrounding the marked outline of the new obstacle, so as to ensure the coverage rate of the gap between the robot and the obstacle to be bypassed.
[0065] In some embodiments, starting from the location point where the obstacle bypassing trigger coordinates are located, in the process of traversing the location points where the absolute coordinates of the obstacles marked in step 1 in different directions and calculating the distances of adjacent points, if the distances of adjacent points calculated in all directions for the first time are greater than or equal to a preset threshold, the currently obtained point set including the location point where the obstacle bypassing trigger coordinates are located is marked as the point set to be bypassed, so as to include the outline of the obstacle that the robot needs to bypass (the outline marked in the obstacle closest to the robot). In this embodiment, starting from the location point where the obstacle bypassing trigger coordinates are located, new location points are added to the same point set. When the distances of adjacent points calculated in all directions for the first time are greater than or equal to the preset threshold, the adjacent points in all directions are not stored in the same point set, and the same point set is marked as the point set to be bypassed, and the same point set is a point set including the location point where the obstacle bypassing trigger coordinates are located. The search efficiency of the coordinates of the obstacles to be bypassed is improved.
[0066] All directions here are various coordinate axis directions expanded from the position point where the obstacle avoidance trigger coordinates are located as the search starting point. For each obstacle absolute coordinate position point where the adjacent point distance needs to be calculated, the positions of the obstacle absolute coordinate positions include the position adjacent points in the positive direction of the X-axis, the position adjacent points in the negative direction of the X-axis, the position adjacent points in the positive direction of the Y-axis, and the position adjacent points in the negative direction of the Y-axis.
[0067] The preset threshold is preferably 2 cm. In the same point set, if the Euclidean distance between any two adjacent obstacle absolute coordinates is less than 2 cm, it can be regarded as the Euclidean distance between the corresponding two adjacent obstacle grids is less than 2 cm. In the grid map, starting from the location point where the obstacle avoidance trigger coordinates are located, the obstacle grid is searched in the surrounding adjacent grids. Whenever the Euclidean distance between two adjacent obstacle grids is less than 2 cm, they are classified as two elements of the set, until the Euclidean distance between the two obstacle grids searched successively in all directions is greater than 2 cm, and the marked obstacle edge point set is obtained.
[0068] As an embodiment, when the robot walks to the point where the minimum distance between the side of its body and the absolute coordinates of the obstacle reaches the preset obstacle avoidance distance, a candidate frame is set with the point where the obstacle avoidance trigger coordinates are located as the center of the rectangle, so that the coordinates of the obstacles to be avoided are screened out in the candidate frame and form a set of points to be avoided, thereby narrowing the search range of the coordinates of the obstacles to be avoided. Figure 5In the example, the grid where the coordinates of the obstacle to be circumvented are located is screened in the grid map covered by the candidate box 103. For example, the grid where the coordinates of the obstacle to be circumvented are located is screened from the black cells filled in the outline of obstacle #1 and the black cells filled in the outline of obstacle #2, which are marked as obstacle grids.
[0069] Preferably, the candidate box surrounds all or part of the marked absolute coordinate positions of the obstacles. The reason for selecting the absolute coordinate positions of some obstacles is that the absolute coordinate positions of these obstacles are distributed more concentratedly so that they can be regarded as being located in the same obstacle, and are closer to the robot than the absolute coordinate positions of other obstacles. Of course, if the obstacle that the robot needs to bypass (the area occupied by the obstacle to be bypassed) is large, the absolute coordinate positions of all the marked obstacles can be regarded as being located in the same obstacle.
[0070] exist Figure 5 In the robot walking scene shown, the preset obstacle avoidance distance is preferably 2 cm to 10 cm, which can accommodate multiple grid spacings. Figure 5 When the robot 100 approaches obstacle #1 so that the minimum distance between the robot's body side (the right side of the robot's body) and the obstacle's absolute coordinate position point (the position point marked as the obstacle grid in the left side of obstacle #1) reaches the preset obstacle avoidance distance, the white cell 104 in the left side of obstacle #1 indicates the obstacle's absolute coordinate position point whose minimum distance from the robot's body side reaches the preset obstacle avoidance distance. Then a candidate box 103 can be set with the white cell 104 as the rectangular center, and the candidate box 103 surrounds all the black cells filled in obstacles #1 and #2 (the grids where the obstacle's absolute coordinate position point is located).
[0071] If the detection range of the line laser sensor overlaps with the candidate frame, then the candidate frame can frame more obstacles or a more complete outline of the same obstacle compared to the rectangular frame surrounding the set of obstacle points to be bypassed. Figure 5 It can be seen that there is an overlapping area between the candidate frame 103 and the detection range 102 of the line laser sensor, which means that: while the candidate frame 103 frames part of the marked obstacle grid within the detection range 102 of the line laser sensor, the line laser sensor begins to detect new untraversed areas, so that the candidate frame 103 can frame as many obstacles as possible covered by the detection range 102.
[0072] Specifically, the method for setting the candidate frame includes: taking the position point of the obstacle avoidance trigger coordinate as the center of the rectangle, marking the straight line direction from the robot's body center to the position point of the obstacle avoidance trigger coordinate as the first detection direction, marking the vertical upward direction of the line connecting the robot's body center and the position point of the obstacle avoidance trigger coordinate as the second detection direction, and marking the vertical downward direction of the line connecting the robot's body center and the position point of the obstacle avoidance trigger coordinate as the third detection direction; Figure 5 As shown, the position point of the obstacle avoidance trigger coordinate is located at the center of the white cell 104, that is, the center of the rectangle; the straight line direction from the robot's body center O to the center of the white cell 104 is marked as the first detection direction. If the first detection direction is configured as the positive direction of the horizontal axis of the robot coordinate system, the second detection direction is configured as the positive direction of the vertical axis of the robot coordinate system, and the third detection direction is configured as the negative direction of the vertical axis of the robot coordinate system; the distance between the robot's body center and the position point of the obstacle avoidance trigger coordinate is set as the reference side length, which is directly calculated by the robot after identifying and marking the position point of the obstacle avoidance trigger coordinate.
[0073] Starting from the center of the rectangle, in the first detection direction and the reverse direction, a longitudinal boundary is set at a distance from the center of the rectangle by the reference side length and perpendicular to the first detection direction, which is represented by perpendicular to Figure 5 two straight lines of the line segment OU; then the length of the candidate box in the first detection direction is equal to twice the length of the reference side.
[0074] Starting from the center of the rectangle, in the second detection direction and the third detection direction, a lateral boundary is set at a distance of one body radius from the center of the rectangle and parallel to the first detection direction, which is represented as parallel to Figure 5 two straight lines of the line segment OU; then the length of the candidate box in the second detection direction is equal to twice the radius of the fuselage, that is, the width of the fuselage.
[0075] Then, a rectangle formed by the intersection of each longitudinal boundary and each transverse boundary is marked as the candidate frame, and a rectangular frame is formed by the intersection of two longitudinal boundaries that are twice the reference side length and two transverse boundaries that are twice the radius of the fuselage, so as to take into account the fuselage coverage area and the obstacle contour area detected by the line laser sensor as close as possible, so as to enclose the absolute coordinates of the obstacle marked corresponding to at least one obstacle detected by the line laser sensor. If two obstacle contour positions that are far apart are detected, a relatively small rectangular frame will continue to be framed within the candidate frame, such as a rectangular frame with the minimum area enclosing the position point where the coordinates of the obstacle to be circumvented are located as disclosed in the aforementioned embodiment, so that the candidate frame supports framing a rectangular frame with the minimum area enclosing the position point where the coordinates of the obstacle to be circumvented are located inside it.
[0076] In some embodiments, the line laser data reflected from the obstacle surface collected by the line laser sensor is marked as the obstacle relative coordinates in the initial robot coordinate system to indicate the relative posture of the obstacle outline relative to the robot's body center; the obstacle relative coordinates do not include the coordinates occupied by the point cloud of the ground part, and the vertical height of the coordinates occupied by the point cloud is less than the preset ground height threshold, and the preset ground height threshold is less than 20mm, so as to eliminate the interference of the point cloud height information detected by the line laser on the ground on the line laser data. Then, the robot converts the obstacle relative coordinates to the global coordinate system to obtain the absolute coordinates of the obstacle, wherein the global coordinate system represents the Cartesian coordinate system of the robot's environment and does not change with the position of the robot; the origin of the initial robot coordinate system is the robot's body center, and the robot's walking direction is the positive direction of the horizontal axis of the initial robot coordinate system.
[0077] If the location point of the absolute coordinates of the obstacle is represented by a grid in a grid map, then the location point of the coordinates of the obstacle to be circumvented is represented by a corresponding grid in the same grid map, so that the rectangular frame with the minimum area surrounding the location point of the coordinates of the obstacle to be circumvented and the obstacle avoidance circle both surround the grid where the coordinates of the obstacle to be circumvented are located.
[0078] It should be noted that when the robot is walking, it will emit a line laser to collect the location information of the obstacle, and fill the location information of the obstacle into the grid map in the form of cells to indicate the position of the obstacle on the grid map. The grid map is divided into square cells arranged in multiple rows and columns. A square cell represents a grid. Each square cell has a side length. An obstacle position can be represented by a square cell.
[0079] The obstacle detection height is configured as the height detected by the line laser sensor of obstacles distributed within its detection range in the same vertical plane. It is the height information of the point cloud data scanned by the sensor mapped to the same coordinate system, such as the z-axis coordinate value of the three-dimensional coordinate. If the plane of the yox coordinate system is set to the ground, the obstacle detection height can represent the height from the ground. The line laser sensor generally detects a position at a certain height from the ground, which can be recorded as a certain height position. It occupies a two-dimensional coordinate position on the ground, which can be understood as occupying the obstacle position.
[0080] A person of ordinary skill in the art will appreciate that the implementation of all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned method.
[0081] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
Claims
1. A robot obstacle avoidance circle construction method based on line laser data, wherein a line laser sensor is installed on the front side of the robot body; the method is characterized in that: The robot obstacle avoidance circle construction method comprises: Step 1: When the robot is walking, start the line laser sensor to emit a line laser diagonally downward in the walking direction of the robot to obtain line laser data, and then mark the absolute coordinates of the obstacle according to the line laser data; Step 2: When the robot walks to a point where the minimum distance between the side of its body and the absolute coordinates of the obstacle reaches the preset obstacle avoidance distance, the coordinates of the obstacle to be avoided are selected from the marked absolute coordinates of the obstacle; Step 3: Calculate the target circle center coordinates and target radius based on the coordinates of the obstacle to be circumvented, and then use the target circle center coordinates and target radius to generate an obstacle circumvention circle, so that the robot walks along the obstacle circumvention circle until it bypasses the obstacle.
2. The method for constructing a robot obstacle circumvention circle according to claim 1, characterized in that: In step 2, the absolute coordinates of the obstacle whose minimum distance from the side of the robot's body reaches the preset obstacle avoidance distance are marked as obstacle avoidance trigger coordinates, so that the position point where the obstacle avoidance trigger coordinates are located becomes the position point in the obstacle outline that is closest to the side of the robot's body; wherein the position point where the absolute coordinates of the obstacle are located is used to connect into an obstacle outline, and the coordinates of the obstacle to be avoided include the obstacle avoidance trigger coordinates.
3. The method for constructing a robot obstacle circumvention circle according to claim 2, characterized in that: In step 1, when the robot is walking and using a line laser to detect the outline of the same obstacle, the number of absolute coordinates of the obstacles marked by the robot in the same walking direction and their locations do not change with the change of the distance the robot travels.
4. The method for constructing a robot obstacle circumvention circle according to claim 3, characterized in that: The minimum distance between the robot's body side and the point where the absolute coordinates of the obstacle are located is used to represent the minimum spacing of the line between the edge of the robot on the side leaning toward the obstacle and the point where the absolute coordinates of the obstacle are located within the detection range of the line laser sensor, so that: when the distance between the point where the absolute coordinates of the obstacle are located and the alignment point is the minimum, the minimum distance between the robot's body side and the point where the absolute coordinates of the obstacle are located is the distance between the point where the absolute coordinates of the obstacle are located and the alignment point, wherein the intersection of the line between the center of the robot body and the point where the absolute coordinates of the obstacle are located and the edge of the robot on the side leaning toward the obstacle is recorded as the alignment point.
5. The method for constructing a robot obstacle circumvention circle according to claim 2, characterized in that: In step 3, the method for calculating the target circle center coordinates and the target radius based on the coordinates of the obstacle to be circumvented includes: The robot coordinate system is established with the center of the robot as the origin and the straight line from the center of the robot to the obstacle avoidance trigger coordinate as the positive direction of the horizontal axis. The coordinates of the obstacle to be circumvented are then converted into the robot coordinate system, and then the maximum horizontal coordinate, the minimum horizontal coordinate, the maximum vertical coordinate, and the minimum vertical coordinate are extracted from the coordinates converted into the robot coordinate system, wherein the horizontal coordinate of the obstacle circumvention trigger coordinate converted into the robot coordinate system is the minimum horizontal coordinate; Then the difference between the maximum ordinate and the minimum ordinate is marked as the width of the obstacle to be circumvented; The sum of half the width of the obstacle to be circumvented and the minimum horizontal coordinate is marked as the horizontal coordinate of the center of the target circle, and the sum of half the width of the obstacle to be circumvented and the minimum vertical coordinate is marked as the vertical coordinate of the center of the target circle, forming the center coordinate of the obstacle circumvention circle; wherein, the horizontal coordinate of the center of the target circle and the vertical coordinate of the center of the target circle form the center coordinate of the target circle; At the same time, the product of the square root of 2 and the width of the obstacle to be circumvented is marked as the target radius, which constitutes the radius of the obstacle circumvention circle.
6. The method for constructing a robot obstacle circumvention circle according to claim 5, characterized in that: Before executing step 3, set a minimum area rectangular frame surrounding the coordinates of the obstacle to be circumvented; The obstacle avoidance circle generated in step 3 is executed to surround the rectangular frame with the smallest area; Among them, the rectangular frame with the smallest area has at least one corner point located on the edge of the obstacle avoidance circle.
7. The method for constructing a robot obstacle circumvention circle according to claim 6, characterized in that: The rectangular frame with the smallest area has one side parallel to the horizontal axis of the robot coordinate system, and also has one side parallel to the vertical axis of the robot coordinate system; The robot marks the difference between the maximum horizontal coordinate and the minimum horizontal coordinate as the length of the rectangular frame with the smallest area, and at the same time, the robot marks the difference between the maximum vertical coordinate and the minimum vertical coordinate as the width of the rectangular frame with the smallest area.
8. The method for constructing a robot obstacle circumvention circle according to claim 6, characterized in that: The method for setting the minimum rectangular frame includes: The robot sets a straight line that passes through the coordinate position of the obstacle to be circumvented and is parallel to the ordinate axis of the robot coordinate system as a first boundary, and then in the first boundary, marks a line segment between a point whose ordinate is equal to the maximum ordinate and a point whose ordinate is equal to the minimum ordinate as a first longitudinal edge; wherein both endpoints of the first longitudinal edge fall on the edge of the obstacle circumvention circle; The robot sets a straight line which is at a distance from the first boundary equal to the difference between the maximum horizontal coordinate and the minimum horizontal coordinate and is perpendicular to the horizontal coordinate axis of the robot coordinate system as the first second boundary along the positive direction of the horizontal coordinate axis of the robot coordinate system, and then marks a line segment between a point whose vertical coordinate is equal to the maximum vertical coordinate and a point whose vertical coordinate is equal to the minimum vertical coordinate in the first second boundary as the second longitudinal edge; Connect the endpoint of the first longitudinal side in the positive direction of the longitudinal axis of the robot coordinate system and the endpoint of the second longitudinal side in the positive direction of the longitudinal axis of the robot coordinate system, and then mark the connected line segment as the first transverse side; and connect the endpoint of the first longitudinal side in the negative direction of the longitudinal axis of the robot coordinate system and the endpoint of the second longitudinal side in the negative direction of the longitudinal axis of the robot coordinate system, and then mark the connected line segment as the second transverse side; Then, a rectangle formed by the first longitudinal edge, the second longitudinal edge, the first transverse edge, and the second transverse edge is marked as the rectangular frame with the smallest area.
9. The robot obstacle avoidance method according to claim 6, characterized in that: In step 3, the method of generating an obstacle avoidance circle using the target center coordinates and the target radius includes: Taking the target circle center coordinates as the center of the circle, rotating around the center of the circle for one circle according to the target radius to generate a circular trajectory, and then marking the circular trajectory as the obstacle avoidance circle; If the robot walks along the obstacle circumference circle, the robot configures the target radius as the turning radius required for the robot to walk along the obstacle circumference circle, and configures the position point where the target circle center coordinates are located as the turning center required for the robot to walk along the obstacle circumference circle.
10. The method for constructing a robot obstacle circumvention circle according to claim 2, characterized in that: In step 2, the method of selecting the coordinates of the obstacle to be circumvented from the marked absolute coordinates of the obstacle includes: Starting from the obstacle avoidance trigger coordinate position point, traverse the obstacle absolute coordinate position points marked in step 1, calculate the distance between the absolute coordinate position points of two obstacles traversed successively, and obtain the adjacent point distance; Then, the two points whose adjacent point distance is less than a preset threshold are stored in the same point set, and each point set is a set of the position points of the absolute coordinates of the obstacle contained in each obstacle; Then the point set including the obstacle avoidance trigger coordinates is marked as the obstacle avoidance point set, and then the coordinates of all points in the obstacle avoidance point set are marked as the obstacle coordinates to be avoided, and the obstacle coordinates to be avoided are selected from the marked obstacle absolute coordinates.
11. The method for constructing a robot obstacle circumvention circle according to claim 10, characterized in that: Starting from the position point where the obstacle avoidance trigger coordinates are located, in the process of traversing the position points where the absolute coordinates of the obstacles marked in step 1 in different directions in turn and calculating the distances between adjacent points, if the distances between adjacent points calculated in all directions for the first time are greater than or equal to the preset threshold, the currently obtained point set including the position point where the obstacle avoidance trigger coordinates are located is marked as the set of points to be avoided.
12. The method for constructing a robot obstacle circumvention circle according to claim 10, characterized in that: When the robot walks to the point where the minimum distance between the side of its body and the absolute coordinates of the obstacle reaches the preset obstacle avoidance distance, a candidate frame is set with the point where the obstacle avoidance trigger coordinates are located as the center of the rectangle, so that the coordinates of the obstacles to be avoided are screened out in the candidate frame and form a set of obstacle avoidance points; There is an overlapping area between the detection range of the line laser sensor and the candidate frame.
13. The method for constructing a robot obstacle circumvention circle according to claim 12, characterized in that: The method for setting the candidate frame includes: Taking the obstacle avoidance trigger coordinate location point as the center of the rectangle, mark the straight line direction from the robot body center to the obstacle avoidance trigger coordinate location point as the first detection direction, mark the vertical upward direction of the line connecting the robot body center and the obstacle avoidance trigger coordinate location point as the second detection direction, and mark the vertical downward direction of the line connecting the robot body center and the obstacle avoidance trigger coordinate location point as the third detection direction; Set the distance between the robot's body center and the obstacle avoidance trigger coordinate point as the reference side length; Starting from the center of the rectangle, in the first detection direction and in the opposite direction thereof, a longitudinal boundary is respectively set which is away from the center of the rectangle by the reference side length and is perpendicular to the first detection direction; Starting from the center of the rectangle, a lateral boundary is set in each of the second detection direction and the third detection direction, which is one body radius away from the center of the rectangle and parallel to the first detection direction; Then, a rectangle formed by the intersection of each longitudinal boundary and each transverse boundary is marked as the candidate frame to enclose the absolute coordinates of the obstacle marked corresponding to at least one obstacle detected by the line laser sensor, and support the definition of a minimum area rectangular frame inside the candidate frame that encloses the location point of the coordinates of the obstacle to be circumvented.
Citation Information
Patent Citations
Obstacle dynamic identification algorithm for robot with limited sensing capability
CN105538309A
Obstacle avoidance method and device of robot, medium and terminal
CN110936383A
Local navigation obstacle avoidance method and robot
CN115167434A
Mobile robot obstacle avoidance method, storage medium and system
CN115933659A