A map updating method, robot and readable storage medium

By combining the first key frame and the second key frame in the initial map for processing in the robot, the map update is optimized, which solves the problem of inaccurate positioning caused by scene changes and improves the robot's navigation ability in complex environments.

CN113624222BActive Publication Date: 2024-09-13UBTECH ROBOTICS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110873422.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-30
Publication Date
2024-09-13
Estimated Expiration
2041-07-30

AI Technical Summary

Technical Problem

When the scene changes, the robot map is not updated, resulting in inaccurate positioning.

Method used

By obtaining the first keyframe when the robot is moving, and processing based on these frames and the second keyframe in the initial map, the keyframes are optimized and finally the initial map is updated to ensure the accuracy of the map.

Benefits of technology

It improves the accuracy of map updates, avoids positioning errors caused by non-updated maps, and enhances the robot's navigation ability in complex scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113624222B
    Figure CN113624222B
Patent Text Reader

Abstract

The present application is applicable to the field of robot technology, and provides a map updating method, a robot and a readable storage medium, the method comprising: obtaining each first key frame collected by the robot when moving; processing each first key frame based on each first key frame and each second key frame of the initial map stored by the robot to obtain optimized key frames of the each first key frame; updating the initial map based on the optimized key frame to obtain the updated initial map; the present application uses each first key frame and each second key frame in the initial map to jointly process each first key frame, so that the obtained optimized first key frame can be made more accurate, thereby achieving the purpose of more accurate updating of the initial map.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of robot technology, and in particular, relates to a map updating method, a robot and a readable storage medium. Background Art

[0002] With the development of robots, robots are being used in more and more scenarios, such as restaurants, shopping malls, etc.

[0003] The robot is equipped with a map. When walking, the robot senses the surrounding environment through lasers and locates itself according to the map to avoid collisions with obstacles. However, in complex scenes, objects often move, such as shopping malls and restaurants, causing deviations between the actual scene and the scene saved in the map. When the scene changes, if the robot still locates itself according to the scene in the map, it will cause inaccurate positioning. Therefore, when the scene changes, timely updating the map in the robot can avoid the above problems. Summary of the invention

[0004] The embodiments of the present application provide a map updating method, a robot, and a readable storage medium, which can solve the problem of inaccurate robot positioning due to the failure to update the map in the robot when the scene changes.

[0005] In a first aspect, an embodiment of the present application provides a method for updating a map, comprising:

[0006] Obtain each first key frame collected when the robot moves;

[0007] Processing each of the first key frames based on each of the first key frames and each of the second key frames of the initial map stored by the robot to obtain optimized key frames of each of the first key frames;

[0008] The initial map is updated based on the optimized key frame to obtain the updated initial map.

[0009] In a second aspect, an embodiment of the present application provides a robot, comprising:

[0010] A data acquisition module, used to obtain each first key frame collected when the robot moves;

[0011] A data processing module, configured to process each of the first key frames based on each of the first key frames and each of the second key frames of the initial map stored by the robot to obtain an optimized key frame of each of the first key frames;

[0012] A map updating module is used to update the initial map based on the optimized key frame to obtain the updated initial map.

[0013] In a third aspect, an embodiment of the present application provides a terminal device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the map updating method described in any one of the first aspects above when executing the computer program.

[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and wherein when the computer program is executed by a processor, the map updating method described in any one of the above-mentioned first aspects is implemented.

[0015] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the map updating method described in any one of the above-mentioned first aspects.

[0016] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.

[0017] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the present application first obtains each first key frame collected by the robot, then processes each first key frame based on each first key frame and each second key frame of the initial map pre-stored in the robot to obtain optimized key frames of each first key frame, and finally updates the initial map based on the optimized key frames to obtain an updated initial map; the present application uses each first key frame and each second key frame in the initial map to jointly process each first key frame. Compared with the prior art that only uses each first key frame to optimize each first key frame, or only uses the second key frame in the initial map to optimize each first key frame, the present application can make the obtained optimized first key frame more accurate, thereby achieving the purpose of more accurate updating of the initial map. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0019] Figure 1 This is a schematic diagram of an application scenario of a map updating method provided in an embodiment of the present application;

