Map updating method, robot and computer readable storage medium
By applying probability growth and attenuation models in the robot navigation system, the map is quickly updated, and the positioning deviation and loss problems caused by the robot due to environmental changes are solved, achieving higher positioning accuracy and stability.
Patent Information
- Application Number
- CN202311512129.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-13
- Publication Date
- 2025-05-13
AI Technical Summary
Because the actual environment of the robot is inconsistent with the pre-built map, it leads to positioning deviations and loss problems.
By obtaining the current frame, nearest neighbor keyframes, and global maps, applying probability growth and attenuation models, quickly update the map to ensure that the map is consistent with the actual environment.
It effectively reduces the positioning deviation and loss problems caused by environmental changes, and improves the positioning accuracy and stability of the robot in the actual environment.
Smart Images

Figure CN119992009A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robot navigation technology, and in particular to a map updating method, a robot and a computer-readable storage medium. Background Art
[0002] Autonomous navigation is widely used in the fields of robotics and autonomous driving. Simultaneous Localization and Mapping (SLAM) technology can build a map of the environment and perform positioning, which is the premise and key for robots to achieve autonomous navigation.
[0003] In cleaning robot applications, SLAM technology is generally used to build maps first, and then positioning is performed based on the built maps. However, the actual environment often changes, resulting in inconsistencies between the pre-built maps and the actual environment, causing positioning deviations or even positioning loss. Summary of the invention
[0004] The present application provides a map updating method, a robot and a storage medium to solve the problem of positioning deviation and loss caused by the mismatch between the actual environment and the map of the robot in the prior art.
[0005] In a first aspect, the present application provides a map updating method, applied to a robot, comprising:
[0006] Acquire a current frame, a neighboring key frame, and a target global map, wherein the current frame, the neighboring key frame, and the target global map each include a plurality of position points, each of the position points is configured with an observation probability, and the observation probability is used to indicate the probability that the position point is occupied by an obstacle;
[0007] According to a preset probability growth model and the current frame, respectively, a probability rapid growth operation is performed on the neighbor key frame and the target global map to obtain a first neighbor key frame and a first global map;
[0008] According to a preset probability decay model, the first neighbor key frame and the first global map, a probability slow decay operation is performed on the first global map to obtain a second global map;
[0009] The target global map is updated according to the second global map.
[0010] Optionally, obtaining neighbor key frames includes:
[0011] Obtaining a target key frame, wherein the target key frame is within a preset distance range from the current frame;
[0012] A target key frame satisfying a preset constraint condition is determined as a neighboring key frame among the multiple target key frames.
[0013] Optionally, performing a probability rapid growth operation on the neighboring key frame according to a preset probability growth model and the current frame includes:
[0014] According to the current frame and the neighboring key frames, determining a position point in the neighboring key frames that satisfies a preset distance constraint condition as a repeated observation point;
[0015] A probability rapid growth operation is performed on the repeated observation points according to the probability growth model.
[0016] Optionally, the determining, based on the current frame and the neighboring key frames, that a position point in the neighboring key frames that satisfies a preset distance constraint condition is a repeated observation point comprises:
[0017] Traversing the neighboring key frames to determine the closest point in the current frame that matches the position point in the neighboring key frame;
[0018] Determine whether the distance between each of the position points and the nearest matching point is less than a preset threshold;
[0019] If it is less than, the position point is determined to be the repeated observation point.
[0020] Optionally, performing a probability rapid growth operation on the global map according to a preset probability growth model and the current frame includes:
[0021] According to the current frame and the global map, determining a location point in the global map that meets a preset distance constraint condition as a candidate newly added point, and a location point that does not meet the preset distance constraint condition as a repeated observation point;
[0022] Performing a probability rapid growth operation on the repeated observation points according to the probability growth model;
[0023] The global map and the neighboring key frames are updated according to the candidate new added points.
[0024] Optionally, the determining, based on the current frame and the global map, that a location point satisfying a preset distance constraint in the global map is a candidate newly added point, and a location point not satisfying the preset distance constraint is a repeated observation point comprises:
[0025] Traversing the current frame to determine the closest point in the global map that matches the position point of the current frame;
[0026] Determine whether the distance between each of the position points and the nearest matching point is less than a preset threshold;
[0027] If it is less than, the position point is determined to be the repeated observation point;
[0028] If it is greater, the location point is determined to be a candidate for new addition point.
[0029] Optionally, updating the global map and the neighboring key frame according to the candidate newly added point includes:
[0030] Generate a dynamic map according to the global map, the dynamic map comprising a plurality of location points, each of the location points being configured with an observation probability, and the location points comprising the candidate newly added points;
[0031] According to the candidate newly added points, the probability growth model and the probability decay model, respectively performing a probability growth operation and a probability decay operation on the dynamic map position points;
[0032] The global map and the neighboring key frames are updated according to the observation probability of the dynamic map.
[0033] Optionally, performing a probability growth operation on the dynamic map location point according to the candidate newly added point and the probability growth model includes:
[0034] Determine in the dynamic map that candidate new points that meet the preset distance constraint condition are new points, and determine that candidate new points that do not meet the distance constraint condition are repeated observation points;
[0035] Performing a probability rapid growth operation on the repeated observation points according to the probability growth model;
[0036] Assign an initial observation probability to the newly added point.
[0037] Optionally, determining in the dynamic map that the candidate newly added points satisfying a preset distance constraint condition are newly added points, and the candidate newly added points not satisfying the distance constraint condition are repeated observation points includes:
[0038] Determining in the dynamic map the closest point that matches each of the candidate newly added points;
[0039] Determine whether the distance between the candidate newly added point and the matching closest point is less than a preset threshold;
[0040] If it is less than, the selected newly added point is determined to be a repeated observation point;
[0041] If it is greater, the candidate new point is determined to be a new point.
[0042] Optionally, updating the global map and the neighbor key frames according to the observation probability of the dynamic map includes:
[0043] Determine a stable position point and an unstable position point in the dynamic map after the newly added point is determined according to the observation probability, wherein the stable position point is a position point whose observation probability is greater than a preset minimum static threshold, and the unstable position point is a position point whose observation probability is less than a preset minimum deletion threshold;
[0044] Adding the stable position point to the global map and the neighboring keyframes;
[0045] The unstable location point is deleted in the dynamic map.
[0046] Optionally, performing a probability slow decay operation on the first global map according to a preset probability decay model, the first neighbor key frame and the first global map includes:
[0047] Determining a movement trajectory of the robot;
[0048] Determine an observed key frame according to the movement trajectory and the first neighboring key frame;
[0049] generating an observed local map according to the plurality of observed key frames and the first global map;
[0050] A probability slow decay operation is performed on the first global map according to a preset probability decay model, the observed local map and the first global map.
[0051] Optionally, performing a probability slow decay operation on the first global map according to a preset probability decay model, the observed local map and the first global map includes:
[0052] Traversing the observed local map to determine the closest point in the global map that matches the observed local map location point;
[0053] Determine whether the distance between the position point and the nearest matching point is less than a preset threshold;
[0054] If it is less than, then a probability slow decay operation is performed on the position point according to the probability decay model; and / or
[0055] Traversing the movement trajectory to determine the closest point matching the movement trajectory in the global map;
[0056] Determine whether the distance between the moving trajectory point and the matching closest point is less than a preset threshold;
[0057] If it is less than, a probability slow decay operation is performed on the moving trajectory point according to the probability decay model.
[0058] Optionally, after performing the probability slow decay operation on the first global map, the method further includes:
[0059] Determine whether each location point in the global map has a probability less than a preset minimum deletion probability;
[0060] If it is less than, the location point is deleted from the global map.
[0061] Optionally, updating the target global map according to the second global map includes:
[0062] Determine whether the number of position points changed in each of the observed key frames is greater than a preset threshold;
[0063] If it is greater than, then save and update the observed key frame;
[0064] Determine whether the number of location points changed in the global map is greater than a preset threshold;
[0065] If it is greater, the global map is saved and updated.
[0066] Optionally, before performing the probability slow decay operation on the first global map, the method further includes:
[0067] Add the current moving trajectory points of the robot to the trajectory point cloud;
[0068] Determining whether the number of moving trajectory points in the trajectory point cloud is greater than a preset minimum probability decay interval;
[0069] If yes, then performing a probability slow decay operation on the first global map;
[0070] If not, a probability fast growth operation is performed on the current key frame and the target global map.
[0071] Optionally, before performing a probability slow decay operation on the first global map according to a preset probability decay model, the first neighbor key frame and the first global map, the method further includes:
[0072] Determine whether the matching distance between the current key frame and the global map is less than a preset maximum stable matching distance, and / or determine whether the angular velocity of the robot corresponding to the current key frame is less than a preset maximum stable angular velocity, and / or determine whether the characteristic value of the current key frame is greater than a preset maximum degradation threshold;
[0073] If so, a probability fast growth operation is performed on the current key frame and the target global map.
[0074] Optionally, the preset probability growth model is configured with a probability growth increment, a probability maximum upper limit, a probability growth gradient, a first observation probability, and a second observation probability, wherein:
[0075] The first observation probability is the observation probability of the position point before the probability growth is executed, the second observation probability is the observation probability of the position point after the probability growth is executed, and the probability growth gradient is the ratio of the first observation probability to the maximum upper limit of the probability;
[0076] The second observation probability is determined by first multiplying the probability growth gradient by the probability growth increment to obtain a product, and then adding the first observation probability to the product to obtain a calculation result.
[0077] Optionally, the preset probability decay model is configured with a probability decay increment, a probability maximum upper limit, a probability decay gradient, a first observation probability, and a second observation probability, wherein:
[0078] The first observation probability is the observation probability of the position point before probability decay is performed, the second observation probability is the observation probability of the position point after probability decay is performed, and the probability decay gradient is the ratio of the maximum upper limit of the probability to the first observation probability;
[0079] The second observation probability is determined as a calculation result obtained by first multiplying the probability attenuation gradient by the probability attenuation increment and then subtracting the product from the first observation probability.
[0080] In a second aspect, the present application also provides a robot comprising a memory and a processor, wherein the memory is connected to the processor, and the processor is used to execute one or more computer programs stored in the memory. When the processor executes the one or more computer programs, the robot implements the method described in the first aspect.
[0081] In a third aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method as described in the first aspect.
[0082] In the technical solution provided by the present application, the probability of rapid growth and slow probability decay are performed on the neighboring key frames and the global map according to the current frame, and then the target global map is updated according to the observation probability of the neighboring key frames and the position points in the global map. In the operation of rapid probability growth, the new content in the map has a larger probability growth gradient, so that the new position points in the map are more quickly consistent with the global map, thereby reducing the positioning deviation and loss problems caused by the inconsistency between the actual environment and the global map. In the operation of slow probability decay, a smaller probability decay gradient is set for the map position points, the map retention period for historical information is extended, the recall rate of the map matching algorithm is improved during subsequent robot positioning, and the impact of positioning deviation caused by the inconsistency between the actual environment map and the global map is further reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0084] Figure 1 A schematic diagram of an application environment of a map updating method provided in an embodiment of the present application;
[0085] Figure 2 A schematic diagram of a robot architecture provided in one embodiment of the present application;
[0086] Figure 3 A flowchart of a map updating method provided in one embodiment of the present application;
[0087] Figure 4 A schematic diagram of a probability rapid growth operation provided by an embodiment of the present application;
[0088] Figure 5 A schematic diagram of a probability slow decay operation provided by an embodiment of the present application;
[0089] Figure 6 A flow chart of a method for determining map update conditions provided in an embodiment of the present application;
[0090] Figure 7 A schematic diagram of a method flow for obtaining neighbor key frames provided in an embodiment of the present application;
[0091] Figure 8 A schematic diagram of a method for determining neighboring key frames provided in an embodiment of the present application;
[0092] Fig. 9A schematic flow chart of a method for performing a probability rapid growth operation on neighboring key frames provided in an embodiment of the present application;
[0093] Fig.10 A schematic diagram of a method flow for performing a probability rapid growth operation on a global map provided in an embodiment of the present application;
[0094] Fig.11 A schematic flow chart of a method for updating a global map and neighboring key frames according to a candidate newly added point provided in an embodiment of the present application;
[0095] Fig.12 A schematic flow chart of a method for performing a probability slow decay operation on a global map provided in an embodiment of the present application;
[0096] Fig.13 A schematic diagram of a movement trajectory provided by an embodiment of the present application;
[0097] Fig.14 A schematic flow chart of a method for probability decay and updating of key frames provided in an embodiment of the present application;
[0098] Fig.15 A schematic diagram of a method flow for determining a probability decay period provided in an embodiment of the present application;
[0099] Fig.16 A schematic flow chart of a method for updating a target global map according to a second global map provided in an embodiment of the present application;
[0100] Fig.17 A schematic diagram of the architecture of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0101] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0102] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional module division is performed in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a sequence different from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in this application do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.
[0103] First, in order to facilitate the description of the map updating method provided in the embodiment of the present application, the application environment of the method provided in the embodiment of the present application is introduced.
[0104] See also Figure 1 , Figure 1 The following is a schematic diagram of an application environment of a map updating method provided in an embodiment of the present application. The application scenario is provided with a target space 10, which includes a robot 20, a stationary target 30, and a mobile target 40. The robot 20 can move at different positions in the target space 10, and obtain the position information of the stationary target 30 and the mobile target 40 in the target space 10, so as to generate a map of the application scenario according to the mobile position information of the robot 20 itself, the position information of the stationary target 30, and the position information of the mobile target 40, so as to be used for the subsequent positioning of the robot 20 or the functional interaction between the robot 20 and the application scenario.
[0105] The target space 10 is a space that provides functions of any area. For example, the target space 10 includes indoor space, shopping mall, living room, kitchen, office and other spaces. The robot 20 can be deployed in any type of target space 10 to perform tasks in the target space 10.
[0106] The stationary target 30 is a target whose position is relatively stable in the target space 10, that is, when the robot 20 is around the stationary target 30, it can stably obtain the position information of the stationary target 30. For example, the stationary target 30 can be an object that is usually not moved, such as a refrigerator in the kitchen, a sofa in the living room, a bed in the bedroom, a bookcase in the study, etc., or an object with a low movement frequency, such as a chair, an electric fan, or a door.
[0107] The moving target 40 is a target whose position in the target space 10 is relatively unstable, that is, when the robot 20 is around the moving target 40, it is not possible to stably obtain the position information of the moving target 40. For example, the moving target 40 can be a human or a pet walking in the room, or a basketball or a football rolling in the room.
[0108] See also Figure 2 , Figure 2 A schematic diagram of a robot structure provided in an embodiment of the present application. The robot 20 includes a robot body 21 , a controller 22 , a moving component 23 and a sensor component 24 .
[0109] The robot body 21 serves as the main housing of the robot 20 and is used to protect the robot 20 and accommodate various mechanical components and electrical components.
[0110] The controller 22, as the control core of the robot 20, can be used to analyze and process various control logics. The controller 22 can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array, a single-chip microcomputer, an ARM or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the controller can also be any traditional processor, microcontroller, or state machine. The controller 22 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP, and / or any other such configuration.
[0111] The moving component 23 is communicatively connected with the controller 22, and is used to drive the robot 20 to move between different positions in the target space 10 under the control of the controller 22. For example, the moving component 23 includes a plurality of pulleys and a driving mechanism connected to the pulleys. Specifically, the driving mechanism includes a motor and a transmission shaft, and the motor and the controller are connected by wires to control the rotation of the motor under the action of the electrical signal of the controller, so as to drive the pulley to rotate through the transmission shaft, so as to control the robot to move to different positions in the target space. It can be understood that in some other embodiments, the moving component 23 can also be a mechanical foot, such as a mechanical foot for the movement of a hexapod bionic robot or a mechanical foot of a robot power dog, etc., which is not limited here.
[0112] The sensor component 24 is connected to the controller 22 for communication, and is used to obtain the environmental information of the robot 20 at different positions, and transmit the environmental information obtained by the robot 20 at different positions to the controller 22 for analysis and processing, so as to construct a map of the application scene and the static objects contained therein. For example, the sensor component 24 includes at least a camera, such as a depth camera, a binocular camera or a multi-eye camera, which is used to shoot the environment around the robot 20 to obtain an image containing the position information of nearby static targets and mobile targets. During the movement of the robot 20, the camera continuously shoots the environment around the robot 20 to obtain multiple frames of images. The controller 22 processes the multiple frames of images to obtain a point cloud corresponding to each frame of the image, and selects part of the frame images as key frames according to a preset key frame selection method, so as to use the key frame images to represent the environmental information of the robot 20 in the vicinity of the position point. The controller 22 obtains a global map of the entire target space 10 after splicing and processing according to multiple key frames. That is, it can be understood that the key frame only contains the environmental information around the robot 20 at the corresponding position point, and the global map contains the environmental information of all positions in the entire target space. For example, the target space 10 includes two obstacles A and B. The robot 20 determines a key frame every time it moves a certain distance. Then the target space may contain multiple key frames, some of which contain the position information of obstacle A, some contain the position information of obstacle B, and some may contain the position information of both obstacles A and B. The remaining key frames may contain neither the position information of obstacle A nor the position information of obstacle B. By splicing all the key frames, the global map obtained will completely include the position information of obstacles A and B. It can be understood that the sensor component 24 can include at least one of a radar, a motion sensor or other sensors in addition to a camera. For example, the radar can be a laser radar or a sonic radar, and the motion sensor can be an inertial measurement unit, a gyroscope, an accelerometer or a speedometer.
[0113] The robot 20 may also be configured with other functional components 25 according to the tasks performed. In some embodiments, the robot is a cleaning robot, and the functional component 25 is specifically a cleaning component, which is used to clean the floor or wall. In some embodiments, it can also be used to clean some specific targets, such as carpets, tables and chairs, and toilets. Specifically, the cleaning component may include one or more devices such as a rotating floor brush, a roller cleaning cloth, a spray head, and an exhaust fan. For example, a rotating floor brush is used to gather dust on the floor, and then an exhaust fan is used to suck the dust into a dust bag, or a spray head is used to wet the floor and then a roller cleaning cloth is used to mop the floor. In other embodiments, the robot is a transport robot, and the functional component 25 is specifically a transport component, which is used to transport a target object. Specifically, the transport component may be a robotic arm, which moves after grabbing the target object to transport the target object. The transport component may also be a lift or a conveyor belt, and the target object is placed on the lift or conveyor belt to transport it. It is understandable that the type of robot is not limited to a cleaning robot or a transport robot, but may also be other types of robots, and this application does not limit this.
[0114] Based on the above scenario diagram, the map updating method provided by the embodiment of the present application is introduced below.
[0115] See also Figure 3 , Figure 3 A flowchart of a map updating method provided in an embodiment of the present application. The method includes:
[0116] S31, obtaining a current frame, neighboring key frames and a target global map, wherein the current frame, neighboring key frames and the target global map all include a plurality of position points, each position point is configured with an observation probability, and the observation probability is used to indicate the probability that the position point is occupied by an obstacle.
[0117] In this step, the current frame is the observation point cloud obtained by the robot at the current position based on the image taken by the sensor. The observation point cloud includes multiple position points, each of which is a point determined according to the machine vision algorithm to represent the features of the object in the image. When the position point is converted to the map coordinate system, it has a certain three-dimensional coordinate, such as the position point (8, 13, 21). Each number is the distance from the corresponding coordinate axis in the three-dimensional coordinate system. For example, the first number 8 represents the distance from the x-axis is 8. According to the coordinates of the position point, a unique and accurate position can be determined in the map coordinate system. It can be understood that the expression of the coordinate system is not limited to the rectangular coordinate system, but can also be a polar coordinate system, such as (8, π / 6, π / 12), which is not limited here.
[0118] In this step, in addition to the coordinate information, the location point is also configured with an observation probability, which is used to indicate the probability value of the location point being occupied by an entity. For example, the location point (8,13,21,0.3), where the last digit 0.3 is used to represent that the location point (8,13,21) has a 0.3 probability of being occupied by an entity, that is, there is an entity at the location point. In different current frame point clouds, the observation probability is not exactly the same, but when a location point is occupied by a stationary target, the change in the observation probability of the location point in a continuous current frame is usually relatively stable. When the location point is occupied by a moving target for a short time, the observation probability of the location point in a continuous current frame has a large fluctuation, because some of the current frames observe that the moving target has an observation probability at the location point, and when the moving target moves, the remaining current frames cannot observe that the moving target has an observation probability at the location point. At the same time, the high or low observation probability can also assist in judging whether the location point is occupied by an entity.
[0119] In this step, the neighbor key frame is a key frame determined within a certain distance range according to the current frame. The robot will continuously shoot the surrounding environment to obtain images during the movement, so the information obtained between multiple current frames is relatively small. In order to reduce the pressure of the robot to process images, it is necessary to select a frame from multiple continuous current frames according to certain key frame selection rules to determine it as a key frame to represent the environmental information obtained at a position point within a certain distance. The key frame selection method can be to select a frame as a key frame every time the robot moves a fixed distance, or to determine the key frame according to the feature value in the current frame, such as the line segment feature, which is not limited here. Each key frame only represents the local environmental information of the robot at the position point, that is, the key frame can be understood as a local map relative to the global map, and all the key frames can be obtained after splicing to obtain a global map with environmental information of all positions. There are certain differences in the environmental information recorded between adjacent key frames, but there may be records for objects in the target space, such as two adjacent key frames that record the position information and observation probability of obstacle A. Therefore, for a current frame, the neighbor key frames may be multiple key frames near the current frame.
[0120] In this step, the target global map is a map that records the environmental information in the entire target space. The global map also includes multiple location points, and the location points in the global map are different from the location points in the current frame and the key frame, which only include local location points corresponding to the shooting picture, but include information of each location point in the target space. The location point is specifically represented as a map point in the target global map. The map point also has three-dimensional coordinates to help determine the specific location of the map point, and also records information on whether the map point is occupied by an entity, that is, it can be understood that the observation probability of the map point can only be 1 or 0, so that the robot can perform tasks according to the target global map. In some embodiments, the map point can also record that the entity occupying the map point is a certain type of object. For example, when the robot needs to perform the task of cleaning the carpet, the map point corresponding to the carpet can be determined according to the global map, and the moving path can be planned according to the map points between the carpet and the robot's own position that are not occupied by the entity.
[0121] In this step, the current frame is acquired based on the image currently taken by the sensor, the target global map is generated based on the splicing of all key frames of the target space, and the neighbor key frames are determined by searching in the key frame library based on the current frame. The specific method for determining the neighbor key frames will be described in detail later and will not be described here. It should be noted that the target global map has been generated before the map update of this application. In this step, the target global map can be directly read without temporary generation, and the current frame and the neighbor key frames determined based on the current frame are temporarily generated or determined in the map update operation.
[0122] S32. According to a preset probability growth model and the current frame, a probability rapid growth operation is performed on the neighbor key frame and the target global map respectively to obtain a first neighbor key frame and a first global map.
[0123] In this step, the probability growth model is a model for rapidly increasing the observation probability of the location points. Specifically, the probability growth model is nonlinear for the probability growth of the location points, and a higher growth gradient is set for the location points with lower observation probabilities, so that the newly added and stable location points in the map can quickly increase the observation probability. As a result, the newly added points can quickly keep consistent with the global map and be added to the global map, thereby improving the map's response speed to new content. Accordingly, for location points with a high observation probability, their probability growth is relatively slow to ensure that the observation probability is stable and does not exceed the probability upper limit. The specific configuration of the probability growth model and the method of using the probability growth model to perform a rapid probability growth operation are described in detail later and will not be described in detail here.
[0124] In this step, the first neighbor keyframe is a neighbor keyframe that has been updated after probability growth and according to the observed probability, and the first global map is a global map that has been updated after probability growth and according to the observed probability. It can be understood that the relationship between the global map and the keyframe is global and local, that is, when the keyframe used to represent the local environmental information is updated, the global map representing the global environmental information should also be updated synchronously. Through the rapid probability growth operation, the newly added content in the actual environment relative to the pre-built map can be quickly added to the neighbor keyframe and the global map. Obviously, compared with the pre-built map, the actual environment has many deleted contents in addition to the newly added content, such as some objects such as tables are placed in other locations, so it is necessary to delete some content from the neighbor keyframe and the global map, that is, the first neighbor keyframe and the first global map are not map files that have been completely updated, but transitional map files.
[0125] S33: According to a preset probability decay model, the first neighbor key frame and the first global map, a probability slow decay operation is performed on the first global map to obtain a second global map.
[0126] In this step, the probability decay model is a model for slowly decaying the observation probability of the position point. Specifically, the probability decay model is also nonlinear for the probability decay of the position point. A lower attenuation gradient is set for the position point with a lower observation probability, so that the content with a lower probability in the map can still be saved with a low observation probability, thereby extending the map's retention of historical information, thereby improving the recall rate of the map matching algorithm during positioning. For example, some objects in the target space have a low observation probability due to changes in light or unclear contrast with surrounding objects. If the object is directly deleted from the map, it means that the object cannot be correctly detected. Therefore, although the observation probability is low, the information of the object is still retained in the map, which can increase the probability of the object being correctly detected in subsequent processing. The specific configuration of the probability decay model and the method of using the probability decay model to perform a slow probability decay operation are described in detail later and will not be explained here.
[0127] In this step, the second global map is a global map that has been probability decayed and updated according to the observation probability. It can be understood that due to the connection between the global map and the key frame, when updating the second global map, it is also necessary to perform probability decay on the first neighbor key frame and obtain the second neighbor key frame. Through the probability slow decay operation, the probability decay is performed on the first neighbor key frame and some position points in the first global map that cannot be stably observed, and some points with probability values lower than the threshold are deleted to obtain the second global map and the second neighbor key frame.
[0128] S34. Update the target global map according to the second global map.
[0129] In this step, after determining the second global map, the target global map can be updated according to the second global map, that is, the second global map is saved and overwritten with the pre-built target global map to complete the map update. In some embodiments, after obtaining the second global map, it is also necessary to determine whether the second global map meets the constraint conditions. Only the second global map that meets the constraint conditions can be saved, so as to reduce the number of updates of the target global map, avoid writing to the storage disk too frequently, and improve the update quality.
[0130] In the technical solution of the embodiment of the present application, the probability growth model is used to rapidly increase the probability of neighbor keyframes and the global map, so that the newly added content in the map has a larger probability growth gradient, so that the newly added content in the map is more quickly consistent with the global map, thereby reducing the positioning deviation and loss problems caused by the inconsistency between the actual environment and the global map. The probability decay model is used to slowly decay the probability of the first neighbor keyframe and the first global map, and a smaller probability decay gradient is set for the position point to be decayed, thereby extending the map's retention period for historical information, improving the recall rate of the map matching algorithm during subsequent robot positioning, and further reducing the impact of positioning deviation caused by the inconsistency between the actual environment map and the global map.
[0131] The probability growth model provided by the embodiments of the present application is introduced below.
[0132] The probability growth model provided in the present application is configured with a total of five parameters, namely, probability growth increment, probability maximum upper limit, probability growth gradient, first observation probability and second observation probability. Among them, the first observation probability is the observation probability of the position point before the probability growth is executed, the second observation probability is the observation probability of the position point after the probability growth is executed, the probability growth gradient is the ratio of the first observation probability to the maximum upper limit of probability, the probability growth gradient is used to dynamically control the probability growth amplitude, and the probability growth increment and the maximum upper limit of probability are preset values. The specific steps for performing the rapid probability growth operation according to the probability growth model are as follows: first, determine the first observation probability, the probability growth increment and the maximum upper limit of probability, then determine the probability growth gradient according to the ratio of the maximum upper limit of probability to the first observation probability, and finally calculate the second observation probability according to the first observation probability, the probability growth gradient and the probability growth increment. The calculated second observation probability is the observation probability of the position point after the rapid probability growth. Specifically, the exemplary calculation can be performed according to the following formula:
[0133] Grad_i=Maxprob / Prob_i (Formula 1)
[0134] Prob_i=Prob_i+Grad_i*Delta (Formula 2)
[0135] Among them, Grad_i is the probability growth gradient of any position point i, Maxprob is the maximum upper limit of probability, Prob_i in Formula 1 is the first observation probability, Prob_i on the left side of Formula 2 is the second observation probability, Prob_i on the right side of Formula 2 is the first observation probability, and Delta is the probability growth increment.
[0136] See also Figure 4 , Figure 4 A schematic diagram of a rapid probability growth operation provided for an embodiment of the present application. For example, for a certain position point n (8, 13, 21, 0.3), its first observation probability is determined to be 0.3, and then the maximum probability upper limit is set to 1, and the probability growth increment is 0.04. Then the probability growth gradient is 1 / 0.3=3.3, and the second observation probability is 0.3+3.3x0.04=0.432. The second observation probability has a larger growth rate than the first observation probability, so after multiple probability increases, the position point can be considered to be stably added to the global map or key frame. At the same time, for the other two position points m and l, the first observation probability of position point m is 0.2, and the second observation probability after rapid probability growth is 0.4. The first observation probability of position point l is 0.5, and the second observation probability after rapid probability growth is 0.508. By comparing the position points l, m, and n horizontally, it can be determined that the position points with lower observation probabilities have a relatively larger increase in observation probabilities in the rapid probability growth operation, while the position points with higher observation probabilities have a relatively smaller increase in observation probabilities in the rapid probability growth operation.
[0137] The probability decay model provided by the embodiments of the present application is introduced below.
[0138] The probability decay model provided in the present application is configured with a total of five parameters, namely, probability decay increment, maximum probability upper limit, probability decay gradient, first observation probability and second observation probability. Among them, the first observation probability is the observation probability of the position point before the probability decay is executed, the second observation probability is the observation probability of the position point after the probability decay is executed, the probability decay gradient is the ratio of the first observation probability to the maximum probability upper limit, the probability decay gradient is used to dynamically control the probability decay amplitude, and the probability decay increment and the maximum probability upper limit are preset values. The specific steps for performing the probability slow decay operation according to the probability decay model are as follows: first, determine the first observation probability, the probability decay increment and the maximum probability upper limit, then determine the probability decay gradient according to the ratio of the maximum probability upper limit to the first observation probability, and finally calculate the second observation probability according to the first observation probability, the probability decay gradient and the probability decay increment. The calculated second observation probability is the observation probability of the position point after the probability slow decay. Specifically, the exemplary calculation can be performed according to the following formula:
[0139] Grad_i=Prob_i / Maxprob (Formula 3)
[0140] Prob_i=Prob_i-Grad_i*Delta (Formula 4)
[0141] Among them, Grad_i is the probability attenuation gradient of any position point i, Maxprob is the maximum upper limit of probability, Prob_i in Formula 3 is the first observation probability, Prob_i on the left side of Formula 4 is the second observation probability, Prob_i on the right side of Formula 4 is the first observation probability, and Delta is the probability attenuation increment.
[0142] See also Figure 5 , Figure 5 A schematic diagram of a probability slow decay operation provided for an embodiment of the present application. For example, for a certain position point n (8, 13, 21, 0.3), its first observation probability is determined to be 0.3, and then the maximum probability upper limit is set to 1, and the probability decay increment is 0.1. Then the probability growth gradient is 0.3 / 1=0.3, and the second observation probability is 0.3-0.3x0.1=0.27. The second observation probability decays less than the first observation probability. Unless the observation probability decays multiple times, the observation probability corresponding to the position point will still be maintained above a certain level, ensuring that the target corresponding to the position point will not be deleted from the map. At the same time, for the other two position points m and l, the first observation probability of position point m is 0.2, and the second observation probability after slow probability decay is 0.18. The first observation probability of position point l is 0.8, and the second observation probability after slow probability decay is 0.72. By comparing the position points l, m, and n horizontally, it can be determined that the position points with lower observation probabilities have a relatively smaller observation probability attenuation amplitude in the probability slow decay operation, while the position points with higher observation probabilities have a relatively larger observation probability attenuation amplitude in the probability slow decay operation.
[0143] In some embodiments, before step S32, a step of determining a map update condition is also included. Figure 6 , Figure 6 A flowchart of a method for determining map update conditions provided in an embodiment of the present application. Figure 6 This section describes how to determine map update conditions, including:
[0144] S61, determining whether the matching distance between the current frame and the global map is less than a preset maximum stable matching distance;
[0145] S62, determining whether the angular velocity of the robot corresponding to the current frame is less than a preset maximum stable angular velocity;
[0146] S63: Determine whether the characteristic value of the current frame is greater than a preset maximum degradation threshold.
[0147] In step S61, the current frame is matched with the global map according to a preset matching rule to determine the partial area corresponding to the current frame in the global map. Those skilled in the art can select and determine specific matching rules from common knowledge according to different situations and make adaptive adjustments to the matching rules, which will not be introduced in detail. The matching distance is calculated by the map matching module in the robot controller. When the matching distance is less than the preset maximum stable matching distance, it can be determined that the current frame is consistent with the global map, that is, the current frame can correspond to a partial area of the global map. When the matching distance is greater than the maximum stable matching distance, it cannot be determined that the current frame is consistent with the global map, that is, the global map cannot be updated according to the current frame.
[0148] In step S62, the angular velocity corresponding to the current frame is also calculated by the map matching module in the robot controller, and the specific calculation process is not described in detail. The angular velocity is the angular velocity of the robot when shooting the current frame. The larger the angular velocity, the more blurred the current frame is due to the difficulty in focusing, and the difference between the pictures or point clouds between the adjacent current frames is large, resulting in a large error in the measured point cloud. The current frame is not suitable as a basis for updating the map. On the contrary, the smaller the angular velocity, the clearer the current frame image shot by the robot is, and the pictures or point clouds between the multiple current frames are more stable and continuous. Therefore, only when the angular velocity is less than the preset maximum stable angular velocity, the corresponding current frame can be used to update the map.
[0149] In step S63, the eigenvalue corresponding to the current frame is also calculated by the map matching module in the robot controller, and the specific calculation process is not described in detail. The eigenvalue is a numerical value determined from the image according to the machine vision algorithm and is used to characterize the picture. In some feature-degraded scenes, such as long corridors, the robot lacks observation constraints in the forward direction, resulting in low eigenvalues and large errors. Therefore, only when the eigenvalue corresponding to the current frame is greater than the maximum degradation threshold, the current frame can be used to update the map.
[0150] In some embodiments, the above steps S61, S62 and S63 are used together to determine the map update condition, that is, the map update method is executed only when the judgment results of the above three steps are all yes. Otherwise, when the judgment result of any one of the steps is not yes, the map update method is not executed. It should be noted that in some other embodiments, those skilled in the art can arbitrarily combine, add or delete steps Sx and Sx to adjust the map update judgment condition.
[0151] The following describes a method for obtaining neighbor key frames provided in an embodiment of the present application.
[0152] See also Figure 7 , Figure 7A schematic flow chart of a method for obtaining neighbor key frames provided in an embodiment of the present application specifically includes:
[0153] S71, obtaining a target key frame;
[0154] S72: Determine, among multiple target key frames, a target key frame that satisfies a preset constraint condition as a neighboring key frame.
[0155] In step S71, the target keyframe is a keyframe whose distance from the current frame is within a preset distance range. Specifically, the position point corresponding to the current frame in the global map can be determined based on the current frame, and then all position point sets within the preset distance range are queried based on the position point, and then multiple keyframes are determined as target keyframes based on the position point set. For example, the robot determines a keyframe every 0.5 meters, and the preset distance range is 3 meters. For a position point of a current frame, all keyframes within a radius of 3 meters with the position point as the center are queried as 30 frames, and the 30 frames of keyframes are determined as target keyframes.
[0156] In step S72, the preset constraint condition is a condition for determining the neighboring key frames, which can be adjusted according to the actual situation. In some embodiments, the constraint condition is the two most recent key frames. Figure 8 , Figure 8 A schematic diagram of a method for determining neighboring key frames provided in an embodiment of the present application. For example, the distances between the position points corresponding to the four key frames A, B, C, and D and the current frame position point P are 0.2m, 0.5m, 0.7m, and 1.2m, respectively, and the key frames A, B, and P with the closest distances are taken as neighboring key frames. In other embodiments, the constraint condition is that the key frames are less than 1 meter apart. For example, for the four key frames A, B, C, and D, the distances between the key frames A, B, and C are all less than 1 meter, and the key frames A, B, and C are all determined as neighboring key frames.
[0157] The following describes a method for performing a rapid probability growth operation on neighboring key frames.
[0158] See also Fig. 9 , Fig. 9 A schematic flow chart of a method for performing a probability rapid growth operation on neighboring key frames provided in an embodiment of the present application, the method comprising:
[0159] S91, according to the current frame and the neighboring key frames, determining the position points in the neighboring key frames that meet the preset distance constraint condition as repeated observation points;
[0160] S92. Perform a probability rapid growth operation on repeated observation points according to the probability growth model.
[0161] In step S91, the repeated observation points are points that can be observed and confirmed in both the neighboring key frames and the current frame. Specifically, by comparing the current frame with the neighboring key frames, the position points that meet the distance constraint conditions in the neighboring key frames are determined as repeated observation points. In some embodiments, the step of determining repeated observation points includes:
[0162] S911, traverse each position point in the neighboring key frame, and determine the nearest point matching the position point in the neighboring key frame in the current frame;
[0163] S912: Determine whether the distance between the position point and the nearest matching point is less than a preset threshold.
[0164] S913: If it is less than , it is determined that the position point can be observed in both the neighboring key frame and the current frame and is the same position point, and the position point is a repeated observation point.
[0165] S914: If it is greater than, determine that the location point is not a repeated observation point.
[0166] In step S912, the threshold is a parameter used to determine repeated observation points, and can be set according to actual conditions. In some embodiments, the preset threshold is the point cloud resolution of the current frame.
[0167] In some embodiments, before step S91, the method further includes: converting the position point of the current key frame to a map point in the global map coordinate system. Since the current frame, key frame, etc. are point cloud maps, only by converting the point cloud to a map point in the global map coordinate system can the position points in the point cloud map be in the same standard system.
[0168] In some embodiments, before step S911, a current frame search tool is constructed according to the current frame, and the current frame search tool is used to help search for the nearest point of the position point. For example, the current frame search tool is a KD-Tree (i.e., a k-dimensional tree algorithm) constructed according to the point cloud of the current frame, and the KD-Tree is used to search for the nearest point in the current frame that matches the position point in the neighboring key frame.
[0169] The following describes a method for performing a rapid probability growth operation on the global map.
[0170] See also Fig.10 , Fig.10 A schematic flow chart of a method for performing a probability rapid growth operation on a global map provided in an embodiment of the present application, the method comprising:
[0171] S101. According to the current frame and the global map, determine the position points in the global map that meet the preset distance constraint condition as candidate new points, and the position points that do not meet the preset distance constraint condition as repeated observation points.
[0172] S102: Perform a probability rapid growth operation on repeated observation points according to a probability growth model.
[0173] S103: Update the global map and neighboring key frames according to the candidate new points.
[0174] In step S101, repeated observation points are points that can be observed and confirmed in both the global map and the current frame. For details, please refer to the definition of repeated observation points in step S91, which will not be repeated here. Candidate new points are location points that cannot be confirmed in the global map and only exist in the current frame. The candidate new points are determined by comparing the current frame with the global map to determine possible change points. Subsequently, by probabilistically processing and updating the candidate new points, it can be determined whether these candidate new points need to be updated to the map without recalculating each location point in the map to reduce the amount of updated data. Specifically, by comparing the current frame with the global map, the location points in the global map that meet the distance constraint conditions are determined as repeated observation points, and the location points in the global map that do not meet the distance constraint conditions are determined as candidate new points. In some embodiments, the steps of determining repeated observation points and candidate new points include:
[0175] S1011, traversing the position points in the current frame to determine the nearest point matching the position point of the current frame in the global map;
[0176] S1012, determining whether the distance between each position point and the nearest matching point is less than a preset threshold;
[0177] S1013. If it is less than, determine the location point as a repeated observation point;
[0178] S1014: If it is greater than, determine the location point as a candidate for new addition point.
[0179] In step S1012, the threshold is a parameter used to determine whether a position point is a repeated observation point or a candidate new point, and can be set according to actual conditions. In some embodiments, the preset threshold is the point cloud resolution of the current frame.
[0180] In some embodiments, before step S101, the process further includes: converting the position points of the current frame into map points in the global map coordinate system. Since the current frame is a point cloud map, it is impossible to directly compare the current frame with the position points in the global map. Therefore, only by converting the point cloud into map points in the global map coordinate system can the position points in the point cloud map and the position points in the global map be in the same standard system.
[0181] In some embodiments, before step S1011, a global search tool is constructed based on the global map, and the global search tool is used to help search for the nearest point of the position point. Similar to the current frame search tool, the global search tool is a KD-Tree constructed based on the global map, and the KD-Tree is used to search for the nearest point in the current frame that matches the position point in the neighboring key frame. It can be understood that since the current frame is temporarily determined, the current frame search tool is also temporarily generated. The global map is a map that has been constructed in advance, so the global search tool can be temporarily generated, or it can be pre-set and stored in the robot, and can be directly scheduled for use.
[0182] The following describes a method for updating the global map and neighboring keyframes based on candidate new points.
[0183] See also Fig.11 , Fig.11 A schematic flow chart of a method for updating a global map and neighboring key frames according to a candidate newly added point provided in an embodiment of the present application, the method comprising:
[0184] S111. Generate a dynamic map based on the global map.
[0185] S112. According to the candidate newly added points, the probability growth model and the probability decay model, respectively, a probability growth operation and a probability decay operation are performed on the dynamic map location points.
[0186] S113: Update the global map and neighboring key frames according to the observation probability of the dynamic map.
[0187] In step S111, the dynamic map is a local map generated on the basis of the layer of the global map. The dynamic map uses the same map coordinate system as the global map to represent the location point. The map content is similar to the key frame and only represents the environmental information within a certain distance range in the global map. As a result, the dynamic map and the global map maintain the same map format so that the global map can be updated according to the dynamic map. At the same time, the dynamic map and the global map are relatively independent, and there is no need to frequently update the global map to improve the map usage efficiency. At the same time, the dynamic map only includes part of the content of the global map, so that the data volume of the dynamic map is relatively small and easy to update. The dynamic map matches the key frame and is updated according to the key frame, and has good robustness for noise points and dynamic targets in a certain key frame.
[0188] In step S112, according to the candidate newly added points and the probability growth model, the probability growth operation is performed on the dynamic map location point, including:
[0189] S1121. Determine in the dynamic map that candidate new points that meet preset distance constraints are new points, and determine that candidate new points that do not meet the distance constraints are repeated observation points.
[0190] S1122. Perform a probability rapid growth operation on repeated observation points according to the probability growth model.
[0191] S1123. Assign initial observation probabilities to the newly added points.
[0192] In S1121, the distance constraint condition is similar to the above and is set according to the actual situation. The specific steps of determining the newly added points and repeated observation points are: first determine the nearest point matching each candidate newly added point in the dynamic map, and then determine whether the distance between the candidate newly added point and the matching nearest point is less than a preset threshold; if the distance between the candidate newly added point and the matching nearest point is less than the threshold, determine that the newly added point is a repeated observation point; if the distance between the candidate newly added point and the matching nearest point is greater than the threshold, determine that the candidate newly added point is a newly added point. In some embodiments, the threshold is the point cloud resolution.
[0193] In S1123, when a location point in the candidate newly added point is determined not to be an original location point in the dynamic map, the candidate newly added point is determined to be a newly added point in the dynamic map, and an initial observation probability needs to be assigned to the newly added point, for example, the initial observation probability is 30. When the dynamic map is subsequently updated according to the new current frame, the observation probability of the newly added point is updated to determine whether to add the newly added point to the global map, retain it in the dynamic map, or directly delete it from the dynamic map.
[0194] In step S112, according to the candidate newly added points and the probability decay model, a probability decay operation is performed on the position points in the dynamic map, including: performing a probability slow decay operation on each position point in the dynamic map according to the probability decay model.
[0195] In step S113, the method for updating the global map and neighboring key frames according to the observation probability of the dynamic map includes:
[0196] S1131, determining stable position points and unstable position points in the dynamic map after the newly added points are determined according to the observation probability;
[0197] S1132, adding stable position points to the global map and neighboring key frames;
[0198] S1133. Delete unstable location points in the dynamic map.
[0199] In step S1131, a stable position point is a position point in the dynamic map where the observation probability is relatively stable. Specifically, for example, if a target in a real environment is stably located at the same position, the robot can observe the target at this position at different positions, so its observation probability will continue to increase according to the probability growth model. It can be understood that in addition to mobile targets, some noise points caused by light, algorithms, target materials or other factors also belong to unstable position points. Therefore, a stable position point is specifically defined as a position point in the dynamic map where the observation probability is greater than a preset minimum static threshold. In some embodiments, the determination of a stable position point is to determine whether the observation probability of each position point in the dynamic map is greater than a preset minimum static threshold, and if it is greater, the position point is determined to be a stable position point. In this embodiment, the minimum static threshold is 40, and in other embodiments, it can be adjusted according to actual conditions, and there is no limitation on this.
[0200] In step S1131, an unstable position point is a position point in the dynamic map whose observation probability is relatively unstable. It can be seen from the description of the stable position point in the above text that if a target in the real environment is moving and its position is constantly changing, the robot cannot observe the target in the same position at different positions, so the observation probability of the target at the position point will continue to decrease according to the probability decay model. Therefore, an unstable position point is specifically defined as a position point in the dynamic map whose observation probability is less than a preset minimum deletion probability. In some embodiments, the determination of an unstable position point is to determine whether the observation probability of each position point in the map is less than a preset minimum deletion threshold. If less than, the position point is determined to be an unstable position point. In this embodiment, the minimum deletion threshold is 20, and in other embodiments, it can be adjusted according to actual conditions, and there is no limitation on this.
[0201] The following describes a method for performing a slow probability decay operation on the global map.
[0202] See also Fig.12 , Fig.12 A schematic flow chart of a method for performing a probability slow decay operation on a global map provided in an embodiment of the present application, the method comprising:
[0203] S121, determining the movement trajectory of the robot;
[0204] S122, generating an observed local map according to the movement trajectory of the robot and the first nearest neighbor key frame;
[0205] S123: Perform a probability slow decay operation on the first global map according to a preset probability decay model, the observed local map, and the first global map.
[0206] In step S121, please refer to Fig.13 , Fig.13Schematic diagram of a movement trajectory provided by an embodiment of the present application. The movement trajectory of the robot is a set of position points that the robot passes through during the process of executing the slow decay of probability. For example, the robot passes through position points P0, P1, P2...P n , then the moving trajectory is a set of position points {P0, P1, P2...P n}.
[0207] In step S122, the first neighbor key frame is obtained by performing a probability rapid growth operation on the neighbor key frame according to the probability growth model and the current frame. In some embodiments, generating an observed local map according to the movement trajectory of the robot and the first neighbor key frame includes:
[0208] S1221. Determine an observed key frame according to the movement trajectory and the first nearest key frame.
[0209] S1222: Determine an observed local map according to the multiple observed key frames and the first global map.
[0210] In step S1221, the moving trajectory is first traversed to search for neighboring key frames for each position point in the moving trajectory. For example, for position point P1, the two first neighboring key frames closest to position point P1 are determined as observed key frames, and for subsequent position points P2 and P3, the first neighboring key frames closest to each other are also determined as observed key frames, and all observed key frames form an observed key frame set.
[0211] In step S1222, the first global map is obtained by performing a probability rapid growth operation on the target global map according to the probability growth model and the current frame. The observed key frame set is traversed, and the portion corresponding to the observed key frame is determined in the first global map and the portion is determined as the observed local map. For example, the first global map includes any four regions A, B, C, and D, where the observed key frame corresponds to region A, and the observed local map is a local map constructed based on region A.
[0212] In step S123, performing a probability slow decay operation on the first global map includes:
[0213] S1231, traversing the observed local map to determine the nearest point in the global map that matches the observed local map position point;
[0214] S1232, determining whether the distance between the position point and the nearest matching point is less than a preset threshold;
[0215] S1233. If it is less than, perform a probability slow decay operation on the location point according to the probability decay model.
[0216] S1234: If it is greater than, there is no need to perform a probability slow decay operation on the location point.
[0217] In step S1231, the position points in the global map are matched with the position points in the observed local map to obtain the nearest point. For example, according to the global search tool KD-Tree generated by the global map, the position points in the observed local map are input into the KD-Tree one by one, and the nearest point matching the input position point is determined by the KD-Tree.
[0218] In step S1232, since the position of the position point and the position of the nearest point are known, the distance between the position point and the nearest point can be calculated. The threshold is used to determine whether the position point is a position point in the global map corresponding to the observed local map. The specific setting of the threshold can be adjusted according to the actual situation. In this embodiment, it is determined to be the point cloud resolution of the current frame. When the distance between the position point and the matching nearest point is less than the threshold, the position point is subject to probability decay, otherwise it is not subject to probability decay.
[0219] In some embodiments, performing a probability slow decay operation on the first global map further includes:
[0220] S1235, traversing the movement trajectory to determine the nearest point matching the movement trajectory in the global map;
[0221] S1236, determining whether the distance between the moving trajectory point and the nearest matching point is less than a preset threshold;
[0222] S1237: If it is less than, perform a probability slow decay operation on the moving trajectory point according to the probability decay model.
[0223] S1238. If it is greater than, there is no need to perform a probability slow decay operation on the location point.
[0224] In step S1235, the nearest matching point is determined according to the moving trajectory, which is essentially to determine the position point that the robot has moved in the global map. Since the robot itself needs to occupy a volume, the position point on the robot's moving path must be open and movable, otherwise the target set at the position point will block the movement of the robot.
[0225] In step S1236, since the robot itself has a volume, in addition to the position point on the moving trajectory, the position points within a certain distance range near the position point are also occupied by the robot and will not be occupied by other targets. When the robot leaves the position point, the position point should be empty and not occupied by the target. For example, the setting of the threshold is related to the radius of the robot. If the robot radius is 0.5 meters, all the position points within 0.5 meters of the position point on the moving trajectory will be subject to probability attenuation.
[0226] In some embodiments, after step S1234 and / or S1238, the global map needs to be updated according to the observation probability of the location point in the global map. Specifically, it includes: determining whether the observation probability of each location point in the global map is less than the preset minimum deletion probability. When the observation probability of the location point is less than the minimum deletion probability, the location point is deleted in the global map. It should be noted that the minimum deletion probability is set according to the custom setting of the scene. In this embodiment, the minimum deletion probability is set to 15. Those skilled in the art can adjust it according to the actual situation, and there is no limitation on this.
[0227] In some embodiments, after determining that the observed key frame has been observed, the key frame probability decay operation is also included. As described above, the relationship between the key frame and the global map is the relationship between the local and the global. Therefore, in addition to the probability decay and update of the global map, the key frame probability decay and update is also required. Fig.14 , Fig.14 A schematic flow chart of a method for probabilistically decaying and updating key frames provided in an embodiment of the present application specifically includes:
[0228] S141, performing a probability slow decay operation on each position point in the observed key frame according to the probability decay model;
[0229] S142, determining whether the observation probability of each location point is less than a preset minimum deletion threshold;
[0230] S143. If it is less than, delete the position point from the observed key frame.
[0231] S144. If it is greater than, determine the observation probability of the next position point.
[0232] In step S141, since the probability of some position points in the observed key frame has been rapidly increased before, in order to keep the observation probability of the key frame balanced and not increase too much, it is necessary to slowly decay the probability of each position point in the observed key frame. If the position point in the observed key frame is a repeated observation point, the probability decay is performed after the probability increase, and the observation probability of the position point can still maintain a steady growth and not be too high. If the position point is not a repeated observation point before, it is only subjected to probability decay, so that the observation probability of the position point in the observed key frame is balanced as a whole.
[0233] In step S142, each position point in the observed key frame is traversed to determine whether the observation probability of the position point is less than the minimum deletion threshold. If it is, the position point is deleted from the observed key frame, thereby updating the observed key frame. It should be noted that since the probability decay model sets a relatively small probability decay gradient for low observation probability position points, the position points will not be deleted easily, but their probabilities will be slowly decayed. This can also ensure the accuracy of deleting position points, that is, the deleted position points are most likely moving targets or noise points.
[0234] See also Fig.15 , Fig.15 A flow chart of a method for determining a probability decay period provided in an embodiment of the present application. In some embodiments, before performing a probability slow decay operation on the first global map, the method further includes determining a probability decay period, specifically including:
[0235] S151. Add the movement trajectory of the robot to the trajectory point cloud.
[0236] S152: Determine whether the number of position points in the trajectory point cloud is greater than a preset minimum probability attenuation interval.
[0237] S153: If it is greater than, perform a probability slow decay operation on the first global map.
[0238] S154: If it is less than, a probability rapid growth operation is performed on the current key frame and the target global map.
[0239] In step S151, the robot's moving trajectory is composed of multiple position points. A probability rapid growth operation needs to be performed every time a certain number of position points are passed, and the position points corresponding to the execution of the probability rapid growth operation will be added to the trajectory point cloud. The trajectory point cloud is a collection of position points that have executed the probability rapid growth. For example, if there are 10 position points in the trajectory point cloud, it means that the current global map and key frame have executed 10 probability rapid growth operations.
[0240] In step S152, the minimum probability decay interval is used to determine the timing of slow probability decay. The slow probability decay operation will be performed only when the number of position points in the trajectory point cloud is greater than the minimum probability decay interval, otherwise the rapid probability growth operation will continue. For example, when the minimum probability decay interval is 10, it means that the probability slow decay is performed once for every 10 rapid probability growths. In this way, the number of map updates can be reduced and the efficiency of map updates can be improved on the basis of ensuring the overall balance of the observation probability of the position points of the map.
[0241] The following describes a method for updating the target global map according to the second global map.
[0242] See also Fig.16 , Fig.16 A schematic flow chart of a method for updating a target global map according to a second global map provided in an embodiment of the present application. The method comprises:
[0243] S161: Determine whether the number of changed position points in each observed key frame is greater than a preset threshold.
[0244] S162: If it is greater than, save and update the observed key frame.
[0245] S163: Determine whether the number of changed location points in the global map is greater than a preset threshold.
[0246] S164: If it is greater than, save and update the global map.
[0247] S165. If it is less than, the update will not be saved for the time being.
[0248] In step S161, the changed position point is the observed key frame after the probability rapid growth operation and the probability slow decay operation are performed, and the key frame that has not been subjected to the probability growth operation and the probability slow decay operation is compared and determined. When the number of changed position points exceeds the threshold, the observed key frame is saved and the original key frame is overwritten. For example, when the threshold is set to 5, the observed key frame will be saved only when there are more than 5 change points, otherwise the observed key frame will not be saved, so as to avoid frequent writing to the storage device to reduce the service life and improve the update efficiency of the key frame.
[0249] In step S163, similarly, the changed position points are determined by comparing the global maps before and after the probability rapid growth operation and the probability slow decay operation. When the number of changed position points exceeds the threshold, the global map is saved and the original target global map is overwritten. The threshold of the global map can be set to be different from the threshold in the key frame. For example, the threshold for judging the saving of the observed key frame is set to 5, and the threshold for judging the saving of the global gradient can be set to 10. The global map is only saved when there are more than 10 change points. It should be noted that the saving judgment condition of the global map and the observed key frame is an and relationship, that is, only when the global map and the observed key frame meet the judgment threshold condition, the global map and the observed key frame will be saved at the same time, so that the updated global map can still be consistent with the updated key frame.
[0250] In summary, the map updating method provided in the embodiment of the present application performs rapid probability growth and slow probability decay on the neighboring key frames and the global map according to the current frame, and then updates the target global map according to the observation probability of the location points in the neighboring key frames and the global map. In the operation of rapid probability growth, the new content in the map has a larger probability growth gradient, so that the new location points in the map are more quickly consistent with the global map, thereby reducing the positioning deviation and loss problems caused by the inconsistency between the actual environment and the global map. In the operation of slow probability decay, a smaller probability decay gradient is set for the map location points, the map retention period for historical information is extended, the recall rate of the map matching algorithm is improved during subsequent robot positioning, and the impact of positioning deviation caused by the inconsistency between the actual environment map and the global map is further reduced.
[0251] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the method of the aforementioned embodiment.
[0252] An embodiment of the present application also provides a robot, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the method of the aforementioned embodiment is implemented when the processor executes the computer program.
[0253] The embodiment of the present application also provides a computer device, which may be a server, and its internal structure diagram may be as follows: Fig.17 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data to be saved in the method of the above embodiment. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the method provided in the above embodiment is implemented.
[0254] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0255] Those skilled in the art 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. In actual applications, the above-mentioned functions can be distributed and 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.
[0256] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those 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 invention, and should be included in the protection scope of the present invention.
Claims
1. A map updating method, applied to a robot, characterized in that: include: Acquire a current frame, a neighboring key frame, and a target global map, wherein the current frame, the neighboring key frame, and the target global map each include a plurality of position points, each of the position points is configured with an observation probability, and the observation probability is used to indicate the probability that the position point is occupied by an obstacle; According to a preset probability growth model and the current frame, respectively, a probability rapid growth operation is performed on the neighbor key frame and the target global map to obtain a first neighbor key frame and a first global map; According to a preset probability decay model, the first neighbor key frame and the first global map, a probability slow decay operation is performed on the first global map to obtain a second global map; The target global map is updated according to the second global map.
2. The method according to claim 1, characterized in that The obtaining of neighbor key frames comprises: Acquire a target key frame, where the target key frame is a key frame whose distance from the current frame is within a preset distance range; A target key frame satisfying a preset constraint condition is determined as a neighboring key frame among the multiple target key frames.
3. The method according to claim 1, characterized in that The performing a probability rapid growth operation on the neighboring key frame according to the preset probability growth model and the current frame includes: According to the current frame and the neighboring key frames, determining a position point in the neighboring key frames that satisfies a preset distance constraint condition as a repeated observation point; A probability rapid growth operation is performed on the repeated observation points according to the probability growth model.
4. The method according to claim 3, characterized in that: The step of determining, according to the current frame and the neighboring key frames, a position point in the neighboring key frames that satisfies a preset distance constraint condition as a repeated observation point comprises: Traversing the neighboring key frames to determine the closest point in the current frame that matches the position point in the neighboring key frame; Determine whether the distance between each of the position points and the nearest matching point is less than a preset threshold; If it is less than, the position point is determined to be the repeated observation point.
5. The method according to claim 1, characterized in that The performing a probability rapid growth operation on the global map according to the preset probability growth model and the current frame includes: According to the current frame and the global map, determining a location point in the global map that meets a preset distance constraint condition as a candidate newly added point, and a location point that does not meet the preset distance constraint condition as a repeated observation point; Performing a probability rapid growth operation on the repeated observation points according to the probability growth model; The global map and the neighboring key frames are updated according to the candidate new added points.
6. The method according to claim 5, characterized in that The step of determining, according to the current frame and the global map, a location point in the global map that meets a preset distance constraint condition as a candidate newly added point and a location point that does not meet the preset distance constraint condition as a repeated observation point comprises: Traversing the current frame to determine the closest point in the global map that matches the position point of the current frame; Determine whether the distance between each of the position points and the nearest matching point is less than a preset threshold; If it is less than, the position point is determined to be the repeated observation point; If it is greater, the location point is determined to be a candidate for new addition point.
7. The method according to claim 5, characterized in that The updating of the global map and the neighboring key frames according to the candidate newly added points comprises: Generate a dynamic map according to the global map, the dynamic map comprising a plurality of location points, each of the location points being configured with an observation probability, and the location points comprising the candidate newly added points; According to the candidate newly added points, the probability growth model and the probability decay model, respectively performing a probability growth operation and a probability decay operation on the dynamic map position points; The global map and the neighboring key frames are updated according to the observation probability of the dynamic map.
8. The method according to claim 7, characterized in that The performing a probability growth operation on the dynamic map location point according to the candidate newly added point and the probability growth model comprises: Determine in the dynamic map that candidate new points that meet the preset distance constraint condition are new points, and determine that candidate new points that do not meet the distance constraint condition are repeated observation points; Performing a probability rapid growth operation on the repeated observation points according to the probability growth model; Assign an initial observation probability to the newly added point.
9. The method according to claim 8, characterized in that The step of determining in the dynamic map that a candidate newly added point that satisfies a preset distance constraint condition is a newly added point and a candidate newly added point that does not satisfy the distance constraint condition is a repeated observation point comprises: Determining in the dynamic map the closest point that matches each of the candidate newly added points; Determine whether the distance between the candidate newly added point and the matching closest point is less than a preset threshold; If it is less than, the selected newly added point is determined to be a repeated observation point; If it is greater, the candidate new point is determined to be a new point.
10. The method according to claim 7, characterized in that The updating of the global map and the neighboring key frames according to the observation probability of the dynamic map comprises: Determine a stable position point and an unstable position point in the dynamic map after the newly added point is determined according to the observation probability, wherein the stable position point is a position point whose observation probability is greater than a preset minimum static threshold, and the unstable position point is a position point whose observation probability is less than a preset minimum deletion threshold; Adding the stable position point to the global map and the neighboring keyframes; The unstable location point is deleted in the dynamic map.
11. The method according to claim 1, characterized in that: The performing a probability slow decay operation on the first global map according to the preset probability decay model, the first neighbor key frame and the first global map comprises: Determining a movement trajectory of the robot; Determine an observed key frame according to the movement trajectory and the first neighboring key frame; generating an observed local map according to the plurality of observed key frames and the first global map; A probability slow decay operation is performed on the first global map according to a preset probability decay model, the observed local map and the first global map.
12. The method according to claim 11, characterized in that The performing a probability slow decay operation on the first global map according to a preset probability decay model, the observed local map and the first global map comprises: Traversing the observed local map to determine the closest point in the global map that matches the observed local map location point; Determine whether the distance between the position point and the nearest matching point is less than a preset threshold; If it is less than, then performing a probability slow decay operation on the position point according to the probability decay model; and / or Traversing the movement trajectory to determine the closest point matching the movement trajectory in the global map; Determine whether the distance between the moving trajectory point and the matching closest point is less than a preset threshold; If it is less than, a probability slow decay operation is performed on the moving trajectory point according to the probability decay model.
13. The method according to claim 12, characterized in that After performing the probability slow decay operation on the first global map, the method further includes: Determining whether the observation probability of each location point in the global map is less than a preset minimum deletion probability; If it is less than, the location point is deleted from the global map.
14. The method according to claim 11, characterized in that Updating the target global map according to the second global map comprises: Determine whether the number of position points changed in each of the observed key frames is greater than a preset threshold; If it is greater than, then save and update the observed key frame; Determine whether the number of location points changed in the global map is greater than a preset threshold; If it is greater, the global map is saved and updated.
15. The method according to claim 1, characterized in that Before performing the probability slow decay operation on the first global map, the method further includes: Adding the current movement trajectory of the robot to the trajectory point cloud, wherein the movement trajectory includes a plurality of position points; Determining whether the number of position points in the trajectory point cloud is greater than a preset minimum probability decay interval; If yes, then performing a probability slow decay operation on the first global map; If not, a probability fast growth operation is performed on the current key frame and the target global map.
16. The method according to claim 1, characterized in that Before performing a probability slow decay operation on the first global map according to the preset probability decay model, the first neighbor key frame and the first global map, the method further includes: Determine whether the matching distance between the current frame and the global map is less than a preset maximum stable matching distance, and / or determine whether the angular velocity of the robot corresponding to the current frame is less than a preset maximum stable angular velocity, and / or determine whether the characteristic value of the current frame is greater than a preset maximum degradation threshold; If so, a probability fast growth operation is performed on the current key frame and the target global map.
17. The method according to any one of claims 1 to 16, characterized in that The preset probability growth model is configured with a probability growth increment, a probability maximum upper limit, a probability growth gradient, a first observation probability, and a second observation probability, wherein: The first observation probability is the observation probability of the position point before the probability growth is executed, the second observation probability is the observation probability of the position point after the probability growth is executed, and the probability growth gradient is the ratio of the first observation probability to the maximum upper limit of the probability; The second observation probability is determined by first multiplying the probability growth gradient by the probability growth increment to obtain a product, and then adding the first observation probability to the product to obtain a calculation result.
18. The method according to any one of claims 1 to 16, characterized in that The preset probability decay model is configured with a probability decay increment, a probability maximum upper limit, a probability decay gradient, a first observation probability, and a second observation probability, wherein: The first observation probability is the observation probability of the position point before probability decay is performed, the second observation probability is the observation probability of the position point after probability decay is performed, and the probability decay gradient is the ratio of the maximum upper limit of the probability to the first observation probability; The second observation probability is determined as a calculation result obtained by first multiplying the probability attenuation gradient by the probability attenuation increment and then subtracting the product from the first observation probability.
19. A robot, characterized in that: The robot comprises a memory and a processor, wherein the memory is connected to the processor, and the processor is used to execute one or more computer programs stored in the memory, and when the processor executes the one or more computer programs, the robot implements the method as described in any one of claims 1 to 18.
20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 18.
Citation Information
Cited By
Space-time diagram-based occupancy probability updating method, apparatus and device, and mobile tool
CN121030255A
Occupation probability update method, apparatus, equipment and mobility tool based on spatiotemporal graph
CN121030255B
Map updating method, path planning method, related device, equipment and medium
CN121346771A