Robot obstacle avoidance method, robot obstacle avoidance device and computer storage medium

By preprocessing the point cloud data of obstacles and updating the obstacle grid by mapping it to the map coordinate system, and combining the actual and virtual obstacle distances for collaborative judgment, the problems of blind spots and single distance decision-making in robot obstacle avoidance methods are solved, thereby improving the reliability and stability of obstacle avoidance.

CN120993922APending Publication Date: 2025-11-21HANGZHOU HUACHENG SOFTWARE TECH CO LTD

Patent Information

Application Number
CN202511479212.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-16
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing obstacle avoidance methods for robots rely on single-frame point cloud data from line laser sensors, which have blind spots and make it difficult to detect low or lateral obstacles. Furthermore, relying solely on distance as the basis for decision-making can easily lead to biased obstacle avoidance decisions in complex environments, affecting the reliability and stability of obstacle avoidance behavior.

Method used

By dividing the current point cloud data into obstacle point clouds, mapping them to the map coordinate system to update the obstacle grid, and combining the actual and virtual obstacle distances for collaborative judgment, including obstacle point cloud preprocessing, ground point set filtering, cumulative mapping and dynamic updating of obstacle grids, the reliability and perception integrity of obstacle recognition are enhanced.

Benefits of technology

It effectively compensates for the blind spot problem of line laser sensors, improves the accuracy of obstacle avoidance decisions, the reliability of the robot's obstacle avoidance behavior, and the stability of the operation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120993922A_ABST
    Figure CN120993922A_ABST
Patent Text Reader

Abstract

The invention provides a robot obstacle avoidance method, a robot obstacle avoidance device and a computer storage medium. The robot obstacle avoidance method comprises the following steps: dividing a current obstacle point cloud from current point cloud data; mapping the current obstacle point cloud to a map coordinate system, and updating an obstacle grid of a global map; acquiring a current obstacle grid of a local map based on the current position of the robot; determining an actual obstacle distance according to the distance between the current obstacle point cloud and the robot; determining a virtual obstacle distance according to the distance between the current obstacle grid and the robot; and making an obstacle avoidance decision for the robot based on the actual obstacle distance and the virtual obstacle distance. When an obstacle avoidance decision is made through the robot obstacle avoidance method, comprehensive evaluation can be carried out based on the actual obstacle distance and the virtual obstacle distance, and the reasonability and accuracy of obstacle avoidance opportunity selection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent robots, and in particular to a robot obstacle avoidance method, a robot obstacle avoidance device, and a computer storage medium. Background Technology

[0002] To achieve efficient and reliable obstacle avoidance, robots typically rely on line laser sensors to acquire point cloud data of the environment ahead, thereby identifying obstacles and triggering corresponding obstacle avoidance strategies. Therefore, accurate obstacle identification and appropriate timing of obstacle avoidance are crucial for improving the overall robustness of the robot's obstacle avoidance system.

[0003] Currently, the mainstream obstacle avoidance methods mainly involve clustering and analyzing point cloud data collected by line laser sensors to extract obstacle information, and using the calculated distance between the obstacle and the robot as the core basis for making obstacle avoidance decisions.

[0004] However, such methods heavily rely on single-frame point cloud data from line laser sensors. Line lasers inherently have blind spots, making it difficult to detect low-lying obstacles or lateral edge obstacles below the laser plane, leading to risks of collisions or getting stuck. More critically, these methods use only the distance between the obstacle and the robot as the sole decision-making criterion. In complex environments, this distance calculation is prone to errors, failing to accurately reflect the actual proximity between the robot and the obstacle. This results in obstacle avoidance decisions being executed too early or too late, severely impacting the reliability of obstacle avoidance behavior and the stability of the operation. Summary of the Invention

[0005] To address the aforementioned technical problems, this application provides a robot obstacle avoidance method, a robot obstacle avoidance device, and a computer storage medium.

[0006] To address the aforementioned technical problems, this application provides a robot obstacle avoidance method, the robot obstacle avoidance method comprising: From the current point cloud data, divide the current obstacle point cloud; Map the current obstacle point cloud to the map coordinate system and update the obstacle grid of the global map; Based on the robot's current position, obtain the current obstacle grid of the local map; The actual obstacle distance is determined based on the distance between the current obstacle point cloud and the robot; The distance to the virtual obstacle is determined based on the distance between the current obstacle grid and the robot; The robot makes obstacle avoidance decisions based on the actual obstacle distance and the virtual obstacle distance.

[0007] The step of dividing the current obstacle point cloud from the current point cloud data includes: The current point cloud data is divided into several point cloud datasets according to preset rules, wherein the two endpoints of each point cloud dataset form a set of dividing points; The point cloud dataset whose point height values ​​are within a preset height range is marked as a ground point set; Set the reference ground height based on the average height of the segmented point sets of all ground point sets; The point cloud dataset in which the difference between the height of each point in the segmented point set and the height of the reference ground is greater than a preset obstacle height threshold is marked as the current obstacle point cloud.

[0008] The step of mapping the current obstacle point cloud to the map coordinate system and updating the obstacle grid of the global map includes: Based on the robot's current position and current forward direction angle, determine the left and right distances between the current obstacle point cloud and the robot; When the left and right distances are within a preset range, the obstacle grid is marked according to the grid result of the current obstacle point cloud mapped to the map coordinate system.

[0009] The step of mapping the current obstacle point cloud to the map coordinate system and updating the obstacle grid of the global map includes: When the left and right distances are not within the preset range, candidate grids are determined to be mapped from the current obstacle point cloud onto the map coordinate system; Obtain the cumulative number of mappings for the candidate raster; The cumulative mapping count is updated based on the number of current obstacle point cloud mappings to the candidate grid. When the cumulative number of mappings reaches a first preset threshold, the candidate grid is marked as the obstacle grid.

[0010] The step of mapping the current obstacle point cloud to the map coordinate system and updating the obstacle grid of the global map includes: Determine the candidate grid cells that the current obstacle point cloud can be mapped onto the map coordinate system; Check whether the neighboring grids of the candidate grid are marked obstacle grids; If so, mark the candidate grid as the obstacle grid.

[0011] The robot obstacle avoidance method further includes: Map the ground point cloud from the ground point set onto the global map; Determine whether there is a ground point cloud that maps to the obstacle grid in the global map; If so, update the cumulative mapping count of the obstacle grid based on the number of mapped ground point clouds; When the cumulative number of mappings of the obstacle grid is less than or equal to a second preset threshold, the obstacle grid is updated to a ground grid.

[0012] Determining the actual obstacle distance based on the distance between the current obstacle point cloud and the robot includes: Calculate the candidate forward distance between each obstacle data point in the current obstacle point cloud and the robot in the robot's forward direction; The forward distance of the actual obstacle distance is determined based on the minimum value among the candidate forward distances; Based on the obstacle data points corresponding to the minimum value, determine the left and right distances in the actual obstacle distance.

[0013] The robot obstacle avoidance method further includes: Traverse the left and right distances between the current obstacle point cloud and the center point of the robot; Discard obstacle data points whose left and right distances are greater than the robot's body range.

[0014] The robot obstacle avoidance method further includes: When the left and right distances in the actual obstacle distance are within the preset compensation range, the forward distance compensation value of the actual obstacle distance is obtained based on the forward distance and left and right distances in the actual obstacle distance, the robot's body radius, and the maximum compensation distance; Based on the forward distance compensation value, the effective forward distance of the actual obstacle distance is obtained.

[0015] The obstacle avoidance decision-making process for the robot based on the actual obstacle distance and the virtual obstacle distance includes: When the smaller of the forward distance in the actual obstacle distance and the forward distance in the virtual obstacle distance is less than a preset safety distance, the robot makes an obstacle avoidance decision.