[0020] Figure 2 is a flowchart of a map updating method provided in an embodiment of the present application;

[0021] Figure 3 is a schematic diagram illustrating a graph optimization algorithm with loop edges provided in one embodiment of the present application;

[0022] Figure 4 It is a flowchart of a method for obtaining an optimized key frame provided in an embodiment of the present application;

[0023] Figure 5 is a flowchart of a method for obtaining a first constraint relationship provided in an embodiment of the present application;

[0024] Figure 6 is a flowchart of a method for obtaining a second constraint relationship provided in an embodiment of the present application;

[0025] Figure 7 is a schematic diagram illustrating a constraint relationship corresponding to a first key frame provided in an embodiment of the present application;

[0026] Figure 8 is a schematic diagram of the structure of a robot provided by an embodiment of the present application;

[0027] Fig. 9 It is a structural diagram of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0028] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0029] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0030] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0031] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0032] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0033] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0034] At present, the method of updating the initial map pre-stored in the robot is mostly to compare the key frames collected by the robot when moving with the key frames in the initial map. If the collected key frames do not exist in the initial map, the collected key frames are directly stored in the initial map, thereby achieving the purpose of updating the initial map. However, the key frames collected by the robot may be inaccurate, especially when there are errors in the robot's position when collecting the key frames. If the key frames and the corresponding position are directly stored in the initial map, the initial map will be inaccurate, which will cause the robot to locate its own position inaccurately according to the updated initial map when performing tasks.

[0035] Figure 1 Schematic diagram of application scenario of the map updating method provided in the embodiment of the present application, the map updating method can be used to update the initial map in the robot. The robot includes a radar device 10 and a processor 20, the radar device 10 is used to collect first key frames during the movement of the robot, the processor 20 is used to obtain each first key frame from the radar device 10, and optimize the first key frame based on each first key frame and the second key frame pre-stored in the initial map of the robot to obtain the optimized key frame of each first key frame. The processor 20 is also used to update the initial map based on the optimized key frame.

[0036] The following combination Figure 1 The map updating method of the embodiment of the present application is described in detail.

[0037] Figure 2 A schematic flow chart of a map updating method provided by the present application is shown, referring to Figure 2 , the method is described in detail as follows:

[0038] S101, obtaining each first key frame collected when the robot moves.

[0039] In this embodiment, the robot may include a processor, a radar device, or an image acquisition device. The radar device collects surrounding environment data by scanning the environment around the robot, and the surrounding environment data collected by the radar device constitutes a key frame, which is recorded as the first key frame in this application. The radar device may include a laser radar, or a device with a laser sensor, and accordingly, the first key frame may be point cloud data collected by the radar device. The image acquisition device may be a camera or a video camera, and accordingly, the first key frame may be image data collected by the image acquisition device.

[0040] Specifically, the robot may collect first key frames according to a preset moving distance when moving. For example, the robot collects a first key frame every time it moves 1 meter.

[0041] Optionally, the first key frame may also be obtained by screening out data frames after the robot collects multiple data frames during movement.

[0042] S102: Processing each of the first key frames based on each of the first key frames and each of the second key frames of the initial map stored by the robot to obtain optimized key frames of each of the first key frames.

[0043] In this embodiment, the robot stores an initial map, which is constructed based on the environment the robot is in at the time of map construction. The initial map is constructed using a graph optimization algorithm.

[0044] Specifically, when using simultaneous localization and mapping (SLAM), the map created may be inaccurate due to the existence of errors. Therefore, a graph optimization algorithm is introduced to make the map created more accurate. Specifically, after walking for a period of time, the robot may return to a point it has walked before, but due to the existence of errors, the position of the robot at the same point is not the same. Therefore, it is necessary to optimize the position of the robot at each point and distribute the errors to the position of each point.

