Global repositioning method and system based on free area of map
By using rectangular features or cuboid feature matching technology based on the map free area in the global relocation method, the problems of large amount of computing and long positioning time in the prior art are solved, and a fast and efficient relocation effect is achieved.
Patent Information
- Application Number
- CN202510100739.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-06-06
AI Technical Summary
The existing global relocation method has a large amount of computing and a long positioning time, making it difficult to quickly realize relocation in various environments.
The global relocation method based on the map free area is adopted, and the idle area is generated by obtaining local maps, and the rectangular features or cuboid features are used to match the pre-established global map feature database to quickly realize relocation.
It reduces the calculation amount and positioning time, improves matching efficiency, is suitable for open and narrow areas, and has better robustness and applicability.
Smart Images

Figure CN120101792A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of relocation technology, and in particular to a global relocation method and system based on map idle areas. Background Art
[0002] Automated Guided Vehicle (AGV), Autonomous Mobile Robot (AMR) and other robots all have positioning requirements. When a robot starts for the first time in a new map, it needs to confirm its position in the map, which involves the function of global relocalization.
[0003] Currently, there are several main ways of global repositioning: the first is to manually define a specific area, which is equivalent to converting global repositioning into local repositioning. This method requires human intervention and cannot effectively achieve autonomy. At the same time, the operator needs to know the actual position of the robot; the second is to obtain a coarse positioning value through means such as the Global Positioning System (GPS) that can provide global position information, and then perform local repositioning. This is generally used in outdoor environments; the third is to use pre-defined markers in the environment (including but not limited to reflective strips for lasers, QR codes for cameras, and general markers obtained through matching, etc.). This method increases the requirements for the on-site environment, and some environments are not suitable for the placement of markers; the fourth is to match the currently received information (including but not limited to point cloud information of lasers and depth cameras, image information of cameras) with the already built global map.
[0004] For the fourth method, existing solutions mostly use brute force matching or other improved methods (including but not limited to branch-and-bound based matching methods), but they all have large computational complexity and place high demands on the computing power of mobile devices. Summary of the invention
[0005] In view of the current problem of large amount of global relocation calculation and long positioning time, an embodiment of the present invention proposes a global relocation method based on the idle area of the map, which includes a coarse positioning means and then cooperates with a local fine positioning means to quickly achieve relocation.
[0006] To solve the above problems, an embodiment of the present invention provides a global repositioning method based on free areas of a map, the method comprising: obtaining a local map of a current position, and generating a free area according to the local map; generating a rectangular feature or a cuboid feature according to the boundary of the free area; matching the rectangular feature or the cuboid feature with a feature database of a pre-established global map; the feature database stores the rectangular features and cuboid features of the free areas in the global map; using the matched position constraints as candidate solutions for global repositioning matching to perform distance precise positioning to obtain current position information.
[0007] The global repositioning method based on the idle area of the map provided by the embodiment of the present invention uses the idle area where the robot is located to match with all the idle areas in the built map, so as to achieve rapid repositioning. The rectangular features or cuboid features used are much smaller than the number of point clouds, and the matching efficiency is higher, which reduces the amount of calculation and positioning time, and can be applied to both open areas and small areas; it has a filtering effect on areas with irregular boundaries, and the matching robustness is better than the traditional method; it can be applied to spatial matching, the calculation will not increase exponentially, and the efficiency is less affected.
[0008] Optionally, generating a free area according to the local map includes: according to point cloud data of the local map, growing outwards with the current position as the center until encountering a point cloud or a boundary of the local map, to obtain a free area around the current position.
[0009] The embodiment of the present invention provides a feasible method for generating an idle area, and can generate an idle area at a current location based on a local map.
[0010] Optionally, if the idle area is a convex polygon / convex polygon, generating a rectangular feature or a cuboid feature according to the boundary of the idle area includes: determining a coordinate system of the current position; the coordinate axes of the coordinate system are consistent with the extension direction of one or more lines and surfaces in the idle area; fitting a straight line or a plane for the maximum boundary and the minimum boundary perpendicular to each coordinate axis to obtain at least one rectangular feature or a cuboid feature; wherein, if the distance between the point cloud and the nearest straight line or the nearest plane is less than or equal to a set threshold, the nearest straight line is a solid line and the nearest plane is a real surface, and if the distance between the point cloud and the nearest straight line or the nearest plane is greater than the set threshold, the nearest straight line is a dotted line and the nearest plane is a virtual surface.
[0011] The embodiment of the present invention provides a feasible feature extraction method for convex polygons / convex polygons, and positioning is based on rectangular features or cuboid features. The amount of data is much smaller than the number of point clouds, so the matching efficiency is very high and it can be applied in both open areas and small areas.
[0012] Optionally, if the idle area is a non-convex polygon, generating a rectangular feature according to the boundary of the idle area includes: determining a coordinate system of the current position; the coordinate axis of the coordinate system is consistent with the extension direction of one or more lines and surfaces in the idle area; generating a first straight line and a second straight line parallel to the X-axis of the coordinate system; the first straight line moves from the origin along the positive axis of the Y-axis of the coordinate system, and when the largest number of point clouds falls on the first straight line, the first straight line at this position is set as the first feature line; the second straight line moves from the origin along the negative axis of the Y-axis of the coordinate system, and when the largest number of point clouds falls on the second straight line, the second straight line at this position is set as the second feature line; generating a third straight line and a fourth straight line parallel to the Y-axis of the coordinate system; the third straight line moves from the origin along the positive axis of the X-axis of the coordinate system, and when the third straight line is aligned with the rectangular feature of the idle area The feature coincides with the maximum boundary on the positive axis side, and the third straight line at this position is set as the third feature line; the fourth straight line moves from the origin along the negative axis of the X axis of the coordinate system, and when the fourth straight line coincides with the maximum boundary of the rectangular feature of the idle area on the negative axis side, the fourth straight line at this position is set as the fourth feature line; the closed rectangle composed of the first feature line, the second feature line, and the line segments of the third feature line and the fourth feature line between the first feature line and the second feature line is the first rectangular feature; the X axis is replaced by the Y axis, the Y axis is replaced by the X axis, and the closed rectangle composed of the feature lines obtained by repeating the above steps is the second rectangular feature; wherein, if the distance between the point cloud and the nearest plane is less than or equal to the set threshold, the nearest plane is a real plane, and if the distance between the point cloud and the nearest plane is greater than the set threshold, the nearest plane is a virtual plane.
[0013] Optionally, if the idle area is a non-convex polygon, generating a rectangular parallelepiped feature according to the boundary of the idle area includes: determining a coordinate system of the current position; the coordinate axes of the coordinate system are consistent with the extension direction of one or more lines and surfaces in the idle area; generating a plane Px1 parallel to the X-axis of the coordinate system and perpendicular to the Y-axis of the coordinate system, the plane Px1 is on one side of the X-axis, and the most point clouds fall on the plane Px1; generating a plane Px2 parallel to the X-axis of the coordinate system and perpendicular to the Y-axis of the coordinate system, the plane Px2 is on the other side of the X-axis, and the most point clouds fall on the plane Px2; generating a plane Py1 parallel to the Y-axis of the coordinate system and perpendicular to the X-axis of the coordinate system, and the plane Py1 is parallel to the rectangular parallelepiped of the idle area. The maximum boundary of the feature on one side of the Y-axis coincides; a plane Py2 is generated which is parallel to the Y-axis of the coordinate system and perpendicular to the X-axis of the coordinate system, and the plane Py2 coincides with the maximum boundary of the cuboid feature of the idle area on the other side of the Y-axis; the cuboid composed of the plane Px1, the plane Px2, and the part of the plane Py1 and the plane Py2 between the plane Px1 and the plane Px2 is the first cuboid feature; the X-axis is replaced by the Y-axis, the Y-axis is replaced by the X-axis, and the cuboid composed of the planes obtained by repeating the above steps is the second cuboid feature; wherein, if the distance between the point cloud and the nearest plane is less than or equal to the set threshold, the nearest plane is a real plane, and if the distance between the point cloud and the nearest plane is greater than the set threshold, the nearest plane is a virtual plane.
[0014] The embodiment of the present invention provides a feasible feature extraction method for non-convex polygons / non-convex polygons, and positioning is performed based on rectangular features or cuboid features. The amount of data is much smaller than the number of point clouds, so the matching efficiency is very high and it can be applied in both open areas and small areas.
[0015] Optionally, the matching of the rectangular feature or the cuboid feature with a feature database of a pre-established global map includes: traversing the rectangular feature / the cuboid feature, and selecting a rectangular feature / cuboid feature that matches the length and the width in a feature database of a pre-established global map according to the length and the width of the rectangular feature / the cuboid feature; traversing the matching rectangular feature / cuboid feature, and matching them with the rectangular feature / the cuboid feature of the idle area to obtain a position constraint.
[0016] The embodiment of the present invention provides a feasible method of feature matching, which can quickly achieve repositioning in conjunction with local precise positioning means.
[0017] Optionally, the method of using the matched position constraints as candidate solutions for global repositioning matching to perform distance precision positioning to obtain current position information includes: summarizing the matched position constraints, and detecting any two position constraints in turn; if two position constraints intersect, simplifying the constraints based on the following rules: two intersecting position constraints degenerate into position constraints with a smaller range; and, points that coincide with each other are still points, lines that intersect with each other degenerate into points, and surfaces that intersect with each other degenerate into lines; using the simplified position constraint set as a candidate solution for global repositioning matching to perform distance precision positioning to obtain current position information.
[0018] The embodiment of the present invention provides a constraint simplification method to simplify constraint points, lines and surfaces, thereby improving matching efficiency.
[0019] Optionally, the method further comprises: expanding each side of the rectangular feature to be matched to obtain a side with a preset width; or expanding each face of the cuboid feature to be matched to obtain a cuboid with a preset thickness.
[0020] The embodiment of the present invention appropriately expands the features, which can improve the success rate of matching and reduce the impact of feature errors.
[0021] Optionally, before generating the idle area according to the local map, the method further comprises: filtering out isolated point cloud clusters from the point cloud data of the local map.
[0022] The embodiment of the present invention proposes to remove isolated point cloud clusters to obtain features of a larger idle area, thereby avoiding affecting the integrity of the idle area.
[0023] The embodiment of the present invention provides a global relocation system based on free areas on a map, which is used in the above-mentioned global relocation method based on free areas on a map.
[0024] The global relocation system based on map free areas provided by the embodiment of the present invention can achieve the same technical effect as the global relocation method based on map free areas described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0026] Figure 1 A schematic flow chart of a global relocation method based on a map idle area provided by an embodiment of the present invention;
[0027] Figure 2 A schematic diagram of an isolated point cloud cluster in a two-dimensional point cloud map provided by an embodiment of the present invention;
[0028] Figure 3 A schematic diagram of generating rectangular features according to strategy 1 provided in an embodiment of the present invention;
[0029] Figure 4 A schematic diagram of generating rectangular features according to Strategy 2 provided in an embodiment of the present invention;
[0030] Figure 5 A schematic diagram of feature matching provided by an embodiment of the present invention;
[0031] Figure 6 A schematic diagram of reference rules for finding intersections of different types of constraints provided by an embodiment of the present invention;
[0032] Figure 7 A schematic diagram of the expansion of a rectangular feature provided by an embodiment of the present invention;
[0033] Figure 8 A schematic diagram of constraint simplification provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to make the above-mentioned objects, features and advantages of the present invention more clearly understood, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0035] The embodiment of the present invention proposes a global repositioning method based on the idle area of the map. This method belongs to the global coarse positioning method. For intelligent robots, etc., when entering a new environment or losing positioning, repositioning is required. Traditional positioning methods are based on the data of sensors (including but not limited to radar, camera, depth camera, etc.) to match the original point cloud, pixels or extracted features. As the number of sensors increases and the resolution improves, the scene becomes larger, and it is difficult to achieve rapid repositioning using ordinary methods.
[0036] Therefore, the embodiment of the present invention proposes a relocation method based on the idle area of the map, which is not matched based on the information of the sensor, but on the contrary, uses the idle area around the intelligent robot for matching. The robot can relatively easily obtain the boundary of the surrounding environment based on the current position, and further can easily obtain the idle area surrounded by the boundary, match the idle area where the current robot is located with all the idle areas in the built map, obtain a series of candidate solutions, and then use the local precise positioning method to achieve rapid relocation.
[0037] Figure 1The following is a schematic flow chart of a global relocation method based on a map idle area in an embodiment of the present invention, the method comprising:
[0038] S102, obtaining a local map of the current location, and generating a free area according to the local map.
[0039] Before generating the idle area, the integrity of the local map of the robot's current position should be ensured as much as possible, that is, the map boundary that can be displayed at the robot's current position should be displayed as much as possible. For example, the robot generates a local map by rotating in place. The local map can be point cloud data and data that can be converted into point cloud, or other data with similar point cloud.
[0040] Optionally, based on the point cloud data of the local map, the current position is taken as the center and grows outward until the point cloud or the boundary of the local map is encountered, thereby obtaining the free area around the current position. After obtaining the current local point cloud map, the current robot position is taken as the center and grows outward until the point cloud or the boundary is encountered.
[0041] In the process of generating the idle area, sometimes there will be a small cluster of point cloud occlusion in the map, which will affect the generation of the idle area features, so it can be regarded as an isolated point cloud cluster and filtered out. Based on this, the above method can also include: filtering out the isolated point cloud cluster on the point cloud data of the above local map.
[0042] Exemplarily, there are two criteria for determining an isolated point cloud cluster: first, the distance between all point clouds in the point cloud cluster and other point clouds is greater than d (d is a settable value); second, the diameter of the smallest circle that can completely include the point cloud cluster is less than r (r is a settable value).
[0043] S104: Generate a rectangular feature or a cuboid feature according to the boundary of the idle area.
[0044] In this embodiment, for two-dimensional maps, the features of the idle area are rectangular features; for three-dimensional maps, the features of the idle area are cuboid features, which add a height constraint to the above-mentioned rectangular features, and the bottom and top surfaces of the cuboid features can be ignored.
[0045] This embodiment divides the idle area into convex polygons / convex polygons and non-convex polygons / non-convex polygons, and provides methods for extracting rectangular features and cuboid features, respectively.
[0046] In the specific implementation process, convex polygons are not strict. If there is a small local non-convex area, the entire free area can also be considered convex, so the category of the current free area can be determined based on the proportion of the non-convex area. When the proportion of the non-convex area is less than the proportional coefficient k, it is considered a convex polygon, otherwise it is considered a convex polygon. The proportional coefficient k is determined according to the boundary of the free area, for example:
[0047] k = side length of non-convex area / side length of entire boundary
[0048] Similarly, for polygons, the proportionality factor k is calculated based on the approximate area.
[0049] If the free area is a convex polygon / convex polyhedron, the method of extracting rectangular features or cuboid features is as follows:
[0050] First, determine the coordinate system of the current position. The coordinate axes of the coordinate system are consistent with the extension direction of one or more lines and surfaces in the idle area, and the origin of the coordinate system is the current position of the robot. The coordinate axes of the coordinate system should be consistent with the extension direction of the lines and surfaces in the environment as much as possible.
[0051] For example, the orientation of the coordinate axis at the robot's position is determined based on the Random Sample Consensus (RANSAC) algorithm. The orientation of the robot's coordinate axis maintains a consistent rule throughout the entire relocation process, that is, a unified selection rule is used for different positions of the entire map. For example, the principle of minimum rotation angle is adopted, that is, after the current robot is adjusted by RANSCA, the direction with the smallest rotation angle is the orientation of the coordinate axis, because turning left or right can align, and the one with the smallest rotation angle can be selected.
[0052] Then, a straight line or a plane is fitted to the maximum boundary and the minimum boundary perpendicular to each coordinate axis to obtain at least one rectangular feature or a cuboid feature.
[0053] Based on the rectangular characteristics of the above-mentioned idle area, there must be two boundaries perpendicular to the coordinate axis. In view of the exploration distance limit of the sensor, the area beyond a certain area is an unexplored area, so the boundary is represented by a dotted line. In general, the lengths of multiple boundaries parallel to the coordinate axis are not equal. If they are equal, any one of them can be used as the maximum boundary. Exemplarily, line and surface features are formed by fitting and other methods for local point cloud data. A closed rectangle composed of multiple lines is a rectangular feature, and at least one rectangular feature can be obtained for a convex polygon; a closed rectangular tube composed of multiple faces is a cuboid feature, and at least one cuboid feature can be obtained for a convex polygon.
[0054] Among them, if the distance between the point cloud and the nearest straight line or the nearest plane is less than or equal to the set threshold, the nearest straight line is a solid line and the nearest plane is a real surface. If the distance between the point cloud and the nearest straight line or the nearest plane is greater than the set threshold, the nearest straight line is a dotted line and the nearest plane is a virtual surface.
[0055] If the free area is a non-convex polygon, the method of extracting rectangular features is as follows:
[0056] First, determine the coordinate system of the current position; the coordinate axis of the coordinate system is consistent with the extension direction of one or more lines and surfaces in the idle area. The method of determining the coordinate system is the same as above.
[0057] Secondly, generate the first straight line and the second straight line parallel to the X-axis of the coordinate system. The first straight line moves from the origin along the positive axis of the Y-axis of the coordinate system. When the most point clouds fall on the first straight line, the first straight line at this position is set as the first characteristic line; the second straight line moves from the origin along the negative axis of the Y-axis of the coordinate system. When the most point clouds fall on the second straight line, the second straight line at this position is set as the second characteristic line. Among them, the most point clouds fall on the first straight line refers to the situation that the most point clouds fall on the first straight line on one side of the X-axis, and the most point clouds fall on the second straight line refers to the situation that the most point clouds fall on the second straight line on the other side of the X-axis.
[0058] Then, generate the third straight line and the fourth straight line parallel to the Y axis of the coordinate system. The third straight line moves from the origin along the positive axis of the X axis of the coordinate system. When the third straight line coincides with the maximum boundary of the rectangular feature of the idle area on the positive axis side, the third straight line at this position is set as the third characteristic line; the fourth straight line moves from the origin along the negative axis of the X axis of the coordinate system. When the fourth straight line coincides with the maximum boundary of the rectangular feature of the idle area on the negative axis side, the fourth straight line at this position is set as the fourth characteristic line. Among them, the third straight line and the fourth straight line are selected from the maximum boundaries on both sides of the rectangular feature.
[0059] The first characteristic line, the second characteristic line, and the third characteristic line and the fourth characteristic line form a closed rectangle between the first characteristic line and the second characteristic line as the first rectangular feature. Replace the X axis with the Y axis, and the Y axis with the X axis, and repeat the above steps to obtain a closed rectangle formed by the characteristic lines as the second rectangular feature.
[0060] Among them, if the distance between the point cloud and the nearest plane is less than or equal to the set threshold, the nearest plane is a real plane, and if the distance between the point cloud and the nearest plane is greater than the set threshold, the nearest plane is a virtual plane.
[0061] If the free area is a non-convex polygon, the method of extracting rectangular features is as follows:
[0062] First, determine the coordinate system of the current position. The coordinate axis of the coordinate system is consistent with the extension direction of one or more lines and surfaces in the idle area. The method of determining the coordinate system is the same as above.
[0063] Secondly, generate a plane Px1 parallel to the X-axis of the coordinate system and perpendicular to the Y-axis of the coordinate system. Plane Px1 is on one side of the X-axis, and the most point clouds fall on plane Px1. Generate a plane Px2 parallel to the X-axis of the coordinate system and perpendicular to the Y-axis of the coordinate system. Plane Px2 is on the other side of the X-axis, and the most point clouds fall on plane Px2.
[0064] Then, a plane Py1 is generated which is parallel to the Y axis of the coordinate system and perpendicular to the X axis of the coordinate system, and the plane Py1 coincides with the maximum boundary of the rectangular feature of the idle area on one side of the Y axis; a plane Py2 is generated which is parallel to the Y axis of the coordinate system and perpendicular to the X axis of the coordinate system, and the plane Py2 coincides with the maximum boundary of the rectangular feature of the idle area on the other side of the Y axis.
[0065] The cuboid formed by plane Px1, plane Px2, and the part of plane Py1 and plane Py2 between plane Px1 and plane Px2 is the first cuboid feature. Replace the X axis with the Y and Z axes, and replace the Y and Z axes with the X axis, and repeat the above steps to obtain the cuboid formed by the planes as the second cuboid feature.
[0066] Among them, if the distance between the point cloud and the nearest plane is less than or equal to the set threshold, the nearest plane is a real plane, and if the distance between the point cloud and the nearest plane is greater than the set threshold, the nearest plane is a virtual plane.
[0067] In this embodiment, due to the characteristics of the rectangular features and the cuboid features themselves, a filtering effect is provided for regions with irregular boundaries, so the matching robustness is better than that of the traditional method.
[0068] S106, matching the rectangular features or cuboid features with a pre-established feature database of the global map.
[0069] The feature database stores rectangular features and cuboid features of free areas in the global map, and the extraction method thereof is consistent with the feature extraction method of the local map.
[0070] Specifically, the above rectangular features / cuboid features are traversed, and according to the length and width of each rectangular feature / cuboid feature, a rectangular feature / cuboid feature that matches the above length and width is selected from a feature database of a pre-established global map. There can be multiple rectangular features or cuboid features generated based on the boundary of the idle area, and each feature is compared with the features in the feature database to filter out features that match both the length and width.
[0071] Traverse the matching rectangular features / cuboid features and match them with the rectangular features / cuboid features of the free area to obtain position constraints. For the features that match the length and width, further feature matching is performed to obtain position constraints. For example, the position constraint can be a point, a line, or a surface.
[0072] In order to improve the success rate of matching and reduce the impact of feature errors, the features to be matched can be expanded to a certain extent during the matching process. Specifically, each side of the rectangular feature to be matched is expanded to obtain a side with a preset width; or each face of the cuboid feature to be matched is expanded to obtain a cuboid with a preset thickness.
[0073] The rectangular features and cuboid features used in this embodiment are much smaller than the number of point clouds, so the matching efficiency is higher and it is applicable to both open areas and small areas.
[0074] The above matching process may result in multiple position constraints. The intersection of all constraints is the matching result. Solid lines have actual constraint effects, while dashed lines have no actual constraint effects. Different types of constraints are from different coordinate systems, so they all have vertical intersections. Therefore, solid lines intersect at one point, and solid surfaces intersect at a straight line. When a solid line intersects a dashed line, the original solid line constraint feature is retained.
[0075] S108, using the position constraint obtained by matching as a candidate solution for global relocation matching to perform distance precise positioning to obtain current position information.
[0076] This implementation provides a method for simplifying the obtained position constraints. Since multiple rectangular features can be extracted from the same area, during the matching process, the same position will generate several constraint points, lines, and surfaces. At the same time, when the current feature is matched with the global feature, multiple candidate solutions will be generated. Therefore, it is necessary to simplify the constraint points, lines, and surfaces.
[0077] First, all the matched position constraints are summarized and any two position constraints are tested in turn; then, if the two position constraints intersect, the constraints are simplified based on the following rules:
[0078] Two intersecting position constraints degenerate into position constraints with a smaller scope. For example, a point and a line intersect to a point, and points that coincide are still points, lines that intersect to a point, and surfaces that intersect to a line.
[0079] The simplified position constraint set is used as a candidate solution for global relocation matching to perform distance precision positioning and obtain the current position information.
[0080] The above feature extraction and matching methods are applicable to both plane and space situations. The objects of matching are point clouds and data that can be converted into point clouds, as well as other data with similar point clouds. When switching from plane matching to space matching, the amount of calculation will not increase exponentially, and the efficiency will be less affected.
[0081] On the one hand, this embodiment can be run alone to realize the relocation function, and on the other hand, when necessary, this method can also be used in combination with other relocation methods to improve the efficiency of relocation. For example, this method can be used as a coarse positioning method in combination with other precise positioning methods.
[0082] The global repositioning method based on the idle area of the map provided by the embodiment of the present invention uses the idle area where the robot is located to match with all the idle areas in the built map, so as to achieve rapid repositioning. The rectangular features or cuboid features used are much smaller than the number of point clouds, and the matching efficiency is higher, which reduces the amount of calculation and positioning time, and can be applied to both open areas and small areas; it has a filtering effect on areas with irregular boundaries, and the matching robustness is better than the traditional method; it can be applied to spatial matching, the calculation will not increase exponentially, and the efficiency is less affected.
[0083] The following embodiments are described by taking relocation based on a two-dimensional map as an example.
[0084] When the robot enters a new environment or is moved manually, it will lose the current positioning information. At this time, it needs to re-position itself globally to confirm its position. Since this embodiment mainly involves the repositioning method, an assumption is made for the mapping process, that is, the robot has completed the mapping of the environment and feature extraction. At the same time, in the implementation case of the two-dimensional map, the matching feature of the plane map uses a rectangular feature.
[0085] Step 1: Generate an idle area based on the robot's current local map.
[0086] Before generating the free area, the integrity of the local map should be ensured as much as possible, that is, the map boundary that can be displayed at the current robot position should be displayed as much as possible. An optional approach is to generate a local map by rotating the robot in place. After obtaining the current local point cloud map, it is grown outward with the current robot position as the center until it encounters a point cloud or boundary.
[0087] In the process of generating idle areas, sometimes there will be a small cluster of point clouds in the map, which will affect the generation of idle area features, so it can be regarded as an isolated point cloud filter. There are two criteria for filtering: first, the distance between all point clouds of the point cloud cluster and other point clouds is greater than d (d is a settable value); second, the diameter of the smallest circle that can completely include the point cloud cluster is less than r (r is a settable value).
[0088] Figure 2 A schematic diagram of an isolated point cloud cluster in a two-dimensional point cloud map is shown, where the dotted box is the isolated point cloud cluster. Due to the viewing angle problem, the undetected area behind the point cloud cluster does not affect the judgment.
[0089] Step 2: Determine the strategy for generating rectangular features in the current local map.
[0090] This embodiment proposes two strategies for generating rectangular features. The first strategy is applicable when the idle area where the current robot is located is a convex polygon area, and the second strategy is applicable when the area where the current robot is located is a non-convex polygon area.
[0091] In the specific implementation process, the convex polygon area is not strict. What this means is that if there is a small local non-convex area, the entire polygon area can also be considered convex. Specifically, the usage strategy of the current area can be determined based on the occupation ratio of the non-convex area. When the non-convex area is less than the proportional coefficient k, it is considered to be a convex polygon and the first strategy is used to generate rectangular features. Otherwise, the second strategy is used to generate rectangular features. Proportional coefficient k = side length of non-convex area / side length of the entire boundary.
[0092] The first strategy generates at least one rectangular feature, and the second strategy generates at least two rectangular features. Then, the orientation of the coordinate axis at the robot position is determined based on a random sampling consensus algorithm.
[0093] Step 3 (optional): Generate rectangular features according to strategy 1.
[0094] This strategy is mainly used to solve the problem of rectangular feature generation of convex polygons. In the process of relocalization, there are rarely standard rectangular free areas in the actual environment, so a specific method is needed to generate polygonal features that can be suitable for matching. In the area where free rectangular features need to be generated in the local map, firstly, based on the position of the robot itself (the coordinate system position, but the coordinate system is not the actual position of the robot, but after alignment), the maximum and minimum boundary fitting lines perpendicular to each coordinate axis are fitted; secondly, for the fitted straight line, the actual point cloud distance to the fitted straight line is less than or equal to a certain set threshold, which is a solid line, and greater than the threshold is a dotted line. To ensure integrity, the dotted line segment between two solid lines that is less than a pre-set length threshold can also be set as a solid line. The boundary without point cloud is the missing boundary, which is a dotted line.
[0095] After fitting a straight line, the distance from the nearest point to the line can be calculated. If the distance is greater than a certain threshold, it is a dotted line. To determine whether it is a solid line or a dotted line, it can be calculated in a discrete manner. For example, the fitted line is discretized into small line segments of 1 cm, and then each line segment is calculated to be a solid line or a dotted line. There are two possibilities for dotted lines. One is that there is no point cloud at a certain position due to the limited radar detection range; the other is that during the fitting process, the point cloud of the line segment is far away from the line segment.
[0096] Figure 3 The figure shows the schematic diagram of generating rectangular features according to strategy 1, with the actual point cloud map on the left and the fitted rectangular features on the right. Among them, a represents the upper and lower boundaries, which are dashed lines because of the distance limit of sensor detection; b represents the rotated coordinate system, and c represents the dashed line obtained by fitting, which is a dashed line because there is no point cloud near the fitting line.
[0097] Step 4 (optional): Generate rectangular features according to strategy 2.
[0098] Based on the robot's own position (the coordinate system position, but the coordinate system is not the actual position of the robot, but after alignment), first generate two straight lines parallel to the X-axis, and move based on the Y-axis to the positive and negative axes. When the most point clouds fall on the straight line, it is set as a feature line. Then generate two straight lines parallel to the Y-axis. The straight line selects the maximum boundary of the rectangular feature, and selects the part between the two feature lines parallel to the X-axis, thereby generating a closed rectangular frame, which is rectangular feature 1. Then start from the Y-axis and generate rectangular feature 2.
[0099] Figure 4 The figure shows a schematic diagram of generating rectangular features according to Strategy 2, with the actual point cloud map on the left and the fitted rectangular features on the right. Figure 4 The horizontal rectangular frame in the middle is rectangular feature one, and the vertical rectangular frame is rectangular feature two.
[0100] Step 5: Perform feature matching.
[0101] Traverse the rectangular features generated in step 3 and step 4, and match them with the feature database generated by the global map. The specific matching process is as follows:
[0102] (1) Traverse the currently generated features and select the features that meet the requirements from the global feature database based on the length and width of the rectangular feature, L1 and L2. To ensure robustness, the selection range needs to be appropriately relaxed, for example, the relaxation range is L±0.2L;
[0103] (2) Traverse the features obtained by filtering in (1) and match them with the features of the current free area. If the strong constraint match is successful, the matching constraint is a point; if the weak constraint match is successful, the matching constraint is a line. Strong constraints refer to the situation where there are at least two solid edges and at least two solid edges are not parallel. The situation other than strong constraints is weak constraints.
[0104] like Figure 5 The feature matching diagram shown in the figure shows the matching points on the top and the matching lines on the bottom. Figure 5 In the figure, a relative translation is added between the two borders to make it clear, but in fact the two borders overlap after matching.
[0105] If there is a solid line between the two lines that the coordinate axis passes through, the matching constraint is a solid line; if the two lines that the coordinate axis passes through are both dashed lines, the matching constraint is a dashed line. Then find the intersection of all constraints, which is the matching result.
[0106] Figure 6 A schematic diagram showing reference rules for finding intersections of different types of constraints. A solid line intersects with a solid line at a point, a solid line intersects with a solid surface at a point, and a solid surface intersects with a solid surface at a straight line. When a solid line intersects with a dotted line, the original solid line constraint feature is retained; when a real surface intersects with a dotted surface, the original real surface constraint feature is retained.
[0107] In order to improve the success rate of matching and reduce the impact of the error of the rectangular feature, the boundary of the rectangular feature to be matched will be expanded to a certain extent during the matching process. Figure 7 A schematic diagram of the expansion of a rectangular feature is shown. Figure 7 The solid line in the middle is the rectangular feature of the map, and the shadow with width is the dilated rectangular feature to be matched.
[0108] Step 6: Summarize all the matched position constraints and simplify them using the constraint simplification method proposed in this embodiment. The simplified constraint set is the candidate solution for global relocation matching. When matching constraints, the matching score can be obtained according to the matching situation, and then the candidate solutions are sorted according to the score. The candidate solutions with the preferred order are used for local precise matching, so that relocation can be completed quickly.
[0109] Figure 8 The diagram of constraint simplification is shown. The left side is a diagram before constraint simplification, and the right side is a diagram after constraint simplification. The left side diagram shows constraint 1 (point), constraint 2 (line), constraint 3 (line), constraint 4 (line), and constraint 5 (point). The right side diagram shows that constraint 1 and constraint 2 are identified as point 1 after simplification, constraint 2 and constraint 3 are identified as point 2 after simplification, and constraint 4 and constraint 5 remain unchanged.
[0110] The following embodiments are described by taking repositioning based on a three-dimensional map as an example.
[0111] In this embodiment, the robot has completed the mapping and feature extraction of the environment. This implementation case is based on an indoor ground mobile robot. Assuming that the ground is relatively flat, a rectangular parallelepiped is used here as the extraction feature of the idle area. At the same time, the distance from the robot to the ground is basically the same. Therefore, in this embodiment, a height constraint h is added, that is, no feature matching is required in the height direction, and only the four faces passing through the X-axis and the Y-axis need to be matched.
[0112] Step 1: Generate free areas based on the current local map.
[0113] This step is similar to the above-mentioned embodiment and will not be described again here.
[0114] Step 2: Determine the strategy for generating cuboid features in the current local map.
[0115] This embodiment proposes two strategies for generating rectangular features. The first one is applicable to the idle area where the current robot is located, which is a convex polyhedron area, and the second one is applicable to the area where the current robot is located, which is a non-convex polygonal area. In the specific implementation process, the convex polyhedron area is not strict. What is meant here is that if there is a small local area of non-convexity, the entire polyhedron area can also be considered as convex. Therefore, the use strategy of the current area can be determined according to the occupancy ratio of the non-convex area. When the non-convex area is smaller than the proportional coefficient k (the approximate area of the non-convex area / the approximate area of the entire area), it is considered to be a convex polyhedron, and the first strategy is used to generate rectangular features, otherwise the second strategy is used to generate rectangular features. The first strategy will generate at least one rectangular feature, and the second strategy will generate at least two rectangular features. Then the orientation of the coordinate axis at the robot position is determined according to the random sampling consistency algorithm.
[0116] Step 3 (optional): Generate cuboid features based on the strategy.
[0117] This method is mainly used to solve the problem of cuboid feature generation of convex polyhedrons. In the relocation process, there are rarely standard cuboid free areas in the actual environment. Therefore, a specific method is needed to generate cuboid features that can be suitable for matching. In the area where the local map needs to generate free cuboid features, firstly, based on the position of the robot itself (the coordinate system position, but the coordinate system is not the actual position of the robot, but after alignment), the maximum and minimum boundary fitting planes perpendicular to each coordinate axis are used. Secondly, for the fitted plane, the actual point cloud distance to the fitted plane is less than or equal to a certain set threshold, which is a real surface, and greater than the threshold is a virtual surface. To ensure integrity, the virtual surface in the real surface that is less than the pre-set area threshold can also be set as a real surface. Missing boundaries are represented by virtual surfaces. In this embodiment, the bottom and top surfaces of the cuboid can be ignored.
[0118] Step 4 (optional): Generate rectangular features based on strategy 2.
[0119] The coordinate system currently used is not the actual position of the robot, but the coordinate system after alignment. First, generate a rectangular feature with the main direction of X. Parallel to the X-axis, fit two planes Px1 and Px2 of the rectangular block on both sides perpendicular to the Y-axis to ensure that the most point clouds fall on the plane; then parallel to the Y-axis and perpendicular to the X-axis, generate another two planes Py1 and Py2 on both sides, select the maximum boundary of the rectangular block as the plane, and intercept the part between Px1 and Px2. Then generate a rectangular feature with the main direction of Y according to the same rules. Since this implementation case has added constraints in the Z-axis direction, there is no need to fit the plane here.
[0120] Step 5: Perform feature matching.
[0121] Traverse the rectangular features generated in step 3 and step 4, and match them with the feature database generated by the global map. The specific matching process is as follows:
[0122] (1) Traverse the currently generated features and select the features that meet the requirements from the global feature database based on the length and width of the rectangular feature, L1 and L2. To ensure robustness, the selection range needs to be appropriately relaxed, such as L±0.2L;
[0123] (2) Traverse the features filtered by (1) and match them with the current features. If the strong constraint match is successful, the matching constraint is a line parallel to the Z axis; if the weak constraint match is successful, the matching constraint is a face. Strong constraints refer to at least two real faces, and at least two real faces are not parallel. Situations other than strong constraints are weak constraints.
[0124] In order to improve the success rate of matching and reduce the impact of feature errors, during the matching process, each face feature of the cuboid to be matched will be expanded to a certain extent, from the original face to a cuboid with a certain thickness. Because the Z axis is constrained, the final matching result is a point for the strong constraint case, and a line for the weak constraint case.
[0125] Step 6: Summarize all the matched position constraints and simplify them using the constraint simplification method proposed in this embodiment. The simplified constraint set is the candidate solution for global relocation matching. When matching constraints, the matching score can be obtained according to the matching situation, and then the candidate solutions can be sorted according to the score. The candidate solutions with the preferred order are used for local precise matching, so that relocation can be completed quickly.
[0126] The embodiments of the present invention have the following advantages:
[0127] 1. As a global coarse positioning method, the polygon (polyhedron) features used in the embodiment of the present invention are much smaller than the number of point clouds, so the matching efficiency is very high and it can be applied in both open areas and small areas.
[0128] 2. Due to the characteristics of polygon (polyhedron) features themselves, they have a filtering effect on areas with irregular boundaries, so the matching robustness is better than traditional methods.
[0129] 3. When switching from plane matching to space matching, the calculation will not increase exponentially and the efficiency will be less affected.
[0130] The embodiment of the present invention further provides a global repositioning system based on free areas of a map, which is used to execute the above-mentioned global repositioning method based on free areas of a map.
[0131] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned global relocation method embodiment based on the free area of the map is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0132] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the control device through a computer, and the program can be stored in a computer-readable storage medium. When the program is executed, it may include the processes of the above-mentioned method embodiments, wherein the storage medium may be a memory, a disk, an optical disk, etc.
[0133] In this article, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0134] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0135] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A global relocation method based on map idle areas, characterized in that: The method comprises: Obtaining a local map of the current location, and generating a free area according to the local map; Generate a rectangular feature or a cuboid feature according to the boundary of the idle area; Matching the rectangular features or the cuboid features with a pre-established feature database of a global map; the feature database stores the rectangular features and cuboid features of the free areas in the global map; The matched position constraints are used as candidate solutions for global relocation matching to perform distance precision positioning and obtain the current position information.
2. The method according to claim 1, characterized in that The generating of the idle area according to the local map comprises: According to the point cloud data of the local map, the free area around the current position is obtained by growing outwards with the current position as the center until the point cloud or the boundary of the local map is encountered.
3. The method according to claim 1, characterized in that If the idle area is a convex polygon / convex polygon, generating a rectangular feature or a cuboid feature according to the boundary of the idle area includes: Determine a coordinate system of the current position; the coordinate axes of the coordinate system are consistent with the extension direction of one or more lines and surfaces in the idle area; For the maximum boundary and minimum boundary fitting straight line or plane perpendicular to each coordinate axis, at least one rectangular feature or cuboid feature is obtained; wherein, if the distance between the point cloud and the nearest straight line or the nearest plane is less than or equal to a set threshold, the nearest straight line is a solid line and the nearest plane is a real surface; if the distance between the point cloud and the nearest straight line or the nearest plane is greater than the set threshold, the nearest straight line is a dotted line and the nearest plane is a dotted surface.
4. The method according to claim 1, characterized in that: If the idle area is a non-convex polygon, generating a rectangular feature according to a boundary of the idle area includes: Determine a coordinate system of the current position; the coordinate axes of the coordinate system are consistent with the extension direction of one or more lines and surfaces in the idle area; Generate a first straight line and a second straight line parallel to the X-axis of the coordinate system; the first straight line moves from the origin along the positive axis of the Y-axis of the coordinate system, and when the most point clouds fall on the first straight line, the first straight line at this position is set as the first characteristic line; the second straight line moves from the origin along the negative axis of the Y-axis of the coordinate system, and when the most point clouds fall on the second straight line, the second straight line at this position is set as the second characteristic line; Generate a third straight line and a fourth straight line parallel to the Y axis of the coordinate system; the third straight line moves from the origin along the positive axis of the X axis of the coordinate system, and when the third straight line coincides with the maximum boundary of the rectangular feature of the idle area on the positive axis side, the third straight line at this position is set as the third characteristic line; the fourth straight line moves from the origin along the negative axis of the X axis of the coordinate system, and when the fourth straight line coincides with the maximum boundary of the rectangular feature of the idle area on the negative axis side, the fourth straight line at this position is set as the fourth characteristic line; The closed rectangle formed by the first characteristic line, the second characteristic line, the third characteristic line, and the fourth characteristic line between the first characteristic line and the second characteristic line is the first rectangular feature; the closed rectangle formed by the characteristic lines obtained by repeating the above steps by replacing the X axis with the Y axis and the Y axis with the X axis is the second rectangular feature; If the distance between the point cloud and the nearest plane is less than or equal to a set threshold, the nearest plane is a real plane; if the distance between the point cloud and the nearest plane is greater than the set threshold, the nearest plane is a virtual plane.
5. The method according to claim 1, characterized in that: If the idle area is a non-convex polygon, generating a cuboid feature according to the boundary of the idle area includes: Determine a coordinate system of the current position; the coordinate axes of the coordinate system are consistent with the extension direction of one or more lines and surfaces in the idle area; Generate a plane Px1 parallel to the X-axis of the coordinate system and perpendicular to the Y-axis of the coordinate system, the plane Px1 is on one side of the X-axis, and most point clouds fall on the plane Px1; generate a plane Px2 parallel to the X-axis of the coordinate system and perpendicular to the Y-axis of the coordinate system, the plane Px2 is on the other side of the X-axis, and most point clouds fall on the plane Px2; Generate a plane Py1 parallel to the Y axis of the coordinate system and perpendicular to the X axis of the coordinate system, wherein the plane Py1 coincides with the maximum boundary of the cuboid feature of the idle area on one side of the Y axis; generate a plane Py2 parallel to the Y axis of the coordinate system and perpendicular to the X axis of the coordinate system, wherein the plane Py2 coincides with the maximum boundary of the cuboid feature of the idle area on the other side of the Y axis; The rectangular parallelepiped formed by the plane Px1, the plane Px2, the plane Py1, and the plane Py2 between the plane Px1 and the plane Px2 is the first rectangular parallelepiped feature; the rectangular parallelepiped formed by the planes obtained by replacing the X-axis with the Y-axis and the Y-axis with the X-axis and repeating the above steps is the second rectangular parallelepiped feature; If the distance between the point cloud and the nearest plane is less than or equal to a set threshold, the nearest plane is a real plane; if the distance between the point cloud and the nearest plane is greater than the set threshold, the nearest plane is a virtual plane.
6. The method according to any one of claims 3 to 5, characterized in that: The matching of the rectangular feature or the cuboid feature with a pre-established feature database of a global map includes: Traversing the rectangular features / the cuboid features, and selecting, according to the length and width of the rectangular features / the cuboid features, a rectangular feature / cuboid feature that matches the length and the width from a feature database of a pre-established global map; The matching rectangular features / cuboid features are traversed and matched with the rectangular features / cuboid features of the idle area to obtain position constraints.
7. The method according to claim 6, characterized in that The method of using the matched position constraint as a candidate solution for global relocation matching to perform distance precise positioning to obtain current position information includes: Summarize the matched position constraints and detect any two position constraints in sequence; If two position constraints intersect, the constraints are simplified based on the following rules: two intersecting position constraints degenerate into the position constraints with a smaller range; and, points that coincide with each other are still points, lines that intersect with each other degenerate into points, and surfaces that intersect with each other degenerate into lines; The simplified position constraint set is used as a candidate solution for global relocation matching to perform distance precision positioning and obtain the current position information.
8. The method according to claim 6, characterized in that The method further comprises: Expand each edge of the rectangular feature to be matched to obtain an edge with a preset width; or, Each face of the cuboid feature to be matched is expanded to obtain a cuboid with a preset thickness.
9. The method according to claim 2, characterized in that: Before generating the idle area according to the local map, the method further includes: An operation of filtering out isolated point cloud clusters is performed on the point cloud data of the local map.
10. A global relocation system based on map free area, characterized in that: Used to execute the global repositioning method based on map free area as described in any one of claims 1-9.