[0016] The obstacle avoidance decision-making process for the robot based on the actual obstacle distance and the virtual obstacle distance includes: Obtain the forward distance difference between the actual obstacle distance and the virtual obstacle distance; When the absolute value of the forward distance difference is less than a preset difference threshold, the robot makes an obstacle avoidance decision based on the actual obstacle distance. When the absolute value of the forward distance difference is greater than or equal to a preset difference threshold, the robot makes an obstacle avoidance decision based on the distance to the virtual obstacle.

[0017] Before making obstacle avoidance decisions for the robot based on the actual obstacle distance and the virtual obstacle distance, the process includes: When the smaller of the forward distance in the actual obstacle distance and the forward distance in the virtual obstacle distance is less than a preset deceleration distance threshold, the robot is decelerated.

[0018] To address the aforementioned technical problems, this application also provides a robot obstacle avoidance device, which includes a memory and a processor coupled to the memory; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the robot obstacle avoidance method as described above.

[0019] To address the aforementioned technical problems, this application also provides a computer storage medium storing a computer program, which, when executed by a processor, implements the steps in the robot obstacle avoidance method described above.

[0020] Compared with existing technologies, the beneficial effects of this application are: mapping the current obstacle point cloud to the map coordinate system and updating the obstacle grid of the global map, realizing spatial modeling and long-term memory of obstacle information, which can effectively compensate for the problem of missed detection of low-lying obstacles or lateral edge obstacles caused by blind spots of line laser sensors, and significantly enhance the perception integrity and robustness of the system in complex environments. Furthermore, when executing obstacle avoidance decisions, it breaks through the limitation of existing technologies that rely solely on a single distance indicator, comprehensively considering the actual obstacle distance based on the current obstacle point cloud and the virtual obstacle distance calculated based on the current obstacle grid, realizing collaborative judgment, improving the rationality and accuracy of obstacle avoidance timing selection, thereby enhancing the reliability of robot obstacle avoidance behavior and the stability of the operation process. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein: Figure 1 This is a flowchart illustrating an embodiment of the robot obstacle avoidance method provided in this application; Figure 2 This is a flowchart illustrating an embodiment of this application for dividing the current obstacle point cloud from point cloud data; Figure 3 This is a flowchart illustrating another embodiment of the robot obstacle avoidance method provided in this application; Figure 4This is a schematic diagram of the structure of an embodiment of the robot obstacle avoidance device provided in this application; Figure 5 This is a schematic diagram of the structure of an embodiment of the computer storage medium provided in this application. Detailed Implementation

[0022] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application will be described in detail below with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, it should be noted that, for ease of description, only the parts relevant to this application are shown in the accompanying drawings, not all structures. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0023] The terms “first,” “second,” etc. (if applicable) in this application are used to distinguish different objects, not to describe a particular order. Furthermore, the terms “comprising” and “featured,” and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.

[0024] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0025] The robot obstacle avoidance method of this application is applied to a robot obstacle avoidance device. The robot obstacle avoidance device can be a server, a terminal device, or a system in which the server and terminal device cooperate. Accordingly, all components of the robot obstacle avoidance device, such as units, subunits, modules, and submodules, can be entirely located in the server, entirely located in the terminal device, or separately located in both the server and the terminal device.

[0026] Furthermore, the aforementioned server can be either hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software programs or software modules, such as software or software modules used to provide distributed server functionality, or as a single software program or software module; no specific limitations are made here.

[0027] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the robot obstacle avoidance method provided in this application.

[0028] Specifically, such as Figure 1 As shown, the specific steps are as follows: Step S11: Divide the current obstacle point cloud from the current point cloud data.

[0029] In this embodiment of the application, the point cloud data collected by the line laser sensor may contain invalid or abnormal points due to sensor noise, environmental interference, low reflectivity of the target object, or excessive distance. Therefore, in order to improve the quality and reliability of the point cloud data, it is necessary to preprocess the point cloud data to remove invalid data and abnormal frames.

[0030] Specifically, in the process of measuring distance, line laser sensors may collect invalid data, such as points with a distance measurement value of zero, due to reasons such as the target object having too low reflectivity, the distance being too close, or the sensor itself being faulty. These invalid data will be removed from the point cloud data to avoid interference from invalid data to subsequent environmental perception.

[0031] Furthermore, during robot movement, it may encounter uneven ground, bumps, or sudden acceleration and deceleration, causing its body to tilt momentarily. This affects the attitude stability of the line laser sensor, resulting in overall deformation or shift in the acquired point cloud frames. To address this, this application equips the robot with an inertial measurement unit (IMU) to detect the robot's attitude angle at the acquisition time corresponding to each frame of point cloud data based on the real-time pose information provided by the IMU. When the robot's attitude angle exceeds a preset tilt threshold, this frame is marked as an abnormal frame and discarded.

[0032] Furthermore, after preprocessing the point cloud data, it is necessary to segment the point cloud data according to the breakpoint distance threshold to divide it into multiple point cloud segments. Each point cloud segment corresponds to a continuous boundary structure or surface contour in the environment, serving as the data basis for subsequently segmenting obstacle point clouds from the point cloud data. The calculation method of the breakpoint distance threshold is shown in Equation (1): (1) in, Indicates the breakpoint distance threshold. This indicates the measured distance to the current point. This indicates the scanning resolution of the line laser sensor. This represents the standard deviation of the current linear laser plane data.

[0033] Specifically, iterate through the distance between each point in the point cloud data and its neighboring points. If the distance between a point and its neighboring points is greater than the breakpoint distance threshold, then mark the point and its neighboring points as a breakpoint.

[0034] Furthermore, after segmenting the point cloud data according to the breakpoint distance threshold, each segmented point cloud fragment corresponds to a continuous boundary structure or surface contour, such as a wall edge or obstacle contour. Therefore, by calculating the average height of the two endpoints in each point cloud fragment, if the average height of the two endpoints of the point cloud fragment is greater than a preset ground height value, the point cloud in the point cloud fragment is classified as an obstacle point cloud; if the average height of the two endpoints of the point cloud fragment is less than the preset ground height value, the point cloud in the point cloud fragment is classified as a ground point cloud.

[0035] In an optional embodiment, the step of dividing the current obstacle point cloud from the current point cloud data includes: dividing the current point cloud data into several point cloud datasets according to a preset rule, wherein the two endpoints of each point cloud dataset form a segmentation point set; marking the point cloud datasets whose point height values ​​are within a preset height range as ground point sets; setting a reference ground height based on the average height of the segmentation point sets of all ground point sets; and marking the point cloud datasets whose point height values ​​of the segmentation point sets and the reference ground height are all greater than a preset obstacle height threshold as the current obstacle point cloud.

[0036] Please see Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of this application for dividing the current obstacle point cloud from point cloud data.

[0037] Specifically, such as Figure 2 As shown, the specific steps are as follows: Step S21: Divide the current point cloud data into several point cloud datasets according to preset rules, wherein the two endpoints of each point cloud dataset form a segmentation point set.

[0038] In this embodiment, the preset rule is to first divide the current point cloud data into several point cloud segments according to the breakpoint distance threshold, and then construct a straight line equation according to the first and last endpoints of the point cloud segment. If there is a point in the point cloud segment whose maximum distance to the straight line is greater than the preset maximum distance, then the point is marked as a split point. The point and its adjacent split points re-divide the point cloud segment into smaller point cloud segments with higher geometric consistency.

[0039] The process of dividing the point cloud data into several point cloud segments based on the breakpoint distance threshold can be referred to in step S11, and will not be repeated here.

[0040] Specifically, after segmenting the point cloud data according to the breakpoint distance threshold, in order to further segment the point cloud segments that are more spatially continuous and geometrically coherent, and to improve the segmentation accuracy of the obstacle point cloud segmentation from the point cloud data, the first and last endpoints of the point cloud segments segmented by the segmentation points are connected to construct a straight line equation, and the maximum distance from the point in the point cloud segment to the straight line is calculated.