[0045] As an example, Figure 3 Each circle in the figure represents a node, and each node represents the position of the robot at that position. The edge between two nodes is represented by an inter-frame edge, which represents the spatial constraint between the two nodes, that is, the relative position between the two nodes. The graph optimization algorithm finds an optimal configuration, that is, the optimal position of each node, so that the error is minimized. If the starting position of the robot is X1, and the position of the robot at the starting point is (0, 0), after a period of walking, the robot walks to the position of X6, X6 and X1 are the same position, that is, X6 should be the starting position, and a loop edge is formed between X6 and X1, and the loop edge is represented by (0, 0). At the starting point, the position of the robot should be (0, 0), but due to the existence of error, the collected position of the robot at X6 becomes (2, 3), and the error value of the robot during walking is (2, 3). Through the graph optimization algorithm, the error value (2, 3) can be distributed to each inter-frame edge similarly evenly to minimize the error, and then the optimized position corresponding to each node robot is obtained.

[0046] In this embodiment, processing each first key frame may be to optimize the position of the robot corresponding to each first key frame.

[0047] S103: Update the initial map based on the optimized key frame to obtain the updated initial map.

[0048] In this embodiment, the initial map can be updated by storing the information corresponding to the optimized key frame in the initial map. That is, the data of the first key frame and the positional information obtained after the first key frame is optimized are saved together in the initial map to achieve the purpose of updating the initial map. Optionally, each first key frame can be added to the initial map, and then the positional information corresponding to each first key frame can be optimized, and the positional information after the optimization of each first key frame can be saved in the initial map to achieve the purpose of updating the initial map.

[0049] In an embodiment of the present application, firstly, each first key frame collected by the robot is obtained, and then each first key frame is processed based on each first key frame and each second key frame of the initial map pre-stored in the robot to obtain an optimized key frame of each first key frame, and finally the initial map is updated based on the optimized key frame to obtain an updated initial map; the present application uses each first key frame and each second key frame in the initial map to jointly process each first key frame. Compared with the prior art that only uses each first key frame to optimize each first key frame, or only uses the second key frame in the initial map to optimize each first key frame, the present application can make the obtained optimized first key frame more accurate, thereby achieving the purpose of more accurate updating of the initial map.

[0050] like Figure 4 As shown, in a possible implementation manner, the implementation process of step S102 may include:

[0051] S1021, obtaining a first constraint relationship between the i-th first key frame and the i+1-th first key frame, where 1≤i≤n-1, and n is the number of first key frames.

[0052] In this embodiment, it is necessary to obtain the first constraint relationship between two adjacent first key frames collected.

[0053] In this embodiment, the first constraint relationship may be the difference between two adjacent first key frames. Optionally, the first constraint relationship may be the constraint relationship between the positions of the robot when collecting two adjacent first key frames, the constraint relationship of the position, or the constraint relationship between the variances corresponding to two adjacent first key frames.

[0054] For example, if three first key frames are collected, the first constraint relationship between the first first key frame and the second first key frame may be calculated. The first constraint relationship between the second first key frame and the third first key frame may be calculated.

[0055] S1022: Obtain a matching score between each of the first key frames and each of the second key frames.

[0056] In this embodiment, the matching score represents the degree of matching between two key frames. Specifically, the first key frame can be mapped to the initial map, and the similarity between the data in the first key frame and the data in the second key frame can be calculated. Optionally, a correlation scan matching method can be used to determine the matching score between the first key frame and the second key frame.

[0057] S1023: Calculate a second constraint relationship between a first key frame corresponding to a matching score within a preset range and a second key frame having a matching score with the first key frame within a preset range.

[0058] In this embodiment, the preset range can be set as needed, for example, 4-5, 5-6 or 7-8, etc. Specifically, the selection of the preset range can satisfy: the matching score of a first key frame and at most one second key frame is within the preset range. The second key frame whose matching score with the first key frame is within the preset range can be the second key frame that is closest to the first key frame on the preset map.

[0059] In this embodiment, the explanation of the second constraint relationship is similar to that of the first constraint relationship, and reference may be made to the explanation of the first constraint relationship, which will not be repeated here.

[0060] Specifically, after obtaining the matching scores, the matching scores within a preset range can be screened out. A first key frame corresponding to a matching score within the preset range has a second key frame that matches it. If there are multiple different second key frames that all match the same first key frame, the second key frame with a high matching score can be used as the second key frame that matches the first key frame, and the second constraint relationship between the second key frame with a high matching score and the first key frame is calculated.

