Repositioning method, robot and computer readable storage medium
By recording the robot position pose and obtaining laser frames for matching, and building a local map for relocation when the matching fails, the problem of low success rate of robot relocation in the prior art is solved, and the success rate and reliability of relocation are improved.
Patent Information
- Application Number
- CN202510220495.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-06-13
AI Technical Summary
Existing robots have low success rates during relocation, especially when the robots have large changes in position or are blocked by obstacles.
By recording the robot's current position on the built grid map, obtain the first laser frame and match the position. If the match fails, continue to acquire at least two second laser frames to build the local map and match the local map with the built raster map to improve the success rate of relocation.
The success rate of robot relocation is improved, and the reliability of relocation is enhanced by first matching the first laser frame and pose, and then building a local map from other angles.
Smart Images

Figure CN120141434A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of robotics, and particularly relates to a relocalization method, a robot, a computer-readable storage medium, and a computer program product. Background Art
[0002] During the process of building a map, if the robot is paused, then after a period of time, the map building is resumed, or, when the robot moves a short distance and then resumes the map building, the robot needs to be relocalized. This is because, when the robot has a map, if the localization is lost, then relocalization needs to be performed to obtain the pose of the robot on the map.
[0003] During the relocalization process, if the position of the robot when resuming the map building is far from the position of the robot when it was paused, it may lead to relocalization failure. Or, if the position of the robot when resuming the map building is close to the position of the robot when it was paused, but the obstacle blocking results in a large difference between the point cloud scanned by the laser and the key frame recently inserted on the map, it may also lead to relocalization failure.
[0004] Therefore, a new relocalization method is needed to improve the success rate of relocalization. Summary of the Invention
[0005] Embodiments of this application provide a relocalization method, a robot, and a computer-readable storage medium, which can solve the problem of low success rate of relocalization of existing robots.
[0006] In a first aspect, embodiments of this application provide a relocalization method, including:
[0007] During the map building process of the robot, if the robot pauses map building, record the current pose of the robot on the built grid map to obtain a first pose;
[0008] After the robot obtains a first laser frame to resume map building, perform matching on the built grid map according to the first laser frame and the first pose, where the first laser frame is the first laser frame obtained by the robot through a lidar after resuming map building;
[0009] In the case where there is no data on the built grid map that matches the first laser frame, obtain at least two second laser frames, where the coordinate information corresponding to the second laser frames is the same as the coordinate information corresponding to the first laser frame, but the angle information included in the second laser frames is different from the angle information included in the first laser frame;
[0010] Establish a local map according to each of the second laser frames;
[0011] Match the local map with the built grid map;
[0012] When the matching is successful, continue mapping the established grid map.
[0013] The beneficial effects of the embodiments of the present application compared with the prior art are as follows:
[0014] In the embodiments of the present application, after the robot obtains the first laser frame to resume mapping, match is performed on the established grid map according to the first laser frame and the first pose. Since the first laser frame is the first laser frame obtained by the lidar after the robot resumes mapping, and when the robot does not move, the first laser frame obtained by the robot is very likely to match the established grid map. Therefore, first matching according to the first laser frame and the first pose on the established grid map can improve the efficiency and success rate of matching. In addition, when the matching between the first laser frame and the established grid map fails, continue to obtain at least two second laser frames to construct a local map, then match the local map with the established grid map, and continue mapping the established grid map when the matching is successful. Since the coordinate information corresponding to the second laser frame is the same as the coordinate information corresponding to the first laser frame, but the angle information included in the second laser frame is different from the angle information included in the first laser frame, therefore, matching the local map with the established grid map is equivalent to repositioning the robot from another angle, thereby further improving the success rate of repositioning.
[0015] In a second aspect, an embodiment of the present application provides a robot, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method described in the first aspect is implemented.
[0016] In a third aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0017] In a fourth aspect, an embodiment of the present application provides a computer program product, which when running on a robot, causes the robot to execute the method described in the first aspect above.
[0018] It can be understood that the beneficial effects of the second to fourth aspects above can refer to the relevant descriptions in the first aspect above, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art.
[0020] Figure 1It is a schematic diagram of a laser frame obtained by a robot being blocked by an obstacle provided by this application;
[0021] Figure 2 It is a schematic flowchart of a relocalization method provided by an embodiment of this application;
[0022] Figure 3 It is a schematic structural diagram of a robot provided by an embodiment of this application. Detailed implementation manners
[0023] In the following description, for the purpose of illustration rather than limitation, specific details such as specific system architectures, technologies, etc. are presented to thoroughly understand the embodiments of this application. However, those skilled in the art should clearly understand that this application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of this application.
[0024] It should be understood that when used in the specification of this application and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0025] It should also be understood that the term "and / or" used in the specification of this application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0026] In addition, in the description of the specification of this application and the appended claims, the terms "first", "second", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0027] The reference to "an embodiment" or "some embodiments" etc. described in the specification of this application means that a specific feature, structure, or characteristic described in combination with the embodiment is included in one or more embodiments of this application. Thus, the statements "in an embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
[0028] During the process of the robot building a map, if the user picks up the robot or moves the robot, the robot will pause building the map. After the user puts down the robot or stops moving the robot, the robot will resume the action of building the map. When the robot resumes the action of building the map, the robot needs to reposition itself to improve the accuracy of the built map.
[0029] During the repositioning process, the robot obtains a laser frame at the current position through its own lidar, and then reposition itself based on the laser frame and the built map. If the position of the robot when resuming map building is far from the position of the robot when it paused, the matching degree between the obtained laser frame and the built map is low. At this time, the robot usually fails in repositioning. And if the position of the robot when resuming map building is close to the position of the robot when it paused, but the obstruction of obstacles causes a large difference between the obtained laser frame and the key frame inserted most recently on the map, the robot usually also fails in repositioning. As Figure 1 shown, if the robot pauses at point A in Figure 1 and resumes map building at point B, due to the obstruction of obstacles around point B, it is very likely that the repositioning cannot be successful at point B.
[0030] To improve the success rate of the robot's repositioning, the embodiment of the present application provides a repositioning method. In this repositioning method, when the first laser frame fails to match the built grid map, at least two second laser frames are continuously obtained to build a local map, and then the local map is matched with the built grid map. Since the coordinate information corresponding to the second laser frame is the same as the coordinate information corresponding to the first laser frame, but the angle information included in the second laser frame is different from the angle information included in the first laser frame, therefore, matching the local map with the built grid map is equivalent to repositioning the robot from other angles, thereby further improving the success rate of repositioning.
[0031] The repositioning method provided by the embodiment of the present application will be described below with reference to the accompanying drawings.
[0032] Figure 2 FIG. shows a schematic flowchart of a repositioning method provided by the embodiment of the present application. This method is applied to the processor of the robot. The robot can be a device capable of autonomous movement with two legs or caterpillar tracks or wheels, or can be a device with other shapes, such as a floor cleaning robot, a window cleaning robot, etc. The repositioning method provided by the embodiment of the present application is described in detail as follows:
[0033] S21, during the process of the robot building a map, if the above-mentioned robot pauses building the map, record the current pose of the above-mentioned robot on the built grid map to obtain the first pose.
[0034] Specifically, when the robot faces an unknown environment, it needs to construct a map corresponding to the unknown environment. Before the map is completely constructed, if the robot malfunctions or detects human interference (such as detecting that the robot is picked up and lifted off the ground by an external force or moved by an external force), the robot will suspend map construction and record the moment of suspending map construction at the current pose corresponding to the constructed grid map (denoted as Ma), and this current pose (i.e., the first pose) is denoted as Pa. Among them, Pa includes its coordinate information and angle information on Ma.
[0035] S22. After the above robot obtains the first laser frame to resume map construction, perform matching on the above constructed grid map according to the above first laser frame and the above first pose, where the above first laser frame is the first laser frame obtained by the lidar after the above robot resumes map construction.
[0036] When the robot detects that it is not affected by external forces, it will resume map construction. Specifically, the processor of the robot notifies the lidar to scan the environment where the robot is located to obtain the corresponding laser frame. To facilitate the distinction of laser frames obtained at different times, in the embodiments of the present application, the first laser frame obtained when the lidar resumes map construction is called the first laser frame. This first laser frame contains the distance information and angle information between the points in the scanned environment and the robot.
[0037] In the embodiments of the present application, when performing matching, feature points can be extracted from the first laser frame, the extracted feature points are corrected in combination with the pose information corresponding to Pa, and then the corrected feature points are matched with the feature points of Ma. It is also possible to select the Template Matching method or the Shape Context Matching (SCM) method, which is not limited here. Among them, the template matching method is a method of finding a similar area to the template image in the target image. It slides the template image on the target image and calculates the matching degree at each position to find the best matching position. The SCM matching method is mainly used for the matching of objects with obvious shape features.
[0038] Optionally, considering that the single-line lidar has a simple structure and low cost, therefore, the lidar in the embodiments of the present application can select a single-line lidar. Of course, if the lidar installed on the robot is a multi-line lidar, the data of one of the laser lines can be selected for use. Further, considering that the horizontal distance can more accurately reflect the distance between the robot and the obstacle, therefore, the lidar in the embodiments of the present application is a horizontally installed lidar. Optionally, when the lidar is not horizontally installed, the laser line of the lidar can be projected onto the horizontal plane, and then the corresponding laser frame can be obtained according to the projection result.
[0039] S23. In the case where there is no data in the established grid map that matches the first laser frame, obtain at least two second laser frames. Among them, the coordinate information corresponding to the second laser frame is the same as the coordinate information corresponding to the first laser frame, but the angle information included in the second laser frame is different from the angle information included in the first laser frame.
[0040] Specifically, in the case where it is determined that the data in the first laser frame does not match the data in Ma, the processor of the robot notifies the lidar to obtain at least two second laser frames at the current position point (the current position point is the position point when the first laser frame is obtained. If the robot is not moved during the paused mapping, the current position point is the position point where Pa is located. Otherwise, the current position point is not the position point where Pa is located). Among the obtained second laser frames, the included angle information does not necessarily be completely different. For example, assume that 3 second laser frames are obtained: second laser frame a1, second laser frame a2, and second laser frame a3. The angle information included in the second laser frame a1 may be b1°, the angle information included in the second laser frame a2 may be b2°, and the angle information included in the third laser frame a3 may be b1°.
[0041] Of course, if there is data in the established grid map that matches the first laser frame, it indicates that the robot's relocalization is successful. At this time, continue to build the map based on the established grid map.
[0042] S24. Establish a local map according to each of the above second laser frames.
[0043] Specifically, after determining the origin of the local map, use the scan matching algorithm to match each second laser frame with the origin, and gradually build the above local map according to the matching results. In the embodiment of the present application, the position point of the robot before obtaining the second laser frame can be used as the origin of the local map. After obtaining each second laser frame, determine the current pose of the robot in the local map to obtain the second pose. When the robot is not moved by an external force, the coordinate information corresponding to the second pose of the robot after obtaining the second laser frame is usually the same as the coordinate information corresponding to the first pose, but the angle information corresponding to the second pose is usually different from the angle information corresponding to the first pose. It should be noted that if the robot obtains the second laser frame by rotating itself, the position after rotation may also be different from the position before rotation. At this time, the coordinate information corresponding to the second pose is different from the coordinate information corresponding to the first pose.
[0044] In the process of constructing the local map, the initial poses provided by an inertial measurement unit (IMU) or a chassis odometer can also be used to register each second laser frame, and then a local map is generated based on the point cloud data corresponding to the registered second laser frames, so as to improve the accuracy of the generated local map.
[0045] Optionally, if there are two or more identical second laser frames among all the second laser frames, one of the two or more identical second laser frames is selected for constructing the local map, so as to filter out redundant second laser frames and thus improve the efficiency of constructing the local map.
[0046] S25, match the above local map with the above constructed grid map.
[0047] Specifically, the local map is equivalent to the local map, and the constructed grid map is equivalent to the original map. When matching the local map with the original map, first convert the obstacle points on the local map into a point cloud, and then match the point cloud with the original map, such as matching the features of the obstacles in the point cloud with the features of the obstacles in the original map to obtain a matching result. For example, when more than a preset proportion (such as 90%) of the obstacle points in the point cloud match the obstacle points in the original map, it is determined that the local map matches the constructed grid map successfully; otherwise, it is determined that the local map matches the constructed grid map fails. Among them, when the local map matches the constructed grid map successfully, it indicates that the robot's repositioning is successful; otherwise, it indicates that the robot's repositioning fails.
[0048] S26, continue mapping the above constructed grid map in the case of successful matching.
[0049] In the case of successful matching, the robot continues to move and obtains the corresponding laser frame, and expands the constructed grid map according to the obtained laser frame to improve the constructed grid map.
[0050] In the embodiment of the present application, after the robot obtains the first laser frame to resume mapping, matching is performed on the established grid map according to the first laser frame and the first pose. Since the first laser frame is the first laser frame obtained by the lidar after the robot resumes mapping, and when the robot does not move, the first laser frame obtained by the robot is very likely to match the established grid map. Therefore, first matching the established grid map according to the first laser frame and the first pose can improve the efficiency and success rate of the matching. In addition, when the matching between the first laser frame and the established grid map fails, at least two second laser frames are continuously obtained to construct a local map, and then the local map is matched with the established grid map, and mapping of the established grid map is continued when the matching is successful. Since the coordinate information corresponding to the second laser frame is the same as the coordinate information corresponding to the first laser frame, but the angle information included in the second laser frame is different from the angle information included in the first laser frame, therefore, matching the local map with the established grid map is equivalent to repositioning the robot from another angle, thereby further improving the success rate of repositioning.
[0051] In some embodiments, in the above S23, obtaining at least two second laser frames includes:
[0052] Obtaining at least two second laser frames by controlling the rotation of the lidar, or obtaining at least two second laser frames by controlling the robot to rotate in place and by controlling the rotation of the lidar.
[0053] Specifically, after the lidar rotates, since the angle between the light emitted by the lidar and the reference direction changes, and this angle is the same as the angle indicated by the angle information corresponding to the second laser frame, therefore, the angle information included in the second laser frame obtained based on the reflection of the emitted light will also change after the lidar rotates, which is conducive to obtaining a second laser frame with angle information different from that of the first laser frame. Of course, if during the rotation of the lidar, the angle information included in the obtained laser frame is the same as the angle information included in the first laser frame, then this laser frame is not used as the above-mentioned second laser frame.
[0054] It should be noted that during the rotation of the lidar, the position of the robot remains unchanged to ensure that the coordinate information corresponding to the second laser frame is the same as the coordinate information corresponding to the first laser frame.
[0055] In the embodiment of the present application, considering the installation position of the lidar, there may be a blind area in the scanning area of the lidar. This blind area causes the laser frames obtained after the lidar rotates 360° not to reflect the environmental information around the robot at 360°. At this time, during the rotation of the lidar, the robot can be controlled to rotate in place to increase the probability of obtaining laser frames containing different angle information.
[0056] Optionally, when it is necessary to obtain the environmental information around the robot in 360°, if only the lidar is controlled to rotate, the lidar can be controlled to rotate at least one full circle; if the robot is controlled to rotate in place and the lidar is controlled to rotate, the robot can be controlled to rotate in place at least one full circle, and / or, both the robot is controlled to rotate in place at least one full circle and the lidar is controlled to rotate.
[0057] In some embodiments, considering that the larger the range involved in relocalization, the longer the matching time required. Therefore, in order to improve the matching efficiency, the relocalization method provided in the embodiments of the present application further includes:
[0058] During the robot mapping process, the pose of the robot on the already built grid map is recorded at every preset first distance to obtain a trajectory point pose sequence, and, during the period when the above-mentioned robot pauses mapping, it is monitored whether the above-mentioned robot leaves the position point where the above-mentioned first pose is located.
[0059] Optionally, the above-mentioned first pose is the last pose recorded in the trajectory point pose sequence.
[0060] Among them, the above-mentioned preset first distance is set according to the actual situation. For example, it is set according to the size of the component used for movement in the robot. For example, when the component used for movement in the robot is a wheel, it is set according to the size of the wheel. The larger the wheel size of the robot, the more the above-mentioned preset first distance, that is, the preset first distance is positively correlated with the wheel. Optionally, the above-mentioned preset first distance can be set to 1 meter.
[0061] In the embodiments of the present application, during the robot mapping process, the pose of the robot on the already built grid map is recorded at intervals of the preset first distance, and the arrangement order of each pose corresponds to its recording time. For example, assuming that the recording time of pose 1 is earlier than the recording time of pose 2, and the earlier the recording time, the more forward the sorting, then the sorting of pose 1 is before the sorting of pose 2. The recorded poses with an arrangement order form the above-mentioned trajectory point pose sequence.
[0062] In the embodiments of the present application, during the pause of map building by the robot, it is possible to monitor whether the robot leaves the position where it just started to pause through a sensor, that is, to monitor whether the robot leaves the position point of the first pose. Optionally, the above sensor may include an image sensor, an infrared sensor, a pressure sensor, and an inertial measurement unit (IMU). Specifically, when judging by the image sensor, the ground environment images corresponding to the robot at the pause moment and after the pause can be obtained through the image sensor. If the ground environment image after the pause changes compared with the ground environment image corresponding to the pause moment, it is determined that the robot leaves the position point of the first pose; when judging by the infrared sensor, the targets on the ground where the robot is located at the pause moment and after the pause can be monitored through the infrared sensor. If the target after the pause changes compared with the target at the pause moment (such as the distance to the same target changes, or the target itself changes), it is determined that the robot leaves the position point of the first pose; when judging by the pressure sensor, if the pressure sensor is used to detect the pressure value of the ground on the robot, when the pressure value of the pressure sensor tends to 0, it indicates that the robot is picked up. At this time, it is determined that the robot leaves the position point of the first pose.
[0063] Correspondingly, in S25 above, after matching the local map with the built grid map, it further includes:
[0064] A1. In the case where the matching fails and it is monitored that the robot does not leave the position point of the first pose during the pause of map building, select the poses from the trajectory point pose sequence whose distance from the position point of the first pose is not greater than a preset second distance, and the second distance is greater than the first distance.
[0065] Specifically, set the preset second distance to be greater than the preset first distance so that there are as many poses as possible in the trajectory point pose sequence that meet the following conditions: the distance from the position point of the first pose is not greater than the second distance.
[0066] In the embodiments of the present application, each pose in the trajectory pose sequence can be respectively calculated for the distance from the first pose to obtain the distances between each pose and the first pose, and the poses whose distances from the position point where the first pose is located are not greater than a preset second distance are filtered out according to the obtained distances and the preset second distance. Optionally, if the first pose is used as the last recorded pose in the trajectory pose sequence, the later the recorded pose (the pose closer to the first pose in the trajectory pose sequence), the closer its distance is to the first pose. Assuming that the first pose is the penultimate pose, the distances from the second-to-last pose, the third-to-last pose, etc. to the first pose are calculated in turn. If the distance is greater than the preset second distance, the calculation is stopped, and the poses whose distances from the position point where the first pose is located are not greater than the preset second distance are obtained. For example, assuming that the distance from pose 1 to the first pose is less than the preset second distance, the distance from pose 2 to the first pose is less than the preset second distance, but the distance from pose 3 to the first pose is greater than the preset second distance, then the poses whose distances from the position point where the first pose is located are not greater than the preset second distance are pose 1 and pose 2. Since in the trajectory pose sequence, the distance calculation starts from the pose closer to the first pose, the amount of calculation required for the distance calculation can be reduced, and the efficiency of obtaining the filtered poses can be improved.
[0067] A2. Construct a new local map according to the filtered poses, match the new local map with the established grid map, and continue mapping the established grid map when the matching is successful.
[0068] Specifically, considering that the coordinate system of the filtered poses is the coordinate system where the established grid map is located, in order to improve the accuracy of the constructed new local map, usually the relative pose between the filtered poses and the first pose is calculated, and then according to the corresponding relationship between the first pose and the second pose (when the robot does not move, the position point where the second pose is located is usually the position point where the first pose is located, only due to different coordinate systems, so the coordinate information is different and the corresponding angle information may also be different) and the calculated relative pose, the pose of the filtered poses in the local map, the second pose i, is calculated. Each second pose i is used as a navigation point, and the arrangement order between the navigation points is the same as the arrangement order of the filtered poses. Optionally, the second pose i with the closest distance to the second pose is used as the first navigation point, and the robot is controlled to navigate to the first navigation point. At this navigation point, at least two laser frames (assumed to be called the third laser frames) are obtained, and a new local map is constructed according to the obtained at least two third laser frames. Among them, the process of obtaining at least two third laser frames is similar to the process of obtaining at least two second laser frames in S23, such as by controlling the rotation of the lidar, and / or by controlling the robot to rotate in place and controlling the rotation of the lidar, which will not be elaborated here.
[0069] In the case where the new local map does not match the established grid map, control the robot to navigate to the next navigation point, obtain at least two third laser frames at the next navigation point, then construct another new local map according to the at least two obtained third laser frames, and match the other new local map with the established grid map. That is, in the embodiments of the present application, select an unselected navigation point from each navigation point. If the selected navigation point is used as the target navigation point, control the robot to navigate to the target navigation point, obtain at least two third laser frames at the target navigation point, and construct a new local map according to the at least two third laser frames. Match the new local map with the established grid map. If the match is successful, continue mapping. Otherwise, return to the step of selecting an unselected navigation point from each navigation point and subsequent steps above until the new local map matches the established grid map successfully, or until all navigation points have been selected.
[0070] Since it is determined that the robot has not left the position point where the first pose is located during the pause of mapping, it indicates that the robot is still near the established grid map of the constructed grid map. At this time, continue to construct a new local map based on the trajectory passed by the robot to match the established grid map again, which can improve the success rate of relocalization.
[0071] In some embodiments, considering that when the robot has not left the position point where the first pose is located, a new local map is constructed based on the positions in the trajectory pose sequence whose distance from the first pose is not greater than a preset second distance. Therefore, in order to increase the probability of obtaining accurate poses for constructing the new local map, it is first necessary to determine whether the number of poses included in the trajectory pose sequence is greater than 1. That is, before step A1 of screening out the poses whose distance from the position point where the first pose is located is not greater than the preset second distance from the above trajectory pose sequence, it further includes:
[0072] Detect whether the number of poses included in the above trajectory pose sequence is greater than 1.
[0073] In the case where the number of poses included in the above trajectory pose sequence is not greater than 1, clear the established above-established grid map and reconstruct the map.
[0074] Correspondingly, the above screening out the poses whose distance from the position point where the first pose is located is not greater than the preset second distance from the above trajectory pose sequence includes:
[0075] In the case where the number of poses included in the above trajectory pose sequence is greater than 1, screen out the poses whose distance from the position point where the first pose is located is not greater than the preset second distance from the above trajectory pose sequence.
[0076] In the embodiments of the present application, the first pose is the pose recorded when the robot pauses mapping. After the first pose is stored in the trajectory point pose sequence, the trajectory point pose sequence includes at least 1 pose. When the number of poses included in the trajectory point pose sequence is greater than 1, it indicates that in addition to recording the first pose, the trajectory point pose sequence also records other poses. At this time, the distances between these poses and the first pose can be calculated. However, if the number of poses included in the trajectory point pose sequence is equal to 1, since the local map constructed based on the first pose has failed to match the built grid map, no new local map is constructed based on the first pose. Instead, the built grid map can be cleared and the map can be reconstructed to improve the success rate of relocalization. Optionally, before clearing the built grid map, relevant information about the relocalization failure can be returned so that the user knows that the robot needs to reconstruct the map.
[0077] In some embodiments, considering that when the robot pauses mapping, it is possible that the actual moving distance of the robot is shorter than a preset second distance. Therefore, in order to improve the accuracy of the poses selected subsequently, the distance from the first pose to the origin of the built grid map can be calculated first. If the distance from the first pose to the origin of the built grid map is less than the preset second distance, then the second distance is set equal to the distance from the first pose to the origin of the built grid map. For example, assume that the preset second distance is 2 meters and the distance from the first pose to the origin of the built grid map is 1.8 meters. Then the second distance is updated from 2 meters to 1.8 meters. Of course, if the distance from the first pose to the origin of the built grid map is not less than the preset second distance, there is no need to change the second distance.
[0078] Since after it is determined that the distance from the first pose to the origin of the built grid map is less than the preset second distance, the second distance is updated to the distance from the first pose to the origin of the built grid map, and the fact that the distance from the first pose to the origin of the built grid map is less than the preset second distance indicates that the actual moving distance of the robot does not exceed the second distance. Therefore, by setting it in this way, it is beneficial to the accuracy of the poses whose distances from the first pose are less than the second distance selected subsequently.
[0079] The above introduced the content of how the robot realizes relocalization when the local map fails to match the built grid map and the robot does not leave the position point where the first pose is located during the pause. Next, the content of how the robot realizes relocalization when the local map fails to match the built grid map and the robot leaves the position point where the first pose is located during the pause will be introduced.
[0080] In some embodiments, the relocalization method provided by the embodiments of the present application further includes:
[0081] During the above-mentioned robot mapping process, the pose of the robot on the above-mentioned built grid map is recorded every preset first distance to obtain a trajectory point pose sequence, and during the period when the robot pauses mapping, it is monitored whether the robot leaves the position point where the first pose is located.
[0082] Among them, the content of obtaining the trajectory point pose sequence and monitoring whether the robot leaves the position point where the first pose is located has been described above and will not be elaborated here.
[0083] Correspondingly, in the above S25, after matching the above-mentioned local map with the above-mentioned built grid map, it further includes:
[0084] B1. In the case of matching failure and monitoring that the robot leaves the position point where the first pose is located during the period when the robot pauses mapping, determine the current pose of the robot on the above-mentioned local map to obtain a second pose.
[0085] Among them, the second pose is the pose of the robot on the local map after the robot obtains the second laser frame used to construct the local map. This second pose can be determined with reference to the coordinate information and angle information of the robot before obtaining all the second laser frames. For example, assuming that the coordinate information of the robot before and after obtaining all the second laser frames remains unchanged, the coordinate information corresponding to this second pose is the origin of the local map. Assuming that the angle information of the robot changes before and after obtaining all the second laser frames, the angle information corresponding to this second pose can be set as the changed angle information.
[0086] B2. Determine exploration points whose distances from the position point where the second pose is located are not greater than a preset second distance according to the explorable area of the above-mentioned local map.
[0087] Among them, the explorable area of the local map generally refers to the area that the robot can enter in the local map. The exploration point generally refers to a node that needs to be focused on during the exploration process. This exploration point can be generated based on a random sampling method or a sub-region division method.
[0088] Specifically, generate one or more exploration points according to the explorable area of the local map, calculate the distances between the generated exploration points and the position point where the second pose is located, and compare each calculated distance with the preset second distance respectively to screen out the exploration points that are not greater than the preset second distance.
[0089] B3. Generate a new local map according to the above-mentioned exploration points.
[0090] Specifically, a new local map can be generated based on the laser frames obtained at the exploration points. Optionally, during the process of constructing the new local map, the initial poses provided by the IMU or the chassis odometer can also be used to register each laser frame, and then a new local map can be generated based on the point cloud data corresponding to the registered laser frames, so as to improve the accuracy of the generated new local map.
[0091] Optionally, the above B3, generating a new local map according to the above exploration points, includes:
[0092] B31. Navigate from the position point where the second pose is located to the above exploration point, and obtain at least two third laser frames at the above exploration point.
[0093] In the embodiments of the present application, the laser frames obtained at the exploration points and at the navigation points are both referred to as the third laser frames. Among them, the process of obtaining the third laser frames at the exploration points is similar to that at the navigation points, and will not be elaborated here.
[0094] B32. Generate the above new local map according to at least two of the above third laser frames.
[0095] Among them, the process of generating the new local map is similar to the process of generating the local map, and will not be elaborated here.
[0096] Since the new local map is generated based on at least two third laser frames, the accuracy of the generated new local map is improved.
[0097] B4. Match the above new local map with the above established grid map.
[0098] Among them, the process of matching the new local map with the established grid map is similar to the process of matching the local map with the established grid map, and will not be elaborated here.
[0099] B5. Continue mapping the above established grid map in the case of successful matching.
[0100] Specifically, in the case where the new local map matches the established grid map successfully, it indicates that the robot relocalization is successful. At this time, continue to construct the map on the basis of the established grid map.
[0101] In the embodiments of the present application, since the exploration points whose distance from the position point where the second pose is located is not greater than the preset second distance are used to generate the new local map, the new local map matched with the established grid map will not be too large, thereby improving the matching efficiency.
[0102] In some embodiments, considering that the number of exploration points whose distance from the position point where the second pose is located is not greater than a preset second distance may be greater than 1. Therefore, each determined search point can be added as a navigation point to the navigation point stack (i.e., the stack for storing navigation points), and the first determined search point (such as the first search point determined according to the clockwise or counterclockwise direction) is added to the head of the navigation point stack. When a new local map needs to be generated, in the above B31, when navigating from the position point where the second pose is located to the above exploration point, specifically includes: navigating from the position point where the second pose is located to the exploration point at the head of the navigation point stack. Optionally, in order to reduce the probability of repeated navigation (i.e., making the same exploration point navigated only once), after navigating to the exploration point at the head of the stack, delete the exploration point at the head of the stack. Or, a preset timeout time T is set in advance, stop after navigation timeout, delete the exploration point at the head of the stack, and obtain at least two third laser frames according to the position point where it stops, and generate a new local map according to the at least two third laser frames. Optionally, the above T can be determined according to the preset second distance, and the T is in a positive correlation with the preset second distance to improve the accuracy of the determined T.
[0103] When the new local map generated according to the exploration point at the head of the stack does not match the built grid map, it can be navigated to the next exploration point to construct another new local map. That is, when the number of exploration points is greater than 1, after the above B4, after matching the above new local map with the above built grid map, it further includes:
[0104] C1. In the case of a matching failure, search for a target exploration point that meets the following conditions in the explorable area at the above exploration point: the distance from the position point where the second pose is located is not greater than the above preset second distance; the distance from the unnavigated exploration points is greater than a preset third distance, and the above preset third distance is less than the above preset second distance.
[0105] Specifically, when the exploration point is stored as a navigation point in the navigation point stack, if the new local map generated according to the navigation point at the head of the stack does not match the built grid map, a target exploration point for generating another new local map is re-determined. The distance between the target exploration point and the position point where the second pose is located is not greater than the preset second distance (assuming the second distance is 2 meters, then the third distance can be set to 0.8 meters), and the distance between the target exploration point and the exploration points in the navigation point stack that are not at the head of the stack is greater than the preset third distance.
[0106] C2. Generate a new local map according to the above target exploration point, and match the above new local map with the above built grid map.
[0107] Specifically, the robot is controlled to navigate to the target exploration point, and at least two laser frames are acquired to generate a new local map based on the acquired laser frames. Among them, the process of generating the new local map is similar to the process of generating the local map, and the process of matching the new local map with the built grid map is similar to the process of matching the local map with the built grid map, which will not be elaborated here.
[0108] C3. In the case of successful matching, continue mapping the above-mentioned built grid map.
[0109] In the embodiment of the present application, since the distance between the target exploration point and the position point where the second pose is located is not greater than the preset second distance, when a new local map is generated according to the target exploration point, the generated new local map can be made closer to the position point where the second pose is located. In addition, since the distance between the target exploration point and the exploration points in the navigation point stack that are not the stack head is greater than the preset third distance, a certain distance is provided between each exploration point, which is beneficial to improving the success rate of the robot navigating to each exploration point.
[0110] Optionally, if the matching fails, the corresponding navigation points are selected in the order of arrangement of all the navigation points stored in the current navigation point stack for generating a new local map and for matching the generated new local map with the built grid map. After successful matching, continue mapping. Otherwise, select the next navigation point to continue generating a new local map until all navigation points have been navigated to, or the robot is successfully repositioned. If the robot has not been successfully repositioned after all navigation points have been navigated to, clear the built grid map and remap. Optionally, before clearing the built grid map, relevant information about the failed repositioning can also be returned so that the user knows that the robot needs to reconstruct the map.
[0111] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0112] Figure 3 It is a schematic structural diagram of a robot provided by an embodiment of the present application. As Figure 3 shown, the robot 3 of this embodiment includes: at least one processor 30 ( Figure 3 only one processor is shown here), a memory 31, and a computer program 32 stored in the memory 31 and executable on the at least one processor 30. When the processor 30 executes the computer program 32, the steps in any of the above method embodiments are implemented.
[0113] The robot 3 may include, but is not limited to, a processor 30 and a memory 31. Those skilled in the art can understand, Figure 3This is only an example of the robot 3, which does not constitute a limitation on the robot 3. It may include more or fewer components than those shown in the figure, or combine some components, or different components. For example, it may also include input / output devices, network access devices, etc.
[0114] The so-called processor 30 may be a central processing unit (CPU), and the processor 30 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0115] In some embodiments, the memory 31 may be an internal storage unit of the robot 3, such as the hard disk or memory of the robot 3. In other embodiments, the memory 31 may also be an external storage device of the robot 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the robot 3. Further, the memory 31 may also include both the internal storage unit and the external storage device of the robot 3. The memory 31 is used to store an operating system, application programs, a boot loader, data, and other programs, such as the program code of the computer program, etc. The memory 31 may also be used to temporarily store data that has been output or will be output.
[0116] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.
[0117] An embodiment of this application also provides a network device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor. When the processor executes the computer program, the steps in any of the foregoing method embodiments are implemented.
[0118] An embodiment of this application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in each of the foregoing method embodiments can be implemented.
[0119] An embodiment of this application provides a computer program product. When the computer program product runs on a robot, the robot can implement the steps in each of the foregoing method embodiments when executed.
[0120] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above method embodiments of this application, a computer program can be used to instruct relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the photographing device / robot, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.
[0121] In the above embodiments, the descriptions of the respective embodiments have their own focuses. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0122] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0123] In the embodiments provided in this application, it should be understood that the disclosed device / network device and method can be implemented in other ways. For example, the device / network device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.
[0124] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or may be distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0125] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A relocation method, characterized in that: include: During the robot mapping process, if the robot pauses mapping, the current position of the robot on the built grid map is recorded to obtain the first position; After the robot acquires a first laser frame to restore the map, matching is performed on the built grid map according to the first laser frame and the first posture, wherein the first laser frame is the first laser frame acquired by the laser radar after the robot restores the map; When there is no data matching the first laser frame in the established grid map, acquiring at least two second laser frames, wherein coordinate information corresponding to the second laser frames is the same as the coordinate information corresponding to the first laser frame, but angle information included in the second laser frames is different from angle information included in the first laser frame; Establishing a local map according to each of the second laser frames; Matching the local map with the established grid map; If the matching is successful, the constructed grid map continues to be constructed.
2. The relocation method according to claim 1, wherein: The acquiring of at least two second laser frames comprises: Acquire at least two second laser frames by controlling the laser radar to rotate; or, At least two second laser frames are acquired by controlling the robot to rotate in place and by controlling the laser radar to rotate.
3. The relocation method according to claim 1 or 2, characterized in that: Also includes: During the robot mapping process, the robot's position and posture on the built grid map are recorded at every preset first distance to obtain a trajectory point position and posture sequence; During the period when the robot is suspended from mapping, monitoring whether the robot leaves the position point where the first posture is located; After matching the local map with the built grid map, the method further includes: In case that the matching fails and it is monitored that the robot does not leave the position point where the first posture is located during the pause of mapping, a posture whose distance from the position point where the first posture is located is not greater than a preset second distance is selected from the trajectory point posture sequence, and the second distance is greater than the first distance; A new local map is constructed according to the filtered positions and postures, the new local map is matched with the constructed grid map, and the constructed grid map is continued to be constructed if the match is successful.
4. The relocation method according to claim 3, characterized in that: Before selecting a posture whose distance from the position point where the first posture is located is not greater than a preset second distance from the trajectory point posture sequence, the method further includes: Detecting whether the number of postures included in the trajectory point posture sequence is greater than 1; The step of selecting a posture whose distance from the position point where the first posture is located is not greater than a preset second distance from the trajectory point posture sequence includes: When the number of postures included in the trajectory point posture sequence is greater than 1, a posture whose distance from the position point where the first posture is located is not greater than a preset second distance is screened out from the trajectory point posture sequence.
5. The relocation method according to claim 4, characterized in that: After detecting whether the number of postures included in the trajectory point posture sequence is greater than 1, the method further includes: When the number of postures included in the trajectory point posture sequence is not greater than 1, the constructed grid map is cleared and the map is reconstructed.
6. The relocation method according to claim 1 or 2, characterized in that: Also includes: During the robot mapping process, the robot's position and posture on the built grid map are recorded at every first preset distance to obtain a trajectory point position and posture sequence; and during the period when the robot pauses in mapping, the robot is monitored to see whether it leaves the position point where the first posture is located; After matching the local map with the built grid map, the method further includes: In case that the matching fails and it is monitored that the robot leaves the position point where the first posture is located during the pause of mapping, determining the current posture of the robot on the local map to obtain a second posture; Determining, according to the explorable area of the local map, an exploration point whose distance from the position point where the second posture is located is not greater than a preset second distance; generating a new local map according to the exploration points; Matching the new local map with the established grid map; If the matching is successful, the constructed grid map continues to be constructed.
7. The relocation method according to claim 6, characterized in that: The generating a new local map according to the exploration points comprises: Navigate from the location point where the second posture is located to the exploration point, and obtain at least two third laser frames at the exploration point; The new local map is generated according to at least two of the third laser frames.
8. The relocation method according to claim 7, characterized in that: The number of the exploration points is greater than 1, and after matching the new local map with the established grid map, the method further includes: In the case of a matching failure, searching the explorable area at the exploration point for a target exploration point that meets the following conditions: a distance from the position point where the second posture is located is not greater than the preset second distance; a distance from the unnavigated exploration point is greater than a preset third distance, and the preset third distance is less than the preset second distance; Generate a new local map according to the target exploration point; Matching the new local map with the established grid map; If the matching is successful, the constructed grid map continues to be constructed.
9. A robot comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
11. A computer program product, characterized in that The invention comprises a computer program, which, when being executed, enables the method according to any one of claims 1 to 8 to be performed.