[0041] If a point in a point cloud segment has a maximum distance from a line that exceeds a preset maximum distance threshold, that point is marked as a segmentation point. Furthermore, this segmentation point, along with its immediate and adjacent segmentation points, forms a segmentation point pair, which is used to generate two new point cloud segments.

[0042] For example, there exists a split point and Point cloud segments , divide point and Connecting them constructs the equation of a straight line, if If the maximum distance to the line is greater than the preset maximum distance threshold, then Marked as a split point, split point and By constructing a pair of segmentation points, a new point cloud fragment is redefined. dividing point and By creating a pair of segmentation points, another new point cloud fragment is redefined. .

[0043] After dividing the new point cloud into new segments based on the new segmentation points, it is still necessary to construct straight line equations for the first and last endpoints of the new point cloud segments, and determine whether there are other segmentation points in the point cloud segments based on the maximum distance from the points in the new point cloud segments to the straight line.

[0044] Repeat the above process until the maximum distance from all points in the point cloud segment to the straight line formed by the beginning and end points of the point cloud segment is less than the preset maximum distance threshold.

[0045] Finally, the point cloud segments obtained according to the preset rules constitute several point cloud datasets.

[0046] Since the first and last endpoints of each point cloud dataset serve as the dividing points between that point cloud dataset and its neighboring point cloud datasets, the first and last endpoints of each point cloud dataset are combined to form a set of dividing points.

[0047] Step S22: Mark the point cloud dataset whose point height values ​​are within a preset height range as a ground point set.

[0048] In this embodiment, after obtaining several point cloud datasets, since the point cloud data in all the point cloud datasets are obtained based on line laser sensors, and the line laser sensors may be distributed in different positions on the robot body, in order to ensure the spatial consistency of the data and avoid calculation errors caused by inconsistencies in coordinate systems, it is necessary to transform the point cloud data from the line laser coordinate system to the robot coordinate system.

[0049] The transformation method for transforming point cloud data from the line laser coordinate system to the robot coordinate system is shown in formula (2).

[0050] (2) in, The coordinates of any point in the current point cloud data in the online laser coordinate system; These are the coordinates of the point in the robot's coordinate system. For all current point cloud data; This is the point cloud transformation matrix from the line laser coordinate system to the robot coordinate system, which includes a rotation matrix. Translation vector Rotation matrix In and translation vector In All of these are determined by the external parameters of the line laser sensor relative to the robot's coordinate system.

[0051] After transforming the point cloud data from the linear laser coordinate system to the robot coordinate system, all point cloud data are in the same coordinate system and have a unified spatial reference datum. Based on this, ground point sets can be extracted from the point cloud data by segmenting the height information of the point sets according to a preset height range.

[0052] Optional, the preset height range is ±5mm.

[0053] Optionally, to reduce computational load and speed up the partitioning of several point cloud datasets, only the partitioning point set of several point cloud datasets can be transformed from the line laser coordinate system to the robot coordinate system.

[0054] In this embodiment, the two segmentation points in each segmentation point set are traversed. If the height values ​​of the two segmentation points in the segmentation point set are both within the preset height range, then the point cloud dataset corresponding to the segmentation point set is marked as a ground point set.

[0055] In an optional embodiment, two segmentation points in each segmentation point set can be traversed. If the average height of the two segmentation points in the segmentation point set is within a preset height range, the point cloud dataset corresponding to the segmentation point set is marked as a ground point set.

[0056] In another optional embodiment, all points in each point cloud dataset can be traversed. If the height values ​​of all points in the point cloud dataset are within a preset height range, then the point cloud dataset is marked as a ground point set.

[0057] In another optional embodiment, all points in each point cloud dataset can be traversed. If the average height of all points in the point cloud dataset is within a preset height range, then the point cloud dataset is marked as a ground point set.

[0058] Step S23: Set the reference ground height based on the average height of the segmented point sets of all ground point sets.

[0059] Since the ground point set contains ground height information of the robot's current environment, its average height can be calculated to obtain a reference ground height representing the current position.

[0060] In this embodiment, after obtaining the ground point set, the height values ​​of all segment points in the segment point set that makes up the ground point set are obtained, and the average height of all segment points is calculated, and the average height is used as the reference ground height.

[0061] In an optional embodiment, after obtaining the ground point set, the height values ​​of all ground points in the ground point set are obtained, and the average height of all ground points is calculated, and the average height is used as the reference ground height.

[0062] Step S24: Mark the point cloud dataset where the difference between the point height value of the segmented point set and the reference ground height is greater than a preset obstacle height threshold as the current obstacle point cloud.

[0063] In this embodiment, after obtaining the reference ground height, the segmentation point sets of all point cloud datasets that are not marked as ground point sets are traversed. If the difference between the height value of all points in the segmentation point set and the reference ground height is greater than the preset obstacle height threshold, the point cloud dataset corresponding to the segmentation point set is marked as the current obstacle point cloud.

[0064] Optionally, the preset obstacle height threshold is 25mm.

[0065] In an optional embodiment, after obtaining the reference ground height, all point cloud datasets that are not marked as ground point sets are traversed. If the difference between the average height of all points in the point cloud dataset and the reference ground height is greater than a preset obstacle height threshold, then the point cloud dataset is marked as the current obstacle point cloud.

[0066] This application calculates a reference ground height based on a set of ground points, fully considering the impact of ground undulations and robot pose fluctuations on obstacle detection accuracy. By dynamically updating the reference ground height, it effectively compensates for measurement deviations caused by terrain changes and robot posture variations. Furthermore, by combining this with a preset obstacle height threshold, the height of the segmented point set in the point cloud dataset is calculated, accurately distinguishing between ground points and obstacle points. This allows for the selection of a more accurate obstacle point set, improving the reliability and adaptability of obstacle recognition in complex environments.

[0067] Step S12: Map the current obstacle point cloud to the map coordinate system and update the obstacle grid of the global map.

[0068] In this embodiment, after obtaining the current obstacle point cloud, in order to achieve unified fusion of obstacle point cloud data across multiple times and locations, it is necessary to map the current obstacle point cloud from the robot coordinate system to the global map coordinate system to accurately construct a consistent environment model. Therefore, this application will perform coordinate transformation on each point in the current obstacle point cloud based on the robot's real-time pose information, converting it to its corresponding position in the map coordinate system.

[0069] The transformation method for converting the current obstacle point cloud from the robot coordinate system to the map coordinate system is shown in formula (3).

[0070] (3) in, The coordinates of any point in the current obstacle point cloud in the robot coordinate system; These are the coordinates of the point in the map coordinate system. For all current obstacle point clouds; This is the point cloud transformation matrix from the robot coordinate system to the map coordinate system, which includes a rotation matrix. Translation vector Rotation matrix In The robot's forward direction angle; translation vector. In This refers to the robot's current location coordinates based on the map coordinate system.

[0071] Optionally, the map coordinate system can be set based on the robot's initial position.

[0072] Furthermore, since line lasers have inherent blind spots, they are difficult to detect low-lying obstacles or lateral edge obstacles below the laser plane. Therefore, for the current obstacle point cloud converted to the map coordinate system, it is necessary to map it to a grid map to obtain an obstacle grid, thereby improving the robot's ability to perceive obstacles in low-lying or lateral areas.

[0073] The mapping method for mapping the current obstacle point cloud from the map coordinate system to the grid map is shown in formula (4).

[0074] (4) in, The coordinates of any point in the current obstacle point cloud in the map coordinate system; These are the raster coordinates of the point; This is the zero point of the raster map; This refers to the raster resolution, which is the actual size corresponding to the side length of a single raster cell.