[0061] As an example, if the matching score between the 3rd second key frame and the 1st first key frame is within a preset range, the matching score between the 4th second key frame and the 1st first key frame is within a preset range, and the matching score between the 3rd second key frame and the 1st first key frame is greater than the matching score between the 4th second key frame and the 1st first key frame, then the 3rd second key frame can be used as the second key frame that matches the 1st first key frame.

[0062] Specifically, the implementation process of step S1023 may include:

[0063] S10231, obtaining a first key frame and a second key frame corresponding to matching scores within a preset range.

[0064] In this embodiment, if the matching score is within the preset range, it can be said that the first key frame corresponding to the matching score within the preset range matches the second key frame, that is, the difference between the two key frames is not large. It can be said that the scene corresponding to the data in the first key frame is not large in difference from the scene corresponding to the data in the second key frame that matches the first key frame and is collected by the robot when building the initial map.

[0065] If the first key frame cannot find a matching second key frame, it means that the scene corresponding to the data in the first key frame has changed significantly compared to the scene at the location when the robot constructed the initial map.

[0066] S10232, calculating a second constraint relationship between a third key frame and a fourth key frame, wherein the third key frame is a first key frame corresponding to a matching score within a preset range, and the fourth key frame is a second key frame having a matching score with the first key frame within the preset range.

[0067] In this embodiment, after obtaining the first key frame and the second key frame corresponding to the matching scores that meet the preset range, the constraint relationship between the two key frames can be calculated, which is recorded as the second constraint relationship in this application. This application can optimize the first key frame through the established constraint relationship by establishing a constraint relationship between the first key frame and the second key frame whose matching scores are within the preset range, so that the first key frame can also be constrained by the initial map during the optimization process, and the gap between the optimized first key frame and the second key frame in the initial map can be reduced.

[0068] S1024: Process each of the first key frames based on the first constraint relationship and the second constraint relationship to obtain an optimized key frame of each of the first key frames.

[0069] In this embodiment, each first key frame is optimized by using a plurality of first constraint relationships and a plurality of second constraint relationships to obtain an optimized key frame of each first key frame.

[0070] In the embodiment of the present application, through the first constraint relationship between the i-th first key frame and the i+1-th first key frame, and the second constraint relationship between the first key frame corresponding to the matching score within the preset range and the second key frame whose matching score with the first key frame is within the preset range, the optimized first key frame can be made more accurate and have a smaller error. The optimized first key frame not only satisfies the relationship between the first key frames, but also satisfies the relationship between the first key frame and the second key frame.

[0071] like Figure 5 As shown, in a possible implementation manner, the implementation process of step S1021 may include:

[0072] S10211, obtaining the first position of the robot when collecting the i-th first key frame.

[0073] In this embodiment, when the robot collects each first key frame, it corresponds to a position resource, which is recorded as the first resource in this application. The first resource represents the position and posture of the robot when collecting the first key frame.

[0074] S10212, obtaining the second position information of the robot when collecting the (i+1)th first key frame.

[0075] S10213: Obtain the first constraint relationship based on the first bit resource and the second bit resource.

[0076] In this embodiment, the first constraint relationship can be a relative position of the second position relative to the first position, or a relative position of the first position relative to the second position. The relative position represents the difference between the robot in two postures.

[0077] In the embodiment of the present application, a constraint relationship between two adjacent first key frames can be established by collecting the position difference between two adjacent first key frames by the robot, which can make the establishment of the constraint relationship easier and provide support for the subsequent optimization of the first key frames using a graph optimization algorithm.

[0078] like Figure 6 As shown, in a possible implementation manner, the implementation process of step S10232 may also include:

[0079] S102321, obtaining the third position information of the robot when collecting the third key frame.

[0080] S102322, obtaining the fourth position information of the robot when the fourth key frame is collected.

[0081] S102323, based on the third bit resource and the fourth bit resource, obtain the second constraint relationship.

[0082] In this embodiment, the method for obtaining the second constraint relationship is similar to the method for obtaining the first constraint relationship. For details, please refer to the above explanation of step S10213, which will not be repeated here.

[0083] In an embodiment of the present application, by calculating the difference between the third bit value corresponding to the third key frame and the fourth bit value corresponding to the fourth key frame, a constraint relationship between the third key frame and the fourth key frame can be established, which can provide support for the subsequent optimization of the first key frame using a graph optimization algorithm.

