Map updating method, robot, and storage medium
Patent Information
- Application Number
- CN202210367573.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-08
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2042-04-08
AI Technical Summary
但实际应用中环境可能改变,导致记录的历史地图和环境有差异,进而导致激光建图设备定位丢失
[0021]上述地图更新方法、装置、机器人及存储介质,通过将所述至少两个位姿节点中每一位姿节点对应的激光数据按照第一预设规则与预存的原始地图进行匹配,得到所述至少两个位姿节点中每个位姿节点与所述预存的原始地图之间的第一匹配结果;根据所述至少两个位姿节点中每个位姿节点的第一匹配结果,从所述至少两个位姿节点中确定出至少两个目标位姿节点,其中,所述至少两个目标位姿节点由位姿节点组中的位姿节点组成,所述位姿节点组由相邻的至少两个位姿节点组成,所述位姿节点组中包括至少一个目标位姿节点对应的激光数据与所述预存的原始地图的激光数据相匹配;根据所述至少两个目标位姿节点的位姿以及所述至少两个目标位姿节点对应的激光数据更新所述预存的原始地图。通过上述方式,本申请将机器人在运动过程中获得多个位姿节点以及每个位姿节点对应的激光数据,然后将位姿节点对应的激光数据与原始地图进行匹配,在存在创建时间连续的至少两个位姿节点的激光数据与原始地图匹配时,从与原始地图匹配的位姿节点中确定至少两个目标位姿节点,利用至少两个目标位姿节点更新原始地图中对应的区域,本申请以位姿节点对应的激光数据为最小单元与原始地图进行匹配,然后根据匹配结果选择出至少两个目标位姿节点,该其中,所述至少两个目标位姿节点由位姿节点组中的位姿节点组成,所述位姿节点组由相邻的至少两个位姿节点组成,所述位姿节点组中包括至少一个目标位姿节点对应的激光数据与所述预存的原始地图的激光数据相匹配,即根据匹配结果,选择连续多个目标位姿节点更新原始地图中对应区域,能够有效高了地图更新的准确度,并且能够在环境变化较大时也能实现地图更新,地图更新后,则能够提高其他设备使用更新后的地图,对其自身位置的进行更准确的定位,也即提高了定位的精度。
Smart Images