[0075] In an optional embodiment, the step of mapping the current obstacle point cloud to the map coordinate system and updating the obstacle grid of the global map includes: determining the left and right distances between the current obstacle point cloud and the robot based on the robot's current position and current forward direction angle; and marking the obstacle grid according to the grid result of mapping the current obstacle point cloud to the map coordinate system when the left and right distances are within a preset range.

[0076] In this embodiment, after obtaining the map coordinates of the current obstacle point cloud, before mapping the obstacle point cloud onto the grid map, the vertical distance from each point in the current obstacle point cloud to the robot's central vertical axis can be calculated based on the robot's current position and current direction of travel. Specifically, the central vertical axis extends along the robot's direction of travel; the distance from a point to the left of the central vertical axis is the left distance, and the distance from a point to the right of the central vertical axis is the right distance. The central vertical axis is an axis parallel to the robot's direction of travel.

[0077] Furthermore, a preset range is set, which corresponds to the sensitive area extending inward from the left and right edges of the robot body. Optionally, this range can be an area extending inward from the left and right edges of the robot by 3mm.

[0078] If the left or right distance of any point in the obstacle point cloud falls within a preset range, the point is determined to be in a critical area that may affect the robot's passage or cause a collision. Since the obstacle corresponding to the point is difficult to detect stably due to the blind spot of the line laser field of view, in order to improve the reliability of the response, after calculating the grid coordinates of the point in the map coordinate system by formula (4), the corresponding grid is immediately marked as the obstacle grid.

[0079] Optionally, the preset range corresponds to the area extending 3mm from the left and right edges of the robot towards the center of the robot.

[0080] In another optional embodiment, the step of mapping the current obstacle point cloud to the map coordinate system and updating the obstacle grid of the global map includes: when the left and right distances are not within the preset range, determining candidate grids on the map coordinate system to which the current obstacle point cloud is mapped; obtaining the cumulative mapping count of the candidate grids; updating the cumulative mapping count according to the number of mappings of the current obstacle point cloud to the candidate grids; and marking the candidate grids as obstacle grids when the cumulative mapping count reaches a first preset threshold.

[0081] In this embodiment, after obtaining the left and right distances between the current obstacle point cloud and the robot, if the left or right distance between the current obstacle point cloud and the robot is not within a preset range, it indicates that the obstacle point is a non-critical obstacle in the environment or an obstacle that can be reliably detected. In order to avoid incorrect grid type updates, a grid update strategy based on cumulative confidence will be adopted in this case.

[0082] Specifically, firstly, the grid coordinates of the current obstacle point cloud are obtained using formula (4), and the grid containing these coordinates is marked as a candidate grid. Then, the cumulative mapping count of the candidate grid is obtained; this count is used to record the number of times the obstacle point cloud in multiple consecutive frames is mapped to the grid. For each frame of obstacle point cloud, if an obstacle point is mapped to the grid, the number of mappings of the obstacle point is added to the cumulative mapping count of the grid. When the cumulative mapping count reaches a first preset threshold, the grid is determined to be a stable obstacle region in the environment and is marked as an obstacle grid.

[0083] This application sets two obstacle grid update strategies based on a preset range. For obstacle point clouds within the preset range, which may affect passage or cause collisions and are difficult to observe stably due to the blind spots of the line laser sensor, a "direct marking" strategy is adopted. Once an obstacle point is detected falling into the area, its mapped grid is immediately marked as an obstacle grid, achieving a fast response and effectively avoiding the collision risk caused by the defects of the line laser sensor. For obstacle point clouds not within the preset range, sensor noise, dynamic object movement, or instantaneous occlusion can make single detection results unreliable. If directly marked, non-obstacle grids are easily misclassified as obstacle grids. Therefore, a "cumulative confidence" strategy is adopted. Only when the cumulative number of times obstacle points are mapped to the grid in multiple consecutive frames reaches a first preset threshold is the grid determined as an obstacle grid, effectively filtering temporary interference and improving the stability and accuracy of obstacle determination.

[0084] In another optional embodiment, the step of mapping the current obstacle point cloud to the map coordinate system and updating the obstacle grid of the global map includes: determining candidate grids on the map coordinate system to which the current obstacle point cloud is mapped; querying whether the neighboring grids of the candidate grids are marked obstacle grids; if so, marking the candidate grids as obstacle grids.

[0085] In this embodiment, after obtaining candidate grids based on obstacle point clouds, it is possible to query whether the neighboring grids of the candidate grid have already been marked as obstacle grids. If at least one neighboring grid of the candidate grid has been marked as an obstacle grid, it is considered that the region where the candidate grid is located and the region where the neighboring grid is located belong to the same obstacle. In this case, the candidate grid is directly marked as an obstacle grid, thereby achieving reasonable completion of obstacle identification and enhancing the completeness of obstacle recognition.

[0086] Optionally, adjacent rasters can be the eight-neighborhood of the candidate raster or rasters within the eight-neighborhood range.

[0087] In an optional embodiment, the robot obstacle avoidance method further includes: mapping the ground point cloud of the ground point set to the global map; determining whether there is a mapped ground point cloud of an obstacle grid mapped to the global map; if so, updating the cumulative mapping count of the obstacle grid according to the number of mapped ground point clouds; and updating the obstacle grid to a ground grid when the cumulative mapping count of the obstacle grid is less than or equal to a second preset threshold.

[0088] In this embodiment, the mapped ground point cloud is the ground point cloud mapped to the obstacle grid of the global map.

[0089] In this embodiment, considering that the robot is in a continuous state of movement, during the construction of the global map, some grids previously marked as obstacles may no longer actually contain obstacles. Therefore, a dynamic update mechanism is proposed to effectively clear obstacle grids in the global map using the ground point cloud from the ground point set.

[0090] Specifically, after obtaining the obstacle grid of the updated global map, the ground point cloud obtained in step S22 is first mapped onto the map coordinate system.

[0091] The transformation method for converting the ground point cloud of the ground point set from the robot coordinate system to the map coordinate system is shown in formula (5).

[0092] (5) in, Let be the coordinates of any point cloud in the ground point set in the robot coordinate system; These are the coordinates of the point in the map coordinate system. For ground point set; This is the point cloud transformation matrix from the robot coordinate system to the map coordinate system, which includes a rotation matrix. Translation vector Rotation matrix In The robot's forward direction angle; translation vector. In This refers to the robot's current location coordinates based on the map coordinate system.

[0093] Subsequently, the ground point cloud of the ground point set is mapped from the map coordinate system to the raster map, and the mapping method is shown in formula (6).

[0094] (6) in, ; The coordinates of any ground point cloud in the ground point set in the map coordinate system; These are the raster coordinates of the point; This is the zero point of the raster map; This refers to the raster resolution, which is the actual size corresponding to the side length of a single raster cell.

[0095] Finally, based on the grid coordinates of the ground point cloud, it is determined whether any ground point cloud is mapped to an obstacle grid in the global map. If so, the cumulative mapping count of the obstacle grid is updated according to the number of ground point clouds mapped to that obstacle grid, and the grid's label is changed according to the updated cumulative mapping count.

[0096] Specifically, if a ground point cloud exists in an obstacle grid, each ground point cloud will cause the cumulative mapping count of the obstacle grid to decrease by a preset value. When the result of the cumulative mapping count decrease is less than or equal to a second preset threshold, the obstacle grid is updated to a ground grid.

[0097] Optionally, the preset value can be 2, and the second preset threshold can be 0. When the cumulative mapping count in a certain obstacle grid is 6, and the number of ground point clouds falling into the obstacle grid is 3, each time a ground point cloud falls into the grid, the cumulative mapping count will decrease by 2. After three decreases, the cumulative mapping count drops to 0, which is equal to the second preset threshold, and the obstacle grid will be updated to a ground grid.

