Loopback detection method and loopback detection equipment
By constructing polar coordinates and Cartesian global descriptors, using lidar sensors to obtain the distance between the current frame and the candidate frame, setting the distance threshold to determine the loopback, solving the problem of wrong loopback in scenarios with high environmental structure similarity, and improving loopback detection accuracy and accuracy.
Patent Information
- Application Number
- CN202411231128.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-31
AI Technical Summary
The existing loopback detection technology is prone to error loopback in scenarios with high environmental structure similarity, and the loopback detection based on lidar causes loopback detection to fail when the robot has a large range of motion.
By constructing polar coordinates and Cartesian global descriptors, using the lidar sensor to obtain the distance between the current frame and the candidate frame, setting a distance threshold to determine the correctness of the loopback, reducing error loopbacks, and improving loopback detection accuracy.
It effectively reduces error loopbacks in scenarios with high environmental structure similarity, improves the accuracy and accuracy of loopback detection, reduces the computational complexity of the algorithm, and is suitable for loopback detection in large-scale environments.
Smart Images

Figure CN119224726A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robotics technology, and in particular to a loop detection method and a loop detection device. Background Art
[0002] As a key link in the SLAM system, loop detection calculates the similarity between two frames to identify the position, so as to determine whether the robot has returned to the place it has been before, and then builds loop constraints for back-end optimization to reduce the cumulative error of the robot in the SLAM process. Depending on the type of sensor used, it can be divided into vision-based loop detection and lidar-based loop detection.
[0003] Vision-based loop detection can obtain more feature information in the environment through visual sensors, ensuring the accuracy of loop detection. Its robustness in complex scenes has also been improved after integrating deep learning. However, vision-based loop detection is sensitive to changes in perspective and illumination, and after applying deep learning, it also faces problems such as network structure design and training data dependence.
[0004] Loop detection based on lidar can effectively avoid the impact of lighting changes. The common loop detection based on Euclidean distance has good operating efficiency and detection accuracy. However, when the robot's motion range is large, the cumulative error often causes the Euclidean distance between the two matching point clouds to exceed the set distance threshold, resulting in loop detection failure. If the distance threshold is increased, it may lead to erroneous loop detection, which in turn affects the mapping accuracy. Summary of the invention
[0005] In view of this, the present invention provides a loop detection method and a loop detection device to improve the accuracy of loop detection.
[0006] In a first aspect, the present invention provides a loop detection method, which is applied to a mobile robot. The loop detection method includes: using a laser radar sensor to obtain current laser point cloud data of a current frame; constructing a current global descriptor based on the current laser point cloud data, and obtaining candidate global descriptors of candidate frames, where the candidate frames are historical frames to be matched; calculating the distance between the current global descriptor and each candidate global descriptor, and when the minimum distance is less than or equal to a preset distance, obtaining a target candidate frame corresponding to the minimum distance, and determining whether a loop occurs between the target candidate frame and the current frame.
[0007] In this implementation, a global descriptor is constructed and the distance between the global descriptors is used to determine whether a loop occurs between the target candidate frame and the current frame. The distance threshold is used to judge the correctness of the loop, which can effectively reduce false loops in scenes with high environmental structure similarity and improve the accuracy of loop detection.
[0008] In one implementation, the global descriptor is a polar coordinate global descriptor and / or a Cartesian coordinate global descriptor.
[0009] In one implementation, constructing a current global descriptor based on current laser point cloud data includes: constructing a polar coordinate system based on the X-axis of the laser radar coordinate system as the polar axis; dividing the point cloud area according to the polar coordinate system to obtain multiple polar coordinate point cloud areas; obtaining the highest value of the current laser point cloud data in each polar coordinate point cloud area, assigning a value to the corresponding polar coordinate point cloud area, and obtaining corresponding multiple point cloud area coding values; expanding the multiple polar coordinate point cloud areas along the polar axis of the polar coordinate system, and obtaining the current polar coordinate global descriptor according to the corresponding multiple point cloud area coding values.
[0010] In one implementation, the point cloud area is divided according to a polar coordinate system to obtain multiple polar coordinate point cloud areas, including: taking the pole of the polar coordinate system as the center and the first preset distance as the radius, the point cloud area is divided to obtain multiple circular ring areas; and the multiple circular ring areas are radially divided according to preset angles to obtain multiple polar coordinate point cloud areas.
[0011] In one implementation, constructing a current global descriptor based on current laser point cloud data includes: constructing a Cartesian coordinate system based on the X-axis and Y-axis of the laser radar coordinate system; dividing the point cloud area according to the Cartesian coordinate system to obtain multiple Cartesian coordinate point cloud areas; obtaining the highest value of the current laser point cloud data in each Cartesian coordinate point cloud area, assigning a value to the corresponding Cartesian coordinate point cloud area, and obtaining corresponding multiple point cloud area coding values; and obtaining the current Cartesian coordinate global descriptor according to the positions of the multiple Cartesian coordinate point cloud areas and the corresponding multiple point cloud area coding values.
[0012] In one implementation, dividing the point cloud area according to the Cartesian coordinate system to obtain multiple Cartesian coordinate point cloud areas includes: obtaining a second preset distance and a third preset distance; dividing the point cloud area horizontally at equal intervals according to the second preset distance, and dividing the point cloud area vertically at equal intervals according to the third preset distance to obtain multiple Cartesian coordinate point cloud areas.
[0013] In one implementation, the loop detection method also includes: flipping multiple Cartesian coordinate point cloud areas 180 degrees along the X-axis and the Y-axis respectively to obtain multiple flipped Cartesian coordinate point cloud areas; obtaining a current enhanced Cartesian coordinate global descriptor according to the positions of the multiple flipped Cartesian coordinate point cloud areas and the corresponding multiple point cloud area encoding values.
[0014] In one implementation, calculating the distance between the current global descriptor and each candidate global descriptor, obtaining the candidate frame corresponding to the minimum distance, and determining that a loop occurs between the candidate frame and the current frame includes: accumulating the cosine distance between each column vector of the current global descriptor and the corresponding column vector of the candidate global descriptor; obtaining the candidate frame corresponding to the minimum cosine distance; calculating the horizontal distance between the current frame and the candidate frame; and when the horizontal distance is less than or equal to a preset value, determining that a loop occurs between the candidate frame and the current frame.
[0015] In one implementation, calculating the distance between the current global descriptor and each candidate global descriptor further includes: when the global descriptor is a polar coordinate global descriptor, translating all column vectors of the candidate polar coordinate global descriptor to the right by a first preset unit, and moving the right end column vector of the current polar coordinate global descriptor to the left end of the candidate polar coordinate global descriptor to obtain an updated candidate polar coordinate global descriptor; calculating the distance between the current polar coordinate global descriptor and the updated candidate polar coordinate global descriptor; when the global descriptor is a Cartesian coordinate global descriptor, translating all column vectors of the candidate Cartesian coordinate global descriptor to the right by a second preset unit , and move the left end column vector of the current Cartesian coordinate global descriptor to the left end of the candidate Cartesian coordinate global descriptor to obtain an updated candidate Cartesian coordinate global descriptor; calculate the distance between the current Cartesian coordinate global descriptor and the updated candidate Cartesian coordinate global descriptor; translate all column vectors of the candidate Cartesian coordinate global descriptor to the left by a second preset unit, and move the right end column vector of the current Cartesian coordinate global descriptor to the right end of the candidate Cartesian coordinate global descriptor to obtain an updated candidate Cartesian coordinate global descriptor; calculate the distance between the current Cartesian coordinate global descriptor and the updated candidate Cartesian coordinate global descriptor.
[0016] In a second aspect, the present invention provides a loop detection device, which includes: an acquisition module, used to use a laser radar sensor to acquire current laser point cloud data of a current frame; a construction module, used to construct a current global descriptor based on the current laser point cloud data, and obtain a candidate global descriptor of a candidate frame, where the candidate frame is a historical frame to be matched; a calculation module, used to calculate the distance between the current global descriptor and each candidate global descriptor, obtain the candidate frame corresponding to the minimum distance, and determine whether a loop occurs between the candidate frame and the current frame.
[0017] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the loop detection method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0018] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the loop detection method of the first aspect or any corresponding embodiment thereof.
[0019] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, where the computer instructions are used to enable a computer to execute the loop detection method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 is a flow chart of a loop detection method according to an embodiment of the present invention;
[0022] Figure 2 is a flow chart of another loop detection method according to an embodiment of the present invention;
[0023] Figure 3 is a structural block diagram of a loop detection device according to an embodiment of the present invention;
[0024] Figure 4 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0026] According to an embodiment of the present invention, an embodiment of a loop detection method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0027] In this embodiment, a loop detection method is provided, which can be used for a mobile robot. Figure 1is a flow chart of a loop detection method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0028] Step S101, using a laser radar sensor to obtain current laser point cloud data of a current frame.
[0029] When the robot is walking, the laser radar sensor on the robot is used to detect and obtain radar data. The radar data is processed to obtain the current laser point cloud data of the current frame.
[0030] Step S102: construct a current global descriptor based on the current laser point cloud data, and obtain a candidate global descriptor of the candidate frame.
[0031] Among them, the candidate frame is a historical frame to be matched, and this application is used to determine whether a loop occurs between the current frame and the candidate frame.
[0032] The current global descriptor includes a polar coordinate global descriptor and / or a Cartesian coordinate global descriptor.
[0033] In one implementation, the current global descriptor is a polar coordinate global descriptor. The current laser point cloud data is divided into regions according to polar coordinates, and all regions are expanded along the polar axis to obtain a polar coordinate global descriptor.
[0034] In one implementation, the current global descriptor is a Cartesian coordinate global descriptor. The current laser point cloud data is divided into regions according to Cartesian coordinates, and all regions are assigned values to obtain a Cartesian coordinate global descriptor.
[0035] Specifically, a global descriptor is constructed when acquiring laser point cloud data. That is, a current global descriptor of the current laser point cloud data is constructed at the current moment, and a candidate global descriptor of the historical laser point cloud data is constructed at the historical moment. Therefore, at the current moment, the candidate global descriptor of the candidate frame can be directly obtained.
[0036] Step S103, calculating the distance between the current global descriptor and each candidate global descriptor, and when the minimum distance is less than the preset distance, obtaining the target candidate frame corresponding to the minimum distance, and determining whether a loop occurs between the target candidate frame and the current frame.
[0037] The distance between the current global descriptor and each candidate global descriptor is calculated. When the distance between the current global descriptor and a candidate global descriptor is small, it means that the current frame and the corresponding candidate frame are in similar environments. When the distance between the current global descriptor and a candidate global descriptor is large, it means that the current frame and the corresponding candidate frame are in different environments.
[0038] The minimum distance is obtained, and it is determined whether the minimum distance is less than or equal to a preset distance. When the minimum distance is less than or equal to the preset distance, a target candidate frame corresponding to the minimum distance is obtained, and it is determined that a loop occurs between the target candidate frame and the current frame.
[0039] The loop detection method provided in this embodiment constructs a global descriptor and uses the distance between the global descriptors to determine whether a loop occurs between the target candidate frame and the current frame, wherein the distance threshold is used to judge the correctness of the loop, thereby effectively reducing false loops in scenes with high environmental structure similarity and improving the accuracy of loop detection.
[0040] In this embodiment, a loop detection method is provided, which can be used in the above-mentioned mobile terminals, such as mobile phones, tablet computers, etc. Figure 2 is a flow chart of another loop detection method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0041] Step S201, using a laser radar sensor to obtain current laser point cloud data of a current frame.
[0042] For details, please see Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0043] Step S202: construct a current global descriptor based on the current laser point cloud data, and obtain a candidate global descriptor of the candidate frame.
[0044] The current global descriptor includes a polar coordinate global descriptor (Polar Descriptor) and / or a Cartesian coordinate global descriptor (Cart Descriptor).
[0045] In one implementation, the current global descriptor includes a current polar coordinate global descriptor and a current Cartesian coordinate global descriptor, and the candidate global descriptors include a candidate polar coordinate global descriptor and a candidate Cartesian coordinate global descriptor.
[0046] Specifically, the above step S202 includes:
[0047] Step S2021, constructing a current polar coordinate global descriptor based on the current laser point cloud data.
[0048] In one implementation, the point cloud area is divided with the pole of the polar coordinate system as the center and the first preset distance as the radius to obtain multiple circular areas, and the multiple circular areas are radially divided according to the preset angle to obtain multiple polar coordinate point cloud areas. The highest value of the current laser point cloud data in each polar coordinate point cloud area is obtained, and the corresponding polar coordinate point cloud area is assigned a value to obtain the corresponding multiple point cloud area encoding values, and the multiple polar coordinate point cloud areas are expanded along the polar axis of the polar coordinate system, and the current polar coordinate global descriptor is obtained according to the corresponding multiple point cloud area encoding values.
[0049] Specifically, the laser radar scanning center is taken as the origin, and the X-axis of the laser radar coordinate system is used as the polar axis to construct a polar coordinate system. The current laser point cloud data in the point cloud area is divided into equal intervals in radial and azimuth angles using the BEV perspective (Bird's-Eye-View). Nr is the number of rings, and Ns is the number of sectors on each ring, which represents the set of point clouds in the jth sector area under the i-th annular area. Let N = {1, 2, ..., N-1, N}, then the division of the point cloud area of the current frame can be expressed as:
[0050]
[0051] After dividing the point cloud into regions, the maximum height of the point cloud in each region is used to assign a value to the region:
[0052]
[0053] The region encoding function is:
[0054]
[0055] in, The returned value is the Z-axis coordinate value of the point cloud p. For areas without point clouds, the value is 0. Expand the entire area divided above along the polar axis to obtain the current polar coordinate global descriptor.
[0056] Step S2022: construct a current Cartesian coordinate global descriptor based on the current laser point cloud data.
[0057] In one implementation, a Cartesian coordinate system is constructed based on the X-axis and Y-axis of the laser radar coordinate system; a second preset distance and a third preset distance are obtained; according to the second preset distance, the point cloud area is divided into equal intervals horizontally, and according to the third preset distance, the point cloud area is divided into equal intervals vertically to obtain a plurality of Cartesian coordinate point cloud areas; the highest value of the current laser point cloud data in each Cartesian coordinate point cloud area is obtained, and a value is assigned to the corresponding Cartesian coordinate point cloud area to obtain the corresponding plurality of point cloud area coding values; the current Cartesian coordinate global descriptor is obtained according to the positions of the plurality of Cartesian coordinate point cloud areas and the corresponding plurality of point cloud area coding values.
[0058] Specifically, the laser radar scanning center is used as the origin, and the X-axis and Y-axis of the laser radar coordinate system are used as the coordinate axes to construct a Cartesian coordinate system. The downsampled point cloud is divided into equal intervals horizontally and vertically using the BEV perspective. Each area is assigned the maximum height of the point cloud inside it, and the area without point cloud is assigned 0 to obtain the current Cartesian coordinate global descriptor.
[0059] In one implementation, the current Cartesian coordinate global descriptor also includes a current enhanced Cartesian coordinate global descriptor. The multiple Cartesian coordinate point cloud regions are flipped 180 degrees along the X-axis and the Y-axis respectively to obtain multiple flipped Cartesian coordinate point cloud regions; the current enhanced Cartesian coordinate global descriptor is obtained according to the positions of the multiple flipped Cartesian coordinate point cloud regions and the corresponding multiple point cloud region encoding values.
[0060] The position index of the current enhanced Cartesian coordinate global descriptor is the same as the index value of the corresponding position of the current Cartesian coordinate global descriptor.
[0061] Among them, strengthening the Cartesian coordinate global descriptor can solve the loop detection in the scenario where the robot is in the opposite direction but a loop occurs.
[0062] Step S2023, obtaining the candidate global descriptor of the candidate frame.
[0063] Specifically, the above step S2023 includes:
[0064] Step a1: Get the historical global descriptor of the historical frame.
[0065] Corresponding to step S2022, a historical polar coordinate global descriptor, a historical Cartesian coordinate global descriptor and a historical enhanced Cartesian coordinate global descriptor of the historical frame are obtained.
[0066] Step a2: determine a candidate frame and determine a candidate global descriptor of the candidate frame.
[0067] Construct a row key keyword subdescriptor and search for candidate frames from historical frames that may loop back with the current frame.
[0068] Specifically, each row vector r in the current global descriptor constructed in the above step is encoded into a real value through the row encoding function ψ, and the final row key is represented by an M-dimensional vector l:
[0069]
[0070] l=(ψ(r 1 ),…,ψ(r M ));
[0071] Through the first stage of search, the row key of the key frame to be searched is stored using KDTree (k-dimensional tree), and the row key of the current frame is searched in KDTree to obtain candidate frames that may loop with the current frame.
[0072] A candidate global descriptor of the candidate frame is further determined, wherein the candidate global descriptors include a candidate polar coordinate global descriptor, a candidate Cartesian coordinate global descriptor, and a candidate enhanced Cartesian coordinate global descriptor.
[0073] Among them, the row key method can quickly search and find historical key frames that may loop with the current frame as candidate frames, reducing the computational complexity of the algorithm.
[0074] Step S203, calculating the distance between the current global descriptor and each candidate global descriptor, and when the minimum distance is less than the preset distance, obtaining the target candidate frame corresponding to the minimum distance, and determining whether a loop occurs between the target candidate frame and the current frame.
[0075] Accumulate the cosine distance between each column vector of the current global descriptor and the corresponding column vector of the candidate global descriptor; obtain the candidate frame corresponding to the minimum cosine distance; calculate the horizontal distance between the current frame and the candidate frame; when the horizontal distance is less than or equal to a preset value, determine that a loop occurs between the candidate frame and the current frame.
[0076] The present application first selects candidate frames from historical frames, and then determines the target candidate frames corresponding to the minimum distance from the candidate frames, and performs a two-stage hierarchical search, thereby reducing the computational complexity of the algorithm.
[0077] Specifically, the above step S203 includes:
[0078] Step S2031: Calculate the distance between the current global descriptor and each candidate global descriptor.
[0079] I q with I c The current global descriptor and the candidate global descriptor are obtained from the current frame point cloud and the candidate frame point cloud respectively. The distance measurement is performed on the similarity. The cosine distance between the following vectors with the same index is calculated by column comparison. The distance calculated for each pair of column vectors is summed, and the summed distance is divided by the number of columns N for normalization. Among them, the expression of the distance function is:
[0080]
[0081] However, due to the rotation and translation of the robot body, the view angle and position of the laser radar have changed compared to the last time it arrived at the location, so the current global descriptor will be offset relative to the candidate global descriptor. Therefore, this application will translate the candidate global descriptor in columns, and measure the distance between the candidate global descriptor and the current global descriptor each time it is translated.
[0082] In one implementation, when the global descriptor is a polar coordinate global descriptor, all column vectors of the candidate polar coordinate global descriptor are translated to the right by a first preset unit, and the right end column vector of the candidate polar coordinate global descriptor is moved to the left end to obtain an updated candidate polar coordinate global descriptor; and the distance between the current polar coordinate global descriptor and the updated candidate polar coordinate global descriptor is calculated.
[0083] Specifically, the change in the robot's perspective is manifested as a column offset of the polar coordinate global descriptor. Therefore, all columns of the candidate polar coordinate global descriptor are translated one unit to the right, and the rightmost column of the current polar coordinate global descriptor is moved to the leftmost end of the candidate polar coordinate global descriptor to obtain a new candidate polar coordinate global descriptor. The total number of translations and calculations is equal to the number of columns of the candidate polar coordinate global descriptor.
[0084] In one implementation, when the global descriptor is a Cartesian coordinate global descriptor, all column vectors of the candidate Cartesian coordinate global descriptor are translated to the right by a second preset unit, and the left end column vector of the current Cartesian coordinate global descriptor is moved to the left end of the candidate Cartesian coordinate global descriptor to obtain an updated candidate Cartesian coordinate global descriptor; the distance between the current Cartesian coordinate global descriptor and the updated candidate Cartesian coordinate global descriptor is calculated; all column vectors of the candidate Cartesian coordinate global descriptor are translated to the left by a second preset unit, and the right end column vector of the current Cartesian coordinate global descriptor is moved to the right end of the candidate Cartesian coordinate global descriptor to obtain an updated candidate Cartesian coordinate global descriptor; the distance between the current Cartesian coordinate global descriptor and the updated candidate Cartesian coordinate global descriptor is calculated.
[0085] Specifically, the lateral translation of the robot is manifested as a Cartesian coordinate global descriptor column offset. Therefore, the present application sets the Cartesian coordinate global descriptor loop detection range threshold d c Set to 6m. Assume that the column resolution of the Cartesian global descriptor is 2m, and translate the candidate Cartesian global descriptor to the left and right by 1-3 units respectively. After translating to the left by n units, take the rightmost n columns of the current Cartesian global descriptor and move them to the rightmost end of the new candidate Cartesian global descriptor. Similarly, the same applies to the right translation.
[0086] The distance between the current global descriptor and the new candidate global descriptor is:
[0087]
[0088] in, For I c The new candidate Cartesian coordinate global descriptor obtained after shifting by m columns.
[0089] Step S2032: Select a candidate Cartesian coordinate global descriptor to determine whether a loop occurs between the target candidate frame and the current frame.
[0090] The candidate frame with the smallest distance from the candidate Cartesian coordinate global descriptors is selected as the optimal candidate frame.
[0091] Specifically, select the minimum distance that satisfies the similarity distance threshold and return the candidate frame index value corresponding to the minimum distance:
[0092]
[0093] Among them, C is the set of candidate frame index values searched from KDTree, τ is the similarity distance threshold, and c* is the index value of the optimal candidate frame.
[0094] Furthermore, the present application also eliminates the optimal candidate frames that are highly similar to the current global descriptor but are actually far away in horizontal distance.
[0095] Specifically, the relative pose transformation T from the current frame to the optimal candidate frame is cq It can be expressed as:
[0096] T cq =(T wc ) -1 ·T wq
[0098] Among them, T wq is the current frame pose, T wc is the optimal candidate frame pose.
[0099] Calculate the horizontal distance t between two frames based on the relative pose transformation xy , when it is greater than the preset value d t , then it is not considered that these two frames of point cloud have looped:
[0100]
[0101] Among them, t x ,t y are the x and y components of the relative position transformation of the two frame point clouds, respectively, where d t Take 10m.
[0102] The loop detection method provided in the present embodiment, by adding the construction of Cartesian coordinate global descriptor and newly added Cartesian coordinate global descriptor, makes the algorithm have good robustness for both same-direction and reverse offset revisit. The algorithm of the present invention reduces the algorithm's computational complexity through two-stage hierarchical search. The algorithm of the present invention judges the correctness of the loop according to the horizontal distance threshold, effectively reduces the wrong loop in the scene with high environmental structure similarity, thereby improving the accuracy of the SLAM system, because the loop detection range threshold of the Cartesian coordinate global descriptor is 6m, and the horizontal distance judgment threshold is 10m, the loop detected in the case of offset revisit will not be affected by the horizontal distance threshold judgment. Compared with the existing algorithms of the same type, the method shows higher loop detection accuracy, and is not affected by the robot odometer distance, in a large scale and offset revisit and the scene with high environmental structure similarity, it can accurately detect the loop, build the correct loop constraint for the back-end optimization, reduce the accumulated error generated by the robot in the SLAM process, and finally establish a global consistency map.
[0103] In this embodiment, a loop detection device is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0104] This embodiment provides a loop detection device, such as Figure 3 As shown, including:
[0105] The acquisition module 301 is used to acquire the current laser point cloud data of the current frame using the laser radar sensor.
[0106] The construction module 302 is used to construct a current global descriptor based on the current laser point cloud data and obtain a candidate global descriptor of a candidate frame, where the candidate frame is a historical frame to be matched.
[0107] The calculation module 303 is used to calculate the distance between the current global descriptor and each candidate global descriptor, and when the minimum distance is less than or equal to the preset distance, obtain the target candidate frame corresponding to the minimum distance, and determine whether the target candidate frame and the current frame have a loop.
[0108] The further functional description of each of the above modules is the same as that of the above corresponding embodiments and will not be repeated here.
[0109] The loop detection device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0110] The embodiment of the present invention also provides a computer device having the above Figure 3 The loop detection device shown.
[0111] See also Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 4 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.
[0112] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0113] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0114] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device 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 combinations thereof.
[0115] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0116] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.
[0117] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0118] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0119] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0120] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A loop detection method, characterized in that: Applied to a mobile robot, the method comprises: Using the laser radar sensor to obtain the current laser point cloud data of the current frame; Constructing a current global descriptor based on the current laser point cloud data, and obtaining a candidate global descriptor of a candidate frame, wherein the candidate frame is a historical frame to be matched; The distance between the current global descriptor and each of the candidate global descriptors is calculated, and when the minimum distance is less than or equal to a preset distance, a target candidate frame corresponding to the minimum distance is obtained, and it is determined that a loop occurs between the target candidate frame and the current frame.
2. The loop detection method according to claim 1, characterized in that: The global descriptor is a polar coordinate global descriptor and / or a Cartesian coordinate global descriptor.
3. The loop detection method according to claim 2, characterized in that: The constructing a current global descriptor based on the current laser point cloud data comprises: Construct a polar coordinate system based on the X-axis of the laser radar coordinate system as the polar axis; Dividing the point cloud region according to the polar coordinate system to obtain a plurality of polar coordinate point cloud regions; Obtaining the highest value of the current laser point cloud data in each polar coordinate point cloud area, assigning a value to the corresponding polar coordinate point cloud area, and obtaining corresponding multiple point cloud area coding values; The plurality of polar coordinate point cloud regions are expanded along the polar axis of the polar coordinate system, and a current polar coordinate global descriptor is obtained according to the corresponding encoding values of the plurality of point cloud regions.
4. The loop detection method according to claim 3, characterized in that: The point cloud region is divided according to the polar coordinate system to obtain a plurality of polar coordinate point cloud regions, including: Taking the pole of the polar coordinate system as the center of the circle and the first preset distance as the radius, the point cloud area is divided to obtain a plurality of circular areas; The plurality of circular areas are radially divided according to a preset angle to obtain the plurality of polar coordinate point cloud areas.
5. The loop detection method according to claim 2, characterized in that: The constructing a current global descriptor based on the current laser point cloud data comprises: Construct a Cartesian coordinate system based on the X-axis and Y-axis of the laser radar coordinate system; Dividing the point cloud region according to the Cartesian coordinate system to obtain a plurality of Cartesian coordinate point cloud regions; Obtaining the highest value of the current laser point cloud data in each Cartesian coordinate point cloud area, assigning a value to the corresponding Cartesian coordinate point cloud area, and obtaining corresponding multiple point cloud area coding values; A current Cartesian coordinate global descriptor is obtained according to the positions of the plurality of Cartesian coordinate point cloud regions and the corresponding plurality of point cloud region encoding values.
6. The loop detection method according to claim 5, characterized in that: The point cloud region is divided according to the Cartesian coordinate system to obtain a plurality of Cartesian coordinate point cloud regions, including: Acquire a second preset distance and a third preset distance; According to the second preset distance, the point cloud area is divided into equal intervals horizontally, and according to the third preset distance, the point cloud area is divided into equal intervals vertically to obtain the multiple Cartesian coordinate point cloud areas.
7. The loop detection method according to claim 5, characterized in that: The method further comprises: Flipping the plurality of Cartesian coordinate point cloud regions by 180 degrees along the X-axis and the Y-axis respectively to obtain a plurality of flipped Cartesian coordinate point cloud regions; The current enhanced Cartesian coordinate global descriptor is obtained according to the positions of the multiple flipped Cartesian coordinate point cloud regions and the corresponding multiple point cloud region encoding values.
8. The loop detection method according to claim 2, characterized in that: The calculating the distance between the current global descriptor and each of the candidate global descriptors, obtaining the candidate frame corresponding to the minimum distance, and determining that a loop occurs between the candidate frame and the current frame comprises: Accumulating the cosine distance between each column vector of the current global descriptor and the corresponding column vector of the candidate global descriptor; Obtain the candidate frame corresponding to the minimum cosine distance; Calculating a horizontal distance between the current frame and the candidate frame; When the horizontal distance is less than or equal to a preset value, it is determined that a loop occurs between the candidate frame and the current frame.
9. The loop detection method according to claim 2, characterized in that: The calculating the distance between the current global descriptor and each of the candidate global descriptors further comprises: When the global descriptor is a polar coordinate global descriptor, all column vectors of the candidate polar coordinate global descriptor are translated to the right by a first preset unit, and the right end column vector of the current polar coordinate global descriptor is moved to the left end of the candidate polar coordinate global descriptor to obtain an updated candidate polar coordinate global descriptor; and the distance between the current polar coordinate global descriptor and the updated candidate polar coordinate global descriptor is calculated; When the global descriptor is a Cartesian coordinate global descriptor, all column vectors of the candidate Cartesian coordinate global descriptor are translated to the right by a second preset unit, and the left end column vector of the current Cartesian coordinate global descriptor is moved to the left end of the candidate Cartesian coordinate global descriptor to obtain an updated candidate Cartesian coordinate global descriptor; the distance between the current Cartesian coordinate global descriptor and the updated candidate Cartesian coordinate global descriptor is calculated; all column vectors of the candidate Cartesian coordinate global descriptor are translated to the left by a second preset unit, and the right end column vector of the current Cartesian coordinate global descriptor is moved to the right end of the candidate Cartesian coordinate global descriptor to obtain an updated candidate Cartesian coordinate global descriptor; the distance between the current Cartesian coordinate global descriptor and the updated candidate Cartesian coordinate global descriptor is calculated.
10. A loop detection device, characterized in that: An image processor is included, and the processor is used to execute instructions to implement the loop detection method as described in any one of claims 1-9.