Map calibration method, vehicle and computer readable storage medium
By constructing a semantic map of loop closure pairs and performing loop closure detection, the problem of poor map accuracy in SLAM systems is solved, achieving more efficient and accurate map calibration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHERY AUTOMOBILE CO LTD
- Filing Date
- 2026-01-30
- Publication Date
- 2026-06-05
AI Technical Summary
SLAM systems accumulate positioning errors when building maps, resulting in poor map accuracy.
By obtaining the vehicle's current location and a preset index structure, a semantic map of loop closure pairs is constructed, and loop closure detection is performed based on the semantic map to calibrate the map.
It improves the efficiency and accuracy of map calibration by understanding scene semantics for more precise calibration and reduces reliance on low-level visual or geometric features.
Smart Images

Figure CN122149434A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of map calibration, and more specifically, to a map calibration method, a vehicle, and a computer-readable storage medium. Background Technology
[0002] With the rapid development of autonomous driving technology and robot navigation systems, SLAM (Simultaneous Localization and Mapping) systems have become one of the key technologies for achieving autonomous navigation. SLAM systems can build maps and estimate their own position in unknown environments, which is crucial for the localization and navigation of mobile intelligent devices (such as autonomous vehicles, drones, and service robots) in complex environments. However, SLAM systems accumulate localization errors, resulting in poor accuracy of the constructed maps.
[0003] There is currently no good solution to the above problems. Summary of the Invention
[0004] This application provides a map calibration method, a vehicle, and a computer-readable storage medium to at least solve the technical problem of poor accuracy of maps constructed in related technologies.
[0005] According to one aspect of the embodiments of this application, a map calibration method is provided, comprising: obtaining the current vehicle position and a preset index structure, wherein the preset index structure is constructed based on the historical trajectory parameters of the vehicle within a historical time period; obtaining historical trajectory points matching the current vehicle position from the preset index structure based on the current vehicle position to obtain loop closure point pairs of the vehicle on the map; constructing a semantic map corresponding to different points in the loop closure point pairs, wherein the semantic map contains semantic elements corresponding to different points; and performing loop closure detection on the map based on the semantic map, wherein the loop closure detection is used to calibrate the map.
[0006] Furthermore, the method also includes: obtaining vehicle trajectory parameters, wherein the trajectory parameters are used to describe the vehicle's trajectory within the current time period; determining whether a preset index structure meets the structure update conditions based on the trajectory parameters and historical trajectory parameters; updating the preset index structure based on the trajectory parameters to obtain a target index structure if the preset index structure meets the structure update conditions; and obtaining historical trajectory points matching the current vehicle position from the preset index structure based on the current vehicle position to obtain loop point pairs on the map, including: obtaining historical trajectory points matching the current vehicle position from the target index structure based on the current vehicle position to obtain loop point pairs.
[0007] Further, based on driving trajectory parameters and historical trajectory parameters, it is determined whether the preset index structure meets the structure update conditions, including: based on driving trajectory parameters, determining the first trajectory length, the number of first trajectory nodes, and the first trajectory shape of the vehicle in the current time period; based on historical trajectory parameters, determining the second trajectory length, the number of second trajectory nodes, and the second trajectory shape of the vehicle when it last performed loop closure detection on the map; based on the first trajectory length and the second trajectory length, determining the trajectory length change; based on the number of first trajectory nodes and the second trajectory nodes, determining the number of newly added trajectory nodes; and based on the first trajectory shape and the second trajectory shape, determining the trajectory deformation degree; based on the number of newly added trajectory nodes, the trajectory length change, and the trajectory deformation degree, it is determined whether the preset index structure meets the structure update conditions; preferably, the structure update conditions include at least one of the following: the number of newly added trajectory nodes is greater than or equal to the preset growth amount; the trajectory length change is greater than the preset length increment; and the trajectory deformation degree is greater than the preset deformation degree.
[0008] Furthermore, the method further includes: determining the storage state of a preset storage structure, wherein the preset storage structure is used to store the results of loop closure detection on the map, and the storage state is used to describe the amount of data stored in the preset storage structure; obtaining target detection results within a historical time period from the preset storage structure, wherein the target detection results are used to characterize the results obtained by successfully performing loop closure detection on the map; when the first trajectory length is greater than or equal to a preset detection length and the storage state is greater than the preset storage state, constructing a detection judgment result based on the target detection results and the change in trajectory length, wherein the detection judgment result is used to characterize whether loop closure detection on the map is required; when the detection judgment result characterizes the need for loop closure detection on the map, determining whether the preset index structure meets the structure update conditions based on the number of newly added trajectory nodes, the change in trajectory length, and the degree of trajectory deformation; preferably, constructing the detection judgment result based on the target detection results and the change in trajectory length includes: determining the number of target detection results; when the number of results is a preset number of results, or when the number of results is greater than the preset number of results and the change in trajectory length is greater than or equal to the detection trigger threshold, determining that the detection judgment result characterizes the need for loop closure detection on the map.
[0009] Further, based on the current vehicle position, historical trajectory points matching the current vehicle position are obtained from a preset index structure to obtain a loop point pair on the map, including: determining the current trajectory node from the driving trajectory parameters based on the current vehicle position, wherein the current trajectory node corresponds to the current vehicle position; determining historical trajectory nodes from the preset index structure based on the current trajectory node, wherein the spatial distance from the historical trajectory node to the current trajectory node is less than the spatial distance from any node in the preset index structure other than the historical trajectory node to the current trajectory node; constructing a loop point pair based on the current trajectory node and the historical trajectory node; preferably, constructing a loop point pair based on the current trajectory node and the historical trajectory node includes: calculating the travel distance between the current trajectory node and the historical trajectory node to obtain a first calculation result; calculating the spatial distance between the current trajectory node and the historical trajectory node to obtain a second calculation result; and determining that the current trajectory node and the historical trajectory node constitute a loop point pair when the first calculation result satisfies a preset travel distance threshold and the second calculation result satisfies a preset spatial distance threshold.
[0010] Furthermore, constructing semantic maps corresponding to different points in the loop point pair includes: extracting semantic elements from the current trajectory node based on a preset range to obtain a first semantic element set; extracting semantic elements from the historical trajectory node based on a preset range to obtain a second semantic element set; validating the first and second semantic element sets respectively to obtain a validity verification result, wherein the validity verification result is used to characterize whether both the first and second semantic element sets are valid; if the validity verification result characterizes both the first and second semantic element sets as valid, constructing a first semantic map corresponding to the current trajectory node based on the first semantic element set, and constructing a second semantic map corresponding to the historical trajectory node based on the second semantic element set.
[0011] Furthermore, based on the semantic map, loop closure detection is performed on the map, including: deduplicating multiple first semantic elements contained in the first semantic map to obtain a first target map; deduplicating multiple second semantic elements contained in the second semantic map to obtain a second target map; constructing an element mapping relationship between the first target map and the second target map, wherein the element mapping relationship is used to represent the mapping relationship between the first semantic elements and the second semantic elements; and performing loop closure detection on the map based on the element mapping relationship; preferably, constructing the element mapping relationship between the first target map and the second target map includes: obtaining the first spatial position of any first semantic element. Based on the first spatial location and the first semantic type, determine the target semantic element corresponding to any first semantic element from the second target map, wherein the second semantic type of the target semantic element is the same as the first semantic type, and the distance between the second spatial location and the first spatial location of the target semantic element is less than the distance between the spatial locations of other semantic elements of the second semantic type (excluding the target semantic element) and the first spatial location in the second target map; construct an initial mapping relationship based on any first semantic element and the target semantic element; integrate the initial mapping relationships corresponding to multiple first semantic elements to obtain the element mapping relationship.
[0012] Further, based on the element mapping relationship, loop closure detection is performed on the map, including: determining the pose transformation matrix between the first target map and the second target map based on the element mapping relationship; matching the first target map and the second target map based on the pose transformation matrix to obtain a map matching result, wherein the map matching result is used to characterize whether the first target map and the second target map are successfully matched; if the map matching result indicates that the first target map and the second target map are successfully matched, loop closure detection is performed on the map based on the first target map to obtain a loop closure detection result, wherein the loop closure detection result is used to characterize whether the map loop closure detection is successful; preferably, matching the first target map and the second target map based on the pose transformation matrix to obtain a map matching result includes: performing coordinate transformation on any first semantic element based on the pose transformation matrix to obtain a transformed first semantic element; calculating the spatial relationship between the transformed first semantic element and the target semantic element. Distance difference; if the spatial distance difference is less than a preset distance difference, any first semantic element is determined to be successfully matched; if the number of successfully matched first semantic elements is greater than a preset number of matches, the map matching result is determined to indicate that the first target map and the second target map are successfully matched; preferably, based on the first target map, loop closure detection is performed on the map to obtain loop closure detection results, including: parsing the target detection results to obtain historical matching results, wherein the historical matching results are used to indicate the matching results of the first target map and the second target map within a historical time period; based on the historical matching results, consistency verification is performed on the map matching results to obtain consistency verification results, wherein the consistency verification results are used to indicate whether the historical matching results and the map matching results meet the consistency conditions; if the consistency verification results indicate that the historical matching results and the map matching results meet the consistency conditions, the loop closure detection result is determined to indicate that the map loop closure detection is successfully performed.
[0013] According to another aspect of the embodiments of this application, a map calibration device is also provided, comprising: a first acquisition module, configured to acquire the current vehicle position and a preset index structure, wherein the preset index structure is constructed based on the historical trajectory parameters of the vehicle within a historical time period; a point pair construction module, configured to acquire historical trajectory points matching the current vehicle position from the preset index structure based on the current vehicle position, thereby obtaining loop point pairs of the vehicle on the map; a map construction module, configured to construct a semantic map corresponding to different points in the loop point pairs, wherein the semantic map contains semantic elements corresponding to different points; and a loop closure detection module, configured to perform loop closure detection on the map based on the semantic map, wherein the loop closure detection is used to calibrate the map.
[0014] According to another aspect of the embodiments of this application, a vehicle is also provided, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of this application when it runs.
[0015] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to perform the methods of various embodiments of this application.
[0016] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the methods of various embodiments of this application.
[0017] According to another aspect of the embodiments of this application, a computer program product is also provided, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods in various embodiments of this application.
[0018] According to another aspect of the embodiments of this application, a computer program is also provided, which, when executed by a processor, implements the methods of the various embodiments of this application.
[0019] In this embodiment, the method involves obtaining the vehicle's current location and a preset index structure; based on the current vehicle location, obtaining historical trajectory points matching the current vehicle location from the preset index structure to obtain loop point pairs on the map; constructing semantic maps corresponding to different points in the loop point pairs; and performing loop detection on the map based on the semantic maps. By constructing the preset index structure, the construction process of loop point pairs is accelerated, improving the efficiency of map calibration. Subsequently, by constructing semantic maps corresponding to different points in the loop point pairs, richer feature information can be provided for map calibration. This allows the calibration process to not only rely on low-level visual or geometric features but also make more accurate calibration decisions based on understanding scene semantics. This achieves the technical effect of improving map accuracy through calibration, thereby solving the technical problem of poor map accuracy in related technologies. Attached Figure Description
[0020] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0021] Figure 1 This is a flowchart of a map calibration method according to an embodiment of this application;
[0022] Figure 2 This is a flowchart of an optional loop closure detection strategy according to an embodiment of this application;
[0023] Figure 3 This is an architecture diagram of an optional map calibration method according to an embodiment of this application;
[0024] Figure 4 This is a schematic diagram illustrating a specific implementation process of an optional map calibration method according to an embodiment of this application;
[0025] Figure 5 This is a schematic diagram of a map calibration device according to an embodiment of this application. Detailed Implementation
[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0028] According to an embodiment of this application, an embodiment of a map calibration method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0029] This embodiment provides a map calibration method. Figure 1 This is a flowchart of a map calibration method according to an embodiment of this application, such as... Figure 1 As shown, the process includes the following steps:
[0030] Step S102: Obtain the current vehicle location and preset index structure, wherein the preset index structure is constructed based on the vehicle's historical trajectory parameters within a historical time period.
[0031] The aforementioned preset index structure can be a structure used to quickly find the data required by the map calibration system (hereinafter referred to as the calibration system) from historical trajectory parameters. It may include, but is not limited to, K-Dimensional Tree (KD tree), R-tree, quadtree, octree, or Locality Sensitive Hashing (LSH).
[0032] The aforementioned historical time period can refer to a period of time prior to the current moment.
[0033] The aforementioned historical trajectory parameters can be vehicle trajectory data collected by the calibration system within a historical time period, including but not limited to vehicle position coordinates, direction angle, speed, and possible timestamps. These parameters can describe the vehicle's motion trajectory within a historical time period and be used to construct a preset index structure.
[0034] In one optional embodiment, considering that the preset index structure is built based on the vehicle's historical trajectory parameters, it provides a fast query mechanism, enabling the calibration system to quickly find historical locations that are relatively close to the current vehicle position within a large amount of historical data. This reduces the computational load of the calibration system and avoids performing full matching comparisons on all historical data. Furthermore, by comparing the current vehicle position with historical positions, the calibration system can effectively identify closed-loop phenomena, i.e., whether the vehicle has returned to a previously traveled location. This helps correct any positioning deviations caused by sensor errors or environmental changes. Based on this, the calibration system can first obtain the vehicle's current position and the preset index structure.
[0035] For example, the calibration system can use vehicle dynamics information collected by inertial measurement units (IMUs), global positioning systems (GPS), wheel speed sensors, and vision sensors. The raw sensor data can be preprocessed using filtering (e.g., Kalman filtering), calibration, and data fusion techniques to improve data quality and reduce external interference. Subsequently, based on the preprocessed sensor data, the calibration system can accurately calculate the vehicle's current position using positioning algorithms such as particle filter localization, visual odometry, or simultaneous localization and mapping (SLAM) with lidar. Furthermore, the calibration system can construct a pre-defined index structure, such as a KD-tree, based on historical driving time, location, and direction information to quickly find historical trajectory points approximating the current vehicle position.
[0036] For example, the calibration system can upload vehicle location information captured by onboard sensors to the cloud, and perform preprocessing on the uploaded location data in the cloud, such as data cleaning, format standardization, and outlier removal, to obtain a more accurate current vehicle location. Simultaneously, the calibration system can build a pre-defined index structure in the cloud based on historical data, such as a distributed hash table or a cloud-native R-tree index, to quickly retrieve historical trajectory points that are close to the current vehicle location.
[0037] Step S104: Based on the current vehicle location, retrieve historical trajectory points that match the current vehicle location from the preset index structure to obtain the loop point pair of the vehicle on the map.
[0038] The aforementioned historical trajectory points can be collected by the vehicle's sensors (such as LiDAR and cameras), representing the vehicle's location information at different points in time. These points can include the vehicle's precise coordinates in the environment, as well as additional information such as the vehicle's heading angle and speed. Historical trajectory points can accumulate over time to form a point cloud map of the vehicle's driving path, which can be used for tasks such as loop closure detection, localization, and mapping.
[0039] The aforementioned loop closure pairs can be the pairing relationship between the vehicle's current location and historical location points identified by the loop closure detection algorithm. These pairs can be determined based on a comparison of historical trajectory points and the current vehicle position, using techniques such as feature matching (e.g., semantic element matching) and geometric constraints (e.g., distance and angle differences). Effective loop closure pairs can provide closed-loop information, helping the calibration system correct accumulated errors and improve positioning accuracy and map quality.
[0040] In one alternative embodiment, considering the vehicle's movement within the environment, its position and the map of its surroundings are constantly being updated. When the vehicle returns to a previously traversed area, this phenomenon is called a loop closure. Since each successful loop closure detection provides a closed-loop constraint for the calibration system, thereby reducing positioning errors, identifying and processing loop closures is crucial for correcting accumulated positioning errors. Based on this, the calibration system can retrieve historical trajectory points matching the current vehicle position from a preset index structure. These historical trajectory points, along with the trajectory points corresponding to the current vehicle position, form loop closure point pairs on the map, facilitating loop closure detection on the current map.
[0041] For example, the calibration system can use the nearest neighbor search function of a KD-tree to find the nearest historical trajectory point based on the current vehicle position and calculate the Euclidean distance between the current vehicle position and the historical trajectory point. If this distance is less than a preset distance threshold, the calibration system can consider the historical node as a candidate point for loop closure detection. Subsequently, the calibration system can compare the direction information of the trajectory point corresponding to the current vehicle position with the direction information of the candidate historical point. If the difference between the two directions is also less than a preset difference threshold, the calibration system can further confirm that the trajectory point corresponding to the current vehicle position and the candidate historical point constitute a loop closure point pair.
[0042] For example, the calibration system can use the query function of an R-tree to obtain a series of candidate historical trajectory points based on the geographic coordinates of the current vehicle location. These points are spatially close to the current vehicle location. Then, the calibration system can compare the multi-scale features of the trajectory points corresponding to the current vehicle location with the features of these candidate historical trajectory points to find the best matching point, which is then used as the aforementioned historical trajectory point. Finally, the calibration system can determine the trajectory points corresponding to the current vehicle location and the historical trajectory points as loop closure pairs.
[0043] Step S106: Construct a semantic map corresponding to different points in the loop-loop point pair, wherein the semantic map contains semantic elements corresponding to different points.
[0044] The aforementioned semantic map can be a high-level map representation that not only includes geometric information from traditional maps, such as location, direction, and distance, but also embeds semantic understanding information about objects and scenes in the environment. This allows it to identify lanes, sidewalks, buildings, traffic signs, dynamic obstacles (such as pedestrians and vehicles), and other static or dynamic objects, thereby providing vehicles with more intuitive and richer environmental information and contributing to safer and more efficient route planning and decision-making.
[0045] The aforementioned semantic elements can refer to object or scene features that are explicitly identified and classified in a semantic map. Different semantic elements can have different meanings and functions. During the semantic map construction process, the calibration system can process and analyze the data captured by the vehicle's sensors to transform this data into semantic information with labels. These labels reflect the categories of elements, such as parking spaces, speed bumps, and traffic lights.
[0046] In one alternative embodiment, considering that semantic elements typically remain unchanged in the environment and that their function and location are relatively stable, by extracting and constructing a semantic map of a local area, the calibration system can not only rely on visual features (such as edges, corners, etc.) but also utilize semantically meaningful objects in the environment (such as parking spaces, speed bumps, pillars, etc.) for loop closure detection. This allows loop closure detection to exhibit stronger detection accuracy when facing challenges such as changes in lighting, seasonal changes, or partial occlusion. Based on this, the calibration system can construct semantic maps corresponding to different points in the loop closure point pairs, thereby helping the calibration system to perform more accurate positioning and matching, reducing the uncertainty of position estimation during the calibration process.
[0047] For example, for trajectory points in a loopback pair corresponding to the current vehicle's position, the calibration system can capture the current frame image using an onboard camera and perform semantic segmentation on that image to identify different types of semantic elements, such as vehicles, pedestrians, lane lines, buildings, and trees. Subsequently, the calibration system can extract predefined semantic elements from the segmentation results, such as parking spaces, speed bumps, or specific road signs, and record the location and type information of these elements. Then, the calibration system can combine the extracted semantic elements with the current vehicle's GPS and IMU data to obtain the precise position of each semantic element in the world coordinate system, thereby mapping these semantic elements onto the current map to obtain a semantic map corresponding to the current vehicle's position. For historical trajectory points in a loopback pair, the calibration system can extract the semantic elements corresponding to the historical trajectory points and use the same method to map these semantic elements onto the historical map to obtain a semantic map corresponding to the historical trajectory points.
[0048] Step S108: Based on the semantic map, perform loop closure detection on the map, where loop closure detection is used to calibrate the map.
[0049] The aforementioned loop closure detection can be a detection technique used to identify and correct whether a vehicle or other mobile device has revisited a previously explored location. Specifically, during loop closure detection, the calibration system can detect loop closures, i.e., path repetitions, by comparing currently acquired map fragments with previously stored map fragments, thereby correcting accumulated errors in path estimation and ensuring the consistency and accuracy of map construction.
[0050] In one optional embodiment, considering that during long-term vehicle operation or long-distance travel, positioning systems such as SLAM in the vehicle gradually accumulate positioning errors due to sensor noise and uncertainty, loop closure detection, by identifying whether the vehicle returns to a previously known position, can introduce closed-loop constraints to correct this accumulated error and improve the accuracy of positioning and map construction. Based on this, the calibration system can perform loop closure detection on the map based on a semantic map. This allows loop closure detection to be based on higher-level semantic features already present in the semantic map (such as parking spaces, road signs, etc.), rather than relying solely on low-level features (such as image feature points or laser point clouds), resulting in higher accuracy for map calibration based on loop closure detection.
[0051] In this embodiment, the method involves obtaining the vehicle's current location and a preset index structure; based on the current vehicle location, obtaining historical trajectory points matching the current vehicle location from the preset index structure to obtain loop point pairs on the map; constructing semantic maps corresponding to different points in the loop point pairs; and performing loop detection on the map based on the semantic maps. By constructing the preset index structure, the construction process of loop point pairs is accelerated, improving the efficiency of map calibration. Subsequently, by constructing semantic maps corresponding to different points in the loop point pairs, richer feature information can be provided for map calibration. This allows the calibration process to not only rely on low-level visual or geometric features but also make more accurate calibration decisions based on understanding scene semantics. This achieves the technical effect of improving map accuracy through calibration, thereby solving the technical problem of poor map accuracy in related technologies.
[0052] Furthermore, the method also includes: obtaining vehicle trajectory parameters, wherein the trajectory parameters are used to describe the vehicle's trajectory within the current time period; determining whether a preset index structure meets the structure update conditions based on the trajectory parameters and historical trajectory parameters; updating the preset index structure based on the trajectory parameters to obtain a target index structure if the preset index structure meets the structure update conditions; and obtaining historical trajectory points matching the current vehicle position from the preset index structure based on the current vehicle position to obtain loop point pairs on the map, including: obtaining historical trajectory points matching the current vehicle position from the target index structure based on the current vehicle position to obtain loop point pairs.
[0053] The aforementioned driving trajectory parameters can be parameters used to accurately describe the path and attitude information of the vehicle's movement within the current time period, and may include, but are not limited to, the vehicle's heading angle, speed, acceleration, and possible turning radius and travel distance.
[0054] The aforementioned structure update conditions can refer to a set of rules or thresholds used to determine when and how to update the preset index structure used for fast retrieval, such as KD-trees or R-trees. Specifically, when new trajectory data is generated during vehicle movement, and the difference between this new data and the data in the existing index structure reaches a certain level, or when the efficiency of the index structure drops below a predetermined threshold, the structure update conditions can be triggered to incrementally update the preset index structure. This incremental update helps maintain the optimal performance of the preset index structure, thereby ensuring search speed and accuracy.
[0055] The target index structure mentioned above can be a new index structure obtained by adjusting or incrementally rebuilding the preset index structure after the preset index structure meets the structure update conditions.
[0056] In one alternative embodiment, considering that as the vehicle moves, new trajectory points are continuously added to the preset index structure, while older trajectory points may no longer be usable in the current loop closure detection process, the calibration system needs to construct an update mechanism to determine when and how to update the preset index structure to maintain its effectiveness for the current loop closure detection process. Based on this, the calibration system can obtain driving trajectory parameters describing the vehicle's trajectory within the current time period. Subsequently, the calibration system can determine whether the preset index structure meets the structure update conditions by comparing the driving trajectory parameters with historical trajectory parameters. If the preset index structure meets the structure update conditions, the calibration system can update the preset index structure based on the driving trajectory parameters to obtain the target index structure, thereby improving the efficiency and matching accuracy of subsequent trajectory point searches. After obtaining the target index structure, the calibration system can obtain historical trajectory points matching the current vehicle position from the target index structure based on the current vehicle position, resulting in loop closure point pairs, making the constructed loop closure point pairs more accurate.
[0057] Further, based on driving trajectory parameters and historical trajectory parameters, it is determined whether the preset index structure meets the structure update conditions, including: based on driving trajectory parameters, determining the first trajectory length, the number of first trajectory nodes, and the first trajectory shape of the vehicle in the current time period; based on historical trajectory parameters, determining the second trajectory length, the number of second trajectory nodes, and the second trajectory shape of the vehicle when it last performed loop closure detection on the map; based on the first trajectory length and the second trajectory length, determining the trajectory length change; based on the number of first trajectory nodes and the second trajectory nodes, determining the number of newly added trajectory nodes; and based on the first trajectory shape and the second trajectory shape, determining the trajectory deformation degree; based on the number of newly added trajectory nodes, the trajectory length change, and the trajectory deformation degree, it is determined whether the preset index structure meets the structure update conditions; preferably, the structure update conditions include at least one of the following: the number of newly added trajectory nodes is greater than or equal to the preset growth amount; the trajectory length change is greater than the preset length increment; and the trajectory deformation degree is greater than the preset deformation degree.
[0058] The aforementioned first trajectory length can refer to the total length of the vehicle's travel path within the current time period, and can reflect the geographical area covered by the vehicle since the last loopback detection.
[0059] The aforementioned number of first trajectory nodes can be the total number of trajectory nodes generated by the calibration system based on the vehicle's driving conditions within the current time period.
[0060] The aforementioned first trajectory shape can be the overall geometric shape of the vehicle's travel path within the current time period, and may include, but is not limited to, features such as the curvature and directional changes of the path.
[0061] The second trajectory length mentioned above can be the total length of the vehicle's driving trajectory recorded by the calibration system during the last loop closure detection of the map. It can be used to compare with the current trajectory length to understand the range of the vehicle's movement since the last detection.
[0062] The number of the second trajectory nodes mentioned above can be the number of trajectory nodes that the calibration system has accumulated during the previous loop closure detection.
[0063] The second trajectory shape can be the geometric shape of the vehicle's travel path during the previous loop closure detection, and may include, but is not limited to, features such as the curvature and direction changes of the path. It can be used to compare with the current trajectory to evaluate the changes in the vehicle's path.
[0064] The aforementioned change in trajectory length can be calculated by comparing the first trajectory length and the second trajectory length, representing the increase in the vehicle's travel path length between two loop closure detections. This helps the calibration system understand whether the distance traveled by the vehicle has met the structural update conditions.
[0065] The number of newly added trajectory nodes mentioned above refers to the number of trajectory nodes newly added by the calibration system within the current time period compared to the last loop closure detection. This is crucial for determining whether the preset index structure needs to be updated.
[0066] The aforementioned degree of trajectory deformation can be the geometric difference between the first trajectory and the second trajectory, and may include, but is not limited to, changes in direction and path curvature, to help the calibration system determine whether there have been significant changes in the vehicle's driving environment or driving mode, thereby deciding whether it is necessary to update the preset index structure to adapt to the new driving data.
[0067] In an optional embodiment, considering that monitoring the number of newly added trajectory nodes, the change in trajectory length, and the degree of trajectory deformation can avoid unnecessary reconstruction of the preset index structure—that is, if the changes in driving trajectory parameters are not significant, loop closure detection can be performed without updating the preset index structure—this greatly reduces the consumption of computational resources. Therefore, the calibration system can determine the first trajectory length, the number of first trajectory nodes, and the first trajectory shape of the vehicle in the current time period based on the driving trajectory parameters. To accurately compare the driving trajectory parameters with historical trajectory parameters to determine whether the preset index structure needs to be updated, the calibration system can also determine the second trajectory length, the number of second trajectory nodes, and the second trajectory shape when the vehicle last performed loop closure detection on the map. Subsequently, the calibration system can determine the change in trajectory length based on the first and second trajectory lengths, determine the number of newly added trajectory nodes based on the number of first and second trajectory nodes, and determine the degree of trajectory deformation based on the first and second trajectory shapes. Finally, the calibration system can quantify the degree of change in driving trajectory parameters compared to historical trajectory parameters based on the number of newly added trajectory nodes, the change in trajectory length, and the degree of trajectory deformation to determine whether the preset index structure meets the structure update conditions.
[0068] In another optional embodiment, the calibration system can compare the number of newly added trajectory nodes with a preset growth number, the change in trajectory length with a preset length increment, and the degree of trajectory deformation with a preset deformation degree. If the comparison results show that the number of newly added trajectory nodes is greater than or equal to the preset growth number, or the change in trajectory length is greater than the preset length increment, or the degree of trajectory deformation is greater than the preset deformation degree, then the calibration system can determine that the preset index structure meets the structure update conditions. At this time, the calibration system can update the preset index structure.
[0069] Furthermore, the method further includes: determining the storage state of a preset storage structure, wherein the preset storage structure is used to store the results of loop closure detection on the map, and the storage state is used to describe the amount of data stored in the preset storage structure; obtaining target detection results within a historical time period from the preset storage structure, wherein the target detection results are used to characterize the results obtained by successfully performing loop closure detection on the map; when the first trajectory length is greater than or equal to a preset detection length and the storage state is greater than the preset storage state, constructing a detection judgment result based on the target detection results and the change in trajectory length, wherein the detection judgment result is used to characterize whether loop closure detection on the map is required; when the detection judgment result characterizes the need for loop closure detection on the map, determining whether the preset index structure meets the structure update conditions based on the number of newly added trajectory nodes, the change in trajectory length, and the degree of trajectory deformation; preferably, constructing the detection judgment result based on the target detection results and the change in trajectory length includes: determining the number of target detection results; when the number of results is a preset number of results, or when the number of results is greater than the preset number of results and the change in trajectory length is greater than or equal to the detection trigger threshold, determining that the detection judgment result characterizes the need for loop closure detection on the map.
[0070] The aforementioned preset storage structure can refer to a data structure specifically designed for storing loop closure detection results, and may include, but is not limited to, lists, queues, or sliding windows.
[0071] The aforementioned storage status can describe the amount of data already stored in the preset storage structure, and may include, but is not limited to, the number of data entries stored in the preset storage structure, the storage space occupancy rate, or the time span of the storage results.
[0072] The target detection results mentioned above refer to the results obtained by the calibration system in successfully performing loop closure detection on the map within a historical time period, and can be used for subsequent analysis and verification.
[0073] The above detection and judgment results can be the decision results of the calibration system to comprehensively judge whether the loop closure detection process needs to be started based on the current trajectory length, the change in trajectory length, and the target detection results stored in the preset storage structure.
[0074] In one optional embodiment, considering that the data provided by loop closure detection completed within a historical time period may be insufficient to provide effective consistency verification, the calibration system needs to wait until a preset storage structure—that is, a data structure used to store the results of loop closure detection on the map—has stored a sufficient amount of data before performing loop closure detection. Based on this, the calibration system can first determine the storage status of the preset storage structure to understand the amount of data stored in it. Subsequently, the calibration system can extract the target detection results of successfully performed loop closure detection within the historical time period from this preset storage structure. These results carry valid information about loop closure detection on the map within the historical time period. Then, when the first trajectory length reaches or exceeds the preset detection length, and the storage status meets the preset storage status conditions, the calibration system can use the target detection results and the trajectory length change to construct a detection judgment result, thereby deciding whether to initiate the map loop closure detection process.
[0075] In another optional embodiment, the calibration system can first determine the number of target detection results. If the number of results equals a preset number of results, it indicates that there are few valid loop closure detection results within the historical time period. In this case, to provide a reference for the subsequent loop closure detection process, the calibration system can determine that loop closure detection needs to be performed on the map. If the number of results is higher than a preset number of results and the change in trajectory length is not lower than the detection trigger threshold, it indicates that the preset storage structure provides sufficient historical information for reference, and the vehicle's movement distance is sufficient for loop closure detection. In this case, the calibration system can also determine that loop closure detection needs to be performed on the map.
[0076] This judgment mechanism, which combines stored state with historical detection results, allows the calibration system to more intelligently determine when to perform loop closure detection, avoiding unnecessary loop closure checks and thus significantly improving system efficiency. Simultaneously, statistical analysis of historical detection results enables a more accurate assessment of the necessity of current loop closure detection, reducing false detections caused by random noise or short-term trajectory fluctuations, and improving the overall accuracy and reliability of the detection algorithm.
[0077] Further, based on the current vehicle position, historical trajectory points matching the current vehicle position are obtained from a preset index structure to obtain a loop point pair on the map, including: determining the current trajectory node from the driving trajectory parameters based on the current vehicle position, wherein the current trajectory node corresponds to the current vehicle position; determining historical trajectory nodes from the preset index structure based on the current trajectory node, wherein the spatial distance from the historical trajectory node to the current trajectory node is less than the spatial distance from any node in the preset index structure other than the historical trajectory node to the current trajectory node; constructing a loop point pair based on the current trajectory node and the historical trajectory node; preferably, constructing a loop point pair based on the current trajectory node and the historical trajectory node includes: calculating the travel distance between the current trajectory node and the historical trajectory node to obtain a first calculation result; calculating the spatial distance between the current trajectory node and the historical trajectory node to obtain a second calculation result; and determining that the current trajectory node and the historical trajectory node constitute a loop point pair when the first calculation result satisfies a preset travel distance threshold and the second calculation result satisfies a preset spatial distance threshold.
[0078] The aforementioned current trajectory node can be a trajectory node derived from the current vehicle location information.
[0079] The aforementioned travel distance can refer to the distance required for a vehicle to travel from the current trajectory node to a historical trajectory node.
[0080] The first calculation result mentioned above can be the result of a quantitative comparison of the travel distance between the current trajectory node and the historical trajectory nodes.
[0081] The aforementioned spatial distance can be calculated based on Euclidean geometry principles, representing the straight-line distance between the current trajectory node and historical trajectory nodes in two-dimensional or three-dimensional space.
[0082] The second calculation result mentioned above can be a quantitative comparison of the spatial distance between the current trajectory node and the historical trajectory node, used to assess the spatial proximity between the current trajectory node and the historical trajectory node.
[0083] In one optional embodiment, in order to achieve accurate identification of the vehicle loopback position, the calibration system can first determine the current trajectory node based on the current vehicle position. Then, the calibration system can quickly locate the historical trajectory node that is spatially close to the current trajectory node in the preset index structure. The spatial distance from the historical trajectory node to the current trajectory node is less than the spatial distance from the nodes other than the historical trajectory nodes to the current trajectory node in the preset index structure, so as to ensure that the loopback point pair constructed based on the current trajectory node and the historical trajectory node is sufficiently accurate.
[0084] In another optional embodiment, to further ensure the validity of the constructed loop closure point pair, the calibration system can also evaluate the current trajectory node and the historical trajectory node in terms of travel distance and spatial distance. Specifically, the calibration system can calculate the travel distance between the current trajectory node and the historical trajectory node to obtain a first calculation result. It can also calculate the spatial distance between the current trajectory node and the historical trajectory node to obtain a second calculation result. Subsequently, the calibration system can determine the relationship between the first calculation result and a preset travel distance threshold, and the relationship between the second calculation result and a preset spatial distance threshold. If the first calculation result satisfies the preset travel distance threshold, and the second calculation result satisfies the preset spatial distance threshold, then the calibration system can determine that the current trajectory node and the historical trajectory node constitute a loop closure point pair.
[0085] Furthermore, constructing semantic maps corresponding to different points in the loop point pair includes: extracting semantic elements from the current trajectory node based on a preset range to obtain a first semantic element set; extracting semantic elements from the historical trajectory node based on a preset range to obtain a second semantic element set; validating the first and second semantic element sets respectively to obtain a validity verification result, wherein the validity verification result is used to characterize whether both the first and second semantic element sets are valid; if the validity verification result characterizes both the first and second semantic element sets as valid, constructing a first semantic map corresponding to the current trajectory node based on the first semantic element set, and constructing a second semantic map corresponding to the historical trajectory node based on the second semantic element set.
[0086] The aforementioned first semantic element set can refer to the set of all semantic elements extracted from the environment surrounding the current trajectory node within a preset range. These elements can be obtained through sensor observation and may include, but are not limited to, parking spaces, speed bumps, road signs, etc.
[0087] The aforementioned second set of semantic elements can be a set of semantic elements extracted from a preset range of historical trajectory nodes. It can represent the semantic elements recorded by historical trajectory nodes within a historical time period and can be used to compare and match with the semantic elements of the current trajectory node.
[0088] The above validity verification result can be the result of whether the first set of semantic elements and the second set of semantic elements meet the conditions for loop closure detection.
[0089] The aforementioned first semantic map can be a map constructed based on the first semantic element set, which can represent the environmental structure and layout around the current trajectory node.
[0090] The aforementioned second semantic map can be a map constructed based on a set of second semantic elements, similar to the first semantic map. The second semantic map can represent the environmental structure and layout around historical trajectory nodes, facilitating comparison with the first semantic map to identify whether loops have occurred. During loop detection, the second semantic map can serve as a reference, helping the calibration system determine whether the current trajectory node has appeared in the historical trajectory.
[0091] In an optional embodiment, considering that during loop closure detection, the calibration system may not need to detect the entire map, but can only detect a local map to achieve map calibration, the calibration system can extract semantic elements, including but not limited to parking spaces, speed bumps, curbs, and pillars, from the environment surrounding the current trajectory node based on a preset range, forming a first semantic element set. Simultaneously, the calibration system can also collect semantic elements from the environment of historical trajectory nodes based on the same preset range, generating a second semantic element set. Subsequently, the calibration system can perform validity verification on both sets to confirm that the number of elements is sufficient, the distribution is reasonable, and they meet predetermined matching conditions, thereby obtaining a validity verification result. Only when both the first and second semantic element sets pass validity verification, that is, only when the validity verification results indicate that both the first and second semantic element sets are valid, will the calibration system construct the first semantic map corresponding to the current trajectory node based on the first semantic element set, and construct the second semantic map corresponding to the historical trajectory nodes based on the second semantic element set. This ensures that the subsequent steps of loop closure detection will only be performed when the collected semantic information is sufficiently rich and accurate, avoiding the impact of invalid or low-quality data on detection accuracy and improving the reliability and accuracy of the entire loop closure detection process.
[0092] Furthermore, based on the semantic map, loop closure detection is performed on the map, including: deduplicating multiple first semantic elements contained in the first semantic map to obtain a first target map; deduplicating multiple second semantic elements contained in the second semantic map to obtain a second target map; constructing an element mapping relationship between the first target map and the second target map, wherein the element mapping relationship is used to represent the mapping relationship between the first semantic elements and the second semantic elements; and performing loop closure detection on the map based on the element mapping relationship; preferably, constructing the element mapping relationship between the first target map and the second target map includes: obtaining the first spatial position of any first semantic element. Based on the first spatial location and the first semantic type, determine the target semantic element corresponding to any first semantic element from the second target map, wherein the second semantic type of the target semantic element is the same as the first semantic type, and the distance between the second spatial location and the first spatial location of the target semantic element is less than the distance between the spatial locations of other semantic elements of the second semantic type (excluding the target semantic element) and the first spatial location in the second target map; construct an initial mapping relationship based on any first semantic element and the target semantic element; integrate the initial mapping relationships corresponding to multiple first semantic elements to obtain the element mapping relationship.
[0093] The aforementioned first semantic element can refer to geographical features or objects with different meanings identified in the first semantic map, including but not limited to parking spaces, speed bumps, road signs, etc.
[0094] The aforementioned first target map can be a map formed by deduplicating multiple first semantic elements in the first semantic map. This ensures that each identified first semantic element is uniquely represented on the map, eliminates matching errors caused by duplicate elements, and improves the accuracy of loop closure detection.
[0095] The aforementioned second semantic element can be a geographical feature or object with different meanings identified in the second semantic map, which may include, but is not limited to, parking spaces, speed bumps, road signs, etc.
[0096] The aforementioned second target map can be a map formed by deduplicating multiple second semantic elements in the second semantic map, which can ensure that each identified second semantic element is uniquely represented on the map.
[0097] The above element mapping relationship can be used to describe the correspondence between semantic elements in the first target map and the second target map. This relationship can be based on the matching of spatial location and semantic type, and is the key basis for determining whether the two maps form a closed loop.
[0098] The aforementioned first spatial location can refer to the exact geographical coordinates of the first semantic element in three-dimensional space, which can be obtained through vehicle sensor data and used to accurately locate the first semantic element on the map.
[0099] The aforementioned first semantic type can be a label describing the function or category of the first semantic element, which helps the calibration system understand the meaning of the first semantic element, thereby enabling it to find similar semantic elements for matching between different maps.
[0100] The aforementioned target semantic element can be a second semantic element in the second target map that is of the same type as the first semantic element and is spatially close to it.
[0101] The second semantic type mentioned above can be the semantic type of the target semantic element, and can be consistent with the definition of the first semantic type.
[0102] The aforementioned second spatial location can be the specific coordinates of the target semantic element in three-dimensional space, used to quantify the spatial distance between the target semantic element and the first semantic element, thereby assessing the matching probability between the two.
[0103] The initial mapping relationship mentioned above can be any mapping relationship between a first semantic element and a target semantic element, and can be subsequently integrated into a more comprehensive element mapping relationship.
[0104] In one optional embodiment, considering that elements contained in the semantic map may be observed multiple times during vehicle movement, without deduplication of semantic elements, semantic elements at the same location might be treated as two different elements when comparing the first and second semantic maps, thus affecting the accuracy and reliability of map matching. Deduplication ensures that the matched semantic elements do indeed come from different environmental locations, rather than being repeatedly observed from the same location, thereby improving the quality of map matching. Based on this, the calibration system can first deduplicate multiple first semantic elements contained in the first semantic map to obtain a first target map. Simultaneously, the calibration system can also deduplicate multiple second semantic elements contained in the second semantic map to obtain a second target map. After obtaining the first and second target maps, to help the calibration system understand how the semantic elements between the two maps are related, the calibration system can establish the correspondence between the semantic elements in the first and second target maps using algorithms such as iterative nearest neighbor semantic matching, thereby obtaining the element mapping relationship. Once the semantic element mapping relationship between the first target map and the second target map is established, the relative pose transformation matrix from the first target map to the second target map can be calculated, thereby performing loop closure detection on the map and achieving correct map alignment and loop closure constraints.
[0105] In another optional embodiment, considering the key to constructing the element mapping relationship, it is to find semantic elements in the second target map that have the same semantic element type and are spatially close to those in the first target map, as potential matching objects. By limiting the second semantic type of the semantic elements in the second target map to be the same as the first semantic type, the accuracy of matching can be ensured, and mismatches caused by type differences can be avoided. By limiting the distance between the second spatial position and the first spatial position of the semantic elements in the second target map to be close, the accuracy of constructing the element mapping relationship can be ensured. Based on this, the calibration system can determine the target semantic element corresponding to any first semantic element in the second target map based on the first spatial position and the first semantic type. The target semantic element has the same second semantic type, and the distance between the second spatial position and the first spatial position of the target semantic element is less than the distance between the spatial positions and the first spatial positions of other similar second semantic elements in the second target map (excluding the target semantic element), thus ensuring the accuracy of the selection of the target semantic element. Subsequently, the calibration system can construct an initial mapping relationship based on any first semantic element and target semantic element, and then integrate the initial mapping relationships of all first semantic elements to form a complete element mapping relationship. This process ensures the accuracy and reliability of map loop closure detection.
[0106] Further, based on the element mapping relationship, loop closure detection is performed on the map, including: determining the pose transformation matrix between the first target map and the second target map based on the element mapping relationship; matching the first target map and the second target map based on the pose transformation matrix to obtain a map matching result, wherein the map matching result is used to characterize whether the first target map and the second target map are successfully matched; if the map matching result indicates that the first target map and the second target map are successfully matched, loop closure detection is performed on the map based on the first target map to obtain a loop closure detection result, wherein the loop closure detection result is used to characterize whether the map loop closure detection is successful; preferably, matching the first target map and the second target map based on the pose transformation matrix to obtain a map matching result includes: performing coordinate transformation on any first semantic element based on the pose transformation matrix to obtain a transformed first semantic element; calculating the spatial relationship between the transformed first semantic element and the target semantic element. Distance difference; if the spatial distance difference is less than a preset distance difference, any first semantic element is determined to be successfully matched; if the number of successfully matched first semantic elements is greater than a preset number of matches, the map matching result is determined to indicate that the first target map and the second target map are successfully matched; preferably, based on the first target map, loop closure detection is performed on the map to obtain loop closure detection results, including: parsing the target detection results to obtain historical matching results, wherein the historical matching results are used to indicate the matching results of the first target map and the second target map within a historical time period; based on the historical matching results, consistency verification is performed on the map matching results to obtain consistency verification results, wherein the consistency verification results are used to indicate whether the historical matching results and the map matching results meet the consistency conditions; if the consistency verification results indicate that the historical matching results and the map matching results meet the consistency conditions, the loop closure detection result is determined to indicate that the map loop closure detection is successfully performed.
[0107] The aforementioned pose transformation matrix can be a matrix in three-dimensional space that represents the position and orientation changes of an object from the coordinate system corresponding to the first target map to the coordinate system corresponding to the second target map. This position transformation matrix can include translation vectors and rotation matrices to accurately describe the complete pose transformation information between two different maps, from one coordinate system to another.
[0108] The above map matching results can be used to evaluate whether the first target map and the second target map can be successfully aligned and matched.
[0109] The loop closure detection result mentioned above can indicate whether the vehicle has returned to a place it has previously traveled. A successful loop closure detection means that the calibration system has found a closed loop, which can correct the accumulated errors in the path and improve the accuracy of map building and positioning.
[0110] The aforementioned historical matching results can be the results of matching the first target map and the second target map constructed at that time within a historical period.
[0111] The consistency verification result mentioned above can be the matching result obtained when matching a given first target map and a second target map within a historical time period.
[0112] In one optional embodiment, considering that the vehicle's positioning system accumulates positioning errors during long-term operation, loop closure detection can detect whether the vehicle has returned to a previously traveled location. This allows the use of a pose transformation matrix to correct accumulated errors and improve positioning accuracy. Based on this, the calibration system can first determine the pose transformation matrix between the first target map and the second target map according to the constructed element mapping relationship. This provides a closed-loop constraint for the vehicle's positioning system, reflecting the transformation relationship between the first and second target maps, thus aiding the calibration system in calibrating existing maps. Furthermore, considering that false detections of similar but not identical locations during vehicle positioning can lead to poor map accuracy, the pose transformation matrix helps the calibration system filter out these false detections, ensuring that only true loop closures are detected. Therefore, the calibration system can match the first and second target maps based on the pose transformation matrix and determine whether the first and second target maps are successfully matched, thereby obtaining the map matching result. When the map matching result indicates a successful match between the first and second target maps, the calibration system can perform loop closure detection based on the first target map and determine whether the loop closure detection was successful, thus obtaining the loop closure detection result. A successful loop closure detection result means that the calibration system can utilize these closed-loop constraints to calibrate the map, reducing uncertainty and improving map quality.
[0113] In another optional embodiment, considering the spatial distance difference between the transformed first semantic element and the semantic element in the second target map, the spatial relationship between these two semantic elements can be quantified. By setting a preset distance difference threshold, it can be determined whether the two semantic elements are different observations of the same geographic feature. If the difference is less than the threshold, it indicates that they are highly similar, and the two semantic elements can be considered to represent the same feature. Based on this, the calibration system can first perform coordinate transformation on any first semantic element based on the pose transformation matrix to obtain the transformed first semantic element. Subsequently, in order to quantify the spatial position difference between the transformed first semantic element and the corresponding target semantic element, the calibration system can calculate the spatial distance difference between the transformed first semantic element and the target semantic element. If the calculated spatial distance difference is less than the preset distance difference, the calibration system can determine that the first semantic element and the target semantic element are successfully matched. Further considering that the matching of a single element may not be sufficient to prove that the two maps represent the same area, the consistency of matching of multiple elements is needed to enhance the credibility of this conclusion. Only when a certain number of semantic elements are successfully matched can the matching between the first target map and the second target map be considered successful. Therefore, the calibration system can count the number of all successfully matched first semantic elements. Only when the counted number is greater than the preset number of matches can the calibration system determine that the map matching result indicates that the first target map and the second target map have been successfully matched.
[0114] In another alternative embodiment, considering that historical matching results can provide information about the patterns and results of matching the first target map and the second target map within a historical time period, which is crucial for understanding the accuracy of the current detection results, the calibration system can assess the reliability of the current detection results by parsing historical data. Based on this, the calibration system can first parse the target detection results in a preset storage structure to obtain historical matching results, that is, the results of matching the first target map and the second target map within a historical time period. Furthermore, considering that comparing historical matching results with the current map matching results can help the calibration system determine whether the current map matching results are consistent with past experience, thereby preventing erroneous matching due to noise, environmental changes, or other factors, the calibration system can perform consistency verification on the map matching results based on historical matching results to determine whether the historical matching results and the map matching results meet the consistency conditions, thus obtaining a consistency verification result. Since the calibration system relies on accurate closed-loop information for error correction to improve positioning accuracy, if the closed loop is incorrect, it will not only fail to help the calibration system calibrate the map but will also introduce greater deviations. Therefore, the calibration system can only determine the success of loop closure detection when the historical matching results and the current map matching results are confirmed to be consistent with expectations during the consistency verification process—that is, when the consistency verification results indicate that the historical matching results and the map matching results meet the consistency conditions. This ensures that the loop closure constraints are correct and improves the accuracy of the calibration system's map calibration. At this point, the calibration system can add semantic loop closure edges to the global trajectory map and convert loop closure point pairs into a data format usable by the feature mapper in the calibration system. Finally, the calibration system can update the valid loop closure results to the system's shared data.
[0115] For ease of understanding, Figure 2 This is a flowchart of an optional loop closure detection strategy according to an embodiment of this application, such as... Figure 2As shown, at the beginning, the calibration system first determines whether loop closure detection is needed. Specifically, the calibration system can determine this based on the vehicle's trajectory parameters and the size of the preset storage structure (e.g., the size of the sliding window). If loop closure detection is not needed, it skips the detection process. If loop closure detection is needed, the calibration system can update the current loop closure point pairs. After obtaining the loop closure point pairs, the calibration system needs to determine whether to update the KD-tree adapter to perform incremental reconstruction of the KD-tree. If updating the KD-tree adapter is not needed, the loop closure point pairs are updated to the buffer, and the calibration process ends. If updating the KD-tree adapter is needed, the calibration system can obtain the local map ID to get the semantic elements corresponding to the loop closure point pairs. If obtaining the ID fails, the loop closure point pairs and the updated KD-tree adapter results are updated to the buffer, and the calibration process ends. If obtaining the ID succeeds, the calibration system can further perform local map matching. If matching fails, the loop closure point pairs, the updated KD-tree adapter results, and the local map ID are updated to the buffer, and the calibration process ends. If a match is successful, after updating the loop closure pairs, the updated KD-tree adapter results, and the local map ID to the buffer, the calibration system can perform consistency verification on the matching results. If verification fails, the calibration process ends. If verification is successful, the calibration system can update the loop closure results. Specifically, it can add semantic loop closure edges to the trajectory graph and convert the loop closure pairs to a data format usable by the feature mapper in the calibration system. Finally, the calibration system can update the shared data based on the valid loop closure results.
[0116] Figure 3 This is an architecture diagram of an optional map calibration method according to an embodiment of this application, such as... Figure 3 As shown, the architecture includes a detection triggering module, a data preparation module, a candidate filtering module, a map matching module, and a map fusion module. The detection triggering module checks trajectory length, time interval, and system resources to determine whether to trigger the loop closure detection process. The data preparation module provides data support for loop closure detection; specifically, it performs current map sliding window extraction, KD-tree index construction, and semantic trajectory binding. The candidate filtering module selects loop closure point pairs; specifically, it performs spatial proximity search, semantic feature evaluation, and confidence ranking of candidate trajectory points. The map matching module matches the semantic maps corresponding to different points in the loop closure point pairs; specifically, it constructs constraint equations, solves nonlinear optimization problems, and verifies the reasonableness of the results. The map fusion module synchronizes the loop closure detection results to the map, thereby achieving map calibration; specifically, it performs map data alignment, conflict detection and resolution, and global consistency maintenance.
[0117] Figure 4This is a schematic diagram illustrating a specific implementation process of an optional map calibration method according to an embodiment of this application, as shown below. Figure 4 As shown, initially, the calibration system first checks if the trajectory length is greater than a threshold and if there are no recent loops within the sliding window. If not, it returns a calibration failure and terminates the process. If so, it updates the location of the loop occurrence trajectory point and determines the starting position of the sliding window. Subsequently, the calibration system can construct a loop retrieval interval and determine the target frame position at the trajectory endpoint. Then, the calibration system can acquire semantic element information near the target frame and source frame, perform coordinate transformation, and calculate the geometric feature matching degree. Next, the calibration system can determine if the matching degree is less than the matching degree threshold. If not, it returns a calibration failure and terminates the process. If so, it records the matching result and confirms that the semantic elements in the loop point pair are successfully associated. Subsequently, the calibration system can construct a CERES solver and add matching element residual blocks to solve the transformation matrix. If the solution fails, it returns a calibration failure and terminates the process. If the solution succeeds, it updates the global pose graph, returns a calibration success, and terminates the process.
[0118] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0119] According to an embodiment of this application, a map calibration device is provided. It should be noted that this device can be used to perform the map calibration method described above. The specific real-time process and application scenarios are the same as in the above embodiment, and will not be repeated here. Figure 5 This is a schematic diagram of a map calibration device according to an embodiment of this application, such as... Figure 5 As shown, the device includes:
[0120] The first acquisition module 502 is used to acquire the current vehicle position and preset index structure of the vehicle, wherein the preset index structure is constructed based on the historical trajectory parameters of the vehicle within a historical time period.
[0121] The point-to-point construction module 504 is used to obtain historical trajectory points that match the current vehicle location from a preset index structure based on the current vehicle location, so as to obtain the loop point pairs of the vehicle on the map.
[0122] Map building module 506 is used to build semantic maps corresponding to different points in a loop point pair, wherein the semantic map contains semantic elements corresponding to different points.
[0123] The loop closure detection module 508 is used to perform loop closure detection on the map based on the semantic map, where loop closure detection is used for map calibration.
[0124] Furthermore, the device also includes: a second acquisition module for acquiring vehicle trajectory parameters, wherein the trajectory parameters describe the vehicle's trajectory within the current time period; a first condition determination module for determining whether a preset index structure meets the structure update conditions based on the trajectory parameters and historical trajectory parameters; a structure update module for updating the preset index structure based on the trajectory parameters, if the preset index structure meets the structure update conditions, to obtain a target index structure; and a point pair construction module for: obtaining historical trajectory points matching the current vehicle position from the target index structure, based on the current vehicle position, to obtain loopback point pairs.
[0125] Furthermore, the condition determination module is also used to: determine the first trajectory length, the number of first trajectory nodes, and the first trajectory shape of the vehicle in the current time period based on driving trajectory parameters; determine the second trajectory length, the number of second trajectory nodes, and the second trajectory shape of the vehicle when it last performed loop closure detection on the map based on historical trajectory parameters; determine the trajectory length change based on the first trajectory length and the second trajectory length, determine the number of newly added trajectory nodes based on the number of first trajectory nodes and the number of second trajectory nodes, and determine the trajectory deformation degree based on the first trajectory shape and the second trajectory shape; and determine whether the preset index structure meets the structure update conditions based on the number of newly added trajectory nodes, the trajectory length change, and the trajectory deformation degree. Preferably, the structure update conditions include at least one of the following: the number of newly added trajectory nodes is greater than or equal to the preset growth amount; the trajectory length change is greater than the preset length increment; and the trajectory deformation degree is greater than the preset deformation degree.
[0126] Furthermore, the device also includes: a state determination module, used to determine the storage state of a preset storage structure, wherein the preset storage structure is used to store the results of loop closure detection on the map, and the storage state is used to describe the amount of data stored in the preset storage structure; a result acquisition module, used to acquire target detection results within a historical time period from the preset storage structure, wherein the target detection results are used to characterize the results obtained by successfully performing loop closure detection on the map; a detection judgment module, used to construct a detection judgment result based on the target detection results and the change in trajectory length when the first trajectory length is greater than or equal to the preset detection length and the storage state is greater than the preset storage state, wherein the detection judgment result is used to characterize whether loop closure detection on the map is required; a second condition determination module, used to determine whether the preset index structure meets the structure update conditions based on the number of newly added trajectory nodes, the change in trajectory length, and the degree of trajectory deformation when the detection judgment result characterizes the need for loop closure detection on the map; preferably, the detection judgment module is also used to: determine the number of target detection results; and determine that the detection judgment result characterizes the need for loop closure detection on the map when the number of results is a preset number of results, or when the number of results is greater than the preset number of results and the change in trajectory length is greater than or equal to the detection trigger threshold.
[0127] Furthermore, the point-to-point construction module is also used for: determining the current trajectory node from the driving trajectory parameters based on the current vehicle position, wherein the current trajectory node corresponds to the current vehicle position; determining historical trajectory nodes from a preset index structure based on the current trajectory node, wherein the spatial distance from the historical trajectory node to the current trajectory node is less than the spatial distance from any node other than the historical trajectory node to the current trajectory node in the preset index structure; constructing a loop-loop point pair based on the current trajectory node and the historical trajectory node; preferably, the point-to-point construction module is also used for: calculating the travel distance between the current trajectory node and the historical trajectory node to obtain a first calculation result; calculating the spatial distance between the current trajectory node and the historical trajectory node to obtain a second calculation result; and determining that the current trajectory node and the historical trajectory node constitute a loop-loop point pair when the first calculation result satisfies a preset travel distance threshold and the second calculation result satisfies a preset spatial distance threshold.
[0128] Furthermore, the map construction module is also used to: extract semantic elements from the current trajectory node based on a preset range to obtain a first semantic element set; extract semantic elements from the historical trajectory node based on a preset range to obtain a second semantic element set; perform validity verification on the first semantic element set and the second semantic element set respectively to obtain a validity verification result, wherein the validity verification result is used to characterize whether both the first semantic element set and the second semantic element set are valid; if the validity verification result characterizes both the first semantic element set and the second semantic element set as valid, construct a first semantic map corresponding to the current trajectory node based on the first semantic element set, and construct a second semantic map corresponding to the historical trajectory node based on the second semantic element set.
[0129] Furthermore, the loop closure detection module is also used for: deduplicating multiple first semantic elements contained in the first semantic map to obtain a first target map; deduplicating multiple second semantic elements contained in the second semantic map to obtain a second target map; constructing an element mapping relationship between the first target map and the second target map, wherein the element mapping relationship is used to represent the mapping relationship between the first semantic elements and the second semantic elements; and performing loop closure detection on the map based on the element mapping relationship. Preferably, the loop closure detection module is also used for: obtaining the first spatial position and first semantic type of any first semantic element; determining the target semantic element corresponding to any first semantic element from the second target map based on the first spatial position and the first semantic type, wherein the second semantic type of the target semantic element is the same as the first semantic type, and the distance between the second spatial position and the first spatial position of the target semantic element is less than the distance between the spatial positions of other semantic elements of the second semantic type (excluding the target semantic element) in the second target map and their first spatial positions; constructing an initial mapping relationship based on any first semantic element and the target semantic element; and integrating the initial mapping relationships corresponding to multiple first semantic elements to obtain an element mapping relationship.
[0130] Furthermore, the loop closure detection module is also used for: determining the pose transformation matrix between the first target map and the second target map based on the element mapping relationship; matching the first target map and the second target map based on the pose transformation matrix to obtain a map matching result, wherein the map matching result is used to characterize whether the first target map and the second target map are successfully matched; if the map matching result indicates that the first target map and the second target map are successfully matched, performing loop closure detection on the map based on the first target map to obtain a loop closure detection result, wherein the loop closure detection result is used to characterize whether the loop closure detection on the map is successful; preferably, the loop closure detection module is also used for: performing coordinate transformation on any first semantic element based on the pose transformation matrix to obtain the transformed first semantic element; calculating the spatial distance difference between the transformed first semantic element and the target semantic element; and calculating the spatial distance difference between the transformed first semantic element and the target semantic element. If the difference is less than a preset distance difference, any first semantic element is determined to be successfully matched; if the number of successfully matched first semantic elements is greater than a preset number of matches, the map matching result is determined to indicate that the first target map and the second target map are successfully matched; preferably, the loop closure detection module is further used to: parse the target detection result to obtain historical matching results, wherein the historical matching results are used to indicate the results of matching the first target map and the second target map within a historical time period; based on the historical matching results, perform consistency verification on the map matching result to obtain a consistency verification result, wherein the consistency verification result is used to indicate whether the historical matching result and the map matching result meet the consistency condition; if the consistency verification result indicates that the historical matching result and the map matching result meet the consistency condition, the loop closure detection result is determined to indicate that the map loop closure detection is successful.
[0131] Embodiments of this application also provide a vehicle, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods described in various embodiments of this application when it runs.
[0132] Embodiments of this application also provide a computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to perform the methods of various embodiments of this application.
[0133] Embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements the methods of various embodiments of this application.
[0134] Embodiments of this application also provide a computer program product, including a non-volatile computer-readable storage medium for storing a computer program that, when executed by a processor, implements the methods in various embodiments of this application.
[0135] Embodiments of this application also provide a computer program that, when executed by a processor, implements the methods described in the various embodiments of this application.
[0136] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0137] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0138] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0139] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0140] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0141] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A map calibration method, characterized in that, include: Obtain the current vehicle location and a preset index structure, wherein the preset index structure is constructed based on the vehicle's historical trajectory parameters within a historical time period; Based on the current vehicle location, historical trajectory points matching the current vehicle location are obtained from the preset index structure to obtain the loop point pair of the vehicle on the map; Construct a semantic map corresponding to different points in the loop closure point pair, wherein the semantic map contains semantic elements corresponding to the different points; Based on the semantic map, loop closure detection is performed on the map, wherein the loop closure detection is used to calibrate the map.
2. The method according to claim 1, characterized in that, The method further includes: Obtain the vehicle's driving trajectory parameters, wherein the driving trajectory parameters are used to describe the vehicle's driving trajectory within the current time period; Based on the driving trajectory parameters and the historical trajectory parameters, determine whether the preset index structure meets the structure update conditions; If the preset index structure meets the structure update conditions, the preset index structure is updated based on the driving trajectory parameters to obtain the target index structure; Based on the current vehicle location, historical trajectory points matching the current vehicle location are obtained from the preset index structure to obtain the vehicle's loop point pair on the map, including: Based on the current vehicle location, historical trajectory points matching the current vehicle location are obtained from the target index structure to obtain the loop point pair.
3. The method according to claim 2, characterized in that, Based on the driving trajectory parameters and the historical trajectory parameters, determining whether the preset index structure meets the structure update conditions includes: Based on the driving trajectory parameters, the length of the first trajectory, the number of the first trajectory nodes, and the shape of the first trajectory of the vehicle in the current time period are determined. Based on the historical trajectory parameters, the length of the second trajectory, the number of second trajectory nodes, and the shape of the second trajectory are determined when the vehicle last performed loop closure detection on the map. Based on the first trajectory length and the second trajectory length, determine the amount of change in trajectory length; based on the number of the first trajectory nodes and the number of the second trajectory nodes, determine the number of newly added trajectory nodes; and based on the first trajectory shape and the second trajectory shape, determine the degree of trajectory deformation. Based on the number of newly added trajectory nodes, the change in trajectory length, and the degree of trajectory deformation, determine whether the preset index structure meets the structure update conditions; Preferably, the structural update conditions include at least one of the following: The number of newly added trajectory nodes is greater than or equal to the preset growth number; The change in trajectory length is greater than the preset length increment; The degree of trajectory deformation is greater than the preset degree of deformation.
4. The method according to claim 3, characterized in that, The method further includes: Determine the storage status of a preset storage structure, wherein the preset storage structure is used to store the results of loop closure detection on the map, and the storage status is used to describe the amount of data already stored in the preset storage structure; The target detection results within the historical time period are obtained from the preset storage structure, wherein the target detection results are used to characterize the result of successfully performing loop closure detection on the map; When the length of the first trajectory is greater than or equal to the preset detection length and the storage state is greater than the preset storage state, a detection judgment result is constructed based on the target detection result and the change in the trajectory length. The detection judgment result is used to characterize whether loop closure detection is required for the map. If the detection result indicates that loop closure detection is required on the map, the preset index structure is determined to meet the structure update conditions based on the number of newly added trajectory nodes, the change in trajectory length, and the degree of trajectory deformation. Preferably, based on the target detection result and the trajectory length change, a detection judgment result is constructed, including: Determine the number of results for the target detection; If the number of results is a preset number of results, or if the number of results is greater than the preset number of results and the change in trajectory length is greater than or equal to the detection trigger threshold, the detection judgment result indicates that loop closure detection needs to be performed on the map.
5. The method according to claim 1, characterized in that, Based on the current vehicle location, historical trajectory points matching the current vehicle location are obtained from the preset index structure to obtain the vehicle's loop point pair on the map, including: Based on the current vehicle location, the current trajectory node is determined from the driving trajectory parameters, wherein the current trajectory node corresponds to the current vehicle location; Based on the current trajectory node, historical trajectory nodes are determined from the preset index structure, wherein the spatial distance from the historical trajectory node to the current trajectory node is less than the spatial distance from the nodes other than the historical trajectory node to the current trajectory node in the preset index structure. Based on the current trajectory node and the historical trajectory node, construct the loop point pair; Preferably, constructing the loop closure point pair based on the current trajectory node and the historical trajectory node includes: The travel distance between the current trajectory node and the historical trajectory node is calculated to obtain a first calculation result; The spatial distance between the current trajectory node and the historical trajectory node is calculated to obtain a second calculation result; If the first calculation result satisfies the preset travel distance threshold and the second calculation result satisfies the preset spatial distance threshold, then the current trajectory node and the historical trajectory node are determined to constitute the loop point pair.
6. The method according to claim 1, characterized in that, Constructing a semantic map corresponding to different points in the loop closure pair includes: Based on a preset range, semantic elements are extracted from the current trajectory node to obtain the first set of semantic elements; Based on the preset range, semantic elements are extracted from historical trajectory nodes to obtain a second set of semantic elements. The validity of the first set of semantic elements and the second set of semantic elements are validated respectively to obtain a validity validation result, wherein the validity validation result is used to characterize whether both the first set of semantic elements and the second set of semantic elements are valid; If the validity verification result indicates that both the first semantic element set and the second semantic element set are valid, a first semantic map corresponding to the current trajectory node is constructed based on the first semantic element set, and a second semantic map corresponding to the historical trajectory node is constructed based on the second semantic element set.
7. The method according to claim 1, characterized in that, Based on the semantic map, loop closure detection is performed on the map, including: The first semantic map is deduplicated by removing multiple first semantic elements to obtain the first target map; The second semantic map is deduplicated by removing multiple second semantic elements to obtain the second target map; Construct an element mapping relationship between the first target map and the second target map, wherein the element mapping relationship is used to represent the mapping relationship between the first semantic element and the second semantic element; Based on the element mapping relationship, loop closure detection is performed on the map; Preferably, constructing the element mapping relationship between the first target map and the second target map includes: Get the first spatial location and first semantic type of any first semantic element; Based on the first spatial location and the first semantic type, a target semantic element corresponding to any one of the first semantic elements is determined from the second target map, wherein the second semantic type of the target semantic element is the same as the first semantic type, and the distance between the second spatial location of the target semantic element and the first spatial location is less than the distance between the spatial locations of other semantic elements of the second semantic type in the second target map (excluding the target semantic element) and the first spatial location. Based on any one of the first semantic elements and the target semantic element, an initial mapping relationship is constructed; The initial mapping relationships corresponding to the multiple first semantic elements are integrated to obtain the element mapping relationship.
8. The method according to claim 7, characterized in that, Based on the element mapping relationship, loop closure detection is performed on the map, including: Based on the element mapping relationship, determine the pose transformation matrix between the first target map and the second target map; Based on the pose transformation matrix, the first target map and the second target map are matched to obtain a map matching result, wherein the map matching result is used to characterize whether the first target map and the second target map are successfully matched; If the map matching result indicates that the first target map and the second target map are successfully matched, loop closure detection is performed on the map based on the first target map to obtain a loop closure detection result, wherein the loop closure detection result is used to indicate whether the loop closure detection on the map is successful; Preferably, based on the pose transformation matrix, the first target map and the second target map are matched to obtain a map matching result, including: Based on the pose transformation matrix, coordinate transformation is performed on any one of the first semantic elements to obtain the transformed first semantic element; Calculate the spatial distance difference between the transformed first semantic element and the target semantic element; If the spatial distance difference is less than a preset distance difference, it is determined that any one of the first semantic elements is successfully matched; If the number of successfully matched first semantic elements is greater than the preset number of matches, the map matching result is determined to indicate that the first target map and the second target map have been successfully matched. Preferably, based on the first target map, loop closure detection is performed on the map to obtain loop closure detection results, including: The target detection results are analyzed to obtain historical matching results, wherein the historical matching results are used to characterize the matching results of the first target map and the second target map within the historical time period; Based on the historical matching results, the map matching results are subjected to consistency verification to obtain a consistency verification result, wherein the consistency verification result is used to characterize whether the historical matching results and the map matching results meet the consistency conditions. If the consistency verification result indicates that the historical matching result and the map matching result meet the consistency condition, then the loop closure detection result indicates that the loop closure detection of the map was successfully performed.
9. A vehicle, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, performs the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the storage medium is located to perform the method according to any one of claims 1 to 8.