[0098] Optionally, to avoid the edge points of the ground point set accidentally clearing the obstacle grids of actual obstacles, before clearing the obstacle grids in the global map using the ground point set, during the process of mapping the ground point set from the robot coordinate system to the map coordinate system, the ground point in the ground point set that serves as the endpoint of the split point set can be selected first, and other ground points that are one grid resolution away from the ground point can be removed.

[0099] This application clears obstacle grids in the global map using ground point sets, enabling the robot to restore areas originally marked as obstacles to passable areas as the environment changes during continuous movement, significantly improving the timeliness and accuracy of the global map. Furthermore, this application uses preset values ​​to progressively decrease the cumulative mapping count, effectively preventing map updates caused by single-frame point cloud noise, positioning jitter, or brief false detections. Only when a grid is continuously covered by ground points is its occupancy confidence gradually reduced, ensuring a stable and reliable obstacle clearing process.

[0100] Step S13: Based on the robot's current position, obtain the current obstacle grid of the local map.

[0101] In this embodiment of the application, after obtaining the obstacle grid of the global map, the obstacle grid of the local map is extracted from the obstacle grid of the global map based on the position of the robot in the map coordinate system, with a preset local range as the radius, and used as the current obstacle grid.

[0102] Optionally, the preset local range can be 0.5m.

[0103] Step S14: Determine the actual obstacle distance based on the distance between the current obstacle point cloud and the robot.

[0104] In this embodiment of the application, the distance from each point in the current obstacle point cloud to the robot is decomposed into forward distance and left and right side distance according to the robot's forward direction.

[0105] The forward distance is the perpendicular distance from each point in the current obstacle point cloud to the robot's central horizontal axis; the left and right distances are the perpendicular distances from each point in the current obstacle point cloud to the robot's central vertical axis. The distance from a point to the left of the central vertical axis is the left distance, and the distance from a point to the right of the central vertical axis is the right distance. The central horizontal axis is perpendicular to the robot's forward direction, and the central vertical axis is parallel to the robot's direction.

[0106] Traverse all points in the current obstacle point cloud, calculate the forward distance and left and right distances of each point to the robot center, and thus determine the actual distance from the obstacle to the robot, which serves as the basis for subsequent obstacle avoidance decisions.

[0107] In an optional embodiment, determining the actual obstacle distance based on the distance between the current obstacle point cloud and the robot includes: calculating the candidate forward distance between each obstacle data point in the current obstacle point cloud and the robot in the robot's forward direction; determining the forward distance in the actual obstacle distance based on the minimum value among the candidate forward distances; and determining the left and right side distances in the actual obstacle distance based on the obstacle data point corresponding to the minimum value.

[0108] In this embodiment, for each obstacle point in the current obstacle point cloud, the forward distance from that point to the robot center is first calculated as a candidate forward distance.

[0109] Subsequently, the minimum value among all candidate forward distances is selected as the forward distance from the actual obstacle to the robot's center.

[0110] Finally, based on the obstacle point corresponding to the minimum value, the vertical distance from it to the robot's center longitudinal axis is further calculated. If the point is located to the left of the longitudinal axis, the distance is the left distance of the actual obstacle to the robot's center. If the point is located to the right of the longitudinal axis, the distance is the right distance of the actual obstacle to the robot's center.

[0111] In an optional embodiment, the robot obstacle avoidance method further includes: traversing the left and right distances between the current obstacle point cloud and the center point of the robot; and discarding obstacle data points whose left and right distances are greater than the robot's body range.

[0112] In this embodiment, when calculating the actual obstacle distance, obstacles located in the far areas on both sides of the robot's travel path can be filtered out first, thereby focusing on the nearby obstacles that may actually pose a collision threat.

[0113] Specifically, first calculate the left and right distances from each obstacle point in the current obstacle point cloud to the robot center. If the left or right distance from the obstacle point to the robot center is greater than the robot's body range, then the obstacle point is discarded.

[0114] Step S15: Determine the virtual obstacle distance based on the distance between the current obstacle grid and the robot.

[0115] In this embodiment of the application, the distance from each grid in the current obstacle grid to the robot is decomposed into forward distance and left and right side distance according to the robot's forward direction.

[0116] The forward distance is the vertical distance from each grid cell in the current obstacle grid to the robot's central horizontal axis; the left and right distances are the vertical distances from each grid cell in the current obstacle grid to the robot's central vertical axis, with the distance from the grid cell to the left of the central vertical axis being the left distance, and the distance from the grid cell to the right of the central vertical axis being the right distance. The central horizontal axis is perpendicular to the robot's forward direction, and the central vertical axis is parallel to the robot's direction.

[0117] Traverse all grids in the current obstacle grid, calculate the forward distance and left and right distances of each grid to the robot's center, and thus determine the distance from the virtual obstacle to the robot, which serves as the basis for subsequent obstacle avoidance decisions.

[0118] In an optional embodiment, determining the virtual obstacle distance based on the distance between the current obstacle grid and the robot includes: calculating the candidate forward distance between each obstacle grid of the current obstacle grid and the robot in the robot's forward direction; determining the forward distance in the virtual obstacle distance based on the minimum value among the candidate forward distances; and determining the left and right distances in the virtual obstacle distance based on the obstacle data point corresponding to the minimum value.

[0119] In this embodiment, for each grid cell in the current obstacle grid, the forward distance from that grid cell to the robot center is first calculated as a candidate forward distance.

[0120] Subsequently, the minimum value among all candidate forward distances is selected as the forward distance from the virtual obstacle to the robot's center.

[0121] Finally, based on the obstacle grid corresponding to the minimum value, the vertical distance from it to the robot's center longitudinal axis is further calculated. If the grid is located to the left of the longitudinal axis, the distance is the left distance of the virtual obstacle to the robot's center. If the grid is located to the right of the longitudinal axis, the distance is the right distance of the virtual obstacle to the robot's center.

[0122] Optionally, when calculating the distance to virtual obstacles, the distance from each obstacle grid in the current obstacle grid to the left or right side of the robot's center can be calculated first. If the distance from the obstacle grid to the left or right side of the robot's center is greater than the robot's body range, then the obstacle grid is discarded.

[0123] In an optional embodiment, the robot obstacle avoidance method further includes: when the left and right distances in the actual obstacle distance are within a preset compensation range, obtaining a forward distance compensation value for the actual obstacle distance based on the forward distance and left and right distances in the actual obstacle distance, the robot's body radius, and the maximum compensation distance; and obtaining an effective forward distance for the actual obstacle distance based on the forward distance compensation value.

[0124] In this embodiment, when the robot's body has a circular outline, for obstacles located directly in front of the robot and for obstacles located to the left and right of the robot's central longitudinal axis, when both are at the same forward distance from the robot, due to the robot's arc shape, when the obstacle located directly in front of the robot collides with the robot, the obstacles located to the left and right of the robot's central longitudinal axis still need to move forward a certain distance before colliding with the robot.

[0125] Therefore, in order to avoid the robot making obstacle avoidance decisions too early when the obstacle point is located to the left or right of the robot's central longitudinal axis, it is necessary to reasonably compensate for its forward distance.

[0126] However, when obstacles are close to the left and right edges of the robot's body, the forward distance compensation value calculated based on geometric relationships may exceed the expected range, leading to overcompensation. Therefore, a maximum compensation distance is introduced as an upper limit constraint to restrict the forward distance compensation value, suppressing abnormal increases in the forward distance compensation value for obstacles located at the robot's edge regions. This improves the accuracy and stability of the effective forward distance calculation, thereby ensuring the reliability of obstacle avoidance decisions.

[0127] Specifically, when the left or right distance of the obstacle point is within the preset compensation range, the calculation method for the forward distance compensation value of the obstacle point is as shown in formula (7), based on the forward distance and left and right side distance of the obstacle point, the robot's body radius, and the maximum compensation distance.

