Map updating methods, devices, electronic devices and storage media
By identifying and marking keyframe sequences with deviations in the robot map, the problem of inaccurate localization and navigation caused by environmental changes was solved, enabling effective map updates and accurate robot navigation.
Patent Information
- Application Number
- CN202211419193.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-14
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-11-14
AI Technical Summary
As time changes, environmental features may change, making it difficult for existing technologies to effectively update robot maps to ensure the accuracy of their positioning and navigation.
By determining whether there is a robot's cumulative movement distance greater than a preset distance in the keyframe sequence, and marking it as a keyframe sequence that can be used for map updating when there is a deviation, the map can be updated using these keyframes.
It enables effective updates to the robot map, ensuring accurate positioning and navigation of the robot in the environment and adapting to environmental changes.
Smart Images

Figure CN115824192B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to map updating methods, apparatus, electronic devices, and storage media. Background Technology
[0002] With the rapid development of robotics technology, robots with various functions, such as sweeping robots, inspection robots, and material handling robots, have been widely used in many industries. When a robot moves within an environment, it typically needs to utilize a map corresponding to that environment for positioning and navigation.
[0003] However, the features of the environment may change over time. Therefore, updating the map corresponding to the environment is crucial to enable the robot to perform accurate localization and navigation. Summary of the Invention
[0004] The purpose of this application is to provide a map updating method, apparatus, electronic device, and storage medium for updating maps.
[0005] The first aspect of this application provides a map updating method, including:
[0006] Determine whether there is a robot cumulative motion distance greater than a preset distance in the keyframe sequence. The cumulative robot motion distance of the keyframe sequence is determined by matching multiple keyframes in the keyframe sequence with the map, and by determining the robot motion distance corresponding to keyframes that have been matched successfully less than a preset number of times and / or keyframes that have failed to match.
[0007] If it is determined that the keyframe sequence contains a cumulative robot movement distance greater than a preset distance, the keyframe sequence is marked as a keyframe sequence that can be used for map updating.
[0008] In one embodiment, determining whether there exists a robot's cumulative motion distance greater than a preset distance in the keyframe sequence specifically includes:
[0009] For each key frame in a series of consecutive key frames in the key frame sequence, the key frame is sequentially used as the current key frame and matched with the map.
[0010] If the number of successful matches and consecutive successful matches is less than a preset number, or if the match fails, the robot movement distance corresponding to the current keyframe will be added to the robot's current cumulative movement distance.
[0011] Determine whether the current cumulative movement distance of the robot, after adding the robot's movement distance, is greater than the preset distance;
[0012] If the distance is greater than the preset distance, then it is determined that the keyframe sequence has a cumulative robot movement distance greater than the preset distance.
[0013] In one embodiment, the method further includes: resetting the robot's current cumulative movement distance to a preset value when the number of successful matches and consecutive successful matches is greater than or equal to a preset number.
[0014] In one embodiment, before determining whether there is a robot's cumulative motion distance greater than a preset distance in the keyframe sequence, the method further includes:
[0015] Match the collected keyframes with the map;
[0016] If the matching result meets the initialization conditions, the robot is initialized; and,
[0017] Determining whether there is a robot cumulative motion distance greater than a preset distance in the keyframe sequence specifically includes: when the robot has been initialized, determining whether there is a robot cumulative motion distance greater than a preset distance in the keyframe sequence.
[0018] In one embodiment, after marking the keyframe sequence as a keyframe sequence that can be used for map updating, the method further includes adding the keyframe sequence to a first trajectory queue.
[0019] In one embodiment, if the number of keyframe sequences in the first trajectory queue is greater than a preset number, one or more keyframe sequences that were added to the first trajectory queue earliest are deleted according to the order in which each keyframe sequence was added to the first trajectory queue.
[0020] In one embodiment, it is determined whether a target keyframe subsequence exists in the keyframe sequence that can be used for map updating, wherein each keyframe in the target keyframe subsequence fails to match the map, the cumulative robot movement distance of the target keyframe subsequence is within a preset range, and the previous keyframe and the next keyframe of the target keyframe subsequence both match the map successfully.
[0021] If a target keyframe subsequence exists in the keyframe sequence available for map updating, the target keyframe subsequence is obtained for use in map updating.
[0022] In one embodiment, the method further includes adding the target keyframe subsequence to a second trajectory queue.
[0023] In one embodiment, the method further includes:
[0024] For each keyframe in the target keyframe subsequence, determine the keyframe to be updated in the map corresponding to the keyframe. Specifically, the keyframe to be updated includes the keyframe in the map that has the smallest distance from the keyframe or a distance less than a fourth preset distance.
[0025] For each keyframe in the target keyframe subsequence, the corresponding keyframe to be updated is replaced with the keyframe to generate a new map.
[0026] In one embodiment, the method further includes:
[0027] Construct a K-dimensional tree using the keyframes of the map; and,
[0028] For each keyframe in the target keyframe subsequence, determine the corresponding keyframe in the map to be updated, specifically including:
[0029] For each keyframe in the target keyframe subsequence, the corresponding keyframe to be updated in the map is determined based on the K-dimensional tree.
[0030] In one embodiment, the method further includes:
[0031] Acquire point cloud data collected by the robot from the environment;
[0032] If the time interval between the acquisition time of the point cloud data and the acquisition time of the previous key frame is greater than a preset duration, the point cloud data is determined as a key frame for generating the key frame sequence.
[0033] In one embodiment, the robot movement distance corresponding to the keyframe is determined by the following method:
[0034] Determine the first coordinate position when the robot collects the key frame, and the second coordinate position when the robot collects the previous key frame;
[0035] Based on the first coordinate position and the second coordinate position, determine the robot movement distance corresponding to the keyframe.
[0036] A second aspect of this application provides a map updating method, including:
[0037] Obtain the keyframe sequence that can be used for map updates;
[0038] Determine whether a target keyframe subsequence exists in the keyframe sequence that can be used for map updating, wherein each keyframe in the target keyframe subsequence fails to match the map, the cumulative motion distance of the robot in the target keyframe subsequence is within a preset range, and the previous keyframe and the next keyframe of the target keyframe subsequence both match the map successfully.
[0039] If a target keyframe subsequence exists in the keyframe sequence available for map updating, the target keyframe subsequence is obtained for use in map updating.
[0040] In one embodiment, obtaining a keyframe sequence that can be used for map updating specifically includes:
[0041] The keyframe sequence that can be used for map updates is obtained from the first trajectory queue.
[0042] In one embodiment, obtaining the keyframe sequence that can be used for map updating from the first trajectory queue specifically includes:
[0043] Upon receiving a map update instruction, the keyframe sequence that can be used for map update is obtained from the first trajectory queue.
[0044] A third aspect of this application provides a map updating apparatus, comprising:
[0045] A determining unit is used to determine whether there is a robot cumulative motion distance greater than a preset distance in the keyframe sequence. The robot cumulative motion distance of the keyframe sequence is determined by matching multiple keyframes in the keyframe sequence with a map, and by determining the robot motion distance corresponding to keyframes that have been matched successfully less than a preset number of times and / or keyframes that have failed to match among the multiple matched keyframes.
[0046] A marking unit is used to mark the keyframe sequence as a keyframe sequence that can be used for map updating when it is determined that there is a robot cumulative movement distance greater than a preset distance in the keyframe sequence.
[0047] A fourth aspect of this application provides a map updating apparatus, comprising:
[0048] The acquisition unit is used to acquire keyframe sequences that can be used for map updates;
[0049] The second determining unit is used to determine whether there is a target keyframe subsequence in the keyframe sequence that can be used for map updating, wherein each keyframe in the target keyframe subsequence fails to match the map, the size of the robot's cumulative motion distance in the target keyframe subsequence is within a preset range, and the previous keyframe and the next keyframe of the target keyframe subsequence both match the map successfully.
[0050] The target keyframe subsequence acquisition unit is used to acquire the target keyframe subsequence for map update when the target keyframe subsequence exists in the keyframe sequence available for map update.
[0051] A fifth aspect of this application provides an electronic device, including:
[0052] Memory, used to store computer programs;
[0053] A processor for executing the method described in any one of the embodiments of the present application.
[0054] A sixth aspect of this application provides a computer-readable storage medium comprising: a program that, when run on an electronic device, enables the electronic device to perform the method described in any one of the method embodiments of this application.
[0055] The map updating method provided in this application first determines whether a keyframe sequence contains a cumulative robot movement distance greater than a preset distance. Then, if such a sequence is found to contain a cumulative robot movement distance greater than the preset distance, it is marked as a keyframe sequence suitable for map updating. The cumulative robot movement distance of this keyframe sequence is determined by matching multiple keyframes in the sequence with the map, and by identifying the robot movement distance corresponding to keyframes that have a fewer than preset number of consecutive successful matches and / or keyframes that have failed to match. Therefore, if a keyframe sequence contains a cumulative robot movement distance greater than the preset distance, it indicates a certain deviation between the keyframes in the sequence and the map, and the keyframe sequence can be used to update the map. Attached Figure Description
[0056] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0057] Figure 1This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0058] Figure 2 This is a schematic diagram illustrating the specific process of a map update method provided in an embodiment of this application;
[0059] Figure 3 A schematic diagram illustrating the specific process of determining whether a keyframe sequence contains a robot's cumulative motion distance greater than a preset distance in a map update method provided in an embodiment of this application;
[0060] Figure 4 A schematic diagram illustrating the specific process of a map update method provided for another embodiment of this application;
[0061] Figure 5 A schematic diagram illustrating the specific process of a map update method in a specific application scenario, provided as an embodiment of this application;
[0062] Figure 6 A schematic diagram of the specific structure of a map updating device provided in one embodiment of this application;
[0063] Figure 7 This is a schematic diagram of the specific structure of a map updating device provided in one embodiment of this application. Detailed Implementation
[0064] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. In the description of this application, terms such as "first," "second," and "third" are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance or order.
[0065] As mentioned earlier, robots typically need to utilize a map of that environment for localization and navigation during their movement. However, the features of the environment may change over time. Therefore, updating the map is crucial to support accurate localization and navigation for the robot.
[0066] Based on this, embodiments of this application provide an electronic device. For example... Figure 1 The diagram shows the specific structure of the electronic device 1. The electronic device 1 includes at least one processor 11 and a memory 12. Figure 1 Taking a processor as an example, the processor 11 and the memory 12 can be connected via a bus 10. The memory 12 stores instructions that can be executed by the processor 11. The instructions are executed by the processor 11 to enable the electronic device 1 to perform all or part of the process of the method in the following embodiments.
[0067] In practical applications, the electronic device 1 can be a robot, mobile phone, tablet computer, laptop computer, desktop computer, or a large server or server cluster composed of them.
[0068] For a robot, a map can be stored on its own storage device, allowing it to locate and navigate in its environment. Alternatively, the map can be stored on a server or cloud server. A robot can then communicate with the server or cloud server to send the environmental information it has collected to the server or cloud server and obtain the server's location information for location and navigation.
[0069] Maps typically have a corresponding environment (such as shopping malls or schools), which contains one or more features. For example, a school includes features like school buildings and a playground, while a shopping mall includes features like shops and merchandise. This map is used for localization and navigation within that environment. For instance, creating a map corresponding to a specific environment allows for the localization and navigation of a robot within that environment.
[0070] In addition, the map type can be a raster map or a point cloud map. The map can include multiple keyframes, and during the map update process, some or all of the keyframes can be updated to update the map.
[0071] For example, map M can be represented as:
[0072] M={{map},{keyframe0,keyframe1,……,keyframe m}}
[0073] Where: map represents map data, keyframe m This represents the m-th keyframe.
[0074] Additionally, you can also use the keyframe. m Represented as: keyframe m ={id m ,T m ,P m s m}
[0075] Where: id m Indicates the identifier of the point cloud data in frame m; T m P represents the point cloud pose of the m-th frame of point cloud data; m S represents the point cloud of the m-th frame; m This indicates the matching status between the point cloud and the map in the m-th frame, and can be either true or false.
[0076] like Figure 2 The diagram shown is a flowchart of a map update method provided in an embodiment of this application. Here, electronic device 1 can be taken as a robot, and some or all of the steps of this method can be performed by the robot. The method includes the following steps:
[0077] Step S21: Determine whether there is a robot cumulative motion distance greater than a preset distance in the keyframe sequence.
[0078] During the map update process, step S21 determines whether the keyframe sequence contains a cumulative robot movement distance greater than a preset distance. This keyframe sequence can consist of multiple keyframes, for example, by using the robot to collect data from the map corresponding to the environment, thus obtaining multiple keyframes, and then using these keyframes to generate a keyframe sequence. The number of keyframes in the keyframe sequence can be, for example, 5, 10, 15, 30, 50, 100, or other numbers.
[0079] There are several ways to determine keyframes in practical applications. Here are a few examples:
[0080] As the robot moves within the environment, it can continuously collect point cloud data of the environment using the lidar installed on the robot. For example, every 5 seconds or other time intervals, or after moving a certain distance (such as 5 cm, 10 cm, etc.), the currently collected point cloud data is used as a keyframe. In this way, multiple keyframes are continuously collected by the robot's continuous movement within the environment.
[0081] In practical applications, multiple keyframes can be continuously identified using the above method. These keyframes can then be arranged according to their acquisition time sequence to form a keyframe sequence. For example, if multiple keyframes are identified as A, B, C, D, and E, and their acquisition times are t1, t2, t3, t4, and t5 respectively, then the keyframe sequence A→B→C→D→E can be constructed.
[0082] It should be noted that, for each keyframe in a keyframe sequence, the robot's movement distance corresponding to that keyframe can be determined as follows: First, determine the first coordinate position of the robot when it acquires the keyframe, and the second coordinate position of the robot when it acquires the previous keyframe. Then, based on the first and second coordinate positions, determine the robot's movement distance corresponding to that keyframe. For example, the distance between the first and second coordinate positions can be calculated, such as Euclidean distance. The calculated distance is then used as the robot's movement distance corresponding to that keyframe. In this method, the robot's movement distance corresponding to the keyframe reflects the magnitude of the distance the robot moves during the time interval between the acquisition of that keyframe and the previous keyframe.
[0083] After determining the robot movement distance corresponding to each keyframe in the keyframe sequence, in step S21, the cumulative robot movement distance of the keyframe sequence can be determined in the following way: by matching multiple keyframes in the keyframe sequence with the map respectively, and determining the robot movement distance corresponding to the keyframes that have been matched successfully less than a preset number of times and / or the keyframes that have failed to match.
[0084] One method of matching multiple keyframes in a keyframe sequence with keyframes in a map can be to take each keyframe in a series of consecutive keyframes in the keyframe sequence, treat that keyframe as the current keyframe, and match the current keyframe with the map. For example, a preset matching algorithm can be used to match the current keyframe with the map. This preset matching algorithm can be the Normal Distributions Transform (NDT) algorithm, or other algorithms that can be used to match keyframes with maps.
[0085] Therefore, in step S21, the specific method for determining whether there is a robot cumulative motion distance greater than a preset distance in the keyframe sequence may include: first, taking each keyframe in a series of consecutive keyframes in the keyframe sequence as the current keyframe (wherein, considering that the matching efficiency is usually high, the acquired keyframe can be directly used as the current keyframe), and matching it with the keyframes in the map; the first case may be that, in the case of matching failure, the robot motion distance corresponding to the current keyframe is added to the robot's current cumulative motion distance, and it is determined whether the robot's current cumulative motion distance after adding the robot motion distance is greater than the preset distance; and, if it is greater than the preset distance, it is determined that there is a robot cumulative motion distance greater than the preset distance in the keyframe sequence.
[0086] The second approach is to not add the robot's current motion distance corresponding to the current keyframe to the robot's current cumulative motion distance if the match is successful, and to further use the next keyframe as the new current keyframe for matching with the map.
[0087] The third approach involves further determining whether the number of consecutive successful matches is less than a preset number when a match is successful. If the current keyframe matches the map successfully and the number of consecutive successful matches is less than the preset number, the robot's movement distance corresponding to the current keyframe is added to the robot's current cumulative movement distance. Then, it is determined whether the robot's current cumulative movement distance after adding the robot's movement distance is greater than the preset distance. If it is greater than the preset distance, it is determined that there is a robot cumulative movement distance in the keyframe sequence that is greater than the preset distance.
[0088] The number of consecutive successful matches refers to the number of times the current keyframe and the keyframes preceding it are matched with the map consecutively and successfully. For example, if the current keyframe matches the map successfully, but the keyframe preceding it fails to match the map, then the number of consecutive successful matches is 1; if the current keyframe matches the map successfully, and the keyframe preceding it also matches the map successfully, but the second keyframe preceding it fails to match the map, then the number of consecutive successful matches is 2.
[0089] Of course, if the current keyframe matches the map successfully, and the number of consecutive successful matches is greater than or equal to the preset number, the robot's current cumulative movement distance can be reset to the preset value, such as 0.
[0090] In practical applications, specific methods such as... Figure 3 The method shown determines whether a keyframe sequence contains a robot's cumulative motion distance greater than a preset distance, and includes the following steps:
[0091] Step S211: For each key frame in a series of consecutive key frames in the key frame sequence, use that key frame as the current key frame and match it with the map.
[0092] Step S212: Determine whether the current keyframe matches the map successfully. If yes, proceed to step S213; otherwise, proceed to steps S215 and S216.
[0093] Additionally, if it is determined that the current keyframe fails to match the map, the number of consecutive successful matches can be reset to 0.
[0094] Step S213: Determine whether the number of consecutive successful matches is less than the preset number. If yes, proceed to steps S215 and S216; or if no, proceed to steps S214 and S216.
[0095] Step S214: Reset the robot's current cumulative movement distance to a preset value.
[0096] Step S215: Add the robot's motion distance corresponding to the current keyframe to the robot's current cumulative motion distance.
[0097] Step S216: Determine whether the robot's current cumulative movement distance is greater than the preset distance.
[0098] In step S216, if it is determined that the robot's current cumulative movement distance is greater than the preset distance, it means that in step S21, there is a robot cumulative movement distance greater than the preset distance in the keyframe sequence. Of course, if step S216 determines that the robot's current cumulative movement distance is less than or equal to the preset distance, step S211 needs to be executed again, and the next keyframe in the keyframe sequence is taken as the current keyframe (considering that the efficiency of determining the keyframe is usually lower than the execution efficiency of steps S211 to S216, the next keyframe in the keyframe sequence is usually the next acquired keyframe), and the subsequent related steps are executed again until the loop termination condition is met, that is, the keyframe sequence determines that there is a robot cumulative movement distance greater than the preset distance, or finally determines that the keyframe sequence does not have a robot cumulative movement distance greater than the preset distance.
[0099] Step S22: If it is determined that there is a robot cumulative movement distance greater than a preset distance in the keyframe sequence, mark the keyframe sequence as a keyframe sequence that can be used for map updating.
[0100] Through the above step S21, it can be determined whether there is a robot cumulative movement distance greater than a preset distance in the keyframe sequence. If it is determined that there is a robot cumulative movement distance greater than a preset distance in the keyframe sequence, the keyframe sequence can be further marked as a keyframe sequence that can be used for map updating, thereby being used for map updating. Of course, if it is determined that there is no robot cumulative movement distance greater than a preset distance in the keyframe sequence, the keyframe sequence can be discarded.
[0101] In step S22, if the cumulative robot movement distance in the keyframe sequence exceeds a preset distance, it indicates a discrepancy between the keyframes in the keyframe sequence and the keyframes in the map. It may be necessary to update the keyframes in the map using the keyframes in this keyframe sequence. Therefore, this keyframe sequence is marked as a keyframe sequence suitable for map updating. Subsequently, this marked keyframe sequence can be directly used to update the map. To improve the map updating effect, a subset of keyframe sequences (referred to as target keyframe sequences) can be further selected from this keyframe sequence and then used to update the map. The specific method for updating the map using the marked keyframe sequences will be further explained later.
[0102] The map updating method provided in this application first determines whether a keyframe sequence contains a cumulative robot movement distance greater than a preset distance. Then, if such a sequence is found to contain a cumulative robot movement distance greater than the preset distance, the keyframe sequence is marked as a keyframe sequence suitable for map updating. The cumulative robot movement distance of this keyframe sequence is determined by matching multiple keyframes in the sequence with the map, and based on the robot movement distance corresponding to keyframes that fail to match consecutively. Therefore, if a keyframe sequence contains a cumulative robot movement distance greater than the preset distance, it indicates that there is a certain deviation between the keyframes in the sequence and the map, and the keyframe sequence can be used to update the map.
[0103] In practical applications, the robot usually needs to be initialized before updating the map or executing steps S21 to S22. After initialization, the robot can move in the environment corresponding to the map and use LiDAR to continuously collect point cloud data of the environment and determine keyframes. Steps S21 to S22 are then used to mark the keyframe sequence.
[0104] One method for initializing the robot is to match the collected keyframes with the map, and initialize the robot if the matching result meets the initialization conditions. For example, the initialization condition could be that a certain collected keyframe successfully matches the map, in which case the robot can be initialized; of course, the initialization condition could also be that two consecutive collected keyframes successfully match the map, etc., and the initialization condition can be set according to actual needs.
[0105] It should be further explained that, in step S22 above, after marking the keyframe sequence as a keyframe sequence that can be used for map updating, the method may further include: adding the keyframe sequence to a first trajectory queue. Therefore, the first trajectory queue is used to store keyframe sequences marked as usable for map updating.
[0106] For example, when the robot receives a map update command, it can retrieve a keyframe sequence from the first trajectory queue. This keyframe sequence is marked as a keyframe sequence that can be used for map updating. Specifically, the robot can receive the map update command if the user actively triggers the map update control, or if a scheduled task triggers the command, or if the first trajectory queue contains a keyframe sequence. Alternatively, the robot can receive the map update command under other conditions, thereby retrieving the keyframe sequence from the first trajectory queue and using the keyframes in that sequence to update the map.
[0107] In addition, to save storage space, the number of keyframe sequences in the first trajectory queue can be monitored. If the number of keyframe sequences in the first trajectory queue exceeds a preset number, some keyframe sequences can be deleted. For example, based on the order in which each keyframe sequence was added to the first trajectory queue, one or more keyframe sequences added earliest can be deleted. For instance, the preset number could be 20, so if the number of keyframe sequences in the first trajectory queue exceeds 20, one or more keyframe sequences added earliest can be deleted.
[0108] The above is a detailed description of the map update method provided in this application. In steps S21 to S22 of this method, when it is determined that there is a robot cumulative movement distance greater than a preset distance in the keyframe sequence, the keyframe sequence can be marked as a keyframe sequence that can be used for map update, so as to be used for subsequent map update.
[0109] Regarding the specific methods for updating the map using the keyframe sequence marked as usable for map updating, as mentioned above, for example, the map can be updated directly using the keyframe sequence marked as usable for map updating; alternatively, a subset of keyframe subsequences (referred to as target keyframe subsequences) can be further selected from the keyframe sequence, and then the map can be updated using the target keyframe subsequences. Based on this, embodiments of this application also provide another map updating method. The inventive idea of this method is to further select target keyframe subsequences from the keyframe sequence, and then update the map using the target keyframe subsequences. For example... Figure 4 The specific steps of the method are shown below. Figure 4 If there are any unclear points regarding the method shown, please refer to the relevant content in the other methods mentioned above.
[0110] Step S31: Obtain the keyframe sequence that can be used for map updates.
[0111] In step S31, the specific method for obtaining the keyframe sequence that can be used for map updating can be, for example, by using step S22 above. That is, based on step S22, if it is determined that the keyframe sequence has a robot cumulative motion distance greater than a preset distance, the keyframe sequence is marked as a keyframe sequence that can be used for map updating. Therefore, in step S31, the keyframe sequence marked as a keyframe sequence that can be used for map updating can be obtained.
[0112] In one embodiment, a keyframe sequence that can be used for map updating can also be obtained from the first trajectory queue. For example, as mentioned in the above embodiment, the first trajectory queue is used to store keyframe sequences marked as being usable for map updating. Therefore, step S31 can be to obtain the keyframe sequence that can be used for map updating from the first trajectory queue. In particular, the keyframe sequence that can be used for map updating can be obtained from the first trajectory queue when a map update instruction is received.
[0113] Of course, in step S31, if a keyframe sequence that can be used for map updating is obtained from the first trajectory queue, then the keyframe sequence that can be used for map updating can be deleted from the first trajectory queue accordingly.
[0114] Step S32: Determine whether a target keyframe subsequence exists in the keyframe sequence that can be used for map updating.
[0115] It should be noted that, because a target keyframe subsequence needs to be selected from the keyframe sequences available for map updating, this target keyframe subsequence must meet stricter conditions than the keyframe sequences available for map updating. For example, the target keyframe subsequence must at least meet the following three conditions: all keyframes in the target keyframe subsequence fail to match the map; the cumulative robot movement distance of the target keyframe subsequence is within a preset range; and the preceding and following keyframes of the target keyframe subsequence match the map successfully. Here, the cumulative robot movement distance being within the preset range can mean that the cumulative robot movement distance is greater than a second preset distance and less than a third preset distance.
[0116] The second preset distance can be equal to, less than, or greater than the aforementioned preset distance, and can be set according to actual needs. Furthermore, the third preset distance is greater than the second preset distance.
[0117] Step S33: If a target keyframe subsequence exists in the keyframe sequence available for map updating, obtain the target keyframe subsequence.
[0118] In step S33, if it is determined through step S32 that a target keyframe subsequence exists in the keyframe sequence that can be used for map updating, then the target keyframe subsequence is further obtained, so that the map can be updated using the target keyframe subsequence.
[0119] Obviously, by utilizing this Figure 4 The map update method shown first obtains a keyframe sequence that can be used for map update. Then, it determines whether a target keyframe subsequence exists in this keyframe sequence. If a target keyframe subsequence exists, it is obtained. Since all keyframes in the target keyframe subsequence fail to match the map, the cumulative robot movement distance of the target keyframe subsequence is within a preset range, and both the preceding and following keyframes of the target keyframe subsequence match the map successfully, the target keyframe subsequence obtained from the keyframe sequence that can be used for map update can also be used for map update.
[0120] After obtaining the target keyframe subsequence through step S33 described above, the method may further include adding the target keyframe subsequence to a second trajectory queue. Therefore, the second trajectory queue is used to store the target keyframe subsequence, which is further extracted from the keyframe sequence available for map updating.
[0121] Therefore, for this Figure 4 The map update method shown, in practical applications, could, for example, involve retrieving a sequence of keyframes usable for map update from a first trajectory queue upon receiving a map update command. This could be achieved by iterating through each of these keyframe sequences in the first trajectory queue, sequentially retrieving them, and then determining whether a target keyframe subsequence exists within it. If such a subsequence exists, it is retrieved, thus filtering out the target keyframe subsequence from the keyframe sequences available for map update in the first trajectory queue. Alternatively, after retrieving the target keyframe subsequences, they can be added sequentially to a second trajectory queue according to the order in which they were retrieved.
[0122] Following step S33 described above, the method may further include steps for updating the map using each keyframe in the target keyframe subsequence:
[0123] Step S34: For each keyframe in the target keyframe subsequence, determine the keyframe to be updated in the map that corresponds to that keyframe.
[0124] The target keyframe subsequence can be the target keyframe subsequence obtained in step S33 above, or it can be the target keyframe subsequence obtained from the second trajectory queue. For example, after step S33 above, the target keyframe subsequence obtained in step S33 is added to the second trajectory queue. In step S34, the target keyframe subsequence is first obtained from the second trajectory queue, and then for each keyframe in the target keyframe subsequence, the corresponding keyframe to be updated in the map is determined. Specifically, the keyframe to be updated includes the keyframe in the map that has the smallest distance to the keyframe or a distance less than a fourth preset distance.
[0125] Of course, in step S34, if the target keyframe subsequence is obtained from the second trajectory queue, then the target keyframe subsequence can be deleted from the second trajectory queue accordingly.
[0126] For example, for each keyframe in the target keyframe subsequence, this keyframe can be designated as the third current keyframe. Then, the distance between each keyframe on the map and this third current keyframe can be determined. For instance, the distance can be calculated using the coordinates of the third current keyframe and the coordinates of each keyframe on the map. After determining the distances between each keyframe on the map and the third current keyframe, the keyframe on the map with the smallest distance to the third current keyframe or a distance less than a fourth preset distance can be further identified and designated as the keyframe to be updated.
[0127] In practical applications, in order to improve the execution efficiency of step S34, a k-dimensional tree (KD) can be constructed using each keyframe of the map. Thus, step S34 can specifically include: for each keyframe in the target keyframe subsequence, determining the keyframe to be updated in the map corresponding to that keyframe based on the KD tree.
[0128] Step S35: For each keyframe in the target keyframe subsequence, replace the corresponding keyframe to be updated with the keyframe to generate a new map.
[0129] After determining the keyframes to be updated through step S34, in step S35, for each keyframe in the target keyframe subsequence, the corresponding keyframe to be updated in the map can be replaced by the keyframe, thereby generating a new map and realizing the update of the map.
[0130] Of course, in practical applications, if the target keyframe subsequence obtained in step S34 is from the second trajectory queue, after executing step S35, a new target keyframe subsequence can be obtained from the second trajectory queue. Then, by executing the above steps S34 and S35, the map can be updated until all target keyframe subsequences in the second trajectory queue have been used to update the map.
[0131] Of course, in practical applications, in order to avoid the loss of keyframes in the map due to errors during the map update process, it is usually possible to back up the map before the update so that it can be rolled back after an update error.
[0132] The above is a detailed description of the map update method provided in the embodiments of this application. For ease of understanding, the method can be further explained here in conjunction with specific application scenarios. Figure 5 The diagram shows the specific process of the map update method in this application scenario, including the following steps:
[0133] Step S41: The robot begins to perform the task, wherein the robot stores a map.
[0134] This map can be obtained from the server during the robot's startup process. The robot needs to move during the execution of its tasks.
[0135] Step S42: Initialize the robot.
[0136] For example, the robot's lidar can be used to continuously collect point cloud data of the environment, then key frames can be determined from these point cloud data, and then the key frames can be matched with the map. Only when the matching result meets the initialization conditions can the robot be initialized.
[0137] Step S43: For each key frame in a series of consecutive key frames in the key frame sequence, use that key frame as the current key frame and match it with the map.
[0138] Step S44: Determine whether the current keyframe matches the map successfully. If yes, proceed to step S45; otherwise, proceed to step S47.
[0139] Step S45: Determine whether the number of consecutive successful matches is less than the preset number. If yes, proceed to step S47; otherwise, proceed to step S46.
[0140] Step S46: Reset the robot's current cumulative movement distance to a preset value.
[0141] Step S47: Add the robot's motion distance corresponding to the current keyframe to the robot's current cumulative motion distance.
[0142] Step S48: Determine whether the robot's current cumulative movement distance is greater than the preset distance. If yes, proceed to step S49; otherwise, proceed to step S43.
[0143] Step S49: Mark the keyframe sequence as a keyframe sequence that can be used for map updating.
[0144] Step S410: The keyframe sequence that will be marked as usable for map updates is added to the first trajectory queue.
[0145] Step S411: Upon receiving a map update instruction, obtain a sequence of keyframes that can be used for map update from the first trajectory queue.
[0146] Step S412: Determine whether there is a target keyframe subsequence in the keyframe sequence that can be used for map update. If yes, proceed to step S413; otherwise, proceed to step S411.
[0147] Step S413: Obtain the target keyframe subsequence.
[0148] Step S414: Add the target keyframe subsequence to the second trajectory queue.
[0149] Step S415: For each keyframe in the target keyframe subsequence in the second trajectory queue, determine the keyframe to be updated in the map corresponding to that keyframe.
[0150] Step S416: For each keyframe in the target keyframe subsequence, replace the corresponding keyframe to be updated with the keyframe to generate a new map.
[0151] Step S417: Use the new map to locate and navigate the robot.
[0152] Based on the same inventive concept as the map updating method provided in the embodiments of this application, the embodiments of this application also provide a map updating apparatus, wherein the map includes multiple keyframes. For any unclear aspects of this apparatus embodiment, please refer to the corresponding content of the method embodiment. Figure 6 The diagram shows a detailed structural representation of the device 50, which includes a determining unit 501 and a marking unit 502, wherein:
[0153] The determining unit 501 is used to determine whether there is a robot cumulative motion distance greater than a preset distance in the keyframe sequence. The robot motion distance accumulation in the keyframe sequence is determined by matching multiple keyframes in the keyframe sequence with the map, and by determining the robot motion distance corresponding to keyframes that have been matched successfully less than a preset number of times and / or keyframes that have failed to match among the multiple matched keyframes.
[0154] The marking unit 502 is used to mark the keyframe sequence as a keyframe sequence that can be used for map updating when it is determined that there is a robot cumulative movement distance greater than a preset distance in the keyframe sequence.
[0155] The device 50 provided in the embodiments of this application adopts the same inventive concept as the map update method provided in the embodiments of this application. Under the premise that the map update method can solve the technical problem, the device 50 can also solve the technical problem, which will not be elaborated here.
[0156] The determining unit 501 may specifically include a determining subunit, used to sequentially match each key frame in a series of consecutive key frames in the key frame sequence with the map as the current key frame; if the number of successful matches is less than a preset number, or if the match fails, the robot movement distance corresponding to the current key frame is added to the robot's current cumulative movement distance; it is determined whether the robot's current cumulative movement distance after adding the robot movement distance is greater than the preset distance; if it is greater than the preset distance, it is determined that there is a robot cumulative movement distance in the key frame sequence that is greater than the preset distance.
[0157] The device 50 may also include a reset unit for resetting the robot’s current cumulative movement distance to a preset value if the number of successful matches and consecutive successful matches is greater than or equal to a preset number.
[0158] The device 50 may further include an initialization unit for matching the acquired keyframes with a map; initializing the robot if the matching result meets the initialization conditions; and...
[0159] Determining whether there is a robot cumulative motion distance greater than a preset distance in the keyframe sequence specifically includes: when the robot has been initialized, determining whether there is a robot cumulative motion distance greater than a preset distance in the keyframe sequence.
[0160] The device 50 may also include an adding unit for adding the keyframe sequence to the first trajectory queue.
[0161] The device 50 may further include a deletion unit, used to delete one or more keyframe sequences that were added to the first trajectory queue earliest, according to the order in which each keyframe sequence was added to the first trajectory queue, if the number of keyframe sequences in the first trajectory queue is greater than a preset number.
[0162] The device 50 may further include a third determining unit and a second target keyframe sub-sequence acquisition unit, wherein:
[0163] The third determining unit is used to determine whether there is a target keyframe subsequence in the keyframe sequence that can be used for map updating, wherein each keyframe in the target keyframe subsequence fails to match the map, and the cumulative robot movement distance of the target keyframe subsequence is greater than a second preset distance.
[0164] The second target keyframe subsequence acquisition unit is used to acquire the target keyframe subsequence for map update when a target keyframe subsequence exists in the keyframe sequence available for map update.
[0165] The device 50 may also include a second adding unit for adding the target keyframe subsequence to a second trajectory queue.
[0166] The device 50 may further include a map updating unit, used to determine, for each key frame in the target key frame subsequence, a key frame in the map corresponding to the key frame to be updated, wherein the key frame to be updated specifically includes: a key frame in the map that has the smallest distance to the key frame or a distance less than a fourth preset distance; and for each key frame in the target key frame subsequence, using the key frame to replace the corresponding key frame to be updated to generate a new map.
[0167] The device 50 may further include a construction unit for constructing a K-dimensional tree using the keyframes of the map; and for each keyframe in the target keyframe subsequence, determining the keyframe to be updated in the map corresponding to the keyframe, specifically including:
[0168] For each keyframe in the target keyframe subsequence, the corresponding keyframe to be updated in the map is determined based on the K-dimensional tree.
[0169] The device 50 may further include a keyframe determination unit for acquiring point cloud data collected by the robot from the environment; if the time interval between the acquisition time of the point cloud data and the acquisition time of the previous keyframe is greater than a preset duration, the point cloud data is determined as a keyframe for generating the keyframe sequence.
[0170] The robot motion distance determination unit is used to determine the robot motion distance corresponding to the key frame in the following manner: determining the first coordinate position when the robot acquires the key frame, and the second coordinate position when the robot acquires the previous key frame; and determining the robot motion distance corresponding to the key frame based on the first coordinate position and the second coordinate position.
[0171] Based on the same inventive concept as the map updating method provided in the embodiments of this application, the embodiments of this application also provide a map updating apparatus, wherein the map includes multiple keyframes. For any unclear aspects of this apparatus embodiment, please refer to the corresponding content of the method embodiment. Figure 7 The diagram shows the specific structure of the device 60, which includes: an acquisition unit 601, a second determination unit 602, and a target keyframe sub-sequence acquisition unit 603, wherein:
[0172] Acquisition unit 601 is used to acquire keyframe sequences that can be used for map updating;
[0173] The second determining unit 602 is used to determine whether there is a target key frame subsequence in the key frame sequence that can be used for map updating, wherein each key frame in the target key frame subsequence fails to match the map, the size of the robot's cumulative motion distance in the target key frame subsequence is within a preset range, and the previous key frame and the next key frame of the target key frame subsequence both match the map successfully.
[0174] The target keyframe subsequence acquisition unit 603 is used to acquire the target keyframe subsequence for map update when the target keyframe subsequence exists in the keyframe sequence available for map update.
[0175] The device 60 provided in the embodiments of this application adopts the same inventive concept as the map update method provided in the embodiments of this application. Under the premise that the map update method can solve the technical problem, the device 60 can also solve the technical problem, which will not be described in detail here.
[0176] Specifically, obtaining the keyframe sequence that can be used for map updating may include: obtaining the keyframe sequence that can be used for map updating from the first trajectory queue.
[0177] Obtaining the keyframe sequence that can be used for map updating from the first trajectory queue may specifically include: upon receiving a map update instruction, obtaining the keyframe sequence that can be used for map updating from the first trajectory queue.
[0178] A sixth aspect of this application provides a computer-readable storage medium, comprising: a program, which, when executed on an electronic device, causes the electronic device to perform all or part of the processes of the methods described in the above embodiments. The storage medium may be a disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc. The storage medium may also include combinations of the above types of memory.
[0179] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A map updating method, characterized in that, include: Determine whether there is a robot cumulative motion distance greater than a preset distance in the keyframe sequence. The cumulative robot motion distance of the keyframe sequence is determined by matching multiple keyframes in the keyframe sequence with the map, and by determining the robot motion distance corresponding to keyframes that have been matched successfully less than a preset number of times and / or keyframes that have failed to match. If it is determined that the keyframe sequence contains a cumulative robot movement distance greater than a preset distance, the keyframe sequence is marked as a keyframe sequence that can be used for map updating.
2. The method according to claim 1, characterized in that, Determining whether a keyframe sequence contains a robot's cumulative motion distance greater than a preset distance includes: For each key frame in a series of consecutive key frames in the key frame sequence, the key frame is sequentially used as the current key frame and matched with the map. If the number of successful matches and consecutive successful matches is less than a preset number, or if the match fails, the robot movement distance corresponding to the current keyframe will be added to the robot's current cumulative movement distance. Determine whether the current cumulative movement distance of the robot, after adding the robot's movement distance, is greater than the preset distance; If the distance is greater than the preset distance, then it is determined that the keyframe sequence has a cumulative robot movement distance greater than the preset distance.
3. The method according to claim 2, characterized in that, The method further includes: if a match is successful and the number of consecutive successful matches is greater than or equal to a preset number, resetting the robot's current cumulative movement distance to a preset value.
4. The method according to claim 1, characterized in that, Before determining whether there is a robot cumulative motion distance greater than a preset distance in the keyframe sequence, the method further includes: Match the collected keyframes with the map; If the matching result meets the initialization conditions, the robot is initialized; and, Determining whether there is a robot cumulative motion distance greater than a preset distance in the keyframe sequence specifically includes: when the robot has been initialized, determining whether there is a robot cumulative motion distance greater than a preset distance in the keyframe sequence.
5. The method according to claim 1, characterized in that, After marking the keyframe sequence as a keyframe sequence that can be used for map updating, the method further includes adding the keyframe sequence to a first trajectory queue.
6. The method according to claim 5, characterized in that, If the number of keyframe sequences in the first trajectory queue is greater than a preset number, one or more keyframe sequences that were added to the first trajectory queue earliest are deleted according to the order in which they were added to the first trajectory queue.
7. The method according to claim 1 or 5, characterized in that, Determine whether a target keyframe subsequence exists in the keyframe sequence that can be used for map updating, wherein each keyframe in the target keyframe subsequence fails to match the map, the cumulative motion distance of the robot in the target keyframe subsequence is within a preset range, and the previous keyframe and the next keyframe of the target keyframe subsequence both match the map successfully. If a target keyframe subsequence exists in the keyframe sequence available for map updating, the target keyframe subsequence is obtained for use in map updating.
8. The method according to claim 7, characterized in that, The method further includes adding the target keyframe subsequence to the second trajectory queue.
9. The method according to claim 7, characterized in that, The method further includes: For each keyframe in the target keyframe subsequence, determine the keyframe to be updated in the map corresponding to the keyframe. Specifically, the keyframe to be updated includes the keyframe in the map that has the smallest distance from the keyframe or a distance less than a fourth preset distance. For each keyframe in the target keyframe subsequence, the corresponding keyframe to be updated is replaced with the keyframe to generate a new map.
10. The method according to claim 9, characterized in that, The method further includes: Construct a K-dimensional tree using the keyframes of the map; and, For each keyframe in the target keyframe subsequence, determine the corresponding keyframe in the map to be updated, specifically including: For each keyframe in the target keyframe subsequence, the corresponding keyframe to be updated in the map is determined based on the K-dimensional tree.
11. The method according to claim 1, characterized in that, The method further includes: Acquire point cloud data collected by the robot from the environment; If the time interval between the acquisition time of the point cloud data and the acquisition time of the previous key frame is greater than a preset duration, the point cloud data is determined as a key frame for generating the key frame sequence.
12. The method according to claim 1, characterized in that, The robot's movement distance corresponding to the keyframe is determined using the following method: Determine the first coordinate position when the robot collects the key frame, and the second coordinate position when the robot collects the previous key frame; The robot movement distance corresponding to the keyframe is determined based on the first coordinate position and the second coordinate position.
13. A map updating method, characterized in that, include: Obtain the keyframe sequence that can be used for map updates; Determine whether a target keyframe subsequence exists in the keyframe sequence that can be used for map updating, wherein each keyframe in the target keyframe subsequence fails to match the map, the cumulative motion distance of the robot in the target keyframe subsequence is within a preset range, and the previous keyframe and the next keyframe of the target keyframe subsequence both match the map successfully. If a target keyframe subsequence exists in the keyframe sequence available for map updating, the target keyframe subsequence is obtained for use in map updating.
14. The method according to claim 13, characterized in that, Obtain keyframe sequences that can be used for map updates, specifically including: The keyframe sequence that can be used for map updates is obtained from the first trajectory queue.
15. The method according to claim 14, characterized in that, Obtaining the keyframe sequence that can be used for map updating from the first trajectory queue specifically includes: Upon receiving a map update instruction, the keyframe sequence that can be used for map update is obtained from the first trajectory queue.
16. A map updating device, characterized in that, include: A determining unit is used to determine whether there is a robot cumulative motion distance greater than a preset distance in the keyframe sequence. The robot cumulative motion distance of the keyframe sequence is determined by matching multiple keyframes in the keyframe sequence with a map, and by determining the robot motion distance corresponding to keyframes that have been matched successfully less than a preset number of times and / or keyframes that have failed to match among the multiple matched keyframes. A marking unit is used to mark the keyframe sequence as a keyframe sequence that can be used for map updating when it is determined that there is a robot cumulative movement distance greater than a preset distance in the keyframe sequence.
17. A map updating device, characterized in that, include: The acquisition unit is used to acquire keyframe sequences that can be used for map updates; The second determining unit is used to determine whether there is a target keyframe subsequence in the keyframe sequence that can be used for map updating, wherein each keyframe in the target keyframe subsequence fails to match the map, the size of the robot's cumulative motion distance in the target keyframe subsequence is within a preset range, and the previous keyframe and the next keyframe of the target keyframe subsequence both match the map successfully. The target keyframe subsequence acquisition unit is used to acquire the target keyframe subsequence for map update when the target keyframe subsequence exists in the keyframe sequence available for map update.
18. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for performing the method as described in any one of claims 1 to 15.
19. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that can be executed by a processor to perform the method described in any one of claims 1-15.
Citation Information
Patent Citations
Robot map extension method, device, control apparatus and storage medium
CN110146098A
Instant map construction method and device, robot and storage medium
CN112198878A