Figure CN116929327B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of map technology, and in particular to a map updating method, a robot, and a storage medium. Background Technology
[0002] Traditional laser mapping and localization obtains its real-time location by matching and comparing environmental features with recorded historical maps, and then adding newly scanned features to the map. However, in real-world applications, the environment may change, causing discrepancies between the recorded historical maps and the actual environment, which can lead to the loss of localization by the laser mapping equipment.
[0003] Currently, to solve the above problems, existing technologies use particle filtering to improve positioning accuracy. However, the improvement in positioning accuracy through particle filtering is limited. It is only effective when the environmental change is relatively small (generally less than 30%). When the environmental change exceeds 30%, the positioning accuracy is relatively low, and when the environmental change exceeds 50%, positioning will fail. Summary of the Invention
[0004] Therefore, it is necessary to provide a map update method, robot, and storage medium that can improve positioning accuracy in response to the above-mentioned technical problems.
[0005] In a first aspect, this application provides a robot, the robot including a memory and a processor, the memory storing a computer program executable on the processor, the processor executing the computer program to perform the following steps:
[0006] Acquire at least two pose nodes continuously created by the robot during its movement and the laser data corresponding to the at least two pose nodes;
[0007] The laser data corresponding to each pose node in the at least two pose nodes is matched with the pre-stored original map according to the first preset rule to obtain the first matching result between each pose node in the at least two pose nodes and the pre-stored original map.
[0008] Based on the first matching result of each of the at least two pose nodes, at least two target pose nodes are determined from the at least two pose nodes, wherein the at least two target pose nodes are composed of pose nodes in a pose node group, the pose node group is composed of at least two adjacent pose nodes, and the pose node group includes at least one target pose node whose corresponding laser data matches the laser data of the pre-stored original map;
[0009] The pre-stored original map is updated based on the poses of the at least two target pose nodes and the laser data corresponding to the at least two target pose nodes.
[0010] Secondly, this application also provides a map updating method, the method comprising:
[0011] Acquire at least two pose nodes continuously created by the robot during its movement and the laser data corresponding to the at least two pose nodes;
[0012] The laser data corresponding to each pose node in the at least two pose nodes is matched with the pre-stored original map according to the first preset rule to obtain the first matching result between each pose node in the at least two pose nodes and the pre-stored original map.
[0013] Based on the first matching result of each of the at least two pose nodes, at least two target pose nodes are determined from the at least two pose nodes, wherein the at least two target pose nodes are composed of pose nodes in a pose node group, the pose node group is composed of at least two adjacent pose nodes, and the pose node group includes at least one target pose node whose corresponding laser data matches the laser data of the pre-stored original map;
[0014] The pre-stored original map is updated using the laser data corresponding to the at least two target pose nodes based on their poses.
[0015] Thirdly, this application also provides a map updating device, the device comprising:
[0016] The first acquisition module is used to acquire at least two pose nodes continuously created by the robot during its movement and the laser data corresponding to the at least two pose nodes;
[0017] The first matching module is used to match the laser data corresponding to each pose node in the at least two pose nodes with the pre-stored original map according to the first preset rule, so as to obtain the first matching result between each pose node in the at least two pose nodes and the pre-stored original map.
[0018] The first determining module is used to determine at least two target pose nodes from the at least two pose nodes based on the first matching result of each pose node in the at least two pose nodes, wherein the at least two target pose nodes are composed of pose nodes in a pose node group, the pose node group is composed of at least two adjacent pose nodes, and the pose node group includes at least one target pose node whose corresponding laser data matches the laser data of the pre-stored original map;
[0019] The first update module is used to update the pre-stored original map based on the poses of the at least two target pose nodes and the laser data corresponding to the at least two target pose nodes.
[0020] Fourthly, this application also provides a computer-readable storage medium. When the computer program is executed by a processor, the computer-readable storage medium implements the steps of the method described above.
[0021] The aforementioned map updating method, apparatus, robot, and storage medium obtain a first matching result between each pose node and the pre-stored original map by matching the laser data corresponding to each pose node in the at least two pose nodes with a pre-stored original map according to a first preset rule; based on the first matching result of each pose node in the at least two pose nodes, at least two target pose nodes are determined from the at least two pose nodes, wherein the at least two target pose nodes are composed of pose nodes in a pose node group, the pose node group is composed of at least two adjacent pose nodes, and the pose node group includes at least one target pose node whose corresponding laser data matches the laser data of the pre-stored original map; the pre-stored original map is updated based on the poses of the at least two target pose nodes and the laser data corresponding to the at least two target pose nodes. In this application, the robot acquires multiple pose nodes and corresponding laser data during its movement. Then, the laser data corresponding to each pose node is matched with the original map. When at least two pose nodes with consecutive creation times match the laser data of the original map, at least two target pose nodes are determined from the pose nodes matched with the original map. The corresponding areas in the original map are updated using these at least two target pose nodes. This application uses the laser data corresponding to each pose node as the smallest unit for matching with the original map, and then selects at least two target pose nodes based on the matching results. Wherein, the... At least two target pose nodes are composed of pose nodes in a pose node group. The pose node group consists of at least two adjacent pose nodes. The pose node group includes at least one target pose node whose corresponding laser data is matched with the laser data of the pre-stored original map. That is, based on the matching result, multiple consecutive target pose nodes are selected to update the corresponding area in the original map, which can effectively improve the accuracy of map updates and can also achieve map updates when the environment changes significantly. After the map is updated, other devices can use the updated map to more accurately locate their own positions, which improves the positioning accuracy. Attached Figure Description
[0022] Figure 1 This is a flowchart illustrating a map update method in one embodiment;
[0023] Figure 2 This is a schematic diagram illustrating the process of creating pose nodes and subgraphs in one embodiment of this application;
[0024] Figure 3 This is a flowchart illustrating the map update method in another embodiment;
[0025] Figure 4 This is a structural block diagram of a map updating device in one embodiment;
[0026] Figure 5 This is a diagram of the internal structure of a robot in one embodiment. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0028] This application applies to robots such as robotic vacuum cleaners and shopping mall robots. These robots can use lasers to create a map of a specific area or update the original map of that area. In practical applications, the environment of the area corresponding to the map may change due to various reasons (movement of objects placed in the area). Obviously, if the robot continues to use the original map to perform the corresponding task, it will move to an unknown environment (a small area in the map whose environment has changed is unknown to the robot), and the robot will lose its position, i.e., localization failure.
[0029] In existing technologies, robots improve positioning accuracy through particle filtering. However, this method suffers from low accuracy when environmental changes exceed 30%, and fails to locate when environmental changes exceed 50%. This application addresses this by acquiring multiple pose nodes and corresponding laser data during robot movement. The laser data is then matched against an original map. When at least two pose nodes with consecutive creation times match the original map, at least two target pose nodes are identified from the matched nodes. These two target pose nodes are then used to update the corresponding areas in the original map. This application uses the laser data corresponding to a pose node as the smallest unit for matching against the original map, and then selects at least two target pose nodes based on the matching results. Each target pose node is composed of pose nodes in a pose node group. The pose node group consists of at least two adjacent pose nodes. The pose node group includes at least one target pose node whose corresponding laser data is matched with the laser data of the pre-stored original map. That is, based on the matching result, multiple consecutive target pose nodes are selected to update the corresponding area in the original map, which can effectively improve the accuracy of map updates and can also achieve map updates when the environment changes significantly. After the map is updated, other devices can use the updated map to more accurately locate their own positions, which improves the positioning accuracy.
[0030] In one embodiment, such as Figure 1 As shown, a map update method is provided, including the following steps:
[0031] Step S100: Obtain at least two pose nodes continuously created by the robot during its movement and the laser data corresponding to the at least two pose nodes.
[0032] The robot is a device equipped with laser scanning capabilities, and can be a shopping mall navigation robot, a floor cleaning robot, a map creation robot, or something similar. The robot uses its laser to scan the surrounding environment, obtaining corresponding laser data. This data is then compared with a pre-stored map to pinpoint its location, or the pre-stored map is updated based on newly acquired laser data.
[0033] To improve the accuracy of robot positioning, this application first places the robot in a work area for movement. This work area can be a room, a shopping mall, or an area with multiple rooms. The robot moves within the work area according to certain rules; for example, it can initially move in a straight line, and upon encountering an obstacle, it can turn and continue moving in a straight line.
[0034] During the robot's movement, pose nodes and corresponding laser data can be acquired. Specifically, this process may include: placing the robot in the area of the map to be updated, starting the robot, initializing the robot, and recording the current position as the first pose node. In a specific embodiment, any position can be selected as the first pose node during the robot's movement. Laser data captured by the robot at the first pose node is acquired. The robot is then controlled to continue moving. After moving a certain distance, the second pose node of the robot at that position is acquired, along with the laser data captured by the robot at that second pose node. This process is repeated to obtain multiple pose nodes and their corresponding laser data.
[0035] Step S110: Match the laser data corresponding to each pose node in the at least two pose nodes with the pre-stored original map according to the first preset rule to obtain the first matching result between each pose node in the at least two pose nodes and the pre-stored original map.
[0036] After acquiring the pose nodes and their corresponding laser data, the robot matches the laser data of each pose node with the pre-stored original map in the robot according to a first preset rule. It determines whether there exists an area in the preset original map that matches the laser data of each pose node, thus obtaining a matching result between the pose nodes and the pre-stored original map. This matching result is defined as the first matching result. The laser data of each pose node can be the laser data corresponding to all pose nodes created by the robot during movement, the laser data stored in the robot's memory, or the laser data corresponding to a preset number of newly created pose nodes, such as the laser data corresponding to the 100 most recently created pose nodes. Those skilled in the art can set these parameters according to actual needs; no limitation is made here. If the matching degree between the laser data of a pose node and a pose node in the original map is greater than a threshold (e.g., greater than 60%), then the pose node is considered to match the original map. The algorithm for calculating the matching degree can be any algorithm known to those skilled in the art; this application does not limit it.
[0037] Step S120: Based on the first matching result of each of the at least two pose nodes, determine at least two target pose nodes from the at least two pose nodes. The at least two target pose nodes are composed of pose nodes in a pose node group, which is composed of at least two adjacent pose nodes. The pose node group includes at least one target pose node whose corresponding laser data matches the laser data of the pre-stored original map.
[0038] Based on the first matching result obtained in step S110, at least two target pose nodes are determined from at least two pose nodes created by the robot during its movement. These at least two target pose nodes are composed of pose nodes in a pose node group, which consists of at least two adjacent pose nodes. Each pose node group includes at least one target pose node whose corresponding laser data matches the laser data of the pre-stored original map. In other words, multiple target pose nodes with consecutive creation times and matching the original map are selected based on the first matching result. When multiple consecutive pose nodes match the original map, the robot's position in the original map can be determined.
[0039] For example, taking the acquisition of at least two pose nodes continuously created by the robot during movement as an example, which is 100, the determination of at least two target pose nodes from the at least two pose nodes can include several scenarios: 1. The first 50 consecutive pose nodes match the original map, while the last 50 pose nodes do not match the original map. In this case, if the original map also contains 100 pose nodes, then all 100 pose nodes can be determined as target pose nodes. If the original map contains more than 100 pose nodes, then the 100 created pose nodes can also be used as target pose nodes. Alternatively, 50 pose nodes can be used as target pose nodes first, and subsequent nodes can be determined as target pose nodes after graph optimization based on the actual situation. 2. Pose nodes created in consecutive time and matching the original map include multiple consecutive pose nodes. For example, the first 10 pose nodes created in consecutive time match the original map, pose nodes created from the 11th to the 30th do not match the original map, pose nodes created from the 31st to the 55th match the original map, pose nodes created from the 56th to the 68th do not match the original map, pose nodes created from the 69th to the 90th match the original map, and pose nodes created from the 91st to the 100th do not match the original map. That is, pose nodes 1-10, 31-55, and 69-90 match the original map, while the remaining pose nodes do not match the original map. In this case, 100 pose nodes can be used as target pose nodes, or pose nodes 11-31, 56-69, and 90-100 can be used as target pose nodes.
[0040] Step S130: Update the pre-stored original map using the laser data corresponding to the at least two target pose nodes based on their poses.
[0041] Based on the multiple target pose nodes determined in step S120, the pre-stored original map is updated using the laser data corresponding to the multiple target pose nodes.
[0042] For example, taking the acquisition of at least two pose nodes continuously created by the robot during movement as an example, which totals 100, the determination of at least two target pose nodes from these at least two pose nodes can include several scenarios: 1. The first 50 consecutive pose nodes match the original map, while the last 50 pose nodes do not match the original map. In this case, if the original map also contains 100 pose nodes, it indicates that the environmental change corresponding to the original map is equal to 50%. The entire map can be updated based on the 100 pose nodes. 2. Pose nodes created consecutively and matching the original map include multiple consecutive pose nodes. For example, the first 10 pose nodes created consecutively match the original map, pose nodes created from the 11th to the 30th do not match the original map, pose nodes created from the 31st to the 55th match the original map, pose nodes created from the 56th to the 68th do not match the original map, pose nodes created from the 69th to the 90th match the original map, and pose nodes created from the 91st to the 100th do not match the original map. That is, pose nodes 1-10, 31-55, and 69-90 match the original map, while the remaining pose nodes do not match the original map. If the original map also contains 100 pose nodes, then these 100 pose nodes can be used as target pose nodes to update the original map. In this case, the environmental change rate is 53%.
[0043] As described above, at least two target pose nodes can include pose nodes that do not match the original map. Furthermore, even with significant environmental changes, the original map can still be updated, improving the localization success rate.
[0044] The above map update method involves matching the laser data corresponding to each pose node in the at least two pose nodes with a pre-stored original map according to a first preset rule to obtain a first matching result between each pose node in the at least two pose nodes and the pre-stored original map; determining at least two target pose nodes from the at least two pose nodes based on the first matching result of each pose node in the at least two pose nodes, wherein the at least two target pose nodes are composed of pose nodes in a pose node group, the pose node group is composed of at least two adjacent pose nodes, and the pose node group includes at least one target pose node whose corresponding laser data matches the laser data of the pre-stored original map; and updating the pre-stored original map based on the poses of the at least two target pose nodes and the laser data corresponding to the at least two target pose nodes. In this application, the robot acquires multiple pose nodes and corresponding laser data during its movement. Then, the laser data corresponding to each pose node is matched with the original map. When at least two pose nodes with consecutive creation times match the laser data of the original map, at least two target pose nodes are determined from the pose nodes matched with the original map. The corresponding areas in the original map are updated using these at least two target pose nodes. This application uses the laser data corresponding to each pose node as the smallest unit for matching with the original map, and then selects at least two target pose nodes based on the matching results. Wherein, the... At least two target pose nodes are composed of pose nodes in a pose node group. The pose node group consists of at least two adjacent pose nodes. The pose node group includes at least one target pose node whose corresponding laser data is matched with the laser data of the pre-stored original map. That is, based on the matching result, multiple consecutive target pose nodes are selected to update the corresponding area in the original map, which can effectively improve the accuracy of map updates and can also achieve map updates when the environment changes significantly. After the map is updated, other devices can use the updated map to more accurately locate their own positions, which improves the positioning accuracy.
[0045] Furthermore, based on the above embodiments, the step of acquiring at least two pose nodes continuously created by the robot during its movement and the laser data corresponding to each of the at least two pose nodes may include:
[0046] A new pose node is created every time the robot moves a preset distance to obtain the at least two pose nodes. When the robot is at a new pose node, the laser data obtained by the laser sensor is used as the laser data corresponding to the new pose node to obtain the laser data corresponding to each of the at least two pose nodes.
[0047] Based on the above implementation, as one embodiment, the process of creating the corresponding pose node may include: placing the robot in the area of the map to be updated, starting the robot, initializing the robot, and recording the current position as the first pose node. Of course, in a specific embodiment, any position can be selected as the first pose node during the robot's movement. Laser data captured by a laser when the robot is at the first pose node is obtained. Then, the robot is controlled to continue moving, and the robot's movement distance is obtained through the wheel odometry. After the movement distance equals a preset distance, a second pose node of the robot at that position is created, along with the laser data captured by the robot at the second pose node. This process is repeated, obtaining the corresponding pose node and the corresponding laser data for each preset distance. Optionally, the preset distance can be 0.2 meters, but in a specific implementation, it can be set to other values. Alternatively, the preset distance can be replaced with an interval, such as the distance between adjacent pose nodes being within an interval, for example, between [0.1 meters, 0.3 meters]. This is not limited here.
[0048] Furthermore, based on the above embodiments, the step of acquiring at least two pose nodes continuously created by the robot during its movement and the laser data corresponding to each of the at least two pose nodes may include:
[0049] If the deflection angle of the robot at its current position relative to the position corresponding to the previous pose node is greater than a preset deflection angle, a new pose node is created to obtain the at least two pose nodes. When the robot is at the new pose node, the laser data obtained by the laser sensor is used as the laser data corresponding to the new pose node, so as to obtain the laser data corresponding to each of the at least two pose nodes.
[0050] As another embodiment, the robot's deflection angle can be obtained through a gyroscope or magnetic recorder during its movement. In practice, other sensors or algorithms can also be used to obtain the deflection angle. If the deflection angle is greater than a preset angle, a new pose node is created. It should be noted that to ensure overlap in the laser data of adjacent nodes and improve the accuracy of map updates, the preset angle can be set to 5 degrees. In practice, the preset angle can be adjusted according to actual conditions.
[0051] It should be understood that, in the actual process of creating pose nodes, pose nodes can also be created based on the robot's movement distance and deflection angle.
[0052] Based on the above embodiments, it should be understood that the preset distance between newly created adjacent pose nodes should not be too large. If the distance between adjacent pose nodes is too large, it is easy to cause the laser data corresponding to the later node to have a low matching rate with the laser data of other nodes before that pose node. Similarly, the deflection angle should not be too large either.
[0053] Furthermore, the robot is equipped with a wheeled odometer, and updates the pre-stored original map using the laser data corresponding to the at least two target pose nodes based on their poses, including:
[0054] The robot obtains the pose uploaded by the wheel odometry when it is at the corresponding position of each of the at least two target pose nodes, and uses the pose uploaded by the wheel odometry as the first pose corresponding to the target pose node.
[0055] Based on the matching result between each target pose node and the pre-stored original map, determine the second pose corresponding to each target pose node;
[0056] Graph optimization processing is performed on the first pose and the second pose corresponding to each target pose node to obtain the target pose corresponding to each target pose node.
[0057] Based on the target pose of each target pose node, the pre-stored original map is updated using the laser data corresponding to each target pose node.
[0058] In this embodiment, the robot is equipped with a wheeled odometry system. The previous pose of the wheeled odometry system is used as the first pose corresponding to the pose node. The pose includes, but is not limited to, the robot's location coordinates, ID, and time. Before updating the original map, this embodiment performs graph optimization on the first poses of at least two determined target pose nodes and the second pose in the original map corresponding to each target pose node, thereby obtaining the target pose of each target pose node. Those skilled in the art can use existing algorithms to obtain the target pose corresponding to the robot using the first and second poses. Then, the original map is updated using the optimized target poses of the target pose nodes.
[0059] Furthermore, the robot is equipped with a wheeled odometer, which updates the pre-stored original map using the laser data corresponding to at least two target pose nodes based on their poses, including:
[0060] Obtain the pose uploaded by the wheel odometry when the robot is at the corresponding position of each target pose node in at least two target pose nodes, and use the pose uploaded by the wheel odometry as the first pose corresponding to the target pose node.
[0061] Based on the matching results between each target pose node and the pre-stored original map, determine the second pose corresponding to each target pose node.
[0062] Determine the target subgraph with the first constraint relationship for each target pose node, and take the subgraphs in all subgraphs except the target subgraph corresponding to the current target pose node as the target subgraph to be matched corresponding to the current target pose node;
[0063] Match the laser data corresponding to the current target pose node with the laser data in the target sub-image to be matched, and calculate the fourth pose corresponding to the current target pose node based on the matching result.
[0064] Graph optimization is performed on the first pose, the second pose, and the fourth pose of each target pose node to obtain the target pose corresponding to each target pose node.
[0065] Based on the target pose of each target pose node, the pre-stored original map is updated using the laser data corresponding to each target pose node.
[0066] Furthermore, after using the pose uploaded by the wheel odometer as the first pose corresponding to the target pose node, the processor, when executing the computer program, also performs the following steps:
[0067] A subgraph with the first constraint relationship is determined for each target pose node, and a third pose corresponding to each target pose node is determined based on the laser data corresponding to each target pose node and the laser data in the subgraph with the first constraint relationship for each target pose node, and the third pose is used to replace the first pose.
[0068] In this embodiment, a subgraph is first created, and the constraint relationship between the pose node and the subgraph is established. Then, when updating the original map, the laser data of the target pose node can be used to calculate the third pose of the target pose node (i.e., the pose after graph optimization) with the subgraph. Then, the third pose of the target pose node is used to update the original map.
[0069] The step of creating a subgraph includes: after creating a new pose node, the processor, when executing the computer program, further implements the following steps:
[0070] A subgraph is created, and the first constraint relationship is established between the new pose node and the subgraph. The third pose corresponding to the new pose node is determined according to the second preset rule. Based on the third pose corresponding to the new pose node, the laser data corresponding to the new pose node is updated to the laser data of the subgraph that has the first constraint relationship with the new pose node.
[0071] Simultaneously with the creation of the first pose node, an empty subgraph can also be created. Subgraph creation can also occur at other times, such as before creating the first pose node, or after creating the first pose node and before creating the second pose node. After obtaining each pose node and its corresponding laser data, the laser data corresponding to each pose node is inserted into the subgraph. Each subgraph can hold a first preset number of consecutive laser data points. During the insertion of the laser data corresponding to each pose node into the subgraph, corresponding graph optimization is also performed. Specifically, the graph optimization process includes: graph optimization between the newly created pose node and the data in the corresponding subgraph. For example, when the laser data of the fourth created pose node is inserted into the subgraph, graph optimization is performed between the laser data of the fourth created pose node and the laser data of the three pose nodes (the first to third created pose nodes) in the subgraph. This graph optimization process can employ any method known to those skilled in the art, and is not limited here.
[0072] It should be understood that multiple pose nodes can be created during the robot's movement. Once the number of laser data points contained in the first sub-map equals a first preset number, a second sub-map will be created, and so on, thus creating multiple sub-maps. To achieve a complete update of the work area map, it is necessary to control the laser data acquired by the robot within the work area to cover the entire work area, forming a closed loop in the scan map. That is, the movement path within the work area can be a closed loop, allowing the robot to acquire multiple laser data points, which can encompass the entire work area.
[0073] It should be noted that the laser data contained in each subgraph is the laser data corresponding to consecutive pose nodes. The reason why the laser data contained in each subgraph is the laser data corresponding to consecutive pose nodes is to ensure the accuracy of the pose of each pose node and to facilitate graph optimization processing using adjacent poses.
[0074] Optionally, the first preset quantity can be 50, and the first preset quantity can be set according to the actual situation in specific implementation.
[0075] In this embodiment, creating a subgraph improves the accuracy of matching degree calculation and graph optimization. For example, if the laser data obtained by pose node A and pose node B are perpendicular to each other, the robot creates pose nodes on the two sides of a right angle and obtains laser data facing the intersection of the right angles. The laser data obtained by pose node C, created between the two sides, has a matching degree of almost 0 with pose nodes A and B (i.e., they cannot match). However, if the subgraph includes the fused laser data of pose nodes A and B, then pose node C can match with the subgraph (matching degree greater than 50%). This improves the accuracy of matching degree between pose nodes and lays the foundation for graph optimization, thus enhancing the accuracy of graph optimization.
[0076] When multiple subgraphs exist, the step of inserting a pose segment into a subgraph includes:
[0077] Match the laser data corresponding to the pose node of the current sub-image with the previous sub-image adjacent to the current sub-image;
[0078] The laser data corresponding to the pose node after matching the previous subgraph is inserted into the current subgraph and the previous subgraph, so that the number of laser data in the previous subgraph is equal to the first preset number.
[0079] Based on the above embodiments, in this embodiment, for ease of explanation, a first preset quantity of 4 is used as an example for illustration, such as... Figure 2 The steps include: creating a subgraph, establishing a first constraint relationship between the new pose node and the subgraph, determining the third pose corresponding to the new pose node according to a second preset rule, and updating the laser data corresponding to the new pose node to the laser data of the subgraph with the first constraint relationship with the new pose node based on the third pose.
[0080] When the number of pose nodes with the first constraint relationship in the subgraph is greater than a first preset number, a new subgraph is created;
[0081] After creating the new subgraph, obtain a second preset number of pose nodes;
[0082] Each of the second preset number of pose nodes is associated with the subgraph and the new subgraph to create the first constraint relationship, and the third pose corresponding to each of the second preset number of pose nodes is determined according to the second preset rule.
[0083] Based on the third pose corresponding to each pose node in the second preset number of pose nodes, the laser data corresponding to each pose node in the second preset number of pose nodes is updated to the laser data of the subgraph that has the first constraint relationship with the corresponding pose node in the second preset number of pose nodes.
[0084] Specifically, during the robot's movement, the first pose node X0 is created, and the laser data corresponding to X0 is obtained. Before creating the first pose node X0, the first sub-graph S1 is created (S1 can also be created at other times, such as before creating X1). At this time, the sub-graph S1 is empty. After creating X0, the laser data of X0 can be inserted into the sub-graph S1, and the robot is controlled to continue moving. When it reaches a position 0.2m away from the first pose node X0, the second pose node X1 is created, and the laser data corresponding to X1 is obtained. Then, the laser data corresponding to X1 is inserted into S1 (as another embodiment, X0 and X1 can also be inserted into S1 together).
[0085] As the robot continues to move, when it reaches a position 0.2m away from the second pose node X1, a third pose node X2 is created, and the laser data corresponding to X2 is obtained. At this point, the first sub-image S1 already includes the first preset number (2) laser data points, so the second sub-image S2 can be created. The laser data corresponding to X2 is matched with the first sub-image S1. Since the distances between X2 and X0 and X1 in S1 are relatively close, and the robot has not deflected or the deflection angle is very small, the laser data corresponding to X2 and X0 and X1 contain most of the same content. The matching process is mainly to optimize each image based on the comparison of laser data. The reason for image optimization is that the image obtained by the robot using laser may be unclear due to environmental factors (such as insufficient lighting) or defects in the laser shooting itself (such as errors in the odometer's mileage calculation). Therefore, the matching process can also optimize the laser data accordingly to obtain laser data with clearer images and more accurate pose node positions. Specifically, the matching process includes: first, calculating the matching degree between the images to be matched; only if the matching degree exceeds a preset matching threshold is the graph optimization process performed; if the matching degree is lower than the preset matching threshold, it indicates that the images to be matched are significantly different, and there is no need for graph optimization. For example, when matching X3 and S1, the matching degree of X0, X1, and X2 in X3 and S1 is first calculated. Since X3 is close to X0, X1, and X2 in S1, the image overlap is high, i.e., the matching degree is high. Therefore, corresponding graph optimization is performed on X3 and / or S1. The specific process of graph optimization can be based on existing technology and will not be described in detail here.
[0086] After graph optimization, the optimized X2 (the third pose of the pose node after graph optimization) is inserted into the first subgraph S1 and the second subgraph S2. (As another embodiment, after graph optimization of X1 and X2, the optimized X1 and X2 can also be inserted together into the first subgraph S1 and the second subgraph S2).
[0087] Continue controlling the robot's movement. When it reaches a position 0.2m away from the third pose node X2, create the fourth pose node X3 and obtain the laser data corresponding to X3. Match the laser data corresponding to X3 with S1. The matching process is the same as the matching process between X2 and S1. After matching, insert the matched X3 into S1 and S2. At this time, S1 includes a second preset number of laser data (in this embodiment, the second preset number is 4). Create a new subgraph S3. In other embodiments, the second preset number can be greater than the first preset number.
[0088] Based on the above description, pose nodes X4, X5, X6, and X7 are created sequentially. X4 and X5 are inserted into S2 and S3, and X6 and X7 are inserted into S3. It should be understood that the actual number of pose nodes may not be an integer multiple of the first preset number. That is, after all pose nodes are inserted into their corresponding subgraphs, the number of laser data points in the last created subgraph may be less than the first preset number. However, the laser data in the last created subgraph will undergo the same operations as the pose nodes in other subgraphs. Adjacent subgraphs mainly refer to those created in adjacent order, such as S1 and S2 being adjacent, and S2 and S3 being adjacent.
[0089] When inserting each pose node into the corresponding subgraph, constraints between the pose node and the corresponding subgraph can be established simultaneously (defined as the first constraint relationship). For example, when x2 is inserted into S1 and S2, constraints between x2 and S1 and S2 are established respectively. Figure 2 As shown, the constraints include: the constraint relationship between any pose node in x0-x3 and subgraph S1, the constraint relationship between any pose node in x2-x5 and subgraph S2, and the constraint relationship between any pose node in x4-x7 and subgraph S3. Of course, establishing the constraint relationship between pose nodes and their corresponding subgraphs can also be done before each pose node is inserted into its corresponding subgraph; this is not a limitation here.
[0090] Further, determining the third pose corresponding to the new pose node according to the second preset rule includes:
[0091] Determine the subgraph with the first constraint relationship for the new pose node;
[0092] If the new pose node has the first constraint relationship with the two subgraphs, then based on the creation time of the two subgraphs, the subgraph with the earlier creation time is taken as the target subgraph, the laser data corresponding to the new pose node is matched with the laser data in the target subgraph, and the third pose corresponding to the new pose node is calculated based on the matching result.
[0093] If a new pose node has the first constraint relationship with a subgraph, then the subgraph is taken as the target subgraph. When there is laser data in the target subgraph, the laser data corresponding to the new pose node is matched with the laser data in the target subgraph, and the third pose corresponding to the new pose node is calculated based on the matching result.
[0094] If the new pose node has the first constraint relationship with a subgraph, then the subgraph is taken as the target subgraph. When there is no laser data in the target subgraph, the pose of the robot at the position of the new pose node is obtained by the wheel odometry and taken as the first pose. The first pose is directly taken as the third pose of the new pose node.
[0095] As one embodiment, the process of determining the third pose corresponding to the new pose node may include: based on the above implementation, such as Figure 2 As shown, in this embodiment, the constraint relationships between the newly created pose nodes and their corresponding subgraphs can be established first. Then, graph optimization of the pose nodes is performed based on the constraint relationships between the pose nodes and the subgraphs to obtain the third pose of the pose nodes. Specifically, the subgraphs with the first constraint relationships of the new pose nodes are determined. There are two possible outcomes: 1. The new pose node has the first constraint relationship with two subgraphs, such as... Figure 2 1. All x2-x5 nodes have the first constraint relationship with two subgraphs; 2. A new pose node has the first constraint relationship with a subgraph, such as... Figure 2 x0, x1, x6, and x7 in a subgraph have constraint relationships.
[0096] If the new pose node has the first constraint relationship with the two subgraphs, since the data in the previously created subgraph is relatively more, the subgraph with the earlier creation time is taken as the target subgraph based on the creation time of the two subgraphs. The laser data corresponding to the new pose node is matched with the laser data in the target subgraph, and the third pose corresponding to the new pose node is calculated based on the matching result. For example, when the newly created pose node is x2, x2 is matched with subgraph S1, and the third pose of x2 is calculated.
[0097] If a new pose node has the first constraint relationship with a subgraph, then that subgraph is taken as the target subgraph. If there is laser data in the target subgraph, the laser data corresponding to the new pose node is matched with the laser data in the target subgraph, and the third pose corresponding to the new pose node is calculated based on the matching result. For example, when the newly created pose node is x6, x6 is matched with subgraph S3, and the third pose of x6 is calculated. When there is no laser data in the target subgraph, the pose of the robot at the position of the new pose node is obtained through the wheel odometry as the first pose, and the first pose is directly used as the third pose of the new pose node. For example, when the newly created pose node is x0, subgraph S1 is empty, and the first coordinate of x0 is used as the third pose of x0.
[0098] As another embodiment, when creating a new pose node, it is also possible not to establish a constraint relationship with the subgraph. Instead, the third pose of the new pose node can be obtained by directly connecting the new pose node with the subgraph that was created earlier in the inserted subgraph. For example, x0 will be inserted into subgraph S1, and the first pose of x0 is the third pose of x0. x2 will be inserted into S1 and S2, and the third pose of x2 can be calculated based on x2 and S1.
[0099] As another embodiment, when there are two or more sub-graphs, after replacing the first pose with the third pose, the processor, when executing the computer program, further implements the following steps:
[0100] All subgraphs except the target subgraph corresponding to the current target pose node are taken as the target subgraph to be matched corresponding to the current target pose node;
[0101] The laser data corresponding to the current target pose node is matched with the laser data in the target sub-image to be matched, and the fourth pose corresponding to the current target pose node is calculated based on the matching result.
[0102] Correspondingly, graph optimization processing is performed on the first pose corresponding to each target pose node and the second pose corresponding to each target pose node to obtain the target pose corresponding to each target pose node, including:
[0103] Graph optimization processing is performed on the first pose, the second pose, and the fourth pose of each target pose node to obtain the target pose corresponding to each target pose node.
[0104] Specifically, to improve the accuracy of laser data for pose nodes, a second graph optimization is performed in this embodiment. For example, such as... Figure 2As shown, after graph optimization of pose node x2 with subgraph S1, graph optimization can also be performed on x2 with S2 and S3 respectively. That is, graph optimization is performed on the pose node (x2) with other subgraphs (S2 and S3) other than the target subgraph (the target subgraph of x2 is S1). For ease of description, the other subgraphs are defined as subgraphs to be matched, thereby obtaining the fourth pose of the pose node. After obtaining the fourth pose, graph optimization can be performed based on the first pose, second pose and fourth pose of the pose node to further obtain the target pose of the pose node (i.e., the optimized pose).
[0105] Specifically, the process involves matching the laser data corresponding to the current target pose node with the laser data in the target sub-graph to be matched, and calculating the fourth pose corresponding to the current target pose node based on the matching result, including:
[0106] The laser data corresponding to the current target pose node is matched with the laser data in the target sub-graph to be matched according to the second preset rule to obtain the second matching result;
[0107] Based on the second matching result, a first target subgraph matching the current target pose node is selected from the target subgraph to be matched, and the fourth pose corresponding to the current target pose node is determined based on the current target pose node and the first target subgraph matching the current target pose node.
[0108] As another embodiment, the target pose node can be matched with the laser data in the target sub-graph (excluding the pose node) to obtain a second matching result. Based on the second matching result, the sub-graph that matches the target pose node can be selected from the sub-graph to be matched for graph optimization, thereby reducing the amount of computation and saving computing resources.
[0109] Furthermore, based on the above embodiments, such as Figure 3 As shown, the method further includes:
[0110] Step S310: Obtain the number of subgraphs in memory;
[0111] Step S320: When the number of subgraphs is greater than or equal to a third preset number, graph optimization processing is performed on the first pose corresponding to each target pose node and the second pose corresponding to each target pose node to obtain the target pose corresponding to each target pose node. The third preset number is a natural number greater than or equal to 3.
[0112] To improve computational efficiency and save memory overhead, in this embodiment, steps S310 and S320 can be interspersed throughout the entire operation. Specifically, during operation, the number of subgraphs in memory is monitored. When the number of subgraphs in memory is greater than or equal to a third preset number, graph optimization processing is performed on the first pose and the second pose corresponding to each target pose node in memory. The third preset number is a natural number greater than or equal to 3; for example, the third preset number is 3. In this way, graph optimization is performed once every certain number of subgraphs in memory, limiting the number of calculations performed in memory each time, thus saving memory overhead and improving computational efficiency.
[0113] Furthermore, the method also includes:
[0114] The newly created fourth preset number of subgraphs are selected as the retained subgraphs, and all other subgraphs are selected as the discarded subgraphs.
[0115] Furthermore, the pose nodes of the discarded subgraph that have the first constraint relationship are taken as the discarded pose nodes.
[0116] The discarded subgraph, the discarded pose node, and the laser data corresponding to the discarded pose node are discarded.
[0117] The fourth preset quantity is less than the third preset quantity.
[0118] To further reduce memory consumption, this embodiment also discards some sub-graphs and their corresponding pose nodes after optimizing the graph in memory, retaining only the latest fourth preset number of sub-graphs. This reduces the amount of data in memory, achieving the effect of saving memory consumption. The fourth preset number is less than the third preset number. Specifically, after graph optimization, the two most recently created sub-graphs can be retained to facilitate the insertion of new pose nodes into new sub-graphs. Other sub-graphs and their corresponding pose nodes, as well as the laser data of the pose nodes (pose nodes with constraints on the sub-graphs), are discarded from memory. It should be understood that discarding some sub-graphs and their corresponding pose nodes from memory only means discarding them from memory, not deleting them from the robot. The discarded data is already stored in the robot's storage medium and can be retrieved from the storage medium back into memory when needed.
[0119] Furthermore, before discarding the discarded subgraph, the discarded pose node, and the laser data corresponding to the discarded pose node, the processor is also configured to perform the following steps when executing the computer program:
[0120] Determine whether the discarded pose node has the first constraint relationship with the retained subgraph;
[0121] When the discarded pose node and the retained subgraph have the first constraint relationship, the discarded pose node is modified into a retained pose node.
[0122] To avoid accidentally deleting pose nodes from memory, or to ensure that the pose node is still needed and is not deleted, a judgment can be made before deletion to determine whether the discarded pose node has the first constraint relationship with the retained subgraph. If the discarded pose node has the first constraint relationship with the retained subgraph, the discarded pose node is modified into a retained pose node.
[0123] Furthermore, based on the above embodiments, the method further includes:
[0124] Match the laser data corresponding to the currently created pose node with each subgraph in memory;
[0125] Establish the constraint relationships between the currently created pose node and the subgraph that matches the currently created pose node.
[0126] To improve graph optimization accuracy and lay the foundation for subsequent updates to the original map, this embodiment also establishes constraint relationships between each pose node and other subgraphs (other subgraphs refer to subgraphs that do not include the laser data corresponding to the pose node; for example, S1 is another subgraph relative to pose node X7). As another embodiment, constraint relationships between pose nodes can also be established. Specifically, after each pose node is created, the laser data corresponding to the currently created pose node can be matched with each subgraph. For example, the laser data corresponding to the currently created pose node can be matched with each subgraph. Figure 2 The laser data corresponding to X6 is matched with S1, S2 and S3 respectively. If X6 matches S1, a constraint relationship between X6 and S1 can be established. If the matching degree between X6 and S1 is low, such as less than 50%, a constraint relationship between X6 and S1 is not established.
[0127] Furthermore, based on the above embodiments, the method further includes:
[0128] Based on the constraints and the updated original map, perform graph optimization on the updated original map.
[0129] The more constraints between subgraphs and pose nodes, the easier it is to update the original map later. If a subgraph matches a region of the original map, the original map can be updated based on the constraints between subgraphs and between subgraphs and pose nodes. For example, updating the corresponding region in the subgraph and the region surrounding that region in the original map. In this embodiment, when matching pose nodes with the original map, a second constraint relationship can be established between the pose node matched with the original map and the original map, facilitating subsequent use. Similarly, during graph optimization, constraints can provide basic data. The constraints and the updated original map can be used as input parameters, and appropriate graph optimization algorithms can be used to further optimize the updated original map, thereby improving its accuracy and ultimately enhancing the robot's localization accuracy when using the updated original map.
[0130] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0131] Based on the same inventive concept, this application also provides a map updating apparatus for implementing the map updating method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more map updating apparatus embodiments provided below can be found in the limitations of the map updating method described above, and will not be repeated here.
[0132] In one embodiment, such as Figure 4 As shown, a map updating device is provided, including:
[0133] The first acquisition module 401 is used to acquire at least two pose nodes continuously created by the robot during its movement and the laser data corresponding to the at least two pose nodes.
[0134] The first acquisition module 402 is used to match the laser data corresponding to each pose node in the at least two pose nodes with a pre-stored original map according to a first preset rule, thereby obtaining a first matching result between each pose node in the at least two pose nodes and the pre-stored original map;
[0135] The first determining module 403 is used to determine at least two target pose nodes from the at least two pose nodes based on the first matching result of each pose node in the at least two pose nodes, wherein the at least two target pose nodes are composed of pose nodes in a pose node group, the pose node group is composed of at least two adjacent pose nodes, and the pose node group includes at least one target pose node whose corresponding laser data matches the laser data of the pre-stored original map;
[0136] The first update module 404 is used to update the pre-stored original map based on the poses of the at least two target pose nodes and the laser data corresponding to the at least two target pose nodes.
[0137] Furthermore, the first acquisition module 401 is also used to create new pose nodes when the robot moves a preset interval distance to obtain the at least two pose nodes, and when the robot is in a new pose node, the laser data acquired by the laser sensor is used as the laser data corresponding to the new pose node to obtain the laser data corresponding to each of the at least two pose nodes.
[0138] or,
[0139] If the deflection angle of the robot at its current position relative to the position corresponding to the previous pose node is greater than a preset deflection angle, a new pose node is created to obtain the at least two pose nodes. When the robot is at the new pose node, the laser data obtained by the laser sensor is used as the laser data corresponding to the new pose node, so as to obtain the laser data corresponding to each of the at least two pose nodes.
[0140] Furthermore, the first update module 404 is also used for:
[0141] The robot obtains the pose uploaded by the wheel odometry when it is at the corresponding position of each of the at least two target pose nodes, and uses the pose uploaded by the wheel odometry as the first pose corresponding to the target pose node.
[0142] Based on the matching result between each target pose node and the pre-stored original map, determine the second pose corresponding to each target pose node;
[0143] Graph optimization processing is performed on the first pose and the second pose corresponding to each target pose node to obtain the target pose corresponding to each target pose node.
[0144] Based on the target pose of each target pose node, the pre-stored original map is updated using the laser data corresponding to each target pose node.
[0145] Furthermore, the device also includes:
[0146] The subgraph creation module (not shown) is used to create a subgraph, establish the first constraint relationship between the new pose node and the subgraph, determine the third pose corresponding to the new pose node according to the second preset rule, and update the laser data corresponding to the new pose node to the laser data of the subgraph that has the first constraint relationship with the new pose node according to the third pose corresponding to the new pose node.
[0147] Furthermore, the device also includes:
[0148] The first pose acquisition module (not shown in the figure) is used to determine the subgraph with the first constraint relationship for each target pose node, and to determine the third pose corresponding to each target pose node based on the laser data corresponding to each target pose node and the laser data in the subgraph with the first constraint relationship for each target pose node, and to replace the first pose with the third pose.
[0149] Furthermore, the first pose acquisition module is also used for:
[0150] Determine a subgraph with the first constraint relationship for each target pose node;
[0151] If the current target pose node has the first constraint relationship with the two subgraphs, then the subgraph with the earlier creation time among the two subgraphs is taken as the target subgraph according to the creation time of the two subgraphs.
[0152] The laser data corresponding to the current target pose node is matched with the laser data in the target sub-graph, and the third pose corresponding to the current target pose node is calculated based on the matching result.
[0153] Furthermore, the first pose acquisition module is also used for:
[0154] If the new pose node has the first constraint relationship with the two subgraphs, then based on the creation time of the two subgraphs, the subgraph with the earlier creation time is taken as the target subgraph, the laser data corresponding to the new pose node is matched with the laser data in the target subgraph, and the third pose corresponding to the new pose node is calculated based on the matching result.
[0155] If a new pose node has the first constraint relationship with a subgraph, then the subgraph is taken as the target subgraph. When there is laser data in the target subgraph, the laser data corresponding to the new pose node is matched with the laser data in the target subgraph, and the third pose corresponding to the new pose node is calculated based on the matching result.
[0156] If the new pose node has the first constraint relationship with a subgraph, then the subgraph is taken as the target subgraph. When there is no laser data in the target subgraph, the pose of the robot at the position of the new pose node is obtained by the wheel odometry and taken as the first pose. The first pose is directly taken as the third pose of the new pose node.
[0157] Furthermore, since there are two or more sub-graphs, the device also includes: a second pose acquisition module (not shown), used for:
[0158] All subgraphs except the target subgraph corresponding to the current target pose node are taken as the target subgraph to be matched corresponding to the current target pose node;
[0159] The laser data corresponding to the current target pose node is matched with the laser data in the target sub-image to be matched, and the fourth pose corresponding to the current target pose node is calculated based on the matching result.
[0160] Correspondingly, the first update module 404 is also used for
[0161] Graph optimization processing is performed on the first pose, the second pose, and the fourth pose of each target pose node to obtain the target pose corresponding to each target pose node.
[0162] Furthermore, the second pose acquisition module is also used for:
[0163] The laser data corresponding to the current target pose node is matched with the laser data in the target sub-graph to be matched according to the second preset rule to obtain the second matching result;
[0164] Based on the second matching result, a first target subgraph matching the current target pose node is selected from the target subgraph to be matched, and the fourth pose corresponding to the current target pose node is determined based on the current target pose node and the first target subgraph matching the current target pose node.
[0165] Furthermore, the subgraph creation module is also used for:
[0166] When the number of pose nodes with the first constraint relationship in the subgraph is greater than a first preset number, a new subgraph is created;
[0167] After creating the new subgraph, obtain a second preset number of pose nodes;
[0168] Each of the second preset number of pose nodes is associated with the subgraph and the new subgraph to create the first constraint relationship, and the third pose corresponding to each of the second preset number of pose nodes is determined according to the second preset rule.
[0169] Based on the third pose corresponding to each pose node in the second preset number of pose nodes, the laser data corresponding to each pose node in the second preset number of pose nodes is updated to the laser data of the subgraph that has the first constraint relationship with the corresponding pose node in the second preset number of pose nodes.
[0170] Furthermore, the device also includes:
[0171] The subgraph acquisition module (not shown in the diagram) is used to obtain the number of subgraphs;
[0172] The graph optimization module (not shown) is used to perform graph optimization processing on the first pose and the second pose corresponding to each target pose node when the number of subgraphs is greater than or equal to a third preset number, so as to obtain the target pose corresponding to each target pose node. The third preset number is a natural number greater than or equal to 3.
[0173] Furthermore, the device is also used for:
[0174] The newly created fourth preset number of subgraphs are selected as the retained subgraphs, and all other subgraphs are selected as the discarded subgraphs.
[0175] Furthermore, the pose nodes of the discarded subgraph that have the first constraint relationship are taken as the discarded pose nodes.
[0176] The discarded subgraph, the discarded pose node, and the laser data corresponding to the discarded pose node are discarded.
[0177] The fourth preset quantity is less than the third preset quantity.
[0178] Furthermore, the device is also used for:
[0179] Determine whether the discarded pose node has the first constraint relationship with the retained subgraph;
[0180] When the discarded pose node and the retained subgraph have the first constraint relationship, the discarded pose node is modified into a retained pose node.
[0181] Each module in the aforementioned map update device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0182] In one embodiment, a robot is provided whose internal structure diagram can be as follows: Figure 5 As shown, the robot includes a processor, memory, and a communication interface. The processor provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database (the database may not be present in other embodiments). The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The robot's database stores various sub-maps, pose nodes, laser data corresponding to the pose nodes, and the original map. The communication interface allows the robot to communicate with an external terminal. When the computer program is executed by the processor, it implements the map update method described in any of the above embodiments.
[0183] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the robot to which the present application is applied. A specific robot may include more or fewer parts than shown in the figure, or combine certain parts, or have different part arrangements.
[0184] In one embodiment, a computer-readable storage medium is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0185] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0186] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0187] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0188] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A robot, characterized in that, The robot includes a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the computer program, it performs the following steps: Acquire at least two pose nodes continuously created by the robot during its movement, and the laser data corresponding to each of the at least two pose nodes; The laser data corresponding to each pose node in the at least two pose nodes is matched with the pre-stored original map according to the first preset rule to obtain the first matching result between each pose node in the at least two pose nodes and the pre-stored original map. Based on the first matching result of each of the at least two pose nodes, at least two target pose nodes are determined from the at least two pose nodes. The at least two target pose nodes are composed of pose nodes in a pose node group, which is composed of at least two adjacent pose nodes. The pose node group includes at least one target pose node whose laser data matches the laser data of the pre-stored original map. The at least two target pose nodes also include pose nodes that do not match the original map. The robot acquires the pose uploaded by its wheel odometry at each position corresponding to at least two target pose nodes, and uses the pose uploaded by the wheel odometry as the first pose corresponding to the target pose node. Based on the matching result between each target pose node and the pre-stored original map, the second pose corresponding to each target pose node is determined. Graph optimization processing is performed on the first pose and the second pose corresponding to each target pose node to obtain the target pose corresponding to each target pose node. Based on the target pose of each target pose node, the pre-stored original map is updated using the laser data corresponding to each target pose node; or The robot acquires the pose uploaded by its wheel odometry at each position corresponding to at least two target pose nodes, and uses the pose uploaded by the wheel odometry as the first pose corresponding to the target pose node; determines the second pose corresponding to each target pose node based on the matching result between each target pose node and the pre-stored original map; determines the target subgraph with a first constraint relationship for each target pose node, and uses all subgraphs except the target subgraph corresponding to the current target pose node as the target subgraph to be matched corresponding to the current target pose node; matches the laser data corresponding to the current target pose node with the laser data in the target subgraph to be matched, and calculates the fourth pose corresponding to the current target pose node based on the matching result; performs graph optimization processing on the first pose, the second pose, and the fourth pose of each target pose node to obtain the target pose corresponding to each target pose node; and updates the pre-stored original map using the laser data corresponding to each target pose node based on the target pose of each target pose node.
2. The robot according to claim 1, wherein the robot is equipped with a laser sensor, characterized in that, The acquisition of at least two pose nodes continuously created by the robot during its movement and the laser data corresponding to each of the at least two pose nodes includes: A new pose node is created every time the robot moves a preset interval distance to obtain the at least two pose nodes. When the robot is in a new pose node, the laser data obtained by the laser sensor is used as the laser data corresponding to the new pose node to obtain the laser data corresponding to each of the at least two pose nodes. or, If the deflection angle of the robot at its current position relative to the position corresponding to the previous pose node is greater than a preset deflection angle, a new pose node is created to obtain the at least two pose nodes. When the robot is at the new pose node, the laser data obtained by the laser sensor is used as the laser data corresponding to the new pose node, so as to obtain the laser data corresponding to each of the at least two pose nodes.
3. The robot according to claim 1, characterized in that, After creating the new pose node, the processor, when executing the computer program, also performs the following steps: A subgraph is created, and a first constraint relationship is established between the new pose node and the subgraph. The third pose corresponding to the new pose node is determined according to a second preset rule. Based on the third pose corresponding to the new pose node, the laser data corresponding to the new pose node is updated to the laser data of the subgraph that has the first constraint relationship with the new pose node.
4. The robot according to claim 1, characterized in that, After the pose uploaded by the wheel odometer is used as the first pose corresponding to the target pose node, the processor also performs the following steps when executing the computer program: A subgraph with the first constraint relationship is determined for each target pose node, and a third pose corresponding to each target pose node is determined based on the laser data corresponding to each target pose node and the laser data in the subgraph with the first constraint relationship for each target pose node, and the third pose is used to replace the first pose.
5. The robot according to claim 4, characterized in that, The step of determining a subgraph with the first constraint relationship for each target pose node, and determining the third pose of each target pose node based on the laser data corresponding to each target pose node and the laser data in the subgraph with the first constraint relationship for each target pose node, includes: Determine a subgraph where each target pose node has the first constraint relationship; If the current target pose node has the first constraint relationship with the two subgraphs, then the subgraph with the earlier creation time among the two subgraphs is taken as the target subgraph based on the creation time of the two subgraphs. The laser data corresponding to the current target pose node is matched with the laser data in the target sub-graph, and the third pose corresponding to the current target pose node is calculated based on the matching result. If the current target pose node has the first constraint relationship with a subgraph, then the subgraph is taken as the target subgraph. After determining that there is laser data in the target subgraph, the laser data corresponding to the new pose node is matched with the laser data in the target subgraph, and the third pose corresponding to the new pose node is calculated based on the matching result. After determining that there is no laser data in the target subgraph, the pose of the robot at the position of the new pose node is obtained through the wheel odometry as the first pose, and the first pose is directly used as the third pose of the new pose node.
6. The robot according to claim 1, characterized in that, The step of matching the laser data corresponding to the current target pose node with the laser data in the target sub-image to be matched, and calculating the fourth pose corresponding to the current target pose node based on the matching result, includes: The laser data corresponding to the current target pose node is matched with the laser data in the target sub-graph to be matched according to the second preset rule to obtain the second matching result; Based on the second matching result, a first target subgraph matching the current target pose node is selected from the target subgraph to be matched, and the fourth pose corresponding to the current target pose node is determined based on the current target pose node and the first target subgraph matching the current target pose node.
7. The robot according to claim 3, characterized in that, Create a subgraph, establish the first constraint relationship between the new pose node and the subgraph, determine the third pose corresponding to the new pose node according to the second preset rule, and update the laser data corresponding to the new pose node to the laser data of the subgraph with the first constraint relationship with the new pose node according to the third pose corresponding to the new pose node, including: When the number of pose nodes with the first constraint relationship in the subgraph is greater than a first preset number, a new subgraph is created; After creating the new subgraph, obtain a second preset number of pose nodes; Each of the second preset number of pose nodes is associated with the subgraph and the new subgraph to create the first constraint relationship, and the third pose corresponding to each of the second preset number of pose nodes is determined according to the second preset rule. Based on the third pose corresponding to each pose node in the second preset number of pose nodes, the laser data corresponding to each pose node in the second preset number of pose nodes is updated to the laser data of the subgraph that has the first constraint relationship with the corresponding pose node in the second preset number of pose nodes.
8. The robot according to claim 1, characterized in that, Before performing graph optimization processing on the first pose and the second pose corresponding to each target pose node to obtain the target pose corresponding to each target pose node, the processor is further configured to perform the following steps when executing the computer program: Get the number of subgraphs; When the number of subgraphs is greater than or equal to a third preset number, graph optimization processing is performed on the first pose and the second pose corresponding to each target pose node to obtain the target pose corresponding to each target pose node. The third preset number is a natural number greater than or equal to 3.
9. The robot according to claim 8, characterized in that, After updating the pre-stored original map based on the target pose of each target pose node and the laser data corresponding to each target pose node, the processor is further configured to perform the following steps when executing the computer program: The newly created fourth preset number of subgraphs are selected as the retained subgraphs, and all other subgraphs are selected as the discarded subgraphs. Furthermore, the pose nodes of the discarded subgraph that have the first constraint relationship are taken as the discarded pose nodes. The discarded subgraph, the discarded pose node, and the laser data corresponding to the discarded pose node are discarded. The fourth preset quantity is less than the third preset quantity.
10. The robot according to claim 9, characterized in that, Before discarding the discarded subgraph, the discarded pose node, and the laser data corresponding to the discarded pose node, the processor is further configured to perform the following steps when executing the computer program: Determine whether the discarded pose node has the first constraint relationship with the retained subgraph; When the discarded pose node and the retained subgraph have the first constraint relationship, the discarded pose node is modified into a retained pose node.
11. A map updating method, characterized in that, The method includes: Acquire at least two pose nodes continuously created by the robot during its movement and the laser data corresponding to the at least two pose nodes; The laser data corresponding to each pose node in the at least two pose nodes is matched with the pre-stored original map according to the first preset rule to obtain the first matching result between each pose node in the at least two pose nodes and the pre-stored original map. Based on the first matching result of each of the at least two pose nodes, at least two target pose nodes are determined from the at least two pose nodes. The at least two target pose nodes are composed of pose nodes in a pose node group, which is composed of at least two adjacent pose nodes. The pose node group includes at least one target pose node whose laser data matches the laser data of the pre-stored original map. The at least two target pose nodes also include pose nodes that do not match the original map. The robot acquires the pose uploaded by its wheel odometry at each position corresponding to at least two target pose nodes, and uses the pose uploaded by the wheel odometry as the first pose corresponding to the target pose node. Based on the matching result between each target pose node and the pre-stored original map, the second pose corresponding to each target pose node is determined. Graph optimization processing is performed on the first pose and the second pose corresponding to each target pose node to obtain the target pose corresponding to each target pose node. Based on the target pose of each target pose node, the pre-stored original map is updated using the laser data corresponding to each target pose node; or The robot acquires the pose uploaded by the wheel odometry at each position corresponding to at least two target pose nodes, and uses the pose uploaded by the wheel odometry as the first pose corresponding to the target pose node; determines the second pose corresponding to each target pose node based on the matching result between each target pose node and the pre-stored original map; determines the target subgraph with a first constraint relationship for each target pose node, and uses all subgraphs except the target subgraph corresponding to the current target pose node as the target subgraph to be matched corresponding to the current target pose node; matches the laser data corresponding to the current target pose node with the laser data in the target subgraph to be matched, and calculates the fourth pose corresponding to the current target pose node based on the matching result; performs graph optimization processing on the first pose, the second pose, and the fourth pose of each target pose node to obtain the target pose corresponding to each target pose node; and updates the pre-stored original map based on the target pose of each target pose node using the laser data corresponding to each target pose node.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method of claim 11.
Citation Information
Patent Citations
Robot state detection method, device and equipment
CN112269187A