[0128] (7) in, This is the forward distance compensation value for the obstacle point. The forward distance of the obstacle point. The distance to the left and right sides of the obstacle point. Let be the radius of the robot's body. This is the maximum compensation distance.

[0129] After obtaining the forward distance compensation value, the effective forward distance is obtained according to formula (8).

[0130] (8) in, The effective forward distance after compensating for the forward distance of the obstacle point. Let be the radius of the robot's body. This is the forward distance compensation value for the obstacle point.

[0131] In another optional embodiment, in order to avoid the robot making obstacle avoidance decisions too early for lateral obstacles, when the obstacle grid is located on the left or right side of the robot's central longitudinal axis, it is necessary to reasonably compensate its forward distance. The calculation method of the forward distance compensation value and the effective forward distance can be referred to formula (7) and formula (8), which will not be repeated here.

[0132] This application compensates for the forward distance of obstacle points or obstacle grids within a preset compensation range, enabling more accurate acquisition of the actual distance between obstacle points or obstacle grids and the robot body. This effectively prevents the robot from making obstacle avoidance decisions too early when it detects lateral obstacles, improves the accuracy and rationality of obstacle avoidance decision triggering timing, reduces unnecessary deceleration or turning actions of the robot, and enhances the intelligence level of the robot's autonomous navigation.

[0133] Step S16: Make obstacle avoidance decisions for the robot based on the actual obstacle distance and the virtual obstacle distance.

[0134] In this embodiment of the application, after obtaining the actual obstacle distance and the virtual obstacle distance, the robot can make obstacle avoidance decisions based on the forward distance and left and right distances in the actual obstacle distance, and the forward distance and left and right distances in the virtual obstacle distance.

[0135] Specifically, if the left and right lateral distances in the actual obstacle distance and the left and right lateral distances in the virtual obstacle distance are less than the robot's body radius, and the forward distance in the actual obstacle distance and the forward distance in the virtual obstacle distance are less than a preset safety distance, then the robot will make an obstacle avoidance decision.

[0136] In an optional embodiment, the step of making obstacle avoidance decisions for the robot based on the actual obstacle distance and the virtual obstacle distance includes: making obstacle avoidance decisions for the robot when the smaller of the forward distance in the actual obstacle distance and the forward distance in the virtual obstacle distance is less than a preset safety distance.

[0137] In this embodiment, when the left and right distances of the actual obstacle distance are greater than the robot's body radius, the actual obstacle distance does not participate in the subsequent obstacle avoidance decision; when the left and right distances of the virtual obstacle distance are greater than the robot's body radius, the virtual obstacle distance does not participate in the subsequent obstacle avoidance decision.

[0138] In this embodiment, when the left and right distances in the actual obstacle distance are less than the robot's body radius, while the left and right distances in the virtual obstacle distance are greater than the robot's body radius, if the forward distance in the actual obstacle distance is less than a preset safety distance, then the robot will make an obstacle avoidance decision.

[0139] In this embodiment, when the left and right distances in the actual obstacle distance are greater than the robot's body radius, while the left and right distances in the virtual obstacle distance are less than the robot's body radius, if the forward distance in the virtual obstacle distance is less than a preset safety distance, then the robot will make an obstacle avoidance decision.

[0140] In this embodiment, when both the left and right side distances in the actual obstacle distance and the left and right side distances in the virtual obstacle distance are less than the robot's body radius, if the smaller value of the forward distance in the actual obstacle distance and the forward distance in the virtual obstacle distance is less than a preset safety distance, then the robot makes an obstacle avoidance decision.

[0141] In this embodiment, when the left and right distances in the actual obstacle distance or the left and right distances in the virtual obstacle distance are within the preset compensation range, the forward distance involved in the obstacle avoidance decision is the effective forward distance after compensation.

[0142] The preset safe distance can be about 30mm outside the radius of the robot body.

[0143] In another optional embodiment, the step of making obstacle avoidance decisions for the robot based on the actual obstacle distance and the virtual obstacle distance includes: obtaining the forward distance difference between the forward distance in the actual obstacle distance and the forward distance in the virtual obstacle distance; when the absolute value of the forward distance difference is less than a preset difference threshold, making obstacle avoidance decisions for the robot based on the actual obstacle distance; and when the absolute value of the forward distance difference is greater than or equal to the preset difference threshold, making obstacle avoidance decisions for the robot based on the virtual obstacle distance.

[0144] In this embodiment, when making obstacle avoidance decisions for the robot based on actual obstacle distances and virtual obstacle distances, a detection blind spot exists directly below the line laser sensor and in the adjacent area near the robot's chassis; this area is often referred to as the "light plane blind spot." Within this blind spot, even if low obstacles are present, the line laser sensor cannot obtain an effective actual obstacle distance, posing a high risk of collision. Therefore, when an obstacle is located in the light plane blind spot, a more reliable forward distance needs to be selected from the forward distance in the actual obstacle distance and the forward distance in the virtual obstacle distance as the basis for obstacle avoidance decisions.

[0145] When an obstacle is located in the blind zone of the light plane, the forward distance in the virtual obstacle distance will be greater than the forward distance in the actual obstacle distance. At this time, the absolute value of the difference between the forward distance in the virtual obstacle distance and the forward distance in the actual obstacle distance will be greater than or equal to the preset difference threshold. When the obstacle is not located in the blind zone of the light plane, the forward distance in the virtual obstacle distance and the forward distance in the actual obstacle distance will be closer. At this time, the absolute value of the difference between the forward distance in the virtual obstacle distance and the forward distance in the actual obstacle distance will be less than the preset difference threshold.

[0146] In this embodiment, when the obstacle is located in the blind zone of the light plane, the absolute value of the difference between the forward distance in the virtual obstacle distance and the forward distance in the actual obstacle distance is greater than or equal to a preset difference threshold. This indicates that the actual obstacle distance is unreliable, so the virtual obstacle distance is used as the basis for obstacle avoidance decision.

[0147] In this embodiment, when the obstacle is not located in the blind zone of the light plane, the absolute value of the difference between the forward distance in the virtual obstacle distance and the forward distance in the actual obstacle distance is less than a preset difference threshold. This indicates that the virtual obstacle distance and the actual obstacle distance are basically consistent or the deviation is within an acceptable range. However, the virtual obstacle distance does not significantly exceed the real perception, and the virtual obstacle distance may even have errors due to map resolution. Therefore, the actual obstacle distance is determined to have higher credibility, and the actual obstacle distance is used as the basis for obstacle avoidance decision.

[0148] In another optional embodiment, when the obstacle is located in the blind zone of the light plane, the forward distance in the virtual obstacle distance will be much greater than the forward distance in the actual obstacle distance. At this time, the absolute value of the difference between the forward distance in the virtual obstacle distance and the forward distance in the actual obstacle distance will be much greater than the preset difference threshold. When the obstacle is not located in the blind zone of the light plane, the forward distance in the virtual obstacle distance and the forward distance in the actual obstacle distance may be greater than the preset difference threshold or may be less than the preset difference threshold.

[0149] In this embodiment, when the obstacle is located in the blind zone of the light plane, the absolute value of the difference between the forward distance in the virtual obstacle distance and the forward distance in the actual obstacle distance is much greater than the preset difference threshold. At this time, the virtual obstacle distance is used as the basis for obstacle avoidance decision.

[0150] In this embodiment, when the obstacle is not located in the blind zone of the light plane, and the forward distance in the virtual obstacle distance is greater than the forward distance in the actual obstacle distance, the smaller value between the forward distance in the virtual obstacle distance and the forward distance in the actual obstacle distance is used as the basis for obstacle avoidance decision.

[0151] In this embodiment, when the obstacle is not located in the blind zone of the light plane, and the forward distance in the virtual obstacle distance and the forward distance in the actual obstacle distance are less than a preset difference threshold, the actual obstacle distance is used as the basis for obstacle avoidance decision.