[0084] In a possible implementation manner, the implementation process of step S103 may further include:

[0085] S1031: Use a graph optimization algorithm to process the first constraint relationship and the second constraint relationship to obtain optimized positions corresponding to the first key frames.

[0086] In this embodiment, after obtaining the first constraint relationship between two adjacent first key frames and the second constraint relationship between the first key frame and the second key frame corresponding to the matching score that meets the preset range, the graph optimization algorithm can be used to optimize the position of each first key frame using the constraint relationship corresponding to each first key frame to obtain the optimized position corresponding to each first key frame.

[0087] In this embodiment, even if there is a first key frame without a corresponding second constraint relationship, the first key frame can also be optimized according to the adjacent optimized first key frames.

[0088] As an example, Figure 7As shown, if A1, A2, A3, A4 and A5 are 5 second key frames respectively, and B1, B2, B3, B4 and B5 are 5 first key frames respectively. If the matching score between the first key frame B1 and the second key frame A1 is within the preset range, the first second constraint relationship can be established between the first key frame B1 and the second key frame A1. If the matching score between the first key frame B2 and the second key frame A2 is within the preset range, the second second constraint relationship can be established between the first key frame B2 and the second key frame A2. If the matching score between the first key frame B4 and the second key frame A4 is within the preset range, the third second constraint relationship can be established between the first key frame B4 and the second key frame A4. If the matching score between the first key frame B5 and the second key frame A5 is within the preset range, the fourth second constraint relationship can be established between the first key frame B5 and the second key frame A5.

[0089] A first first constraint relationship may be established between the first key frame B1 and the first key frame B2. A second first constraint relationship may be established between the first key frame B2 and the first key frame B3. A third first constraint relationship may be established between the first key frame B3 and the first key frame B4. A fourth first constraint relationship may be established between the first key frame B4 and the first key frame B5.

[0090] Then the constraints of the first key frame B1 include the first first constraint relationship and the first second constraint relationship. By analogy, the constraints of the first key frame B5 include the fourth first constraint relationship and the fourth second constraint relationship. The position of each first key frame can be optimized using the graph optimization algorithm and the constraint relationship corresponding to each first key frame. Even if the first key frame B3 does not establish a second constraint relationship with the second key frame, the first key frame B3 can also be optimized based on the optimized first key frame B2 and the optimized first key frame B4.

[0091] S1032: Based on the optimized position information, obtain optimized key frames of the first key frames.

[0092] In this embodiment, the optimized key frame includes a first key frame and a corresponding optimized position.

[0093] In the embodiment of the present application, a more accurate position corresponding to each first key frame can be obtained by using a graph optimization algorithm. At the same time, the present application uses the first constraint relationship and the second constraint relationship to optimize the position of each first key frame at the same time. Using two constraint relationships to optimize the position can also obtain more accurate position.

[0094] In a possible implementation, the implementation process of step S103 may include:

[0095] S1031: Select an optimized key frame that meets a second preset condition from the optimized key frames.

[0096] In this embodiment, after the optimized key frames are obtained, not all optimized key frames may be inserted into the initial map, and optimized key frames that meet the second preset condition may be selected from the optimized key frames.

[0097] Specifically, if there are multiple optimized key frames with a relatively close distance, several optimized key frames among the multiple optimized key frames with a relatively close distance may be removed.

[0098] In a possible implementation, the implementation process of step S1031 may include:

[0099] The optimized key frames are arranged in order of acquisition time from earliest to latest to obtain a key frame sequence; starting from the tail position of the key frame sequence, a preset number of optimized key frames are selected as the optimized key frames that meet the second preset condition.

[0100] In this embodiment, the optimized key frames of the preset number of first key frames collected most recently may be selected from the optimized key frames to reduce the number of optimized key frames.

[0101] S1032: Obtain the updated initial map based on the optimized keyframes that meet the second preset condition.

[0102] In this embodiment, the optimized key frames satisfying the second preset condition are stored in the initial map to obtain an updated initial map.

[0103] In the embodiment of the present application, by screening the optimized key frames, the number of optimized key frames inserted into the initial map can be reduced, the amount of data processing can be reduced, the data processing speed can be increased, and data redundancy can be avoided when updating the initial map.

