Laser map processing method and device, storage medium and electronic device
By generating and optimizing local laser maps in mobile devices and performing closed-loop detection with keyframes, the problem of high memory consumption in low-cost laser sweepers is solved, and the accuracy of map construction and the stability of equipment are improved.
Patent Information
- Application Number
- CN202310588943.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-23
- Publication Date
- 2024-12-03
AI Technical Summary
During the movement of existing equipment, the accumulated positioning error caused by low-cost sensor accuracy and environmental factors lead to reduced map construction accuracy, and the global closed-loop optimization method consumes too much memory resources on low-cost laser sweepers, resulting in crash or restart problems.
By obtaining N keyframes from the data collected when the target device moves in the target area, a local laser map is generated, and closed-loop detection and optimization are performed with the keyframes, data containing closed-loop constraints are deleted to reduce memory consumption.
It realizes reducing memory consumption during the process of building the device to run the map, ensuring the accuracy of map construction, and avoiding crashes or restart problems.
Smart Images

Figure CN119063709A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of robots, and more specifically, to a laser map processing method and device, a storage medium, and an electronic device. Background Art
[0002] Existing equipment mainly uses information from sensors such as LiDAR and Inertial Measurement Unit (IMU) for positioning and mapping during movement. However, due to the limitations of low-cost sensor accuracy, human movement or handling, bumps, dynamic environments, etc., cumulative positioning errors will occur, resulting in reduced mapping accuracy.
[0003] A common algorithm for eliminating cumulative errors is to use global closed-loop optimization. For example, when the sweeping robot finishes cleaning, it traverses all key frames, searches for the closed-loop constraints of key frames and all laser maps one by one, and then uses pose graph optimization to eliminate cumulative errors. However, when global closed-loop optimization is implemented on low-cost laser sweepers, there is a problem of excessive memory resource consumption. This will cause a series of problems such as freezing or restarting the sweeper. This problem is particularly prominent in large map scenes or long-distance continuous cleaning scenes.
[0004] With regard to the problem of high memory consumption in the process of building a device to run a map in related technologies, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a laser map processing method and device, a storage medium, and an electronic device to at least solve the problem of large memory consumption in the process of constructing a device to run a map in the related art.
[0006] According to one embodiment of the present invention, a laser map processing method is provided, comprising: obtaining N key frames from data collected when a target device moves in a target area, wherein N is a natural number greater than 1; generating a first laser map using M first key frames among the N key frames, wherein the first laser map includes a local map of the target device moving in the target area, and M is less than N; performing closed-loop detection on the first laser map and the N key frames; and deleting data in the first laser map when it is determined from the closed-loop detection result that a closed-loop constraint is included between the first laser map and the N key frames.
[0007] According to another embodiment of the present invention, a laser map processing device is also provided, including: a first acquisition module, used to acquire N key frames from data collected when the target device moves in the target area, wherein the above N is a natural number greater than 1; a first generation module, used to generate a first laser map using M first key frames among the N key frames, wherein the above first laser map includes a local map of the above target device moving in the above target area, and the above M is less than the above N; a first detection module, used to perform closed-loop detection on the above first laser map and the N key frames; a first deletion module, used to delete the data in the above first laser map when it is determined from the closed-loop detection result that the above first laser map and the N key frames include a closed-loop constraint.
[0008] In an exemplary embodiment, the above-mentioned first acquisition module includes: a first receiving unit, used to receive the above-mentioned data sent by the sensor when the above-mentioned target device moves in the above-mentioned target area; a first determination unit, used to determine the real-time posture information of the above-mentioned target device at each time point using the above-mentioned data; a first acquisition unit, used to obtain the key frame corresponding to each of the above-mentioned time points from the real-time posture information of the above-mentioned target device at each time point, and obtain N of the above-mentioned key frames.
[0009] In an exemplary embodiment, the first generation module includes: a first lifting unit, used to traverse the N key frames in the time order of obtaining the N key frames, and extract M consecutive first key frames from the N key frames; a first generation unit, used to generate the first laser map using the posture information of the M first key frames, wherein the first laser map includes at least one of the following: identification information of the first laser map, posture information of the first laser map, and occupancy grid map of the first laser map.
[0010] In an exemplary embodiment, the first detection module includes: a first matching unit, used to perform closed-loop matching between the first laser map and each of the key frames; a second determination unit, used to determine a first closed-loop matching pair between the first laser map and the first target key frame when the first laser map matches the first target key frame, wherein the first target key frame is a key frame among the N key frames, and the first closed-loop matching pair includes at least one of the following: identification information of the first target key frame, identification information of the first laser map, relative closed-loop posture between the first laser map and the first target key frame, and randomness information of the first closed-loop matching pair; a first verification unit, used to perform closed-loop verification on the first laser map.
[0011] In an exemplary embodiment, the first verification unit includes: a first verification subunit, used to verify the closed-loop continuity constraint between the first laser map and the K key frames, wherein the K key frames are key frames adjacent to the first target key frame, and the K is less than the N.
[0012] In an exemplary embodiment, the first deletion module includes: a first deletion unit, configured to delete data in the first laser map when the closed-loop detection result shows that the first laser map and the K key frames include a closed-loop continuity constraint.
[0013] In an exemplary embodiment, the apparatus further includes: a first extraction module, which is used to, when it is determined from the closed-loop detection result that the first laser map and the N key frames include a closed-loop constraint, traverse the N key frames in the time order of obtaining the N key frames, and extract P consecutive second key frames from the N key frames, wherein the P second key frames and the M first key frames include a preset number of overlapping key frames; a second generation module, which is used to generate a second laser map using the pose information of the P second key frames, wherein the second laser map includes at least one of the following: identification information of the second laser map, pose information of the second laser map, and an occupancy grid map of the second laser map; a third generation module, which is used to perform closed-loop detection on the second laser map and the N key frames, and generate a second closed-loop matching pair between the second laser map and the second target key frame, wherein the second target key frame is a key frame among the N key frames; and a second deletion module, which is used to delete the data in the second laser map after performing closed-loop detection on the second laser map.
[0014] In an exemplary embodiment, the apparatus further includes: a first adjustment module, configured to perform closed-loop detection on the second laser map and the N key frames, and generate a second closed-loop matching pair between the second laser map and the second target key frame, and then, after determining that all the N key frames are traversed and a plurality of closed-loop matching pairs are obtained, adjust the postures of the N key frames, wherein the plurality of closed-loop matching pairs include a first closed-loop matching pair and a second closed-loop matching pair, and the first closed-loop matching pair includes a matching pair between the first laser map and the N key frames; and a first construction module, configured to construct a map of the target device operating in the target area according to the adjusted postures of the N key frames.
[0015] In an exemplary embodiment, the first adjustment module includes: a first construction unit, used to construct the posture constraints of the N key frames, wherein the posture constraints include at least one of the following: constraints of the laser odometer in the target device, closed-loop constraints, closed-loop continuity constraints, constraints of the wheel speed meter of the target device, and constraints of the gyroscope in the target device; a first adjustment unit, used to adjust the postures of the N key frames using the posture constraints.
[0016] In an exemplary embodiment, the first adjustment unit includes at least one of the following: a first construction subunit, which is used to traverse the N key frames when the posture constraint includes the constraint of the laser odometer, and use the posture of each key frame and the posture covariance of each key frame to construct the constraint of the laser odometer; a second construction subunit, which is used to traverse each closed-loop matching pair when the posture constraint includes a closed-loop constraint, and use the posture of the laser map corresponding to each closed-loop matching pair and the posture of each key frame corresponding to the laser map to construct the posture constraint; a third construction subunit, which is used to construct the posture constraint when the posture constraint includes the closed-loop continuity constraint. In the case of a constraint, traverse each of the above-mentioned closed-loop matching pairs, and use the relative posture between each of the above-mentioned key frames corresponding to each of the above-mentioned closed-loop matching pairs to construct the constraint of the above-mentioned closed-loop continuity; a fourth construction subunit is used for, when the above-mentioned posture constraint includes the constraint of the wheel speed meter, traverse the N above-mentioned key frames, and use the determined posture of the wheel speed meter corresponding to each of the above-mentioned key frames and the covariance of the posture of the wheel speed meter to construct the constraint of the above-mentioned wheel speed meter; a fifth construction subunit is used for, when the above-mentioned posture constraint includes the constraint of the gyroscope, traverse the N above-mentioned key frames, and use the determined Euler angle of the gyroscope corresponding to each of the above-mentioned key frames and the covariance of the Euler angle to construct the constraint of the gyroscope.
[0017] In an exemplary embodiment, the first adjustment unit includes: a first adjustment subunit, which is used to adjust the closed-loop adjustment amplitude between each of the key frames according to the posture constraints corresponding to the key frames corresponding to each of the closed-loop matching pairs, so as to obtain the adjusted postures of the N key frames.
[0018] In an exemplary embodiment, the above-mentioned device also includes: a second construction module, which is used to adjust the postures of the N above-mentioned key frames using the above-mentioned posture constraints, and then use the posture and point cloud information of each key frame after the posture is adjusted to construct a motion map of the above-mentioned target device in the above-mentioned target area.
[0019] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute the steps in any one of the above method embodiments when in motion.
[0020] According to another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0021] Through the present invention, N key frames are obtained from the data collected when the target device moves in the target area, where N is a natural number greater than 1; the first laser map is generated using M first key frames in the N key frames, where the first laser map includes a local map of the target device moving in the target area, and M is less than N; the first laser map and the N key frames are closed-loop detected; when it is determined from the closed-loop detection results that the first laser map and the N key frames include closed-loop constraints, the data in the first laser map is deleted. Since in the above method, after the laser map is generated, the laser map and each key frame are closed-loop detected, the closed-loop constraints can be determined, thereby optimizing the key frames, and at the same time, the data in the first laser map is deleted, so that only one laser map is maintained in the memory for closed-loop search, which can greatly reduce memory usage. Therefore, the problem of large memory consumption in the process of building a device running map in the related art is solved, and the memory consumption is reduced, and the accuracy of map construction can be guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a hardware structure block diagram of a mobile terminal of a laser map processing method according to an embodiment of the present invention;
[0023] Figure 2 is a flow chart of a laser map processing method according to an embodiment of the present invention;
[0024] Figure 3 is a schematic diagram of constructing a laser map according to an embodiment of the present invention;
[0025] Figure 4 4 is a structural block diagram of a laser map processing device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0028] First, the related technologies involved in the present invention are explained as follows:
[0029] Keyframe: A term in computer animation, which refers to the frame where the key action of a character or object is located, equivalent to the original drawing in 2D animation. The animation between keyframes can be created and added by software, which is called transition frame or in-between frame.
[0030] Laser map: It can be a local map constructed from multiple frames of laser data. The laser map can be in the form of an occupancy grid map.
[0031] Covariance is used in probability theory and statistics to measure the overall error of two variables. Variance is a special case of covariance, that is, when the two variables are the same. Covariance represents the overall error of the two variables, which is different from the variance that only represents the error of one variable. If the two variables have the same trend, that is, if one is greater than its expected value and the other is also greater than its expected value, then the covariance between the two variables is positive. If the two variables have opposite trends, that is, one is greater than its expected value and the other is less than its expected value, then the covariance between the two variables is negative.
[0032] Wheel Speed Sensor: (VSS) is a type of tachometer. It is a transmitter device used to read the speed of rotation of the wheel. It usually consists of a gear ring and a pickup.
[0033] Closed loop: (Closed loop structure) also called feedback control system, is to compare the measured value of the system output with the expected given value, thereby generating a deviation signal, and use this deviation signal for adjustment and control to make the output value as close to the expected value as possible.
[0034] Gyroscope: It is a device for detecting the angular motion of a high-speed rotating body around one or two axes orthogonal to the rotation axis, using the angular moment of the sensitive housing relative to the inertial space. Angular motion detection devices made using other principles and having the same function are also called gyroscopes.
[0035] Euler angles: a group of three independent angular parameters used to determine the position of a fixed-point rotating rigid body, consisting of the nutation angle θ, the precession angle (i.e., the precession angle) ψ, and the rotation angle φ. It was named after Euler who first proposed it.
[0036] Wheel Speed Sensor (VSS): is a type of tachometer. It is a transmitter device used to read the speed of rotation of the wheel. It usually consists of a gear ring and a pickup.
[0037] Laser odometry: It is essentially a point cloud registration process. The transformation matrix obtained after registration is also the position of the current frame relative to the previous frame.
[0038] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a block diagram of the hardware structure of a mobile terminal of the laser map processing method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0039] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the laser map processing method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0040] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0041] In this embodiment, a laser map processing method is provided. Figure 2 is a flow chart of a laser map processing method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0042] Step S202, acquiring N key frames from the data collected when the target device moves in the target area, where N is a natural number greater than 1;
[0043] Step S204, generating a first laser map using M first key frames among the N key frames, wherein the first laser map includes a local map of the target device moving in the target area, and M is less than N;
[0044] Step S206, performing closed-loop detection on the first laser map and N key frames;
[0045] Step S208: when it is determined from the closed-loop detection result that the first laser map and the N key frames include a closed-loop constraint, data in the first laser map is deleted.
[0046] Optionally, the target device includes but is not limited to a movable device, such as a sweeping robot, an unmanned vehicle, etc. For example, in a scene where a sweeping robot is cleaning, a moving path map needs to be constructed. During the process of constructing the map, it is easy to be interfered by external forces (being moved or picked up), which will lead to inaccurate map construction, and the map needs to be continuously optimized. By collecting moving data in real time during the movement, the map can be continuously optimized.
[0047] Optionally, the values of N M can be set based on actual application scenarios. For example, 1000 key frames are obtained and a laser map is generated for every 10 key frames. Each time a laser map is generated, the laser map and all key frames are closed-loop detected. If a closed-loop constraint is found, the data in the laser map is deleted and the identification information of the laser map is retained; if no closed-loop constraint is found, the laser map is deleted. The key frames are optimized using the data of the closed-loop constraint, and the map is constructed using the optimized key frames.
[0048] The execution subject of the above steps may be a terminal, a server, a specific processor provided in the terminal or the server, or a processor or processing device provided relatively independently from the terminal or the server, but is not limited thereto.
[0049] Through the above steps, N key frames are obtained from the data collected when the target device moves in the target area, where N is a natural number greater than 1; the first laser map is generated using M first key frames in the N key frames, where the first laser map includes a local map of the target device moving in the target area, and M is less than N; the first laser map and the N key frames are closed-loop detected; when it is determined from the closed-loop detection results that the first laser map and the N key frames include closed-loop constraints, the data in the first laser map is deleted. Since in the above method, after the laser map is generated, the laser map and each key frame are closed-loop detected, the closed-loop constraints can be determined, thereby optimizing the key frames, and at the same time, the data in the first laser map is deleted, so that only one laser map is maintained in the memory for closed-loop search, which can greatly reduce memory usage. Therefore, the problem of large memory consumption in the process of building a device running map in the related art is solved, and the memory consumption is reduced, and the accuracy of map construction can be guaranteed.
[0050] In an exemplary embodiment, N key frames are obtained from the data collected when the target device moves in the target area, including: receiving data sent by the sensor when the target device moves in the target area; using the data to determine the real-time posture information of the target device at each time point; obtaining the key frame corresponding to each time point from the real-time posture information of the target device at each time point, and obtaining N key frames. In this embodiment, the sensor includes but is not limited to a laser sensor, a wheel speed meter sensor, a gyroscope sensor, and an acceleration sensor. From the data obtained by the sensor, the key frame is filtered out by a key frame filter. Each key frame includes at least one of the following information: identification information of the key frame, real-time posture of the target device, covariance of the real-time posture, laser point cloud information, wheel speed meter posture information, gyroscope Euler angle, etc. For example, when the sweeping robot is sweeping the floor, the sweeping robot collects the posture information of the sweeping robot through the sensor and calculates the covariance of the posture information. The key frames can be selected from the multiple posture information in the order of the acquisition time, for example, a key frame is extracted every 10 seconds; or they can be selected according to the trajectory of the sweeping robot, for example, a key frame is selected every 1 meter. After the key frames are selected, the key frames generated in real time are stored in the key frame list. By selecting the key frames, this embodiment can ensure the accuracy of map construction and reduce the amount of calculation.
[0051] In an exemplary embodiment, the first laser map is generated using M first key frames among N key frames, including: traversing N key frames in the time order of obtaining N key frames, and extracting M consecutive first key frames from N key frames; generating the first laser map using the posture information of the M first key frames, wherein the first laser map includes at least one of the following: identification information of the first laser map, posture information of the first laser map, and occupation grid map of the first laser map. In this embodiment, each key frame includes identification information of the key frame, and the identification information is determined according to the time when the key frame is obtained. The N key frames are sorted from small to large according to the identification information. For example, when the sweeping robot finishes cleaning, 1000 key frames are traversed from the key frame list, and the first 10 frames are selected to construct the first laser map. It should be noted that the occupation grid map of the first laser map is the main data occupying the memory. By generating a laser map, this embodiment can clearly display the posture of the target device in the local map.
[0052] In an exemplary embodiment, the first laser map is subjected to closed-loop detection with N key frames, including: performing closed-loop matching with each key frame; when the first laser map matches the first target key frame, determining the first closed-loop matching pair between the first laser map and the first target key frame, wherein the first target key frame is a key frame in the N key frames, and the first closed-loop matching pair includes at least one of the following: identification information of the first target key frame, identification information of the first laser map, relative closed-loop posture between the first laser map and the first target key frame, and randomness information of the first closed-loop matching pair; performing closed-loop verification on the first laser map. In this embodiment, closed-loop matching includes detecting whether the posture of each key frame falls into the first laser map, and if it falls into the first laser map, indicating that the key frame matches the first laser map, and generating a closed-loop matching pair. For example, the jth key frame in the N key frames is closed-loop matched with the ith laser map, and the obtained closed-loop matching pair is stored in the closed-loop constraint list. The closed-loop matching method can be determined according to the search range and the amount of calculation, for example, a brute force matching or a branch and bound method. To speed up closed-loop matching, the occupancy grid map of the i-th laser map can be stored with multiple layers of resolution, and the keyframe point cloud can be traversed in sequence from coarse to fine. It should be noted that the first laser map can generate closed-loop matching pairs with multiple keyframes. By generating closed-loop matching pairs between the first laser map and the keyframe, this embodiment can avoid storing the data of the first laser map, thereby reducing memory consumption. In addition, by saving the closed-loop matching pairs, the keyframes can be optimized, thereby ensuring memory-bounded map optimization.
[0053] In an exemplary embodiment, a closed-loop check is performed on the first laser map, including: checking the closed-loop continuity constraint between the first laser map and K key frames, wherein the K key frames are key frames adjacent to the first target key frame, and K is less than N. In this embodiment, the closed-loop check method can be a continuity check method, for example, after closed-loop matching, a closed-loop constraint exists between the i-th laser map and the j-th key frame. Checking the i-th laser map and the node_j-1 frame, node_j-2, ..., node_j-m frame, node_j+1 frame, node_j+2 frame, ..., node_j+m frame also shows that there is a closed-loop continuity constraint. To speed up the continuity verification algorithm, after finding that the i-th laser map and the j-th key frame have closed-loop constraints, this embodiment adopts an adaptive search range (the closer the distance or angle from the j-th key frame, the smaller the search range), when searching for continuous closed loops between the i-th laser map and the node_j-1 frame, node_j-2, ..., node_j-m frame, node_j+1 frame, node_j+2 frame, ..., node_j+m frame, thereby greatly reducing the closed-loop search range and achieving a significant reduction in the amount of calculation. For example, the search range in the original closed-loop matching method is ±5 meters and ±50 degrees, and the closed-loop search range of the j-1 frame and the j+1 frame in this embodiment is ±0.1 meters and ±1 degrees, the closed-loop search range of the j-2 frame and the j+2 frame is ±0.2 meters and ±2 degrees, and the closed-loop search range of the node_j-m frame and the node_j+m frame is ±0.2*m meters and ±2*m degrees. This embodiment can enhance the optimization of key frames and construct a more accurate map by verifying the closed-loop continuity constraints between the first laser map and K key frames.
[0054] In an exemplary embodiment, when it is determined from the closed-loop detection result that a closed-loop constraint is included between the first laser map and the N key frames, deleting data in the first laser map includes: when it is shown in the closed-loop detection result that a closed-loop continuity constraint is included between the first laser map and the K key frames, deleting data in the first laser map. In this embodiment, by deleting the data in the first laser map, memory consumption can be reduced.
[0055] In an exemplary embodiment, when it is determined from the closed-loop detection result that the first laser map and N key frames include a closed-loop constraint, after deleting the data in the first laser map, the method further includes: traversing the N key frames in the time order of acquiring the N key frames, extracting P consecutive second key frames from the N key frames, wherein the P second key frames and the M first key frames include a preset number of overlapping key frames; generating a second laser map using the pose information of the P second key frames, wherein the second laser map includes at least one of the following: identification information of the second laser map, pose information of the second laser map, and an occupancy grid map of the second laser map; performing closed-loop detection on the second laser map and the N key frames, and generating a second closed-loop matching pair between the second laser map and the second target key frame, wherein the second target key frame is a key frame in the N key frames; after performing closed-loop detection on the second laser map, deleting the data in the second laser map. In this embodiment, in deleting the data of the first laser map, M key frames are acquired again in the acquisition method of the M key frames to generate the second laser map. For example, the key frames from the 1st frame to the 10th frame in the 1000-frame key certificate are used to generate the first laser map, and after the data in the first laser map is deleted, the key frames from the 5th frame to the 15th frame are used to generate the second laser map. That is, the first laser map and the second laser map include 5 overlapping key frames, so that the continuity between the first laser map and the second laser map can be guaranteed. In addition, if the tracking is lost before two adjacent key frames (for example, the mth frame and the m+1th frame) (for example, the key frame will be discontinuous when the sweeping robot is lifted), the mth frame is used as the last frame of the previous laser map, and the m+1th frame is used as the first frame of the new laser map.
[0056] In addition, after determining the second laser map, the second laser map is continued to be closed-loop matched and closed-loop verified with all key frames, and the matching method and verification method are the same as those of the first laser map. After the verification is completed, the data in the second laser map is also deleted, and the traversal is continued to generate the third laser map until all key frames are traversed. By traversing the key frames to generate the laser map and deleting the data in the laser map after the closed-loop detection, the memory can be effectively reduced.
[0057] In an exemplary embodiment, after performing closed-loop detection on the second laser map and N key frames and generating a second closed-loop matching pair between the second laser map and the second target key frame, the method further includes: when it is determined that all N key frames are traversed and multiple closed-loop matching pairs are obtained, adjusting the postures of the N key frames, wherein the multiple closed-loop matching pairs include a first closed-loop matching pair and a second closed-loop matching pair, and the first closed-loop matching pair includes a matching pair between the first laser map and the N key frames; and constructing a map of the target device running in the target area according to the postures of the adjusted N key frames. In this embodiment, when it is determined that all N key frames are traversed and the data in the obtained laser map is also deleted, the postures of the N key frames are adjusted using the obtained multiple closed-loop matching pairs, so that a more accurate map can be constructed.
[0058] In an exemplary embodiment, when it is determined that all N key frames have been traversed and multiple closed-loop matching pairs have been obtained, adjusting the poses of the N key frames includes: constructing pose constraints for the N key frames, wherein the pose constraints include at least one of the following: a constraint of a laser odometer in a target device, a closed-loop constraint, a closed-loop continuity constraint, a wheel speedometer constraint of a target device, and a gyroscope constraint in a target device; and adjusting the poses of the N key frames using the pose constraints. In this embodiment, in order to further construct an optimized pose graph, various constraints need to be constructed, specifically including:
[0059] The pose constraints of the target device are constructed using multiple closed-loop matching pairs, including at least one of the following:
[0060] When the pose constraint includes the constraint of the laser odometry, traverse N keyframes, and use the pose of each keyframe and the pose covariance of each keyframe to construct the constraint of the laser odometry; for example, traverse each keyframe of the sweeping robot, extract the real-time pose_node_k and pose covariance Cov_node_k of each keyframe, construct the pose constraint with uncertainty, and construct N laser odometry pose constraints for N keyframes.
[0061] When the pose constraint includes a closed-loop constraint, traverse each closed-loop matching pair, and use the acquired laser map pose corresponding to each closed-loop matching pair and the pose of each key frame corresponding to the laser map to construct the pose constraint; for example, traverse each closed-loop matching pair of the sweeping robot, take out the sub-map pose pose_submap_i and the key frame pose pose_node_j in the matching pair (submap_i, node_j, pose_i_j, Cov_i_j), and construct a pose constraint with uncertainty. N closed-loop constraints construct a total of N closed-loop pose constraints.
[0062] When the pose constraint includes a closed-loop continuity constraint, traverse each closed-loop matching pair, and use the relative pose between each key frame corresponding to each closed-loop matching pair to construct the closed-loop continuity constraint; for example, traverse each closed-loop matching pair of the sweeping robot, take out the i-th sub-graph pose pose_submap_i and the node_j-1th frame, node_j-2th, ..., node_j-mth frame, node_j+1th frame, node_j+2th frame, ..., node_j+mth frame in the closed-loop matching pair (submap_i, node_j, pose_i_j, Cov_i_j), and construct a pose constraint with uncertainty. N closed-loop constraints construct a total of N*2*m closed-loop continuity pose constraints.
[0063] When the posture constraint includes the constraint of the wheel speed meter, traverse N key frames, and use the posture of the wheel speed meter corresponding to each key frame and the covariance of the posture of the wheel speed meter to construct the constraint of the wheel speed meter; for example, traverse each key frame of the sweeping robot, take out the wheel speed meter posture odom_k of each key frame, and calculate the covariance of the wheel speed meter posture based on the relative motion distance and angle between the key frame and the previous key frame, and construct the posture constraint with uncertainty. The wheel speed meter may slip, and the wheel speed meter constraint needs to be added with a robust kernel function. N key frames construct a total of N wheel speed meter posture constraints with robust kernel functions.
[0064] When the pose constraint includes the gyroscope constraint, traverse N keyframes, and use the Euler angles of the gyroscope corresponding to each keyframe and the covariance of the Euler angles to construct the gyroscope constraint. For example, traverse each keyframe of the sweeping robot, take out the gyroscope Euler angles of each keyframe, and calculate the covariance of the gyroscope Euler angles based on the relative time between the keyframe and the previous keyframe and the gyroscope noise coefficient to construct the pose constraint with uncertainty. N gyroscope pose constraints are constructed for N keyframes.
[0065] This embodiment can construct a more accurate map by constructing various posture constraints.
[0066] In an exemplary embodiment, the posture of N key frames is adjusted using posture constraints, including: adjusting the closed-loop adjustment amplitude between each key frame according to the posture constraints corresponding to the key frame corresponding to each closed-loop matching pair, and obtaining the adjusted posture of the N key frames. In this embodiment, after the sweeping robot finishes cleaning, the starting position and the ending position may not completely coincide, and there is a certain distance. If a closed loop is performed, there will be a certain error. Closed-loop optimization is required, and the closed-loop adjustment amplitude between each key frame is adjusted according to the posture constraints, so that the error can be evenly distributed to other closed-loop matching pairs, so that a more accurate posture graph can be constructed.
[0067] In an exemplary embodiment, after adjusting the poses of the N key frames using the pose constraints, the method further includes: constructing a motion map of the target device in the target area using the pose and point cloud information of each key frame after the pose adjustment. In this embodiment, the pose and point cloud information of the optimized key frames can construct a more accurate motion map.
[0068] The present invention will be described below in conjunction with specific embodiments:
[0069] This embodiment takes the construction of a map of a sweeper as an example to illustrate. This embodiment proposes a method for map optimization that can maintain the original closed-loop effect (for example, eliminate cumulative errors) while significantly reducing memory usage and ensuring memory-bounded. Specifically, the method includes the following steps:
[0070] Step 1, real-time key frame construction, is used to generate key frames and does not save the laser map.
[0071] The specific process is as follows:
[0072] During the real-time cleaning process of the sweeper:
[0073] (1) Receive data transmitted by sensors such as laser sensors, wheel speed meters, gyroscopes, and accelerometers in real time, and calculate the current position pose_node_k and position covariance Cov_node_k of the sweeper based on the multi-sensor fusion real-time positioning algorithm.
[0074] (2) According to the key frame filter, determine and save the key frame. Each key frame data includes the following information: node_k (key frame id), real-time position of the sweeper pose_node_k and position covariance Cov_node_k, laser point cloud pcl_k, wheel speed meter position odom_k (the sweeper position obtained by recursion based on wheel speed meter data), gyroscope Euler angle gyro_k (the sweeper Euler angle (including yaw, pitch, roll) obtained by recursion based on gyroscope data).
[0075] (3) Store the key frames generated in real time into the key frame list.
[0076] Step 2: construct the closed-loop constraint part offline.
[0077] After the sweeper finishes cleaning, it uses key frames to generate laser maps in sequence. After each laser map (for example, the first laser map) is generated, the laser map and all key frames are used to find closed loops, find closed loop constraints and closed loop verification, and then the raster data and posture data in the laser map are cleared. Then a laser map (for example, the second laser map) is generated to find the next closed loop, and the process is repeated.
[0078] For example, traverse the key frame list according to the key frame ID from small to large. Generate new laser maps in sequence according to the laser map generation method. For each newly generated laser map, perform the same operation as the original laser map. When the key frame list traversal is completed, perform pose graph optimization;
[0079] Optionally, the laser map generation method includes: under normal circumstances, every 2N key frames (corresponding to the M key frames in the above) generate a laser map by raycasting, and two adjacent laser maps share multiple key frames. Figure 3 As shown in FIG. 1 , there is a tracking loss between two adjacent key frames (the mth frame and the m+1th frame), and the mth frame is taken as the last frame of the previous laser map, and the m+1th frame is taken as the first frame of the new laser map.
[0080] Optionally, the i-th laser map includes the following data: submap_i (laser map id), pose_submap_i (initial pose of the laser map, taking the first key frame pose of the laser map as the initial pose value of the submap), and occupancy grid map Occupancy_i. The occupancy grid map is the main memory occupancy of the laser map.
[0081] Step 3, perform closed-loop matching and closed-loop verification on the newly generated laser map and all key frames in the key frame list. For example, if the closed-loop verification of the i-th laser map and the j-th key frame is successful, a closed-loop matching pair (submap_i, node_j, pose_i_j, Cov_i_j) is obtained and put into the closed-loop constraint list, where pose_i_j represents the relative closed-loop pose of the i-th laser map and the j-th key frame, and Cov_i_j represents the uncertainty of the closed-loop matching. At the same time, this embodiment allows a submap to generate a closed-loop matching pair with multiple key frames.
[0082] Optionally, the closed-loop matching method can use brute force matching or branch and bound method according to the search range and the amount of calculation. To speed up the closed-loop matching algorithm, the occupancy grid map of the i-th laser map can be stored with multiple layers of resolution, and the key frame point cloud is traversed from coarse to fine.
[0083] Optionally, the closed-loop verification method adopts a continuity verification method. For example, after closed-loop matching, it is found that the i-th laser map and the j-th key frame have a closed-loop constraint, then the i-th laser map Figure 1It must be consistent with the node_j-1th frame, node_j-2th, ..., node_j-mth frame, node_j+1th frame, node_j+2th frame, ..., node_j+mth frame, and there is also a closed-loop continuity constraint. To speed up the continuity verification algorithm, after finding that the i-th laser map and the j-th key frame have a closed-loop constraint, this embodiment adopts an adaptive search range (the closer the distance or angle to the j-th key frame, the smaller the search range) when searching for a continuous closed loop between the i-th laser map and the node_j-1 frame, node_j-2, ..., node_j-m frame, node_j+1 frame, node_j+2 frame, ..., node_j+m frame, thereby greatly reducing the closed-loop search range and achieving a significant reduction in the amount of calculation (for example, the search range in the original closed-loop matching method is ±5 meters and ±50 degrees, then the closed-loop search range of the j-1 frame and the j+1 frame is ±0.1 meters and ±1 degrees, then the closed-loop search range of the j-2 frame and the j+2 frame is ±0.2 meters and ±2 degrees, then the closed-loop search range of the node_j-m frame and the node_j+m frame is ±0.2*m meters and ±2*m degrees).
[0084] Step 4: Release the memory of the occupancy grid map Occupancy_i of the newly generated laser map from the memory, and only keep the id (submap_i) and pose (pose_i) of the laser map. Then jump to the above steps and regenerate the next laser map.
[0085] Step 5: pose graph optimization. Based on the above closed-loop matching and closed-loop continuity constraints, pose graph optimization is constructed to obtain the optimized key frame pose.
[0086] Optionally, the specific process of constructing the constraints of the pose graph is as follows:
[0087] (1) Construct the constraints of the front-end laser odometry: Traverse each key frame, extract the real-time pose and covariance of each key frame (sweeper pose pose_node_k and pose covariance Cov_node_k), and construct pose constraints with uncertainty. N key frames construct a total of N laser odometry pose constraints.
[0088] (2) Construct closed-loop constraints: Traverse each closed-loop matching pair, extract the submap pose pose_submap_i and keyframe pose pose_node_j in the matching pair (submap_i, node_j, pose_i_j, Cov_i_j), and construct a pose constraint with uncertainty. N closed-loop constraints construct a total of N closed-loop pose constraints.
[0089] (3) Construct closed-loop continuity constraints: Traverse each closed-loop matching pair, extract the closed-loop continuity relative poses of the i-th sub-graph pose pose_submap_i and the node_j-1th frame, node_j-2th, ..., node_j-mth frame, node_j+1th frame, node_j+2th frame, ..., node_j+mth frame in the matching (submap_i, node_j, pose_i_j, Cov_i_j), and construct pose constraints with uncertainty. N closed-loop constraints construct a total of N*2*m closed-loop continuity pose constraints.
[0090] (4) Constructing wheel speed meter constraints: Traverse each key frame, extract the wheel speed meter pose odom_k of each key frame, and calculate the covariance of the wheel speed meter pose based on the relative motion distance and angle between the key frame and the previous key frame, and construct the pose constraint with uncertainty. Considering that the wheel speed meter may slip, the wheel speed meter constraint needs to be added with a robust kernel function. N wheel speed meter pose constraints with robust kernel functions are constructed for N key frames.
[0091] (5) Construct gyroscope constraints: Traverse each key frame, extract the gyroscope Euler angle of each key frame, and calculate the covariance of the gyroscope Euler angle based on the relative time between the key frame and the previous key frame and the gyroscope noise coefficient, and construct a pose constraint with uncertainty. N gyroscope pose constraints are constructed for N key frames.
[0092] (6) After constructing the pose graph, use nonlinear optimization tools such as ceres or g2o to optimize the pose graph and obtain the optimized key frame pose.
[0093] Step 6: Build the map. Rebuild the optimized map based on the optimized pose and point cloud of each key frame.
[0094] In summary, in the entire closed-loop optimization stage, the memory of this embodiment only maintains one laser map for finding a closed loop, which can greatly reduce memory usage and ensure that the memory usage is independent of the map area and the cleaning time. The memory usage of the sweeper is decoupled from the map size and the cleaning time. In addition, a corresponding continuity verification method is proposed, and a method for adaptive search range is proposed, which can accelerate the continuity verification and thus greatly reduce the amount of calculation. In the process of pose graph optimization, the continuity verification pose is added as a global constraint to the optimization problem, which can effectively improve the pose accuracy.
[0095] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the M contributions to the prior art can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM / RAM, disk, optical disk), including a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0096] In this embodiment, a laser map processing device is also provided. Figure 4 is a structural block diagram of a laser map processing device according to an embodiment of the present invention. Figure 4 As shown, the device comprises:
[0097] A first acquisition module 42 is used to acquire N key frames from data collected when the target device moves in the target area, where N is a natural number greater than 1;
[0098] A first generating module 44 is used to generate a first laser map using M first key frames among the N key frames, wherein the first laser map includes a local map of the target device moving in the target area, and the M is less than the N.
[0099] A first detection module 46, configured to perform closed-loop detection on the first laser map and the N key frames;
[0100] The first deleting module 48 is configured to delete data in the first laser map when it is determined from the closed-loop detection result that a closed-loop constraint is included between the first laser map and the N key frames.
[0101] In an exemplary embodiment, the first acquisition module includes:
[0102] A first receiving unit, configured to receive the data sent by the sensor when the target device moves in the target area;
[0103] A first determining unit, configured to determine the real-time position and posture information of the target device at each time point using the data;
[0104] The first acquisition unit is used to acquire the key frame corresponding to each time point from the real-time posture information of the target device at each time point, and obtain N of the key frames.
[0105] In an exemplary embodiment, the first generating module includes:
[0106] A first extracting unit is used to traverse the N key frames in the time sequence of obtaining the N key frames, and extract the continuous M first key frames from the N key frames;
[0107] The first generating unit is used to generate the first laser map by using the posture information of the M first key frames, wherein the first laser map includes at least one of the following: identification information of the first laser map, posture information of the first laser map, and an occupancy grid map of the first laser map.
[0108] In an exemplary embodiment, the first detection module includes:
[0109] A first matching unit, used for performing closed-loop matching between the first laser map and each of the key frames;
[0110] a second determining unit, configured to determine, when the first laser map matches the first target key frame, a first closed-loop matching pair between the first laser map and the first target key frame, wherein the first target key frame is a key frame among the N key frames, and the first closed-loop matching pair includes at least one of the following: identification information of the first target key frame, identification information of the first laser map, a relative closed-loop pose between the first laser map and the first target key frame, and randomness information of the first closed-loop matching pair;
[0111] The first verification unit is used to perform closed-loop verification on the first laser map.
[0112] In an exemplary embodiment, the first verification unit includes:
[0113] The first verification subunit is used to verify the closed-loop continuity constraint between the first laser map and the K key frames, wherein the K key frames are key frames adjacent to the first target key frame, and the K is less than the N.
[0114] In an exemplary embodiment, the first deletion module includes:
[0115] The first deleting unit is used to delete data in the first laser map when the closed-loop detection result shows that the first laser map and the K key frames include closed-loop continuity constraints.
[0116] In an exemplary embodiment, the apparatus further comprises:
[0117] A first extraction module is used for, when it is determined from the closed-loop detection result that the first laser map and the N key frames include a closed-loop constraint, deleting the data in the first laser map, traversing the N key frames in a time sequence of acquiring the N key frames, and extracting P consecutive second key frames from the N key frames, wherein the P second key frames and the M first key frames include a preset number of overlapping key frames;
[0118] A second generating module, configured to generate a second laser map using the pose information of the P second key frames, wherein the second laser map includes at least one of the following: identification information of the second laser map, pose information of the second laser map, and an occupation grid map of the second laser map;
[0119] a third generating module, configured to perform closed-loop detection on the second laser map and the N key frames, and generate a second closed-loop matching pair between the second laser map and a second target key frame, wherein the second target key frame is a key frame among the N key frames;
[0120] The second deleting module is used to delete the data in the second laser map after performing closed-loop detection on the second laser map.
[0121] In an exemplary embodiment, the above device further comprises:
[0122] A first adjustment module is used for performing closed-loop detection on the second laser map and the N key frames, and generating a second closed-loop matching pair between the second laser map and the second target key frame, and then, when it is determined that all the N key frames are traversed and a plurality of closed-loop matching pairs are obtained, adjusting the postures of the N key frames, wherein the plurality of closed-loop matching pairs include a first closed-loop matching pair and the second closed-loop matching pair, and the first closed-loop matching pair includes a matching pair between the first laser map and the N key frames;
[0123] The first construction module is used to construct a map of the target device running in the target area according to the adjusted positions of the N key frames.
[0124] In an exemplary embodiment, the first adjustment module includes:
[0125] A first construction unit is used to construct the pose constraints of the N key frames, wherein the pose constraints include at least one of the following: a constraint of a laser odometer in the target device, a closed loop constraint, a closed loop continuity constraint, a constraint of a wheel speedometer in the target device, and a constraint of a gyroscope in the target device;
[0126] The first adjustment unit is used to adjust the postures of the N key frames using the posture constraints.
[0127] In an exemplary embodiment, the first adjustment unit includes at least one of the following:
[0128] A first construction subunit is used for traversing the N key frames, and constructing the constraints of the laser odometer by using the pose of each key frame and the pose covariance of each key frame, when the pose constraint includes the constraint of the laser odometer;
[0129] A second construction subunit is used for traversing each of the above-mentioned closed-loop matching pairs when the above-mentioned posture constraint includes a closed-loop constraint, and constructing the above-mentioned posture constraint by using the posture of the laser map corresponding to each of the above-mentioned closed-loop matching pairs and the posture of each of the above-mentioned key frames corresponding to the above-mentioned laser map;
[0130] A third construction subunit is used for, when the above-mentioned posture constraint includes a constraint of closed-loop continuity, traversing each of the above-mentioned closed-loop matching pairs, and constructing the above-mentioned closed-loop continuity constraint by using the relative posture between each of the above-mentioned key frames corresponding to each of the above-mentioned closed-loop matching pairs;
[0131] A fourth construction subunit is used for, when the above-mentioned posture constraint includes the constraint of the wheel speed meter, traversing the N above-mentioned key frames, and constructing the constraint of the wheel speed meter by using the determined posture of the wheel speed meter corresponding to each of the above-mentioned key frames and the covariance of the posture of the wheel speed meter;
[0132] The fifth construction subunit is used for traversing the N key frames mentioned above when the above-mentioned posture constraints include gyroscope constraints, and constructing the gyroscope constraints by using the determined Euler angles of the gyroscope corresponding to each of the above-mentioned key frames and the covariance of the Euler angles.
[0133] In an exemplary embodiment, the first adjustment unit comprises:
[0134] The first adjustment subunit is used to adjust the closed-loop adjustment amplitude between each of the above key frames according to the posture constraint corresponding to the key frame corresponding to each of the above closed-loop matching pairs, so as to obtain the adjusted postures of the N key frames.
[0135] In an exemplary embodiment, the above device further comprises:
[0136] The second construction module is used to adjust the postures of the N key frames using the posture constraints, and then use the posture and point cloud information of each key frame after the posture is adjusted to construct a motion map of the target device in the target area.
[0137] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0138] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when in motion.
[0139] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0140] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0141] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0142] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0143] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of all computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or all of the modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0144] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A laser map processing method, It is characterized in that include: Acquire N key frames from data collected when the target device moves in the target area, where N is a natural number greater than 1; Generate a first laser map using M first key frames among the N key frames, wherein the first laser map includes a local map of the target device moving in the target area, and the M is less than the N; Performing closed-loop detection on the first laser map and the N key frames; When it is determined from the closed-loop detection result that a closed-loop constraint is included between the first laser map and the N key frames, data in the first laser map is deleted.
2. The method according to claim 1, It is characterized in that From the data collected when the target device moves in the target area, N key frames are obtained, including: When the target device moves in the target area, receiving the data sent by the sensor; Determine the real-time position information of the target device at each time point using the data; A key frame corresponding to each time point is obtained from the real-time posture information of the target device at each time point to obtain N key frames.
3. The method according to claim 1, It is characterized in that Generating a first laser map using M first key frames among the N key frames, comprising: According to the time sequence of obtaining the N key frames, traverse the N key frames, and extract M consecutive first key frames from the N key frames; The first laser map is generated using the pose information of the M first key frames, wherein the first laser map includes at least one of the following: identification information of the first laser map, pose information of the first laser map, and an occupancy grid map of the first laser map.
4. The method according to claim 1, It is characterized in that Performing closed-loop detection on the first laser map and the N key frames, including: Performing closed-loop matching between the first laser map and each of the key frames; In a case where the first laser map matches a first target key frame, determining a first closed-loop matching pair between the first laser map and the first target key frame, wherein the first target key frame is a key frame among the N key frames, and the first closed-loop matching pair includes at least one of the following: identification information of the first target key frame, identification information of the first laser map, a relative closed-loop pose between the first laser map and the first target key frame, and randomness information of the first closed-loop matching pair; Perform a closed-loop check on the first laser map.
5. The method according to claim 4, It is characterized in that Performing a closed-loop check on the first laser map includes: Verify the closed-loop continuity constraint between the first laser map and K key frames, wherein the K key frames are key frames adjacent to the first target key frame, and K is less than N.
6. The method according to claim 1, It is characterized in that In the case where it is determined from the closed-loop detection result that a closed-loop constraint is included between the first laser map and the N key frames, deleting data in the first laser map includes: When the closed-loop detection result shows that the first laser map and the K key frames include closed-loop continuity constraints, data in the first laser map is deleted.
7. The method according to any one of claims 1 to 6, It is characterized in that In the case where it is determined from the closed-loop detection result that a closed-loop constraint is included between the first laser map and the N key frames, after deleting the data in the first laser map, the method further includes: According to the time sequence of acquiring the N key frames, traversing the N key frames, extracting P consecutive second key frames from the N key frames, wherein the P second key frames and the M first key frames include a preset number of overlapping key frames; Generate a second laser map using the pose information of the P second key frames, wherein the second laser map includes at least one of the following: identification information of the second laser map, pose information of the second laser map, and an occupancy grid map of the second laser map; Performing closed-loop detection on the second laser map and the N key frames, and generating a second closed-loop matching pair between the second laser map and a second target key frame, wherein the second target key frame is a key frame among the N key frames; After performing closed-loop detection on the second laser map, data in the second laser map is deleted.
8. The method according to claim 7, It is characterized in that After performing closed-loop detection on the second laser map and the N key frames and generating a second closed-loop matching pair between the second laser map and the second target key frame, the method further includes: When it is determined that all N key frames are traversed and multiple closed-loop matching pairs are obtained, adjusting the poses of the N key frames, wherein the multiple closed-loop matching pairs include a first closed-loop matching pair and a second closed-loop matching pair, and the first closed-loop matching pair includes a matching pair between the first laser map and the N key frames; A map of the target device operating in the target area is constructed according to the adjusted positions of the N key frames.
9. The method according to claim 8, It is characterized in that When it is determined that all the N key frames are traversed and a plurality of closed-loop matching pairs are obtained, the positions of the N key frames are adjusted, including: Constructing posture constraints of N key frames, wherein the posture constraints include at least one of the following: a constraint of a laser odometer in the target device, a closed loop constraint, a closed loop continuity constraint, a constraint of a wheel speedometer in the target device, and a constraint of a gyroscope in the target device; The poses of the N key frames are adjusted using the pose constraints.
10. The method according to claim 9, It is characterized in that Constructing the position and posture constraints of the target device using a plurality of the closed-loop matching pairs includes at least one of the following: In the case where the pose constraint includes a constraint of a laser odometer, traversing the N key frames, and constructing the constraint of the laser odometer using the pose of each key frame and the pose covariance of each key frame; In the case where the pose constraint includes a closed-loop constraint, traversing each of the closed-loop matching pairs, and constructing the pose constraint by using the acquired pose of the laser map corresponding to each of the closed-loop matching pairs and the pose of each of the key frames corresponding to the laser map; In the case where the posture constraint includes a closed-loop continuity constraint, traversing each of the closed-loop matching pairs, and constructing the closed-loop continuity constraint by using the relative posture between each of the key frames corresponding to each of the closed-loop matching pairs; In the case where the posture constraint includes a constraint of a wheel speed meter, traversing the N key frames, and constructing the constraint of the wheel speed meter by using the posture of the wheel speed meter corresponding to each of the key frames and the covariance of the posture of the wheel speed meter; In the case where the posture constraint includes a gyroscope constraint, the N key frames are traversed, and the gyroscope constraint is constructed by using the determined Euler angle of the gyroscope corresponding to each key frame and the covariance of the Euler angle.
11. The method according to claim 9, It is characterized in that Adjusting the poses of the N key frames using the pose constraint includes: According to the posture constraints corresponding to the key frames corresponding to each closed-loop matching pair, the closed-loop adjustment amplitude between each of the key frames is adjusted to obtain the adjusted postures of the N key frames.
12. The method according to claim 11, It is characterized in that After adjusting the poses of the N key frames using the pose constraints, the method further includes: The motion map of the target device in the target area is constructed by using the posture and point cloud information of each key frame after the posture is adjusted.
13. A laser map processing device, It is characterized in that include: A first acquisition module is used to acquire N key frames from data collected when the target device moves in the target area, wherein N is a natural number greater than 1; A first generating module, configured to generate a first laser map using M first key frames among the N key frames, wherein the first laser map includes a local map of the target device moving in the target area, and the M is less than the N; A first detection module, used for performing closed-loop detection on the first laser map and the N key frames; The first deleting module is used to delete the data in the first laser map when it is determined from the closed-loop detection result that the first laser map and the N key frames include a closed-loop constraint.
14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 12 when executed by a processor.
15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method described in any one of claims 1 to 12 are implemented.