[0152] In an optional embodiment, before making obstacle avoidance decisions for the robot based on the actual obstacle distance and the virtual obstacle distance, the method includes: when the smaller of the forward distance in the actual obstacle distance and the forward distance in the virtual obstacle distance is less than a preset deceleration distance threshold, the robot is decelerated.

[0153] In this embodiment, before making obstacle avoidance decisions based on the actual obstacle distance and the virtual obstacle distance, it is necessary to ensure that the robot has sufficient time to map newly detected obstacle points from the linear laser coordinate system to the map coordinate system and the grid map. To achieve this, a preset deceleration distance threshold needs to be set, allowing the robot to decelerate when there is still a safe distance from the obstacle.

[0154] Specifically, after obtaining the actual obstacle distance and the virtual obstacle distance, it is necessary to determine whether the forward distance in the virtual obstacle distance or the forward distance in the actual obstacle distance is less than a preset deceleration threshold. If it is less than this threshold, it means that the robot's current travel speed may cause delays in the mapping of newly detected obstacle coordinates, map position shifts of the obstacle, or untimely map updates, leading to incorrect obstacle avoidance decisions. Therefore, in this case, the robot needs to decelerate.

[0155] The preset deceleration threshold can be set based on the height of the currently detected obstacle. For example, for an obstacle with a height of 25mm, the corresponding preset deceleration threshold is 130mm.

[0156] Please see Figure 3 , Figure 3 This is a flowchart illustrating another embodiment of the robot obstacle avoidance method provided in this application.

[0157] Specifically, such as Figure 3 As shown, the specific steps are as follows: Step S301: After the line laser sensor acquires the current frame point cloud data, it first preprocesses the current frame point cloud data. Specifically, when the distance between the data point and the line laser sensor that measured the point is zero, the data point is discarded; according to the real-time pose information provided by the robot inertial measurement unit, the point cloud data acquired when the robot's attitude angle is greater than the preset tilt threshold is discarded. Subsequently, the breakpoint distance threshold of the current frame point cloud data is calculated according to formula (1), and multiple point cloud segments are divided from the current frame point cloud data. Each point cloud segment corresponds to a continuous boundary structure or surface contour in the environment. Finally, a straight line equation is constructed based on the first and last endpoints of each point cloud segment, and all point cloud segments are further divided according to the relationship between the maximum distance from the point in the point cloud segment to the straight line and the preset maximum distance threshold, so as to obtain several point cloud datasets that are more spatially continuous and geometrically more coherent. The first and last endpoints of each point cloud dataset form a set of segmentation points.

[0158] Step S302: After obtaining the segmentation point set, firstly, according to formula (2), the segmentation points in the segmentation point set are transferred from the line laser coordinate system to the robot coordinate system to ensure the spatial consistency of the point cloud data. Then, each segmentation point set is traversed. If the height values ​​of two segmentation points in a segmentation point set are within a preset height range, the segmentation point set is marked as a ground point cloud. Subsequently, the height values ​​of all segmentation points in the segmentation point set that makes up the ground point cloud are obtained, and the average height of all segmentation points is calculated. This average height is used as the reference ground height. Finally, all segmentation point sets that are not marked as ground point clouds are traversed. If the difference between the height values ​​of two segmentation points in a segmentation point set and the reference ground height is greater than a preset obstacle height threshold, the segmentation point set is marked as the current obstacle point cloud.

[0159] Step S303: After obtaining the obstacle point cloud and the ground point cloud, in order to construct a global map with a consistent reference coordinate system, the obstacle point cloud and the ground point cloud are transferred from the robot coordinate system to the map coordinate system according to formula (3).

[0160] Step S304: Based on the robot's forward direction, decompose the distance from each point in the current obstacle point cloud to the robot into forward distance and left / right lateral distance. The forward distance is the perpendicular distance from each point in the current obstacle point cloud to the robot's central horizontal axis; the left / right lateral distance is the perpendicular distance from each point in the current obstacle point cloud to the robot's central vertical axis. Points to the left of the central vertical axis are designated as left-side distances, and points to the right are designated as right-side distances. The central horizontal axis is perpendicular to the robot's forward direction, and the central vertical axis is parallel to the robot's direction. Obstacle data points with left / right lateral distances within a preset range are classified as lateral obstacles; obstacle data points with left / right lateral distances outside the preset range are classified as forward obstacles.

[0161] Step S305: Map the current obstacle point cloud from the map coordinate system to the grid map according to formula (4). For forward obstacles, a grid is marked as an obstacle grid only when the cumulative number of forward obstacle points mapped in a grid over multiple consecutive frames reaches a first preset threshold; for lateral obstacles, a grid is immediately marked as an obstacle grid as long as at least one lateral obstacle point appears in a grid.

[0162] Step S306: For grid maps, in order to avoid areas where there are no obstacles due to environmental changes or false detections being continuously marked as obstacle grids, ground point clouds are used to clear obstacle grids in the grid map. When the number of ground point clouds falling on the same obstacle grid in multiple consecutive frames reaches the number of obstacle point clouds that can be cleared from all obstacle point clouds in that grid, that grid will no longer be marked as an obstacle grid.

[0163] Step S307: After obtaining the updated grid map, based on the robot's position in the map coordinate system, the obstacle grid of the local grid map is extracted from the grid map with a preset local range as the radius, and used as the current obstacle grid.

[0164] Step S308: In the current obstacle grid, calculate the left and right distances from each grid to the robot. If the distance is greater than the robot's body radius, discard the grid. In the remaining grids, calculate the forward distance of each grid as a candidate forward distance, and select the minimum value among all candidate forward distances as the forward distance in the nearest virtual obstacle distance. Calculate the left and right distances of the obstacle grid corresponding to this forward distance as the left and right distances in the nearest virtual obstacle distance. If the left and right distances are within the preset compensation range, compensate the forward distance in the nearest virtual obstacle distance according to formulas (7) and (8).

[0165] Step S309: In the current obstacle point cloud, calculate the left and right distances from each obstacle data point to the robot. If the distance is greater than the robot's body radius, discard the obstacle data point. Among the remaining obstacle data points, calculate the forward distance of each obstacle data point as a candidate forward distance, and select the minimum value among all candidate forward distances as the forward distance in the nearest actual obstacle distance. Calculate the left and right distances of the obstacle data point corresponding to this forward distance as the left and right distances in the nearest actual obstacle distance. If the left and right distances are within the preset compensation range, compensate the forward distance in the nearest actual obstacle distance according to formulas (7) and (8).

[0166] Step S310: After obtaining the actual obstacle distance and the virtual obstacle distance, if the smaller of the forward distance in the actual obstacle distance and the forward distance in the virtual obstacle distance is less than a preset safety distance, it indicates that the robot is at risk of colliding with the obstacle in the current forward direction and needs to enter obstacle avoidance mode to execute obstacle avoidance decisions. When making obstacle avoidance decisions, due to the blind zone of the line laser sensor, when the obstacle is located in the blind zone, the virtual obstacle distance is used for obstacle avoidance decisions. When the obstacle is not located in the blind zone, and the forward distance in the virtual obstacle distance and the forward distance in the actual obstacle distance are greater than a preset difference threshold, the smaller of the forward distance in the virtual obstacle distance and the forward distance in the actual obstacle distance is used as the basis for obstacle avoidance decisions. When the obstacle is not located in the blind zone, and the forward distance in the virtual obstacle distance and the forward distance in the actual obstacle distance are less than a preset difference threshold, the actual obstacle distance is used as the basis for obstacle avoidance decisions.