[0104] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0105] Corresponding to the map updating method described in the above embodiment, Figure 8 A structural block diagram of a robot provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0106] Reference Figure 8 The robot 200 may include: a data acquisition module 210, a data processing module 220 and a map updating module 230.

[0107] The data acquisition module 210 is used to obtain each first key frame collected when the robot moves;

[0108] A data processing module 220, configured to process each of the first key frames based on each of the first key frames and each of the second key frames of the initial map stored by the robot to obtain an optimized key frame of each of the first key frames;

[0109] The map updating module 230 is used to update the initial map based on the optimized key frame to obtain the updated initial map.

[0110] In a possible implementation, the data processing module 220 may specifically include:

[0111] A first calculation unit, used to obtain a first constraint relationship between the i-th first key frame and the i+1-th first key frame, wherein 1≤i≤n-1, and n is the number of first key frames;

[0112] A second calculation unit, used to obtain a matching score between each of the first key frames and each of the second key frames;

[0113] A third calculation unit, configured to calculate a second constraint relationship between a first key frame corresponding to a matching score within a preset range and a second key frame having a matching score within a preset range with the first key frame;

[0114] An optimization unit is used to process each of the first key frames based on the first constraint relationship and the second constraint relationship to obtain an optimized key frame of each of the first key frames.

[0115] In a possible implementation manner, the first computing unit may be specifically configured to:

[0116] Obtaining the first position of the robot when collecting the i-th first key frame;

[0117] Obtaining the second position information of the robot when collecting the (i+1)th first key frame;

[0118] The first constraint relationship is obtained based on the first bit resource and the second bit resource.

[0119] In a possible implementation manner, the third computing unit may be specifically configured to:

[0120] Obtaining a first key frame and a second key frame corresponding to a matching score within a preset range;

[0121] A second constraint relationship between a third key frame and a fourth key frame is calculated, wherein the third key frame is a first key frame corresponding to a matching score within a preset range, and the fourth key frame is a second key frame having a matching score with the first key frame within the preset range.

[0122] In a possible implementation manner, the third computing unit may further be used to:

[0123] Obtaining a third position information of the robot when collecting the third key frame;

[0124] Obtaining a fourth bit information of the robot when collecting a fourth key frame;

[0125] Based on the third bit resource and the fourth bit resource, the second constraint relationship is obtained.

[0126] In a possible implementation, the optimization unit may be further used for:

[0127] Using a graph optimization algorithm, the first constraint relationship and the second constraint relationship are processed to obtain optimized positions corresponding to each of the first key frames;

[0128] Based on the optimized position information, the optimized key frames of the first key frames are obtained.

[0129] In a possible implementation, the map updating module 230 may also be used to:

[0130] Selecting an optimized key frame that meets a second preset condition from the optimized key frames;

[0131] Based on the optimized key frames that meet the second preset condition, the updated initial map is obtained.

[0132] In a possible implementation, the map updating module 230 may also be used to:

[0133] Arrange the optimized key frames in order of acquisition time from earliest to latest to obtain a key frame sequence;

[0134] Starting from the tail position of the key frame sequence, a preset number of optimized key frames are selected as the optimized key frames that meet the second preset condition.

[0135] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0136] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0137] The present application also provides a terminal device, see Fig. 9 The robot 400 may include: at least one processor 410, a memory 420, and a computer program stored in the memory 420 and executable on the at least one processor 410. When the processor 410 executes the computer program, the steps in any of the above-mentioned method embodiments are implemented, for example Figure 2 Steps S101 to S103 in the illustrated embodiment. Alternatively, when the processor 410 executes the computer program, the functions of each module / unit in the above-mentioned device embodiments are implemented, for example Figure 8 The functions of the modules 210 to 230 are shown.

[0138] Exemplarily, the computer program may be divided into one or more modules / units, one or more modules / units are stored in the memory 420 and executed by the processor 410 to complete the present application. The one or more modules / units may be a series of computer program segments capable of completing specific functions, and the program segments are used to describe the execution process of the computer program in the robot 400.

[0139] Those skilled in the art will understand that Fig. 9 It is only an example of a terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, such as input and output devices, network access devices, buses, etc.

