Laser SLAM closed-loop mapping method, device, mobile robot, equipment and medium
By determining the target key frame in laser SLAM mapping and performing loopback matching search or receiving matching instructions to optimize, the problem of large calculation amount and inability to close the loop in lidar SLAM mapping is solved, and efficient mobile robot navigation and map construction are achieved.
Patent Information
- Application Number
- CN202211192389.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-28
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2042-09-28
AI Technical Summary
Existing SLAM mapping solutions have the disadvantages of large amounts of calculation, low processing efficiency, and inability to achieve closed loops in LiDAR-based mobile robot navigation. In particular, it is difficult to perform effective loop detection in scenarios with large cumulative errors.
By acquiring laser sensing data, initializing the raster map, and determining the target keyframe based on the translation and rotation differences, inserting it into the map for loop matching search or receiving matching instructions for closed-loop graph optimization, the target map of the moving object is constructed and the consumption of computing resources is reduced. and adapt to different scenarios.
It achieves effective mapping in different scenarios, saves memory and computing resources, reduces the requirements for processor performance and cost, does not require additional sensor assistance, and meets closed-loop requirements.
Smart Images

Figure CN115655291B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of mobile robot navigation technology, and in particular to a laser SLAM closed-loop mapping method, device, mobile robot, equipment and medium. Background Art
[0002] Simultaneous Location and Mapping (SLAM) is a process in which a mobile robot moves in an unknown environment. It uses lidar or visual cameras to obtain corresponding sensor data, locates itself based on the sensor data, and incrementally builds a map perceived during the movement.
[0003] However, in the process of SLAM mapping based on LiDAR, since the algorithm estimation will produce errors and the errors will accumulate as the image frames are gradually generated, it is necessary to provide a loop mechanism to reduce or even eliminate the accumulated errors. Summary of the invention
[0004] In order to solve or at least partially solve the following technical problems: the current SLAM mapping solutions have the defects of large computational complexity, low processing efficiency and inability to achieve closed loop in some scenarios, the embodiments of the present disclosure provide a laser SLAM closed-loop mapping method, device, mobile robot, equipment and medium.
[0005] In the first aspect, the embodiments of the present disclosure provide a method for laser SLAM closed-loop mapping. The above method includes: acquiring laser sensor data of a moving object; initializing a grid map according to the initial laser frame in the above laser sensor data to obtain an initial key frame; determining a target key frame in the above subsequent laser frame for a subsequent laser frame located after the above initial laser frame timing in the above laser sensor data, wherein the difference between the above target key frame and the previous key frame existing in the above grid map in at least one of translation and rotation is greater than a set threshold; inserting the above target key frame into the above grid map; in the above grid map, performing a loop matching search within a preset distance threshold range of the above target key frame; and / or monitoring whether a matching instruction for a marked loop frame is received; in response to the existence of a matching result in the loop matching search or the receipt of the above matching instruction, performing closed-loop graph optimization processing to construct a target map perceived by the above moving object during movement.
[0006] According to an embodiment of the present disclosure, for subsequent laser frames in the laser sensor data that are located after the initial laser frame timing, a target key frame in the subsequent laser frames is determined, including: for each laser frame in the subsequent laser frames, grid filtering processing is performed to obtain point cloud data of the subsequent laser frames; position matching of the point cloud data of the subsequent laser frames with the grid map is performed to obtain the corresponding posture information of the point cloud data of the subsequent laser frames in the coordinate system of the grid map; and according to the difference between the posture information of each laser frame in the subsequent laser frames and the previous laser frame, it is determined whether each laser frame is a target key frame.
[0007] According to an embodiment of the present disclosure, the above-mentioned posture information includes: position information and attitude angle information; the above-mentioned set threshold includes: a first set threshold for limiting the distance difference and a second set threshold for limiting the angle difference; according to the difference between the respective posture information of the above-mentioned current laser frame and the previous laser frame, determining whether the above-mentioned current laser frame is a target key frame includes: calculating the translation distance between the above-mentioned current laser frame and the above-mentioned previous laser frame according to the respective position information of the above-mentioned current laser frame and the previous laser frame; calculating the rotation angle between the above-mentioned current laser frame and the above-mentioned previous laser frame according to the respective attitude angle information of the above-mentioned current laser frame and the previous laser frame; when the preset conditions are met, determining that the above-mentioned current laser frame is the target key frame, the above-mentioned preset conditions include at least one of the following: the above-mentioned translation distance is greater than the above-mentioned first set threshold, or the above-mentioned rotation angle is greater than the above-mentioned second set threshold.
[0008] According to an embodiment of the present disclosure, inserting the target key frame into the grid map includes: inserting point cloud data of the target key frame into the grid map based on corresponding target posture information.
[0009] According to an embodiment of the present disclosure, the above-mentioned set threshold is determined according to computing resource consumption and preset mapping accuracy, and the above-mentioned preset distance threshold range is related to the error of the above-mentioned laser sensor data matching.
[0010] According to an embodiment of the present disclosure, in the above-mentioned grid map, a loop matching search is performed within a preset distance threshold range of the above-mentioned target key frame, including: in the above-mentioned grid map, determining whether there is a loop frame of the above-mentioned target key frame among the key frames within the preset distance range of the above-mentioned target key frame, the above-mentioned loop frame and the above-mentioned target key frame are used to represent the same location; in the case of the existence of a loop frame, determining that the loop matching search has a matching result; in the case of the absence of a loop frame, determining that the loop matching search does not have a matching result.
[0011] According to an embodiment of the present disclosure, the grid map is initialized according to the initial laser frame in the above-mentioned laser sensor data to obtain an initial key frame, including: upon receiving the above-mentioned initial laser frame, initializing the origin of the coordinate system of the above-mentioned grid map; performing grid filtering processing on the above-mentioned initial laser frame to obtain point cloud data of the above-mentioned initial laser frame; position matching the point cloud data of the above-mentioned initial laser frame with the above-mentioned grid map to obtain the corresponding posture information of the point cloud data of the above-mentioned initial laser frame in the coordinate system of the above-mentioned grid map; inserting the above-mentioned initial laser frame into the above-mentioned grid map according to the corresponding posture information to obtain the initial key frame.
[0012] In a second aspect, an embodiment of the present disclosure provides a device for laser SLAM closed-loop mapping. The device includes: a sensor data acquisition module, a map initialization module, a key frame determination module, a map update module, a closed-loop condition detection module and a closed-loop processing module. The sensor data acquisition module is used to acquire laser sensor data of a moving object. The map initialization module is used to initialize the grid map according to the initial laser frame in the laser sensor data to obtain an initial key frame. The key frame determination module is used to determine the target key frame in the subsequent laser frame after the initial laser frame timing in the laser sensor data, and the difference between the target key frame and the previous key frame existing in the grid map in at least one of translation and rotation is greater than a set threshold. The map update module is used to insert the target key frame into the grid map. The closed-loop condition detection module is used to perform a loop matching search within a preset distance threshold range of the target key frame in the grid map; and / or monitor whether a matching instruction for a marked loop frame is received. The closed-loop processing module is used to perform closed-loop graph optimization processing in response to the existence of a matching result in the loop matching search or the receipt of the matching instruction, so as to construct a target map perceived by the moving object during the movement.
[0013] In a third aspect, an embodiment of the present disclosure provides a mobile robot. The mobile robot stores a set of instruction sets, which are executed by the mobile robot to implement the laser SLAM closed-loop mapping method described above; or the mobile robot includes the laser SLAM closed-loop mapping device described above.
[0014] In a fourth aspect, an embodiment of the present disclosure provides an electronic device. The electronic device includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store computer programs; and the processor is used to implement the laser SLAM closed-loop mapping method as described above when executing the program stored in the memory.
[0015] In a fifth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the laser SLAM closed-loop mapping method described above is implemented.
[0016] The above technical solution provided by the embodiments of the present disclosure has at least some or all of the following advantages:
[0017] In the provided laser SLAM closed-loop mapping method, considering that the laser radar generally has a high frequency, a target key frame for inserting into a grid map is obtained by setting a threshold on at least one of translation and rotation. Compared with inserting each frame of point cloud into the map in the related art, it can save memory usage and reduce the consumption of computing resources, and the value of the threshold can also balance the comprehensive requirements of computing resources and computing accuracy; at the same time, two complementary and coordinated closed-loop condition detection strategies are provided, one is to perform a loop matching search within a preset distance threshold range of the above-mentioned target key frame in the above-mentioned grid map; the other is to monitor whether a matching instruction for a marked loop frame is received. In some cases where there is no matching result in some loop matching searches, such as when mapping in some larger spatial environments, if the cumulative error is greater than the preset distance threshold range, the matching result cannot be searched and the closed loop cannot be performed. By receiving the matching instruction for the marked loop frame, the closed loop can be controlled manually. The above method meets the mapping requirements in various scenarios, does not require the use of additional sensors to assist the closed loop, reduces the requirements for processor performance, and reduces the consumption and cost of computing resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 The flowchart of the laser SLAM closed-loop mapping method according to the embodiment of the present disclosure is schematically shown;
[0021] Figure 2 A schematic diagram schematically shows a grid map after initialization processing according to an embodiment of the present disclosure;
[0022] Figure 3A schematic diagram of inserting a target key frame into a grid map according to an embodiment of the present disclosure is schematically shown;
[0023] Figure 4A A schematic diagram schematically shows a scenario in which no matching results exist in a loop closure matching search on a grid map according to an embodiment of the present disclosure;
[0024] Figure 4B Schematically shows Figure 4A A partial enlarged view of the middle loop;
[0025] Figure 5A A schematic diagram schematically shows a target map obtained after closed-loop graph optimization processing according to an embodiment of the present disclosure;
[0026] Figure 5B Schematically shows Figure 5A A partial enlarged view of the middle loop;
[0027] Figure 6 The detailed implementation flow chart of step S120 according to the embodiment of the present disclosure is schematically shown;
[0028] Figure 7 The detailed implementation flow chart of step S130 according to the embodiment of the present disclosure is schematically shown;
[0029] Figure 8 The structure block diagram of the laser SLAM closed-loop mapping device according to an embodiment of the present disclosure is schematically shown;
[0030] Fig. 9 The structural block diagram of the electronic device provided by the embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0031] In the process of SLAM mapping, a loop closure mechanism is needed to reduce or even eliminate errors. The loop closure mechanism refers to: forming a closed loop detection by identifying whether the current position of the robot is a position that has been passed before, and reducing the accumulated error by performing global or local map optimization.
[0032] However, during the research and development, it was found that: some loop closure mechanisms have large computational complexity and low computational efficiency, and have very high requirements on processor performance; some loop closure mechanisms are not suitable for scenarios with large cumulative errors, and will no longer search for loops when the cumulative error exceeds a limited range; some loop closure mechanisms require the assistance of visual sensing loops, which not only requires the addition of new sensors, but also has complex hardware settings, and large amounts of vision-related computations, which are easily affected by viewing angle and lighting; some loop closure mechanisms are prone to failure in some scenarios where the loop cannot be closed.
[0033] In view of this, an embodiment of the present disclosure provides a method for laser SLAM closed-loop mapping, the method comprising: acquiring laser sensor data of a moving object; initializing a grid map according to an initial laser frame in the laser sensor data to obtain an initial key frame; determining a target key frame in the subsequent laser frame that is located after the initial laser frame in the laser sensor data, wherein the difference between the target key frame and the previous key frame existing in the grid map in at least one of translation and rotation is greater than a set threshold; inserting the target key frame into the grid map; in the grid map, performing a loop matching search within a preset distance threshold range of the target key frame; or, monitoring whether a matching instruction for a marked loop frame is received; in response to the existence of a matching result in the loop matching search or the receipt of the matching instruction, performing closed-loop graph optimization processing to construct a target map perceived by the moving object during movement.
[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0035] In the description of the embodiments of the present disclosure, in the same paragraph or sentence, "A and / or B" means the following three options: including A alone, including B alone, or including A and B at the same time.
[0036] A first exemplary embodiment of the present disclosure provides a laser SLAM closed-loop mapping method.
[0037] Figure 1 The flowchart of the laser SLAM closed-loop mapping method according to an embodiment of the present disclosure is schematically shown.
[0038] Reference Figure 1 As shown, the laser SLAM closed-loop mapping method provided by the embodiment of the present disclosure includes the following steps: S110, S120, S130, S140, S150 and S160. The above steps S110 to S160 can be performed by an electronic device with computing capabilities, and the above electronic device can be a mobile object for positioning and mapping, or an electronic device capable of data communication with a mobile object.
[0039] In step S110 , laser sensing data of the moving object is acquired.
[0040] The above-mentioned moving objects are, for example, mobile robots, including but not limited to: intelligent self-driving vehicles, intelligent sweeping robots, intelligent search and rescue robots, exploration robots, patrol robots, drones, etc.
[0041] The moving object is equipped with a laser radar, which transmits in the surrounding environment at a preset frequency and obtains laser sensing data by detecting laser echoes.
[0042] The above laser sensing data is time-series laser frame data, and is updated in real time as the position of the moving object moves. The laser frame data carries information about the surrounding environment. For example, when the moving object is at the initial position L0, the laser sensing data collected at time t0 is the initial laser frame J0. When the moving object moves at a preset speed, the laser radar on the moving object emits at a preset frequency, and the laser frames collected after the initial position are collectively referred to as subsequent laser frames, that is, the subsequent laser frames are located after the initial laser frame sequence.
[0043] For example, the laser sensor data collected by the moving object at time t1 (t1 is the next sampling time of t0) is laser frame J1, and the laser sensor data collected at time t2 (t2 is the next sampling time of t1) is laser frame J2. As time goes by, at time t k The collected laser sensor data is laser frame J k , k represents the serial number of the laser frame, which is a positive integer. The laser frames J0, J1, J2, etc. carry environmental information that changes with the position of the moving object. Therefore, as the position of the moving object moves, a set of time-series laser frame data that is continuously updated over time and changes in real time with the position of the moving object will be obtained.
[0044] In step S120, the grid map is initialized according to the initial laser frame in the laser sensing data to obtain an initial key frame.
[0045] In the process of initializing the grid map, a corresponding initial key frame is generated on the grid map according to the data of the initial laser frame. For example, in an exemplary embodiment, the grid side length of the grid map is 0.05 m.
[0046] Figure 2 The schematic diagram schematically shows a grid map after initialization processing according to an embodiment of the present disclosure.
[0047] The electronic device starts the SLAM mapping system. When the SLAM mapping system can normally receive the laser sensor data collected by the laser radar, it starts to build the map. The initial position of the moving object is used as the origin of the coordinate system (0, 0), that is, as the starting point of the map. The initial key frame (that is, the first key frame) is generated in the grid map according to the data of the initial laser frame (that is, the first laser frame). Figure 2 As shown, in the grid map after initialization processing, the grid map is indicated by gray-filled grids, and the edge of the light-colored area or the independent pattern (two separate line segments) on the grid map is the laser point cloud 201 of the initial laser frame J0. The rectangular frame 202 around the laser point cloud 201 is also indicated.
[0048] In step S130, for a subsequent laser frame in the laser sensor data that is located after the initial laser frame sequence, a target key frame in the subsequent laser frame is determined, and a difference in at least one of translation and rotation between the target key frame and a previous key frame existing in the grid map is greater than a set threshold.
[0049] According to an embodiment of the present disclosure, the above-mentioned set threshold is determined according to computing resource consumption and preset mapping accuracy.
[0050] Since laser radar generally has a high frequency, a large amount of time-series laser frame data will be generated during the movement of the moving object. By setting a threshold on at least one of the translation and rotation, the target key frame for inserting into the grid map is obtained. Compared with the related technology of inserting each frame of point cloud into the map, it can save memory usage and reduce the consumption of computing resources. In addition, the value of the threshold can also balance the comprehensive requirements of computing resources and computing accuracy.
[0051] For example, in an exemplary embodiment, a motion filter is used to determine the target key frame, and the set threshold for the translation difference in the motion filter is 0.2 m, and the set threshold for the rotation angle difference is 3°.
[0052] For example, for each subsequent laser frame J1 and J2 after the initial laser frame J0, conditional judgment is performed based on the set threshold of at least one of translation and rotation. When a specific subsequent laser frame satisfies the condition greater than the set threshold compared to the previous key frame already existing in the above grid map, the above specific subsequent laser frame is determined as the target key frame. As an example, the value of k is 50. In the subsequent laser frames, the target key frames determined are: J5, J6, J7, J8, J9, J10, J11, J12, J13, J14, J15, J16, J17, J18, J19, J20, J21, J22, J30, J31, J32, J33, J40, J41, J42, J43, J44, J45, J46, J47, J48, J49, J50, J51, J52, J53, J54, J55, J56, J57, J58, J59, J60, J61, J62, J63, J74, J75 10 , J 14 , J 18 , J 26 , J 30 , J 35 , J 40 , J46 , J 50 .
[0053] In step S140, the target key frame is inserted into the grid map.
[0054] In the process of inserting the target key frame into the grid map, the number of the target key frame (the number recorded in time sequence) and the corresponding posture information of the target key frame in the grid map coordinate system can also be recorded. The above posture information includes: position information and attitude angle information. The grid map can be a two-dimensional map or a three-dimensional map. Correspondingly, the posture information can be two-dimensional data or three-dimensional data.
[0055] According to an embodiment of the present disclosure, inserting the target key frame into the grid map includes: inserting point cloud data of the target key frame into the grid map based on corresponding target posture information.
[0056] Figure 3 A schematic diagram of inserting a target key frame into a grid map according to an embodiment of the present disclosure is schematically shown.
[0057] Reference Figure 3 As shown, in addition to the laser point cloud 201 of the existing initial laser frame J0, the grid map also includes a laser point cloud 301 corresponding to a newly inserted target key frame, for example, a laser frame J5.
[0058] Laser frames that are not target keyframes do not need to be inserted into the grid map.
[0059] In step S150, in the grid map, a loop matching search is performed within a preset distance threshold of the target key frame; and / or, it is monitored whether a matching instruction for a marked loop frame is received.
[0060] In some embodiments, laser frames with obvious identical features are manually marked as loop frames in advance. For example, in the process of mapping the motion of a moving object, it is manually observed that the moving object returns to a certain position L that it has already passed. 旧 , the position L will be manually marked 旧 The corresponding laser frame is a loop frame. According to the current laser frame and the position L 旧 The corresponding laser frame constructs the error term and performs closed-loop graph optimization.
[0061] The preset distance threshold range is related to the basic error of the laser sensor data matching. For example, the preset distance threshold range can be set to be larger than the basic error of the laser sensor data matching, and can be set to 5-15 times, and can be adjusted in multiples according to the scene size, not limited to the numerical examples here, and the value of the preset distance threshold range can also be coordinated according to the calculation accuracy and the consumption of computing resources.
[0062] In an exemplary embodiment, when the error of laser sensor data matching is 1m, the preset distance threshold range can be set to 5m. If the path is long, the cumulative error is large, for example, 6m, then there is a situation where the cumulative error exceeds the preset distance threshold range.
[0063] Figure 4A A schematic diagram schematically shows a scenario in which no matching results exist in a loop closure matching search on a grid map according to an embodiment of the present disclosure; Figure 4B Schematically shows Figure 4A A partial enlarged view of the loop in the figure. Figure 4A The box selection area S that needs to be enlarged is shown in FIG. 1 , and the box selection area S includes the loop part and is Figure 4B In the figure, the framed area S is enlarged for illustration.
[0064] Considering that there are scenarios where the loop cannot be closed, for example, Figure 4A and Figure 4B As shown, for example, when building a map in some larger spatial environments, when the cumulative error is greater than the preset distance threshold range, there is no matching result in the loop matching search, that is, no matching result can be found, resulting in the inability to close the loop, such as in Figure 4A The initial key frame 201 (i.e., the first key frame), the second key frame 301, and the subsequent key frames are illustrated in the figure, and the second key frame is used to exemplify the loop frame 310b. During the movement of the moving object, the cumulative error between the key frame 310a corresponding to the current moment and the corresponding loop frame 310b representing the same position is greater than 10m, which exceeds the preset distance threshold range. In this case, there is no matching result by performing a loop matching search within the preset distance threshold range of the above-mentioned target key frame.
[0065] In this scenario, the method disclosed herein also provides a strategy for manual loop closure to compensate, that is, by monitoring whether a matching instruction for a marked loop frame is received, if a manual loop closure is required, a human will manually send a matching instruction for closing the marked loop frame to the electronic device. By receiving a matching instruction for a marked loop frame, manual control of the loop closure can be achieved.
[0066] According to the embodiments of the present disclosure, two closed-loop detection conditions are provided, and the two detection conditions can also be organically combined and used as complementary solutions to implement the strategy of automatic closed-loop and manual closed-loop coordination. In some embodiments, any one of the two closed-loop detection conditions can also be used alone to achieve closed-loop.
[0067] In some embodiments, a loopback matching search is performed within a preset distance threshold range of the target key frame; and / or, monitoring whether a matching instruction for a marked loopback frame is received includes the following embodiments: a loopback matching search is performed within a preset distance threshold range of the target key frame; when no matching result exists in the loopback matching search, monitoring whether a matching instruction for a marked loopback frame is received.
[0068] That is, in this embodiment, the following steps may be preferentially performed: performing a loop matching search within a preset distance threshold of the target key frame; if there is no matching result, the following steps may be performed: monitoring whether a matching instruction for the marked loop frame is received. There is a logic of complementarity and sequential execution between these two loop detection conditions.
[0069] In some other embodiments, the above two solutions can be executed synchronously, that is, while automatically performing the loopback matching search, it is also synchronously monitored whether a matching instruction for the marked loopback frame is received. As long as one of them occurs, the subsequent step S160 is executed.
[0070] According to an embodiment of the present disclosure, in the above-mentioned grid map, a loop matching search is performed within a preset distance threshold range of the above-mentioned target key frame, including: in the above-mentioned grid map, determining whether there is a loop frame of the above-mentioned target key frame among the key frames within the preset distance range of the above-mentioned target key frame, the above-mentioned loop frame and the above-mentioned target key frame are used to represent the same location; in the case of the existence of a loop frame, determining that the loop matching search has a matching result; in the case of the absence of a loop frame, determining that the loop matching search does not have a matching result.
[0071] In step S160, in response to the existence of a matching result in the loop matching search or the reception of the above-mentioned matching instruction, closed-loop graph optimization processing is performed to construct a target map perceived by the above-mentioned moving object during the movement.
[0072] When there is a matching result in the loop matching search or the above matching instruction is received, the closed-loop graph optimization process is performed. In the process of closed-loop graph optimization, by constructing an error term and performing global or local graph optimization, the optimal pose information of each key frame in the global closed loop or local closed loop that minimizes the error term is solved. All key frames (including the initial key frame and one or more target key frames) form a target map according to the optimal pose information.
[0073] Figure 5A A schematic diagram schematically shows a target map obtained after closed-loop graph optimization processing according to an embodiment of the present disclosure; Figure 5B Schematically shows Figure 5A A partial enlarged view of the loop in the figure. Figure 5A The box selection area S that needs to be enlarged is shown in FIG. 1 , and the box selection area S includes the loop part and is Figure 5B In the figure, the framed area S is enlarged for illustration.
[0074] For example, refer to Figure 5A and Figure 5B As shown, in the case of manual loop closure, the electronic device receives a matching instruction for the marked loop frame, performs closed-loop graph optimization processing, and optimizes the posture information of each key frame in the loop, so that the key frame corresponding to the current position and the second key frame (loop frame) form a closed loop 410 (i.e., they are in the same position), and the obtained target map eliminates the cumulative error.
[0075] In the method including the above steps S110 to S160, considering that the laser radar generally has a high frequency, by setting a threshold on at least one of translation and rotation to obtain a target key frame for inserting into the grid map, compared with inserting each frame of point cloud into the map in the related art, it can not only save memory usage, but also reduce the consumption of computing resources, and the value of the threshold can also balance the comprehensive requirements of computing resources and computing accuracy; at the same time, two complementary and coordinated closed-loop condition detection strategies are provided, one is to perform a loop matching search within the preset distance threshold range of the above target key frame in the above grid map; the other is to monitor whether a matching instruction for the marked loop frame is received. In some cases where there is no matching result in the loop matching search, for example, when building a map in some larger spatial environments, if the cumulative error is greater than the preset distance threshold range, the matching result cannot be searched and the closed loop cannot be performed. By receiving the matching instruction for the marked loop frame, the closed loop can be controlled manually. The above method meets the mapping requirements in various scenarios, does not require the use of additional sensors to assist the closed loop, reduces the requirements for processor performance, and reduces the consumption and cost of computing resources.
[0076] Figure 6 The detailed implementation flow chart of step S120 according to the embodiment of the present disclosure is schematically shown.
[0077] According to the embodiments of the present disclosure, referring to Figure 6 As shown, in the above step S120, the grid map is initialized according to the initial laser frame in the above laser sensing data to obtain an initial key frame, including the following steps: S610, S620, S630 and S640.
[0078] In step S610, when the initial laser frame is received, the origin of the coordinate system of the grid map is initialized.
[0079] The initial position of the moving object is used as the origin of the coordinate system of the grid map (0, 0), that is, as the starting point of map construction.
[0080] In step S620, grid filtering is performed on the initial laser frame to obtain point cloud data of the initial laser frame.
[0081] The principle of grid filtering is to divide the current point cloud into a voxel grid with a fixed side length. All points falling into the same grid are represented by the coordinates of the center point of the grid. This can reduce the amount of calculation when matching between laser frames and balance the weights of each point.
[0082] In step S630, the point cloud data of the initial laser frame is position-matched with the grid map to obtain the corresponding position and posture information of the point cloud data of the initial laser frame in the coordinate system of the grid map.
[0083] In some embodiments, the grid map is a two-dimensional map, and the position information of the point cloud data in the two-dimensional grid map is (x, y, θ), where x and y represent the x coordinate and y coordinate in the two-dimensional position information, and θ represents the two-dimensional attitude angle information, specifically the rotation angle information.
[0084] Calculate the point cloud p after grid filtering current Relative position T with the current map ε The solution formula is:
[0085]
[0086] Among them, K is the total number of point clouds to be matched; M smoot h is a smoothing function using a bicubic interpolation pair to interpolate the raster map; p current is the point cloud data of the laser frame (can also be described as laser point cloud); T ε is to p current All points are converted to the pose information in the current map coordinate system.
[0087] The above solution formula can be used to output the pose information of the current laser frame in real time.
[0088] In some embodiments, the grid map is a three-dimensional map, and the position information of the point cloud data in the three-dimensional grid map is (x, y, z, θ P ,θ R ,θ Y ), where (x, y, z) represents the x-coordinate, y-coordinate and z-coordinate in the three-dimensional position information; θ Prepresents the pitch angle, θ R represents the roll angle, θ Y Indicates the yaw angle. Algorithms such as ICP (Iterative Closest Point, a point cloud matching algorithm) and NDT (Normal Distribution Transform, normal distribution transformation algorithm) can also be used to calculate the three-dimensional pose information.
[0089] In step S640, the initial laser frame is inserted into the grid map according to the corresponding posture information to obtain an initial key frame.
[0090] The initial laser frame is inserted into the grid map with the corresponding pose information as the initial key frame of the grid map.
[0091] Based on the above steps S601 to S640, by performing grid filtering during the process of initializing the grid map, the amount of calculation for inter-frame matching can be reduced during the preliminary calculation of the pose information, and the weights of each point in the point cloud can be balanced.
[0092] Figure 7 The detailed implementation flow chart of step S130 according to the embodiment of the present disclosure is schematically shown.
[0093] According to the embodiments of the present disclosure, referring to Figure 7 As shown, in the above step S130, for the subsequent laser frame located after the above initial laser frame timing in the above laser sensing data, determining the target key frame in the above subsequent laser frame includes the following steps: S710, S720 and S730.
[0094] In step S710, grid filtering is performed on each of the subsequent laser frames to obtain point cloud data of the subsequent laser frames.
[0095] The principle of grid filtering is to divide the current point cloud into a voxel grid with a fixed side length. All points falling into the same grid are represented by the coordinates of the center point of the grid. This can reduce the amount of calculation when matching between laser frames and balance the weights of each point.
[0096] In step S720, the point cloud data of the subsequent laser frame is position-matched with the grid map to obtain the corresponding position and posture information of the point cloud data of the subsequent laser frame in the coordinate system of the grid map.
[0097] In this embodiment, for a two-dimensional grid map, the above formula (1) can be referred to to calculate the position information. For a three-dimensional grid map, the ICP, NDT algorithm, etc. can be used to calculate the position information.
[0098] In step S730, it is determined whether each of the laser frames is a target key frame according to the difference between the pose information of each laser frame in the subsequent laser frames and the previous laser frame.
[0099] According to an embodiment of the present disclosure, the above-mentioned posture information includes: position information and posture angle information.
[0100] The above-mentioned set thresholds include: a first set threshold for limiting the distance difference and a second set threshold for limiting the angle difference.
[0101] In the above step S730, whether the above-mentioned current laser frame is a target key frame is determined according to the difference between the respective position information of the above-mentioned current laser frame and the previous laser frame, including: calculating the translation distance between the above-mentioned current laser frame and the previous laser frame according to their respective position information; calculating the rotation angle between the above-mentioned current laser frame and the previous laser frame according to their respective posture angle information; when the preset conditions are met, determining that the above-mentioned current laser frame is a target key frame, and the above-mentioned preset conditions include at least one of the following: the above-mentioned translation distance is greater than the above-mentioned first set threshold, or the above-mentioned rotation angle is greater than the above-mentioned second set threshold.
[0102] For the two-dimensional attitude angle, the rotation angle is expressed as the absolute value of the difference between the rotation angle of the current laser frame and the rotation angle of the previous laser frame.
[0103] For the three-dimensional attitude angle, there are three rotation angles, which are respectively expressed as the absolute value of the difference between the pitch angle of the current laser frame and the previous laser frame, the absolute value of the difference between the roll angle, and the absolute value of the difference between the yaw angle.
[0104] A second exemplary embodiment of the present disclosure provides a device for laser SLAM closed-loop mapping.
[0105] Figure 8 The structure block diagram of the laser SLAM closed-loop mapping device according to an embodiment of the present disclosure is schematically shown.
[0106] Reference Figure 8 As shown, the laser SLAM closed-loop mapping device 800 provided in the embodiment of the present disclosure includes: a sensor data acquisition module 801, a map initialization module 802, a key frame determination module 803, a map update module 804, a closed-loop condition detection module 805 and a closed-loop processing module 806.
[0107] The sensor data acquisition module 801 is used to acquire laser sensor data of a moving object.
[0108] The map initialization module 802 is used to initialize the grid map according to the initial laser frame in the laser sensing data to obtain an initial key frame.
[0109] The key frame determination module 803 is used to determine a target key frame in a subsequent laser frame in the laser sensor data that is located after the initial laser frame sequence, wherein the target key frame has a difference in at least one of translation and rotation greater than a set threshold value compared to a previous key frame already existing in the grid map.
[0110] The map updating module 804 is used to insert the target key frame into the grid map.
[0111] The loop condition detection module 805 is used to perform a loop matching search within a preset distance threshold of the target key frame in the grid map; and / or monitor whether a matching instruction for a marked loop frame is received.
[0112] The closed-loop processing module 806 is used to perform closed-loop graph optimization processing in response to the existence of a matching result in the loop matching search or the receipt of the matching instruction, so as to construct a target map perceived by the moving object during the movement.
[0113] The implementation details of the functional modules included in the device provided in the embodiment of the present disclosure can be referred to the description of the first embodiment and will not be repeated here.
[0114] Any number of the functional modules included in the above-mentioned device 800 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. At least one of the functional modules included in the above-mentioned device 800 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the functional modules included in the above-mentioned device 800 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0115] A third exemplary embodiment of the present disclosure provides a mobile robot.
[0116] The mobile robot stores a set of instruction sets, which are executed by the mobile robot to implement the laser SLAM closed-loop mapping method described above; or the mobile robot includes the laser SLAM closed-loop mapping device described above.
[0117] The above-mentioned mobile robots include but are not limited to: intelligent self-driving vehicles, intelligent sweeping robots, intelligent search and rescue robots, exploration robots, patrol robots, drones, etc.
[0118] A fourth exemplary embodiment of the present disclosure provides an electronic device.
[0119] Fig. 9 The structural block diagram of the electronic device provided by the embodiment of the present disclosure is schematically shown.
[0120] Reference Fig. 9 As shown, the electronic device 900 provided by the embodiment of the present disclosure includes a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902 and the memory 903 communicate with each other through the communication bus 904; the memory 903 is used to store computer programs; the processor 901 is used to implement the laser SLAM closed-loop mapping method as described above when executing the program stored in the memory.
[0121] The fifth exemplary embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the laser SLAM closed-loop mapping method described above is implemented.
[0122] The computer-readable storage medium may be included in the device / apparatus described in the above embodiment; or it may exist independently without being assembled into the device / apparatus. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0123] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0124] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0125] The foregoing is merely a specific embodiment of the present disclosure, which enables those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features applied herein.
Claims
1. A laser SLAM closed-loop mapping method, characterized in that: include: Acquire laser sensing data of moving objects; Initializing the grid map according to the initial laser frame in the laser sensing data to obtain an initial key frame; For a subsequent laser frame in the laser sensor data that is located after the initial laser frame timing, determine a target key frame in the subsequent laser frame, wherein the difference between the target key frame and a previous key frame existing in the grid map in at least one of translation and rotation is greater than a set threshold; Inserting the target key frame into the grid map; In the grid map, performing a loop matching search within a preset distance threshold range of the target key frame; and / or monitoring whether a matching instruction for a marked loop frame is received; In response to the existence of a matching result in the loop matching search or the receipt of the matching instruction, a closed-loop graph optimization process is performed to construct a target map perceived by the moving object during the movement.
2. The method according to claim 1, characterized in that For a subsequent laser frame in the laser sensing data that is located after the initial laser frame timing, determining a target key frame in the subsequent laser frame includes: Performing grid filtering processing on each laser frame in the subsequent laser frames to obtain point cloud data of the subsequent laser frames; Position matching of the point cloud data of the subsequent laser frame with the grid map is performed to obtain corresponding position information of the point cloud data of the subsequent laser frame in the coordinate system of the grid map; According to the difference between the position information of each laser frame in the subsequent laser frames and the previous laser frame, it is determined whether each laser frame is a target key frame.
3. The method according to claim 2, characterized in that The posture information includes: position information and posture angle information; the set threshold includes: a first set threshold for limiting the distance difference and a second set threshold for limiting the angle difference; Determining whether the current laser frame is a target key frame according to the difference between the pose information of the current laser frame and the previous laser frame includes: Calculating a translation distance between the current laser frame and the previous laser frame according to respective position information of the current laser frame and the previous laser frame; Calculating a rotation angle between the current laser frame and the previous laser frame according to the attitude angle information of each of the current laser frame and the previous laser frame; When a preset condition is met, the current laser frame is determined to be a target key frame, and the preset condition includes at least one of the following: the translation distance is greater than the first set threshold, or the rotation angle is greater than the second set threshold.
4. The method according to claim 2, characterized in that: Inserting the target key frame into the grid map includes: The point cloud data of the target key frame is inserted into the grid map based on the corresponding target pose information.
5. The method according to any one of claims 1 to 4, characterized in that The set threshold is determined according to computing resource consumption and preset mapping accuracy, and the preset distance threshold range is related to the error of matching the laser sensor data.
6. The method according to claim 1, characterized in that In the grid map, a loopback matching search is performed within a preset distance threshold range of the target key frame, including: In the grid map, determining whether there is a loop frame of the target key frame among the key frames within a preset distance range of the target key frame, the loop frame and the target key frame being used to represent the same location; In the case where a loop frame exists, determining that a matching result exists in the loop matching search; When there is no loopback frame, it is determined that there is no matching result in the loopback matching search.
7. The method according to claim 1, characterized in that According to the initial laser frame in the laser sensing data, the grid map is initialized to obtain an initial key frame, including: Upon receiving the initial laser frame, initializing the origin of the coordinate system of the grid map; Performing grid filtering processing on the initial laser frame to obtain point cloud data of the initial laser frame; Position matching is performed between the point cloud data of the initial laser frame and the grid map to obtain the corresponding position information of the point cloud data of the initial laser frame in the coordinate system of the grid map; The initial laser frame is inserted into the grid map according to the corresponding posture information to obtain an initial key frame.
8. A laser SLAM closed-loop mapping device, characterized in that: include: A sensor data acquisition module, used to acquire laser sensor data of a moving object; A map initialization module, used to initialize the grid map according to the initial laser frame in the laser sensing data to obtain an initial key frame; A key frame determination module, for determining a target key frame in a subsequent laser frame located after the initial laser frame timing in the laser sensor data, wherein the difference between the target key frame and the previous key frame existing in the grid map in at least one of translation and rotation is greater than a set threshold; A map updating module, used for inserting the target key frame into the grid map; A closed loop condition detection module, used to perform a loop matching search within a preset distance threshold range of the target key frame in the grid map; and / or to monitor whether a matching instruction for a marked loop frame is received; The closed-loop processing module is used to perform closed-loop graph optimization processing in response to the existence of a matching result in the loop matching search or the receipt of the matching instruction, so as to construct a target map perceived by the mobile object during the movement.
9. A mobile robot, characterized in that: A set of instruction sets is stored, and the instruction sets are executed by the mobile robot to implement any method described in claims 1-7, or include the device described in claim 8.
10. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor, for implementing the method according to any one of claims 1 to 7 when executing a program stored in a memory.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Repositioning method and system based on laser radar
CN114236552A
Ground texture image-based navigation method and device, and storage medium
US20200333162A1