[0167] This application maps the current obstacle point cloud onto a grid map to obtain the virtual obstacle distance corresponding to the nearest obstacle grid cell to the robot. This compensates for the shortcomings of line laser sensors, which may miss obstacles due to blind spots, thus improving the completeness and reliability of environmental perception. Furthermore, a grid map update mechanism is implemented. If an obstacle grid cell is covered by ground point cloud data, it will be automatically cleared to ensure that the map state is consistent with the real environment and prevent misjudgments caused by outdated information. During obstacle avoidance decision-making, the virtual obstacle distance and the actual obstacle distance are fused to comprehensively assess the robot's collision risk in forward and lateral directions, enabling the robot to achieve safe, smooth, and efficient autonomous navigation under different operating conditions.

[0168] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0169] To implement the above-mentioned robot obstacle avoidance method, this application also proposes a robot obstacle avoidance device, please refer to the details below. Figure 4 , Figure 4 This is a schematic diagram of an embodiment of the robot obstacle avoidance device provided in this application.

[0170] The robot obstacle avoidance device 400 in this embodiment includes a processor 41, a memory 42, an input / output device 43, and a bus 44.

[0171] The processor 41, memory 42, and input / output device 43 are respectively connected to the bus 44. The memory 42 stores program data, and the processor 41 is used to execute the program data to implement the robot obstacle avoidance method described in the above embodiments.

[0172] In this embodiment, processor 41 can also be referred to as a CPU (Central Processing Unit). Processor 41 may be an integrated circuit chip with signal processing capabilities. Processor 41 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor, or processor 41 can be any conventional processor.

[0173] This application also provides a computer storage medium; please refer to the following: Figure 5 , Figure 5 This is a schematic diagram of a computer storage medium according to an embodiment of the present application. The computer storage medium 600 stores a computer program 61, which, when executed by a processor, is used to implement the robot obstacle avoidance method of the above embodiment.

[0174] When the embodiments of this application are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0175] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A robot obstacle avoidance method, characterized in that, The robot obstacle avoidance method includes: From the current point cloud data, divide the current obstacle point cloud; Map the current obstacle point cloud to the map coordinate system and update the obstacle grid of the global map; Based on the robot's current position, obtain the current obstacle grid of the local map; The actual obstacle distance is determined based on the distance between the current obstacle point cloud and the robot; The distance to the virtual obstacle is determined based on the distance between the current obstacle grid and the robot; The robot makes obstacle avoidance decisions based on the actual obstacle distance and the virtual obstacle distance.

2. The robot obstacle avoidance method according to claim 1, characterized in that, The step of dividing the current obstacle point cloud from the current point cloud data includes: The current point cloud data is divided into several point cloud datasets according to preset rules, wherein the two endpoints of each point cloud dataset form a set of dividing points; The point cloud dataset whose point height values ​​are within a preset height range is marked as a ground point set; Set the reference ground height based on the average height of the segmented point sets of all ground point sets; The point cloud dataset in which the difference between the height of each point in the segmented point set and the height of the reference ground is greater than a preset obstacle height threshold is marked as the current obstacle point cloud.

3. The robot obstacle avoidance method according to claim 1 or 2, characterized in that, The step of mapping the current obstacle point cloud to the map coordinate system and updating the obstacle grid of the global map includes: Based on the robot's current position and current forward direction angle, determine the left and right distances between the current obstacle point cloud and the robot; When the left and right distances are within a preset range, the obstacle grid is marked according to the grid result of the current obstacle point cloud mapped to the map coordinate system.

4. The robot obstacle avoidance method according to claim 3, characterized in that, The step of mapping the current obstacle point cloud to the map coordinate system and updating the obstacle grid of the global map includes: When the left and right distances are not within the preset range, candidate grids are determined to be mapped from the current obstacle point cloud onto the map coordinate system; Obtain the cumulative number of mappings for the candidate raster; The cumulative mapping count is updated based on the number of current obstacle point cloud mappings to the candidate grid. When the cumulative number of mappings reaches a first preset threshold, the candidate grid is marked as the obstacle grid.

5. The robot obstacle avoidance method according to claim 2, characterized in that, The robot obstacle avoidance method further includes: Map the ground point cloud from the ground point set onto the global map; Determine whether there is a ground point cloud that maps to the obstacle grid in the global map; If so, update the cumulative mapping count of the obstacle grid based on the number of mapped ground point clouds; When the cumulative number of mappings of the obstacle grid is less than or equal to a second preset threshold, the obstacle grid is updated to a ground grid.

6. The robot obstacle avoidance method according to claim 3, characterized in that, The step of mapping the current obstacle point cloud to the map coordinate system and updating the obstacle grid of the global map includes: Determine the candidate grid cells that the current obstacle point cloud can be mapped onto the map coordinate system; Check whether the neighboring grids of the candidate grid are marked obstacle grids; If so, mark the candidate grid as the obstacle grid.

7. The robot obstacle avoidance method according to claim 1, characterized in that, Determining the actual obstacle distance based on the distance between the current obstacle point cloud and the robot includes: Calculate the candidate forward distance between each obstacle data point in the current obstacle point cloud and the robot in the robot's forward direction; The forward distance of the actual obstacle distance is determined based on the minimum value among the candidate forward distances; Based on the obstacle data points corresponding to the minimum value, determine the left and right distances in the actual obstacle distance.

8. The robot obstacle avoidance method according to claim 7, characterized in that, The robot obstacle avoidance method further includes: Traverse the left and right distances between the current obstacle point cloud and the center point of the robot; Discard obstacle data points whose left and right distances are greater than the robot's body range.

9. The robot obstacle avoidance method according to claim 7, characterized in that, The robot obstacle avoidance method further includes: When the left and right distances in the actual obstacle distance are within the preset compensation range, the forward distance compensation value of the actual obstacle distance is obtained based on the forward distance and left and right distances in the actual obstacle distance, the robot's body radius, and the maximum compensation distance; Based on the forward distance compensation value, the effective forward distance of the actual obstacle distance is obtained.

10. The robot obstacle avoidance method according to claim 1, characterized in that, The obstacle avoidance decision-making process for the robot based on the actual obstacle distance and the virtual obstacle distance includes: When the smaller of the forward distance in the actual obstacle distance and the forward distance in the virtual obstacle distance is less than a preset safety distance, the robot makes an obstacle avoidance decision.

11. The robot obstacle avoidance method according to claim 10, characterized in that, The obstacle avoidance decision-making process for the robot based on the actual obstacle distance and the virtual obstacle distance includes: Obtain the forward distance difference between the actual obstacle distance and the virtual obstacle distance; When the absolute value of the forward distance difference is less than a preset difference threshold, the robot makes an obstacle avoidance decision based on the actual obstacle distance. When the absolute value of the forward distance difference is greater than or equal to a preset difference threshold, the robot makes an obstacle avoidance decision based on the distance to the virtual obstacle.

12. The robot obstacle avoidance method according to claim 10, characterized in that, Before making obstacle avoidance decisions for the robot based on the actual obstacle distance and the virtual obstacle distance, the process includes: When the smaller of the forward distance in the actual obstacle distance and the forward distance in the virtual obstacle distance is less than a preset deceleration distance threshold, the robot is decelerated.

13. A robot obstacle avoidance device, characterized in that, The robot obstacle avoidance device includes a memory and a processor, wherein the memory is coupled to the processor; The memory is used to store program data, and the processor is used to execute the program data to implement the robot obstacle avoidance method according to any one of claims 1 to 12.

14. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when executed by a processor, implements the steps of the robot obstacle avoidance method as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Robot and obstacle avoidance method and device thereof

    CN111142514A

  • Mapping method and device based on multi-line laser radar, medium and equipment

    CN111578932A

  • Robot automatic collision avoidance system and method

    CN113064437A

  • Mobile robot obstacle avoidance method

    CN113610910A

  • Robot obstacle detection method, robot and robot system

    CN114035584A

Cited By

  • Interaction control method, device and equipment of foot type robot and medium

    CN121492062A

  • Interaction control method, device and equipment of legged robot and medium

    CN121492062B