Map construction method and device, equipment and storage medium
By acquiring and converting the line segment or region representation information of obstacles, a grid map is constructed, which solves the problem of inaccurate representation of obstacles in the prior art, and achieves higher map construction accuracy and robot obstacle avoidance success rate.
Patent Information
- Application Number
- CN202510004272.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-04-18
AI Technical Summary
In the existing grid map construction method, the form of obstacles is used to represent obstacles, and the form of obstacles cannot be effectively characterized, resulting in inaccurate map construction and unable to meet the obstacle avoidance needs of a certain volume of equipment.
By obtaining the first position information represented by the line segment or region of the obstacle, it is converted into the second position information under the world coordinate system, and then at least one layer of grid map is constructed, wherein the grid where the obstacle is located is in the occupied state.
Using line segments or regions to represent obstacles can more accurately characterize the shape of obstacles, improve the accuracy of map construction, meet the obstacle avoidance needs of a certain volume of equipment, and improve the success rate of robot obstacle avoidance.
Smart Images

Figure CN119845250A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine vision, and in particular to a map construction method, device, equipment and storage medium. Background Art
[0002] Map construction is to collect environmental data through sensors (such as lidar, cameras, millimeter wave radar, etc.), and then process these data through algorithms to construct a geometric and topological representation of the environment. Common map construction methods include grid mapping.
[0003] In the existing raster map construction process, obstacles are usually represented in the form of points, but the point form does not conform to the actual shape of the obstacle. The constructed map cannot well represent the obstacle shape, nor does it meet the obstacle avoidance needs of devices with a certain volume. How to improve the accuracy of map obstacle representation has become an urgent problem to be solved. Summary of the invention
[0004] The present application at least provides a map construction method, apparatus, device and storage medium.
[0005] The present application provides a map construction method, including: obtaining first position information represented by a plurality of obstacles, where the obstacles are represented as line segments or areas for characterizing the obstacles; determining second position information corresponding to each obstacle in a world coordinate system based on the first position information represented by each obstacle; and constructing at least one layer of grid map based on the second position information corresponding to each obstacle in the world coordinate system, wherein in the grid map, the grid where the obstacle is located is in an occupied state.
[0006] The present application provides a map construction device, including an acquisition module, a conversion module and a map construction module. The acquisition module is used to acquire first position information represented by a plurality of obstacles, where the obstacles are represented as line segments or regions and are used to characterize the obstacles; the conversion module is used to determine the second position information of each obstacle corresponding to the obstacle in the world coordinate system based on the first position information represented by each obstacle; the map construction module is used to construct at least one layer of grid map based on the second position information of each obstacle corresponding to the obstacle in the world coordinate system, wherein in the grid map, the grid where the obstacle is located is in an occupied state.
[0007] The present application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement any of the above methods.
[0008] The present application provides a computer-readable storage medium on which program instructions are stored. When the program instructions are executed by a processor, any of the above methods is implemented.
[0009] In the above scheme, obstacles are represented by line segments or regions, and a grid map is constructed based on the position information represented by the above obstacles, wherein the grid where the obstacle is located is represented as an occupied state. Compared with representing obstacles in point form, line segments or regions are closer to the real form of obstacles, which can improve the accuracy of obstacle representation in the map.
[0010] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0012] Figure 1 It is a flowchart of an embodiment of the map construction method of the present application;
[0013] Figure 2 This is a flow chart of an embodiment of step 1 of generating a laser radar layer raster map of the present application;
[0014] Figure 3 It is a flowchart of another embodiment of the map construction method of the present application;
[0015] Figure 4 It is a schematic diagram of the framework of an embodiment of a map construction device of the present application;
[0016] Figure 5 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;
[0017] Figure 6 is a schematic diagram of another embodiment of the electronic device of the present application;
[0018] Figure 7 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0019] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0020] In the following description, for the purpose of explanation rather than limitation, specific details such as specific subsystem structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0021] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.
[0022] See also Figure 1 , Figure 1 This is a flowchart of an embodiment of a map construction method of the present application. Specifically, the method may include:
[0023] Step S110: Obtain first position information represented by a plurality of obstacles.
[0024] The obstacle representation may be a line segment or an area, which is used to represent the obstacle. The first position information may be the position information of the line segment or the area, which may represent the position information of the obstacle.
[0025] In some cases, a region may be formed by enclosing multiple line segments.
[0026] Step S120: based on the first position information represented by each obstacle, determine the corresponding second position information of each obstacle in the world coordinate system.
[0027] The second position information is the position information of the obstacle in the world coordinate system.
[0028] It can be understood that by converting the first position information represented by an obstacle into the world coordinate system, the second position information of the corresponding obstacle in the world coordinate system can be obtained.
[0029] In some embodiments, the first position information represented by a certain obstacle is the position information of the obstacle in the world coordinate system, and the first position information can be directly used as the corresponding second position information.
[0030] Step S130: construct at least one layer of grid map based on the second position information of each obstacle corresponding to the world coordinate system.
[0031] Among them, the grid where the obstacle is located in the grid map is in an occupied state.
[0032] It is understandable that one or more layers of grid maps can be constructed using the second position information of each obstacle. For example, if a multi-layer grid map is constructed, grid maps corresponding to different types of obstacles can be constructed according to the type of obstacle, or grid maps corresponding to different obstacles can be constructed.
[0033] In some embodiments, the plurality of obstacle representations include at least one of a detected obstacle representation and a virtual wall representation, wherein the virtual wall representation can be used to represent obstacles configured by a user, and the detected obstacle representation can be used to represent obstacles detected by the robot.
[0034] The above scheme provides a method of using lines or areas to represent obstacles. Compared with representing obstacles in the form of points, this method is closer to the real form of obstacles, can improve the accuracy of obstacle representation in the map, and is more suitable for the obstacle avoidance needs of devices with a certain volume. Furthermore, applying this map to robot obstacle avoidance can improve the success rate of robot obstacle avoidance.
[0035] Furthermore, the virtual wall representation can be a first line segment or region. The detected obstacle representation can be a second line segment, which is located directly in front of the robot and has the same length as the width of the robot. The above settings combine the robot's morphology to characterize the obstacles detected by the robot, taking into account the robot's real shape and obstacle avoidance needs. Compared with the point-form obstacle representation, the robot's obstacle avoidance success rate can be improved.
[0036] In some embodiments, the virtual wall representation and the detected obstacle representation may be used to construct a virtual wall layer grid map and an obstacle avoidance layer grid map, respectively.
[0037] In some embodiments, the detected obstacle representation may further include at least one of a collision obstacle representation and a depth obstacle representation, wherein the collision obstacle representation may represent obstacles detected by a collision sensor, and the depth observed obstacle representation may represent obstacles detected by a depth sensor.
[0038] The difference between the two may include the distance between the obstacle representation and the robot. The first position information of the collision obstacle representation may indicate that the distance between the corresponding second line segment and the robot is a preset distance. The first position information of the depth observation obstacle representation may carry the depth observation distance information, which may indicate that the distance between the corresponding second line segment and the robot is the depth observation distance.
[0039] In some embodiments, the first position information represented by the virtual wall may be position information in a world coordinate system, and may be directly used as the second position information of the corresponding obstacle. Specifically, it may be position information of a line segment or a rectangle in a world coordinate system.
[0040] In some implementation scenarios, the first position information represented by the virtual wall may be the position information of the virtual wall in the world coordinate system, and may be directly used as the second position information of the corresponding obstacle in the world coordinate system.
[0041] In some embodiments, the obstacle detection represents an obstacle detected by the robot, and its first position information is the position information in the robot coordinate system. Based on the robot posture information in the world coordinate system, the above first position information can be converted to the world coordinate system to obtain the second position information of the obstacle in the world coordinate system.
[0042] In some implementation scenarios, the first position information of the detected obstacle is the position information of the detected obstacle in the robot coordinate system. It is understandable that the robot position is movable, and the robot coordinate system is related to the robot position. The above first position information can be the position information in the robot coordinate system when the obstacle is detected. The first position information can indicate that the second line segment is located directly in front of the robot and has the same length as the width of the robot. On the other hand, it can indicate the distance between the second line segment and the robot.
[0043] In some implementation scenarios, the first position information represented by the collision obstacle may be obtained based on the collision information. The collision information may indicate that a collision occurs at a certain moment, and the relative position relationship between the obstacle and the robot at that moment may be determined based on the collision information. Specifically, the obstacle is located directly in front of the robot, and its length is the same as the width of the robot, and the distance between the obstacle and the robot is a preset distance. Exemplarily, the preset distance may represent the distance between the center of the robot coordinate system and the obstacle at the time of the collision, such as the distance between the center of the robot coordinate system and the front end of the robot. Using the second line segment as a representation of the obstacle, the position information of the second line segment in the current robot coordinate system may be used as the first position information represented by the collision obstacle.
[0044] In some implementation scenarios, the first position information represented by the depth observation obstacle can be obtained based on the depth observation information. The depth observation information includes the depth observation distance detected at a certain moment, and the relative position relationship between the obstacle and the robot at that moment can be determined based on the depth observation information. Specifically, the obstacle is located directly in front of the robot, and its length is the same as the width of the robot. The distance between the obstacle and the robot is the above depth observation distance. Using the second line segment as the representation of the obstacle, the position information of the second line segment in the current robot system can be used as the first position information represented by the depth observation obstacle.
[0045] In some application scenarios, the robot posture information in the corresponding world coordinate system can be used to convert the first position information represented by the detected obstacle into the world coordinate system to obtain the second position information corresponding to the obstacle in the world coordinate system.
[0046] In some embodiments, the second position information corresponding to the virtual wall representation may be position information in the first world coordinate system, based on which a virtual wall layer grid map in the first world coordinate system may be constructed.
[0047] Specifically, according to the second position information, the grid where the obstacle corresponding to the virtual wall is located is determined, the grid state where the obstacle is located is set to an occupied state, and other grids are set to an idle state, thereby obtaining a virtual wall layer grid map.
[0048] In some implementation scenarios, there may be one or more first position information represented by a virtual wall. Different first position information corresponds to different obstacles.
[0049] In some embodiments, the second position information corresponding to the detected obstacle indication may be position information in a second world coordinate system, based on which an obstacle avoidance layer grid map in the second world coordinate system may be constructed.
[0050] Specifically, according to the second position information, the grid where the obstacle corresponding to the detected obstacle representation is located is determined, the state of the grid where the obstacle is located is set to an occupied state, and the states of other grids are set to an idle state, thereby obtaining an obstacle avoidance layer grid map.
[0051] In some implementation scenarios, there may be one or more pieces of first position information representing collision obstacles and / or one or more pieces of first position information representing depth observation obstacles.
[0052] In some embodiments, the coordinate systems of grid maps of different layers may be the same or different, for example, the first world coordinate system and the second world coordinate system may be the same or different.
[0053] In some embodiments, grid divisions of grid maps at different layers may be the same or different.
[0054] In some embodiments, after the virtual wall layer grid map is first constructed, the first position information of the new virtual wall representation may be obtained, and the current virtual wall layer grid map may be updated using the first position information of the new virtual wall representation. In some cases, if the user deletes or changes the first position information of the currently configured virtual wall representation, the corresponding virtual wall may be deleted or changed from the current virtual wall layer grid map.
[0055] In some embodiments, after the obstacle avoidance layer grid map is constructed for the first time, first position information of a new detected obstacle representation may be obtained, and the current obstacle avoidance layer grid map may be updated using the first position information of the new detected obstacle representation.
[0056] In some embodiments, the collision obstacle is determined due to the robot colliding in the actual scene. Considering that the obstacle may not be a fixed obstacle, it may be a temporary obstacle. Therefore, a corresponding clearing time interval may be determined for each collision obstacle representation. The corresponding obstacle is cleared according to the clearing time interval corresponding to the collision obstacle representation.
[0057] In some implementation scenarios, each collision obstacle may correspond to the same clearing time interval, which may be configured according to actual application requirements, and may be configured as one week, for example.
[0058] In some implementation scenarios, the clearing time intervals corresponding to obstacles at different locations may be adaptively adjusted according to the collision situation. For example, if multiple collisions occur at the same location, or the number or frequency of collisions within a period of time is high, the clearing time intervals for collision obstacles at the corresponding locations may be extended.
[0059] In a specific application scenario, in response to the number of collision obstacle representations corresponding to the same position meeting a preset number requirement, the clearing time interval corresponding to the obstacle at the position is extended.
[0060] In some embodiments, the depth observation obstacle representation can not only indicate that there is an obstacle at the depth observation distance in front of the robot, but also indicate that there is no obstacle within the depth observation distance range. The robot can continuously obtain new first position information of the depth observation obstacle representation, and if the new first position information of the depth observation obstacle representation indicates that there is no obstacle at the target position, the obstacle at the target position can be cleared. Among them, the above updated obstacles can include depth observation obstacles, and in some cases, can also include collision obstacle representations.
[0061] In a specific application scenario, the first position information represented by the deep observation obstacle is obtained, and the above information indicates that there is a deep observation obstacle 2m away from the robot. Then, assuming that the robot position remains unchanged, the first position information represented by the new deep observation obstacle is obtained, indicating that there is a deep observation obstacle 5m away from the robot. At this time, it can be determined that there is no deep observation obstacle 2m away from the robot, and the obstacle 2m away from the robot can be cleared.
[0062] In some embodiments, the method may further include: generating a lidar layer grid map based on lidar related data.
[0063] The coordinate system of the laser radar layer raster map may be a third world coordinate system, which may be the same as or different from the first world coordinate system / the second world coordinate system.
[0064] In some embodiments, the method may further include: associating each layer of grid maps to obtain a multi-layer grid map. Of course, in some embodiments, each layer of grid maps may also be used independently.
[0065] In some implementation scenarios, if the coordinate systems used by the raster maps of different layers are different, the two coordinate systems can be associated based on the conversion relationship between the two coordinate systems.
[0066] In some embodiments, two or more layers of grid maps may also be merged. Before merging, the expected grid division and world coordinate system after merging may be predetermined, and the grid maps of each layer to be merged may be preprocessed to adjust the grid division and world coordinate system. Specifically, upsampling or downsampling may be performed to adjust the grid division, and the conversion may be performed according to the world coordinate system conversion relationship before and after the merge. Thus, the grid maps of each layer to be merged are consistent with the grid division and world coordinate system after the merge, and then the merge process may be performed directly.
[0067] It should be noted that when merging, information from different layers can be fused or retained. For example, for a grid, the occupancy probability and state of the grid in the laser radar layer grid map and the state of the grid in the virtual wall layer grid map can be simultaneously available.
[0068] See also Figure 2 , Figure 2 This is a flow chart of an embodiment of the step 1 of generating a laser radar layer grid map of the present application. It should be noted that the laser radar layer grid map is generated using laser radar related data. Among them, the laser radar related data may include posture related sensor data and point cloud data.
[0069] Specifically, the generation of the lidar layer raster map can include the following steps:
[0070] Step S210: Determine relative posture information between the current frame and the previous frame based on the posture-related sensor data between the previous frame and the current frame.
[0071] Specifically, point cloud data can be collected frame by frame, and it takes a certain amount of time to collect one frame of point cloud data. Position-related sensor data can also be collected at a certain frequency.
[0072] In some implementation scenarios, from the end time of collecting the previous frame of point cloud data to the end time of collecting the current frame of point cloud data, that is, during the collection process of the current frame of point cloud, the collected posture-related sensor data can be considered as the posture-related sensor data between the previous frame and the current frame.
[0073] Based on the posture-related sensor data between the two frames, the relative posture information between the current frame and the previous frame can be estimated.
[0074] In some embodiments, the posture-related sensor data may include posture-related sensor data and displacement-related sensor data. The posture-related sensor data may be used to determine relative posture information between two frames, and the displacement-related sensor data may be used to determine relative displacement information between two frames.
[0075] In some embodiments, the posture-related sensor data may be angular velocity data. The posture-related sensor data between the previous frame and the current frame includes a plurality of angular velocity data. The product of the number of angular velocity data and the sum of all angular velocity data is taken as the target product, and the ratio of the target product to the acquisition frequency of the angular velocity data is taken as the relative posture information between the current frame and the previous frame.
[0076] In a specific application scenario, an inertial measurement unit (IMU) is used to record the angular velocity data of the robot. There are n angular velocity data recorded between the previous frame and the current frame, represented as {w1, w2, ..., wn}, and the IMU frequency is f1. The rotation transformation between the two frames can be approximated as R = n(w1+w2+, ..., +wn) / f1.
[0077] In some embodiments, the displacement-related sensor data may be odometer data. The posture-related sensor data between the previous frame and the current frame includes a plurality of odometer data. The difference between the last odometer data and the first odometer data may be used as the relative displacement information between the current frame and the previous frame.
[0078] In a specific application scenario, an odometer is used to record the displacement data of the robot. Between the previous frame and the current frame, m odometer displacement data are recorded, represented as {a1, a2, ..., am}. The translation transformation between the two frames can be approximated as T = am-a1.
[0079] In a specific application scenario, after obtaining the point cloud data of the previous frame, start recording IMU data and odometer data, and continue to push them into two lists respectively. When the point cloud data of the current frame is received, take out the data in the list, use the IMU data to infer the rotation transformation between the two frames, and use the odometer data to infer the translation transformation between the two frames to achieve initial pose estimation. The initial pose estimation between the two frames is expressed as {R, T}. After that, clear the sensor data list, re-record the data between the current frame and the next frame, and use it for pose estimation between subsequent frames.
[0080] Step S220: Determine the robot posture information of the current frame in the third world coordinate system based on the robot posture information of the previous frame and the relative posture information in the third world coordinate system.
[0081] The robot posture information of the first frame is the preset posture information. From the second frame onwards, the robot posture information of the current frame is determined based on the robot posture information of the previous frame and the relative posture information.
[0082] In some cases, the robot posture information and relative posture information of the previous frame can be directly added to obtain the robot posture information of the current frame.
[0083] Furthermore, the relative posture information between two frames can be roughly estimated by the posture-related sensor data. In step S220, adjustments can be made based on the preliminary estimated relative posture information to determine the accurate posture information of the robot in the current frame.
[0084] Compared with the pure lidar matching method, the initial pose estimation using IMU and wheel odometer effectively improves the positioning accuracy.
[0085] Step S230: updating the probability grid map based on the current frame robot posture information and the current frame point cloud data.
[0086] After determining the robot posture information of the current frame, the current probability grid map can be updated using the current frame point cloud data based on the posture.
[0087] Among them, the probability grid map is a grid representation in the global coordinate system. Each grid has a corresponding occupancy probability. The occupancy probability indicates the possibility that the grid is occupied, that is, the possibility that there are obstacles that affect the passage. The higher the probability value, the more likely there is an obstacle, and the smaller the probability value, the more likely the space is passable.
[0088] The point cloud data's hit and pass observations on the grid space can increase and decrease the probability value of the corresponding grid. Specifically, the points in the point cloud represent the laser's hit point, which means hitting an obstacle and can increase the probability of occupying the grid, while the points on the line between the robot and the hit point represent the pass point, which means no obstacle is hit and can reduce the probability of occupying the grid.
[0089] The current frame point cloud data can be projected onto the current probability grid map, and the current frame point cloud data can be used to update the occupancy probability of each grid in the current probability grid map.
[0090] In some specific application scenarios, the current frame point cloud data can be updated to the probabilistic grid map based on the Bayer-Hamming algorithm. The probabilistic update method based on the Bayer-Hamming algorithm can effectively improve the reliability of the grid map's occupied and idle states, and is conducive to representing the traversable information of the robot's surrounding environment.
[0091] In some embodiments, each grid in the initial probability grid map may have a preset probability. Each time a frame of point cloud data is collected, the probability grid map may be updated using the frame of point cloud data.
[0092] Step S240: At each preset time interval, the state of each grid is determined based on the occupancy probability of each grid in the current probability grid map to obtain the current lidar layer grid map.
[0093] The grid state may be set to one of occupied, idle and unknown. In some embodiments, the grid state may be set to one of occupied and idle, which may be configured according to actual application requirements.
[0094] In some embodiments, the above preset duration can be set according to actual application needs, so that the probability grid map can be updated once for each frame of point cloud data collected, and the current LiDAR layer grid map can be regenerated. Alternatively, the current LiDAR layer grid map can be regenerated after multiple frames of point cloud data.
[0095] In some implementation scenarios, an occupancy probability threshold and an idle probability threshold can be set, and each grid is traversed. If the occupancy probability value is greater than the occupancy probability threshold, the state of the grid is determined to be an occupied state; if the occupancy probability value is less than the idle probability threshold, the state of the grid is determined to be an idle state; if the occupancy probability value is between the occupancy probability threshold and the idle probability threshold, the state of the grid is determined to be an unknown state.
[0096] In some embodiments, step S220 may include: determining reference pose information of the current frame based on the robot pose information and relative pose information of the previous frame; selecting multiple candidate pose information based on the reference pose information; and selecting one from the multiple candidate pose information as the robot pose information of the current frame.
[0097] In some implementation scenarios, the robot posture information of the previous frame is added to the relative posture information to obtain the reference posture information of the current frame, which is used as the preliminary estimated posture information of the current frame, and this information is further refined.
[0098] In some implementation scenarios, multiple preset transformation information may be set, and the reference posture information may be transformed based on the multiple preset transformation information to obtain multiple candidate posture information.
[0099] In some specific application scenarios, the angle search range (-θ, θ) and the angle search step length k can be set respectively to obtain Preset rotation angles. The displacement search range and step size can be set respectively to obtain several preset displacements (xi, yi). Exemplarily, the displacement search range in the x direction can be set to (-a, a), and the displacement search range in the y direction can be set to (-b, b), and several preset displacements are selected within the range. Each selected preset rotation angle is combined with each preset displacement to obtain multiple preset transformation information.
[0100] The angle search range and the displacement search range can be set according to actual application needs, and further, can be related to the accuracy of displacement estimation by displacement-related sensor data. The search is performed on the basis of a rough estimate to obtain accurate current frame pose information.
[0101] In some embodiments, the accuracy of multiple candidate pose information can be judged based on the current probability grid map and the current frame point cloud data, and one of them can be selected as the current frame robot pose information.
[0102] In some implementation scenarios, for each candidate pose information, the candidate pose information can be used to simulate and update the current probability grid map, and the accuracy of the candidate pose information can be characterized based on the simulated updated probability grid map.
[0103] Furthermore, based on the candidate pose information, the current frame point cloud data is mapped to the current probability grid map, and the current frame point cloud data is used to simulate and update the current probability grid map to obtain the simulated probability grid map corresponding to the candidate pose information. The sum of the occupancy probabilities of each grid in the simulated probability grid map is calculated, and the candidate pose information corresponding to the simulated probability grid map with the largest sum of occupancy probabilities is used as the current frame robot pose information.
[0104] The current probability grid map may be a probability grid map updated by the last frame of point cloud data. The simulation update of the current probability grid map may refer to the relevant contents in the above embodiments, which will not be described in detail here.
[0105] It is understandable that during the acquisition of a frame of point cloud data, the robot may also move, so the robot coordinate system corresponding to each point in a frame of point cloud data may also be different, which can be called motion distortion. Therefore, before using a frame of point cloud data, the frame of point cloud data can be corrected for motion distortion, that is, all points in the frame of point cloud data can be unified to the same robot coordinate system.
[0106] In some cases, the robot coordinate system at the start time of collecting a frame of point cloud data can be used as the starting robot coordinate system, and all points in the frame of point cloud data can be unified into the starting robot coordinate system.
[0107] Specifically, based on the robot posture information corresponding to the historical frame, the robot posture information of each point at the collection moment during the collection process of the current frame point cloud data is estimated, and based on the robot posture information at the collection moment of each point, each point is converted to the starting robot coordinate system.
[0108] It can be understood that the robot posture information at the collection moment of each point is the posture information in the world coordinate system, so that the relative posture of each collection moment relative to the starting moment can be obtained, and then motion distortion correction can be achieved.
[0109] In some implementation scenarios, the point cloud data collection process of the previous frame is from t0 to t1, the point cloud data collection process of the previous frame is from t1 to t2, and the point cloud data collection process of the current frame is from t2 to t3. The robot posture information of the previous frame corresponding to time t1 is expressed as T1, and the robot posture information of the previous frame corresponding to time t2 is expressed as T2. T1 and T2 are known values determined in the historical frame. The specific method of obtaining them can refer to the steps for obtaining the robot posture information in the aforementioned embodiment. Assuming that the short-term motion from t1 to t3 is uniform, the formula for the posture T at any time t from t2 to t3 is as follows:
[0110]
[0111] pass Indicates the rate of posture change. Based on T2, the final posture is determined by the product of time and rate. The posture of each point corresponding to the timestamp can be used to achieve unified coordinate system conversion and complete distortion correction.
[0112] It is understandable that the robot posture information of the first frame of point cloud data can be preset posture information, and after obtaining the robot posture information of the second frame of point cloud data, motion distortion correction can be performed on the third frame and subsequent point cloud data. The first two frames of point cloud data do not need to be corrected.
[0113] In some embodiments, the point cloud can also be downsampled. Specifically, a two-dimensional grid is created, and in each grid, only the point closest to the center of the grid is retained to represent all the points in the grid. This method can reduce the computational complexity without destroying the geometric structure of the laser radar point cloud itself.
[0114] In some implementations, after distortion correction is completed, the point cloud data is downsampled using two-dimensional voxels. Specifically, a two-dimensional voxel grid is created, and in each voxel square, all point clouds within the voxel are approximated using the point closest to the center.
[0115] It can be understood that the above motion distortion correction and downsampling are preprocessing of point cloud data. After the preprocessing is completed, the pose estimation of the current frame point cloud, the probability map update, and the generation of the laser radar layer raster map can be performed.
[0116] In a specific application scenario, the update and maintenance of these three layers of maps do not interfere with each other. For navigation and obstacle avoidance, the three layers of maps can be merged to obtain the most information about obstacle observation. For the APP display of the map, the lidar layer can be used as the bottom layer, the virtual wall layer as the upper layer and different display colors from other layers to provide users with a clearer display effect.
[0117] See also Figure 3 , Figure 3 It is a flowchart of another embodiment of the map construction method of the present application.
[0118] In this embodiment, after data preprocessing, a frame of lidar input is combined with IMU data and wheel odometer data for positioning estimation and probability map update, and then used for lidar layer map generation and update.
[0119] Collision information and single-point TOF (Time of Flight) information use line segments to represent obstacles, which are used to generate and update the real-time obstacle avoidance layer map. It can be understood that the real-time obstacle avoidance layer map utilizes the robot posture information (positioning information) determined during the generation and update of the lidar layer map. Specifically, the generation and update of the real-time obstacle avoidance layer map depends on the positioning information when the detection information is generated. The real-time obstacle avoidance layer can provide the robot with obstacle information outside the observable range of the radar, such as low objects or transparent objects. Its update method can also effectively avoid repeated collisions and obstacle information that degrades the map. Regular clearing can prevent the continuous increase of obstacle information from affecting the passage of equipment.
[0120] Virtual wall information can be user-configured, using line segments or regions to represent obstacles, and is used for virtual wall layer map generation and update. Specifically, obstacles can be represented by line segments or rectangles. Virtual wall layer maps provide user editing capabilities for robot products, effectively improving the user's interactive experience and the effectiveness of navigation algorithms when virtual walls exist.
[0121] The above three layers of maps can be linked together to form a three-layer grid map architecture for mobile robots. The design of layered maps specializes map functions, and upstream and downstream algorithm modules can select map layers for merging and post-processing according to their specific needs, which can effectively improve the scalability and R&D efficiency of mobile robots.
[0122] See also Figure 4 , Figure 4 It is a schematic diagram of the framework of an embodiment of a map construction device of the present application.
[0123] In this embodiment, the map construction device 40 includes an acquisition module 41, a conversion module 42 and a map construction module 43. The acquisition module 41 is used to acquire first position information represented by a plurality of obstacles, where the obstacles are represented as line segments or regions and are used to characterize the obstacles; the conversion module 42 is used to determine the second position information of each obstacle corresponding to the world coordinate system based on the first position information represented by each obstacle; the map construction module 43 is used to construct at least one layer of grid map based on the second position information of each obstacle corresponding to the world coordinate system, wherein in the grid map, the grid where the obstacle is located is in an occupied state.
[0124] See also Figure 5 , Figure 5 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application.
[0125] The electronic device 50 includes a memory 51 and a processor 52. The processor 52 is used to execute program instructions stored in the memory 51 to implement the steps in any of the above map construction method embodiments. In a specific implementation scenario, the electronic device 50 may include, but is not limited to: computer equipment, electrical equipment, microcomputers, desktop computers, servers, and in addition, the electronic device 50 may also include mobile devices such as laptops and tablet computers, which are not limited here.
[0126] Specifically, the processor 52 is used to control itself and the memory 51 to implement the steps in any of the above-mentioned map construction method embodiments. The processor 52 can also be called a CPU (Central Processing Unit). The processor 52 may be an integrated circuit chip with signal processing capabilities. The processor 52 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 52 can be implemented by an integrated circuit chip.
[0127] In some embodiments, the above electronic device 50 may be a robot, or other device that is communicatively connected to the robot.
[0128] See also Figure 6 , Figure 6 It is a schematic diagram of another embodiment of the electronic device of the present application.
[0129] In this embodiment, a robot 60 is used as an example of an electronic device for description. The robot 60 includes a laser radar 61, a wheel odometer 62, an inertial measurement unit (IMU) 63, and a single-point flight distance measurement (TOF) unit 64. Among them, the laser radar 61 can be a single-line laser radar.
[0130] See also Figure 7 , Figure 7 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application.
[0131] The computer-readable storage medium 70 provided in this embodiment stores program instructions 71 that can be executed by a processor. When the program instructions 71 are executed by the processor, they are used to implement the steps in any of the above-mentioned map construction method embodiments.
[0132] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0133] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another subsystem, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0134] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially 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, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
Claims
1. A map construction method, characterized in that: The method comprises: Acquire first position information of a plurality of obstacle representations, where the obstacle representations are line segments or regions for representing the obstacles; Based on the first position information represented by each obstacle, determining the second position information of each obstacle corresponding to the obstacle in the world coordinate system; Based on the second position information of each obstacle corresponding to the world coordinate system, at least one layer of grid map is constructed, wherein in the grid map, the grid where the obstacle is located is in an occupied state.
2. The method according to claim 1, characterized in that The plurality of obstacle representations include at least one of a detection obstacle representation and a virtual wall representation; The virtual wall is represented as a first line segment or area, representing an obstacle configured by the user; The detected obstacle is represented by a second line segment, which represents the obstacle detected by the robot. The second line segment is located directly in front of the robot, and its length is the same as the width of the robot.
3. The method according to claim 2, characterized in that The detected obstacle representation includes at least one of a collision obstacle representation and a depth observation obstacle representation, wherein the collision obstacle representation represents an obstacle detected by a collision sensor, and the depth observation obstacle representation represents an obstacle detected by a depth sensor; the first position information of the collision obstacle representation represents that the distance between the second line segment and the robot is a preset distance, and the first position information of the depth observation obstacle representation represents that the distance between the second line segment and the robot is a depth observation distance; And / or, the first position information of the virtual wall representation is the position information of the virtual wall representation in the world coordinate system, and the first position information of the detected obstacle representation includes the distance between the detected obstacle representation and the robot; and determining the second position information of each obstacle corresponding to the obstacle in the world coordinate system based on the first position information of each obstacle representation includes at least one of the following steps: Using the first position information represented by the virtual wall as the second position information of the corresponding obstacle in the world coordinate system; Based on the robot posture information in the world coordinate system, the first position information represented by the detected obstacle is converted into the world coordinate system to obtain the second position information corresponding to the obstacle in the world coordinate system.
4. The method according to claim 2, characterized in that: The second position information of the obstacle corresponding to the virtual wall is the position information in the first world coordinate system, and the second position information of the obstacle corresponding to the detected obstacle is the position information in the second world coordinate system; The constructing at least one layer of grid map based on the second position information of each obstacle corresponding to the world coordinate system comprises at least one of the following steps: Based on the second position information of the obstacle corresponding to the virtual wall representation, construct a virtual wall layer grid map in the first world coordinate system; Based on the second position information of the obstacle corresponding to the detected obstacle representation, an obstacle avoidance layer grid map in the second world coordinate system is constructed.
5. The method according to claim 2, characterized in that: The detected obstacle representation includes at least one of a collision obstacle representation and a depth observation obstacle representation; the method further includes at least one of the following steps: Clearing the corresponding obstacle according to the clearing time interval corresponding to the collision obstacle indication; In response to the number of the collision obstacle representations corresponding to the same position meeting a preset number requirement, extending the clearance time interval corresponding to the obstacle at the position; In response to the new first position information of the depth-observed obstacle representation indicating that no obstacle exists at the target position, the obstacle at the target position is cleared.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Based on the lidar related data, a lidar layer raster map in the third world coordinate system is generated; And / or, the method further comprises: The raster maps of each layer are associated to obtain a multi-layer raster map.
7. The method according to claim 6, characterized in that The laser radar related data includes posture related sensor data and point cloud data; The step of generating a laser radar layer grid map in a third world coordinate system based on laser radar related data includes: Determine relative posture information between the current frame and the previous frame based on the posture-related sensor data between the previous frame and the current frame; Based on the robot posture information of the previous frame in the third world coordinate system and the relative posture information, determining the robot posture information of the current frame in the third world coordinate system; the robot posture information of the first frame in the third world coordinate system is the preset posture information; Update the probability grid map based on the robot posture information of the current frame and the point cloud data of the current frame; At each interval of a preset duration, the state of each grid is determined based on the occupancy probability of each grid in the current probability grid map to obtain the current lidar layer grid map, and the state of the grid is one of occupied, space and unknown.
8. The method according to claim 7, characterized in that The determining of the robot pose information of the current frame in the third world coordinate system based on the robot pose information of the previous frame in the third world coordinate system and the relative pose information comprises: Determine reference pose information of a current frame based on the robot pose information of the previous frame and the relative pose information; Based on the reference pose information, selecting a plurality of candidate pose information; Based on the current probability grid map and the point cloud data of the current frame, one is selected from the multiple candidate pose information as the robot pose information of the current frame.
9. The method according to claim 8, characterized in that The selecting a plurality of candidate pose information based on the reference pose information comprises: Performing posture transformation on the reference posture information based on multiple preset transformation information respectively to obtain the multiple candidate posture information; And / or, based on the current probability grid map and the point cloud data of the current frame, selecting one from the plurality of candidate pose information as the current frame robot pose information includes: For each of the candidate pose information, mapping the point cloud data of the current frame to the current probability grid map based on the candidate pose information; Using the point cloud data of the current frame to simulate and update the current probability grid map, to obtain a simulated probability grid map corresponding to the candidate pose information; The sum of the occupancy probabilities of the grids in the simulated probability grid map is calculated, and the candidate posture information with the largest sum of the occupancy probabilities is used as the current frame robot posture information.
10. The method according to claim 7, characterized in that The posture-related sensor data between the previous frame and the current frame includes a plurality of angular velocity data and a plurality of odometer data; the relative posture information includes relative posture information and relative displacement information; Determining relative posture information between the current frame and the previous frame based on the posture-related sensor data between the previous frame and the current frame includes: The ratio of a target product to the acquisition frequency of the angular velocity data is used as the relative posture information between the current frame and the previous frame, wherein the target product is the product of the number of the angular velocity data and the sum of the plurality of angular velocity data; The difference between the last odometer data and the first odometer data is used as the relative displacement information between the current frame and the previous frame.
11. The method according to claim 7, characterized in that Before using the point cloud data of the current frame, the method further includes: Based on the robot posture information corresponding to the historical frame, the robot posture information at the collection time of each point in the collection process of the point cloud data of the current frame is estimated; Based on the robot posture information of each point at the time of acquisition, each point is converted to a starting robot coordinate system, where the starting robot coordinate system is the robot coordinate system corresponding to the starting time during the acquisition process of the current frame.
12. A map construction device, characterized in that: The device comprises: An acquisition module, used to acquire first position information represented by a plurality of obstacles, wherein the obstacles are represented as line segments or regions, and are used to characterize the obstacles; A conversion module, used to determine the second position information of each obstacle corresponding to the obstacle in the world coordinate system based on the first position information represented by each obstacle; The map construction module is used to construct at least one layer of grid map based on the second position information of each obstacle corresponding to the world coordinate system, wherein in the grid map, the grid where the obstacle is located is in an occupied state.
13. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores program instructions, and when the program instructions are executed by the processor, the method according to any one of claims 1 to 11 is implemented.
14. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the method according to any one of claims 1 to 11 is implemented.
Citation Information
Cited By
Robot obstacle avoidance method, robot obstacle avoidance device and computer storage medium
CN120993922A