[0140] The processor 410 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0141] The memory 420 may be an internal storage unit of the terminal device, or an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. The memory 420 is used to store the computer program and other programs and data required by the terminal device. The memory 420 may also be used to temporarily store data that has been output or is to be output.

[0142] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0143] The map updating method provided in the embodiment of the present application can be applied to terminal devices such as computers, tablet computers, laptop computers, netbooks, personal digital assistants (PDAs), etc. The embodiment of the present application does not impose any restrictions on the specific type of terminal devices.

[0144] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in each embodiment of the above-mentioned map updating method can be implemented.

[0145] An embodiment of the present application provides a computer program product. When the computer program product is run on a mobile terminal, the mobile terminal implements the steps in each embodiment of the above-mentioned map updating method when executing the computer program product.

[0146] If the integrated unit is implemented in the form of 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 present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0147] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0148] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0149] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0150] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0151] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for updating a map, characterized in that: include: Obtain each first key frame collected when the robot moves; Processing each of the first key frames based on each of the first key frames and each of the second key frames of the initial map stored by the robot to obtain optimized key frames of each of the first key frames; wherein the initial map is constructed based on the environment in which the robot is located at the time when the robot is constructing the map; Updating the initial map based on the optimized key frame to obtain the updated initial map; The processing of each first key frame based on each first key frame and each second key frame of the initial map stored by the robot to obtain an optimized key frame of each first key frame includes: Obtaining a first constraint relationship between the i-th first key frame and the i+1-th first key frame, where 1≤i≤n-1, and n is the number of first key frames; Obtaining a matching score between each of the first key frames and each of the second key frames; Calculating a second constraint relationship between a first key frame corresponding to a matching score within a preset range and a second key frame having a matching score within a preset range with the first key frame; The first key frames are processed based on the first constraint relationship and the second constraint relationship to obtain optimized key frames of the first key frames.

2. The map updating method according to claim 1, characterized in that: The obtaining of the first constraint relationship between the i-th first key frame and the (i+1)-th first key frame includes: Obtaining the first position of the robot when collecting the i-th first key frame; Obtaining a second posture of the robot when collecting the (i+1)th first key frame; The first constraint relationship is obtained based on the first posture and the second posture.

3. The map updating method according to claim 1, characterized in that: The second constraint relationship between the first key frame corresponding to the matching score within the preset range and the second key frame having a matching score within the preset range with the first key frame includes: Obtaining a first key frame and a second key frame corresponding to a matching score within a preset range; A second constraint relationship between a third key frame and a fourth key frame is calculated, wherein the third key frame is a first key frame corresponding to a matching score within a preset range, and the fourth key frame is a second key frame having a matching score with the first key frame within the preset range.

4. The map updating method according to claim 3, characterized in that: The calculating the second constraint relationship between the third key frame and the fourth key frame includes: Obtaining a third posture of the robot when collecting the third key frame; Obtaining a fourth posture of the robot when collecting a fourth key frame; Based on the third posture and the fourth posture, the second constraint relationship is obtained.

5. The map updating method according to claim 1, characterized in that: The processing of each first key frame based on each first key frame and each second key frame of the initial map stored by the robot to obtain an optimized key frame of each first key frame includes: Using a graph optimization algorithm, the first constraint relationship and the second constraint relationship are processed to obtain optimized poses corresponding to the first key frames; Based on the optimized posture, the optimized key frames of the first key frames are obtained.

6. The map updating method according to any one of claims 1 to 5, characterized in that: The updating of the initial map based on the optimized key frame to obtain the updated initial map includes: Selecting an optimized key frame that meets a second preset condition from the optimized key frames; Based on the optimized key frames that meet the second preset condition, the updated initial map is obtained.

7. The map updating method according to claim 6, characterized in that: The step of selecting an optimized key frame satisfying a second preset condition from the optimized key frames includes: Arrange the optimized key frames in order of acquisition time from earliest to latest to obtain a key frame sequence; Starting from the tail position of the key frame sequence, a preset number of optimized key frames are selected as the optimized key frames that meet the second preset condition.

8. A robot comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the map updating method according to any one of claims 1 to 7 is implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the map updating method according to any one of claims 1 to 7 is implemented.