Robot positioning method, device, electronic equipment and storage medium
By integrating and matching three-dimensional point cloud data and area maps, the robot's current position data is determined, and the problems of slow indoor positioning speed and low accuracy of intelligent robots are solved, achieving more efficient and accurate positioning.
Patent Information
- Application Number
- CN202411279813.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-09-12
AI Technical Summary
In the field of intelligent robots, indoor positioning is under strong environmental interference, accurate long-term positioning tasks face huge challenges, and the existing technology has the defects of slow speed or low accuracy.
By obtaining the area map and three-dimensional point cloud data of the area where the robot is located, the two-dimensional coordinate data of the point farthest from the robot's position in the three-dimensional point cloud data is integrated to form a two-dimensional point set, and matching it with the area map based on this to obtain multiple alternative pose data. Then, the score of the alternative pose data is determined based on the predetermined function, and the pose data with the highest score is selected as the current pose data of the robot.
This method can improve the speed and accuracy of robot positioning, reduce the amount of data calculation, enhance the accuracy of posture tracking, and is suitable for precise positioning under conditions of strong environmental interference.
Smart Images

Figure CN118823124B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent robots, and in particular to a robot positioning method, device, electronic equipment and storage medium. Background Art
[0002] In the field of intelligent robots, indoor positioning faces huge challenges in the long-term accurate positioning task under the condition of strong environmental interference. At present, robot positioning and tracking technology still has the defects of slow speed or low accuracy. Summary of the invention
[0003] The embodiments of the present application provide a robot positioning method, device, electronic device and storage medium to solve the technical problem of slow indoor positioning of the robot.
[0004] According to one aspect of an embodiment of the present application, a robot positioning method is provided, including: obtaining an area map and three-dimensional point cloud data of an area where the robot is located; integrating the two-dimensional coordinate data of the point farthest from the robot position in each column of the three-dimensional point cloud data to obtain a two-dimensional point set; matching the two-dimensional point set with the area map to obtain a plurality of alternative posture data; determining a score for the alternative posture data based on a predetermined function; the score characterizing the degree of matching between the alternative posture data and the area map; and determining the alternative posture data with the highest score as the current posture data of the robot.
[0005] Furthermore, the method of obtaining a plurality of candidate pose data based on matching the two-dimensional point set with the area map comprises: determining a boundary of the area map that intersects with the ray where each point in the two-dimensional point set is located; determining a distance value from each point to the boundary; and determining a plurality of candidate pose data based on the distance value.
[0006] Furthermore, determining the score of the alternative posture data based on a predetermined function includes: determining the error value of the alternative position data based on the distance value corresponding to the alternative posture data and a predetermined threshold through at least one error function; the error value represents the degree of matching between the alternative posture data and the area map; and determining the score of the alternative posture data based on at least one of the error values and a scoring function.
[0007] Further, the determining of the highest-scoring alternative posture data as the current posture data of the robot includes: determining a weighting coefficient based on a distance value corresponding to the highest-scoring alternative posture data and multiple distance thresholds through a weight function; performing alignment based on the weighting coefficient, the point corresponding to the highest-scoring alternative posture data, and a translation vector; and determining the aligned alternative posture data as the current posture data of the robot.
[0008] Furthermore, the method obtains a plurality of candidate pose data based on matching the two-dimensional point set with the area map, including: dividing the area map into a predetermined number of direction intervals; determining the ratio of the number of points in the second point set that fall into each direction interval to the total number of points in the second point set; in response to the existence of a target direction interval in which the ratio of the number of points to the total number of points is greater than a predetermined ratio, determining a downsampling rate of the target direction interval, and the downsampling rate is greater than 1; downsampling the points that fall into the target direction interval based on the downsampling rate; and obtaining a plurality of candidate pose data based on matching each point in the two-dimensional point set after downsampling with the area map.
[0009] Furthermore, obtaining a regional map of the area where the robot is located includes: obtaining first air pressure information of the robot's current environment; comparing the first air pressure information with second air pressure information of a base station to determine the altitude information of the robot; determining the area where the robot is located based on the altitude information; and obtaining a regional map corresponding to the area in a predetermined database.
[0010] Furthermore, the area map includes multiple edges, and the edges represent boundaries or channels of the area; the obtaining of the area map of the area where the robot is located includes: obtaining the area map of the area where the robot is located, measurement information of the area map, and semantic information of multiple edges in the area map; the matching based on each point in the two-dimensional point set with the area map includes: matching based on each point in the two-dimensional point set with the area map, the measurement information, and the semantic information.
[0011] According to another aspect of an embodiment of the present application, a robot positioning device is also provided, including: an acquisition module, used to acquire an area map and three-dimensional point cloud data of an area where the robot is located; an integration module, used to integrate the two-dimensional coordinate data of the point farthest from the robot position in each column of the three-dimensional point cloud data to obtain a two-dimensional point set; a matching module, used to match the area map based on the two-dimensional point set to obtain a plurality of alternative posture data; a scoring module, used to determine a score of the alternative posture data based on a predetermined function; the score represents a degree of matching between the alternative posture data and the area map; a determination module, used to determine that the alternative posture data with the highest score is the current posture data of the robot.
[0012] Furthermore, the matching module is specifically used to: determine the boundary of the area map that intersects with the ray where each point in the two-dimensional point set is located; determine the distance value between each point and the boundary; and determine multiple alternative posture data based on the distance value.
[0013] Furthermore, the scoring module is specifically used to: determine the error value of the alternative position data based on the distance value corresponding to the alternative posture data and a predetermined threshold through at least one error function; the error value represents the degree of matching between the alternative posture data and the area map; and determine the score of the alternative posture data based on at least one of the error values and the scoring function.
[0014] Furthermore, the determination module is specifically used to: determine a weighting coefficient based on a distance value corresponding to the highest-scoring alternative posture data and multiple distance thresholds through a weight function; perform alignment based on the weighting coefficient, the point corresponding to the highest-scoring alternative posture data, and the translation vector; and determine that the aligned alternative posture data is the current posture data of the robot.
[0015] Furthermore, the matching module is specifically used to: divide the area map into a predetermined number of direction intervals; determine the ratio of the number of points in the second point set that fall into each direction interval to the total number of points in the second point set; in response to the existence of a target direction interval in which the ratio of the number of points to the total number of points is greater than a predetermined ratio, determine the downsampling rate of the target direction interval, and the downsampling rate is greater than 1; downsample the points that fall into the target direction interval based on the downsampling rate; match each point in the two-dimensional point set after downsampling with the area map to obtain multiple alternative posture data.
[0016] Furthermore, the acquisition module is specifically used to: acquire first air pressure information of the robot's current environment; compare the first air pressure information with second air pressure information of a base station to determine the altitude information of the robot; determine the area where the robot is located based on the altitude information; and acquire an area map corresponding to the area in a predetermined database.
[0017] Furthermore, the area map includes multiple edges, and the edges represent boundaries or channels of the area; the acquisition module is specifically used to: obtain the area map of the area where the robot is located, the measurement information of the area map, and the semantic information of the multiple edges in the area map; the matching module is specifically used to: match each point in the two-dimensional point set with the area map, the measurement information, and the semantic information.
[0018] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the steps in the above method are executed when the program is run.
[0019] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: the memory is used to store computer programs; the processor is used to execute the steps in the above method by running the program stored in the memory.
[0020] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.
[0021] A robot positioning method, device, electronic device and storage medium proposed in the embodiment of the present application, the method obtains a regional map and three-dimensional point cloud data of the area where the robot is located; integrates the two-dimensional coordinate data of the point farthest from the robot position in each column of the three-dimensional point cloud data to obtain a two-dimensional point set; matches the two-dimensional point set with the regional map to obtain multiple candidate posture data; determines the score of the candidate posture data based on a predetermined function; the score represents the matching degree of the candidate posture data with the regional map; determines the candidate posture data with the highest score as the current posture data of the robot. In this way, only the point farthest from the sensor position is selected for the three-dimensional point cloud data and converted into a two-dimensional point set, which can reduce the amount of subsequent data calculation, and only retains the farthest point containing the point where the radar laser falls on the boundary such as the wall, which is more conducive to matching with the boundary of the regional map. In addition, based on the partial candidate posture data pre-screened by matching, the posture data of the current robot is further determined from it through the matching degree score, which can further reduce the amount of data calculation, and improve the accuracy of posture tracking through matching degree screening. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0023] Figure 1 is a flow chart of a robot positioning method according to an embodiment of the present application;
[0024] Figure 2 is a flow chart of a robot positioning method according to an embodiment of the present application;
[0025] Figure 3 is a schematic diagram of a robot positioning scenario according to an embodiment of the present application;
[0026] Figure 4 is a flow chart of a robot positioning method according to an embodiment of the present application;
[0027] Figure 5is a curve diagram of a weight function according to an embodiment of the present application;
[0028] Figure 6 is a schematic diagram of a radar scanning point according to an embodiment of the present application;
[0029] Figure 7 is a structural block diagram of a robot positioning device according to an embodiment of the present application;
[0030] Figure 8 It is a structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] In this embodiment, a robot positioning method is provided. Figure 1 is a flow chart of a robot positioning method according to an embodiment of the present application, such as Figure 1 As shown, the process includes the following steps:
[0034] S10: Obtaining an area map and three-dimensional point cloud data of the area where the robot is located;
[0035] S20: integrating the two-dimensional coordinate data of the point farthest from the robot position in each column of the three-dimensional point cloud data to obtain a two-dimensional point set;
[0036] S30: Matching the two-dimensional point set with the region map to obtain a plurality of candidate pose data;
[0037] S40: Determine a score for the candidate pose data based on a predetermined function; the score represents a degree of matching between the candidate pose data and the region map;
[0038] S50: Determine the candidate posture data with the highest score as the current posture data of the robot.
[0039] In this embodiment, the above method can be applied to robots, such as intelligent robots working indoors, and can also be applied to cloud servers, other terminals or devices connected to the robot.
[0040] In one embodiment, the area map may be a two-dimensional polygonal structure, and the multiple edges included represent the boundaries or passages of the area, such as doors, walls, etc. The area map may contain multiple levels, such as parent areas and child areas, and the parent area may contain child areas to represent larger units. For example, the building is the parent area of the floor, and the floor is the parent area of the room. In this way, the three-dimensional information of the altitude can be reflected in the two-dimensional area map.
[0041] In one embodiment, the three-dimensional point cloud data may be acquired by a laser radar in the robot, for example, by scanning the laser radar to obtain one or more sets of three-dimensional point cloud data.
[0042] In one embodiment, the area map of the area where the robot is located can be obtained by preliminarily determining the area where the robot is located and then searching the area map corresponding to the area in the database. For example, the current altitude of the robot is obtained and compared with the base station to obtain the current rough location area of the robot on the two-dimensional map.
[0043] In one embodiment, preliminarily determining the area where the robot is located may include preliminarily determining the area where the robot is located through communication base station positioning (such as mobile data positioning) or Bluetooth positioning.
[0044] In one embodiment, step S20 may refer to filtering and reducing the dimensionality of the three-dimensional point cloud data to convert it into a two-dimensional point set for matching with the area map. The two-dimensional coordinate data may refer to the coordinate data of the three-dimensional point cloud data after ignoring the Z axis.
[0045] In one embodiment, the point in each column farthest from the robot position may refer to the point in each column obtained by laser radar scanning, which is farthest from the robot position. Here, the robot position may refer to the position where the laser radar emits a laser signal, such as a sensor position.
[0046] For example, the laser radar can collect data from top to bottom in the same vertical direction, and the points obtained form a column. In a column, some light beams will hit the boundaries of the area map, such as walls or doors, and these points hitting the boundaries are the points farthest from the origin. In this way, points in the three-dimensional point cloud data that hit other objects in the area, such as points that hit people or other non-permanent objects, can be filtered out, and it is conducive to better matching with the boundaries of the area map, thereby improving calculation reliability and reducing the amount of calculation.
[0047] In one embodiment, matching the two-dimensional point set with the region map may refer to matching each point in the two-dimensional point set with the region map based on the distance from each point in the two-dimensional point set to the region map boundary. For example, step S30 may include: determining the boundary of the region map intersecting with the ray where each point in the two-dimensional point set is located; determining the distance value between each point and the boundary; and determining multiple candidate pose data based on the distance value.
[0048] In one embodiment, the candidate posture data may be a guess result of the current posture of the robot, and the current posture of the seat robot with the highest credibility may be determined from multiple guess results through scoring. For example, the points in each column of the candidate posture data may be processed according to an error function, and the score of the candidate posture data may be determined based on the obtained error value.
[0049] In this way, only the points farthest from the sensor position are selected for the three-dimensional point cloud data and converted into a two-dimensional point set, which can reduce the amount of subsequent data calculations, and only retain the farthest points including the points where the radar laser falls on the boundary such as the wall, which is more conducive to matching with the boundary of the area map. In addition, based on the partial candidate pose data initially screened by matching, the pose data of the current robot is further determined from it through matching score, which can further reduce the amount of data calculations, and improve the accuracy of pose tracking through matching screening.
[0050] In this embodiment, a robot positioning method is provided. Figure 1 is a flow chart of a robot positioning method according to an embodiment of the present application, such as Figure 1 As shown, the process includes the following steps:
[0051] S11: Obtaining an area map and three-dimensional point cloud data of the area where the robot is located;
[0052] S21: integrating the two-dimensional coordinate data of the point farthest from the robot position in each column of the three-dimensional point cloud data to obtain a two-dimensional point set;
[0053] S31: determining the boundary of the region graph intersecting with the ray where each point in the two-dimensional point set is located;
[0054] S41: Determine the distance value between each point and the boundary;
[0055] S51: Determine a plurality of candidate posture data based on the distance value;
[0056] S61: Determine a score for the candidate pose data based on a predetermined function; the score represents a degree of matching between the candidate pose data and the region map;
[0057] S71: Determine the candidate posture data with the highest score as the current posture data of the robot.
[0058] In this embodiment, the specific implementation methods and related embodiments of the repeated contents in steps S11-S71 can refer to the specific implementation methods and related embodiments of the aforementioned steps S10-S50, which will not be repeated here.
[0059] In one embodiment, a LiDAR scan frame can be viewed as a [N,M] Matrix, where N represents the number of circles (for example, set to 64) and M represents the number of points (for example, 600 is used). According to the offset angle of the radar, the 3D data point cloud is divided into 600 columns, and each circle contributes one point to each column. The resulting 2D point set is It can be defined by the following formula:
[0060]
[0061] Here It represents the Euclidean distance between points i and j from the sensor origin, i.e. the robot position (ignoring the Z axis), and arg max represents the point with the maximum value in the set.
[0062] In one embodiment, Figure 3 As shown in Figure 2, the distance diagrams of two points when j = 1 and 2 are listed respectively. The distance value can be a signed distance, for example, a point in a two-dimensional point set To the boundary of the region graph that intersects its ray Signed distance to the closest point on a line segment , a positive distance value indicates outside the room, and a negative distance value indicates inside the room.
[0063] ;
[0064]
[0065] here, For the point on the boundary The coordinates of the nearest point. Represents the coordinate value of the intersection point of the above ray and the boundary.
[0066] In one embodiment, determining the distance value between each point and the boundary may include: determining the distance value between each point and the boundary; determining whether the distance value exceeds a first threshold; if it exceeds the first threshold, determining the minimum distance value between the point and all boundaries, and determining the candidate pose data based on the minimum distance value. For example, the first threshold may be =0.1m. In this way, the distance value can be initially corrected to avoid calculation errors caused by the point formed when the ray is shot through an open door or glass.
[0067] In one embodiment, determining a plurality of candidate posture data based on the distance value may include: sampling a plurality of candidate posture data within a range of a predetermined radius and a predetermined direction interval based on the distance value according to the area where the robot is located.
[0068] In this way, by screening and determining the candidate pose data based on the distance from the point to the boundary in the two-dimensional point set, the reliability of the candidate pose data can be improved, and errors in pose detection caused by excessive distance can be avoided.
[0069] In some embodiments, the step S40 or S61 may include:
[0070] Determining an error value of the candidate position data based on a distance value corresponding to the candidate position data and a predetermined threshold value by at least one error function; the error value represents a degree of matching between the candidate position data and the area map;
[0071] A score for the candidate pose data is determined based on at least one of the error values and a scoring function.
[0072] In one embodiment, the error function may include: a neighboring error function:
[0073]
[0074] In this function, For norm calculation, the predetermined threshold d can be 2m, or 2.5m, etc. In this way, only points that are very close to the robot can be included. The smaller the error, the more points within the threshold, which means a better matching effect.
[0075] In one embodiment, the error function may include: a weighted error function:
[0076]
[0077] In this function, the predetermined threshold d is 0, is the weight function:
[0078]
[0079] express In this way, we can ignore <0 (i.e., the part inside the room in the area map), because these points are more likely to hit non-permanent environmental factors (such as furniture and people). At the same time, a smaller threshold can be designed using the above weight function to better exclude those points that are far away from the expected intersection with the area map, thereby further improving the accuracy.
[0080] In one embodiment, the error function may include: Unweighted external error function:
[0081]
[0082] In this function, the predetermined threshold d is 0, which can be directly filtered out <0 (i.e., the part inside the room in the area map), and is not correct That is, the points outside the room are processed.
[0083] In one embodiment, the scoring function may include at least one of the following four:
[0084] ;
[0085] ;
[0086] In this way, based on the predetermined error function and scoring function, screening and scoring can be performed based on the matching degree between the point and the area map, so that more accurate pose data can be selected to achieve precise positioning and tracking.
[0087] In some embodiments, the step S71 or S50 may include:
[0088] Determining a weighting coefficient based on the distance value corresponding to the candidate posture data with the highest score and multiple distance thresholds through a weight function;
[0089] Performing registration based on the weighting coefficient, the point corresponding to the candidate pose data with the highest score, and the translation vector;
[0090] The registered candidate posture data is determined to be the current posture data of the robot.
[0091] In one embodiment, the weight function is The obtained weighting coefficient can be the weight for calculating the weighted point-to-line ICP. Based on the weighting function, the influence of long error beams caused by reflections in the room can be reduced.
[0092] In one embodiment, the curve corresponding to the weight function shows a superlinear growth near 0. Thus, the higher the weight of the point close to the boundary of the area graph, the more conducive to posture tracking.
[0093] In one embodiment, performing the registration based on the weighting coefficient, the point corresponding to the candidate pose data with the highest score, and the translation vector may include: performing the registration based on the weighting coefficient, the point corresponding to the candidate pose data with the highest score, and the translation vector by using an ICP algorithm. For example, it is implemented by the following formula:
[0094]
[0095] in Calculate the corresponding distance value based on the area map , and convert the current point from the two-dimensional point set . R is a rotation matrix, t represents the translation vector, and W is the weight function.
[0096] In this way, by weighting the ICP algorithm through the weight function, the influence of clutter can be further filtered out, and the influence caused by long distance and long error beams can be reduced to avoid errors in the results.
[0097] In some embodiments, the existing ICP algorithm registration accuracy will degrade sharply in environments such as long corridors, resulting in abnormal situations such as inaccurate positioning and distorted posture tracking. Therefore, the matching of the two-dimensional point set with the area map is performed to obtain multiple candidate posture data, including:
[0098] dividing the area map into a predetermined number of directional intervals;
[0099] Determine the ratio of the number of points in the second point set that fall into each direction interval to the total number of points in the second point set;
[0100] In response to the existence of a target direction interval where the ratio of the number of points to the total number of points is greater than a predetermined ratio, determining a downsampling rate of the target direction interval, wherein the downsampling rate is greater than 1;
[0101] Downsampling the points falling within the target direction interval based on the downsampling rate;
[0102] Based on matching each point in the down-sampled two-dimensional point set with the area map, a plurality of candidate pose data are obtained.
[0103] In one embodiment, obtaining a plurality of candidate pose data based on matching each point in the downsampled two-dimensional point set with the area map can include: determining the boundary of the area map where the rays intersect for each point in the downsampled two-dimensional point set; determining the distance value between each point and the boundary; and determining a plurality of candidate pose data based on the distance value.
[0104] In one embodiment, dividing the area map into a predetermined number of direction intervals may mean dividing 180° in one direction of the area map into a predetermined number of direction intervals, for example, into 36 direction intervals, each of which is 5°.
[0105] In one embodiment, the ratio of the number of points in the second point set that fall into each direction interval to the total number of points in the second point set is determined, wherein the target direction interval may refer to the direction interval with the most points in each direction interval. For example, the direction interval with the most points is the main direction, and the number of points falling into it is , the total number of points in the second point set is , the determined ratio can be referred to as the corridor degree , this ratio can represent the credibility of the area where the robot is located being a corridor type. The higher the ratio, the closer the area where the robot is located is to the corridor type, that is, a long distance area in one direction.
[0106] Here, in an ordinary room, about half of the points in the two-dimensional point set will fall in one direction, and the other half will fall on the wall perpendicular to the first direction, so the "corridor degree" value obtained is close to If only one vertical wall is scanned, the value of the "corridor degree" is .
[0107] In one embodiment, the predetermined ratio may be 0.5, or 0.4, 0.6, etc. When the ratio corresponding to the target direction interval is greater than the predetermined ratio, the ratio may be adjusted based on the downsampling rate. Downsample the points that fall into the target direction interval. Here,
[0108] In one embodiment, when there is a target direction interval corresponding to a ratio greater than a predetermined ratio, such as a predetermined ratio of 0.5, the target direction interval can be considered as a main direction interval. At this time, the downsampling rate corresponding to the direction interval is Greater than 1.
[0109] In this way, when there is a dominant direction, that is, when the area where the robot is located is close to the corridor type, the points in this direction are downsampled, thereby weakening the influence of the dominant direction and increasing the influence of other directions. This can reduce the error effect of the long corridor environment on the ICP algorithm alignment and improve the accuracy of posture tracking and positioning.
[0110] In some embodiments, obtaining a regional map of the area where the robot is located may include:
[0111] Obtain the first air pressure information of the robot's current environment;
[0112] Comparing the first air pressure information with the second air pressure information of the base station to determine the altitude information of the robot;
[0113] Determine the area where the robot is located based on the altitude information;
[0114] A region map corresponding to the region is obtained from a predetermined database.
[0115] In one embodiment, obtaining the first air pressure information of the current environment of the robot may be obtained by a barometer, and comparing the first air pressure information with the second air pressure information of the base station may refer to comparing the first air pressure information with the second air pressure information of the base station via a wireless network Wifi, a mobile network, Bluetooth or other means.
[0116] In one embodiment, determining the altitude information of the robot may refer to determining the altitude information of the robot based on a difference between the first air pressure information and the second air pressure information.
[0117] In one embodiment, determining the area where the robot is located based on the altitude information may refer to calling corresponding data stored in a predetermined database based on the altitude information to determine the area where the robot is located. For example, the area where the robot is located may refer to a floor, etc., and the predetermined database may be osmAG, etc.
[0118] In one embodiment, obtaining the region map corresponding to the region in the predetermined database may include: obtaining the region map corresponding to the region, metric information of the region map, and semantic information of multiple edges in the region map in the predetermined database. Here, the region map may be a polygonal structure.
[0119] In one embodiment, the region graph includes a plurality of edges, the edges representing boundaries or channels of the region;
[0120] The obtaining of the area map of the area where the robot is located may include: obtaining the area map of the area where the robot is located, the measurement information of the area map, and the semantic information of a plurality of edges in the area map;
[0121] The matching based on each point in the two-dimensional point set with the area map may include: matching based on each point in the two-dimensional point set with the area map, the metric information, and the semantic information.
[0122] In one embodiment, the semantic information may be used to identify walls and passages. For example, each edge has a piece of semantic information, and the type of the edge may be determined based on the semantic information. The metric information may refer to information such as parameters and dimensions of the edge.
[0123] In this way, the area where the robot is located, such as the floor, is preliminarily determined by air pressure, which narrows the initial search space, and then the corresponding area map can be quickly obtained for posture tracking and positioning. Combined with the polygonal structure area map containing semantic information, on the basis of accurately describing the regional situation, the channel or boundary situation can be described more quickly and intuitively based on the metric information and semantic information, which greatly reduces the amount of data that needs to be processed, thereby improving the calculation speed.
[0124] As a possible implementation method, a positioning and posture tracking method is provided, such as Figure 4 As shown, it may specifically include:
[0125] Step 1: Global initialization based on barometer and Wifi data;
[0126] Step 2: Load or reload the area map and obtain point cloud data at the same time;
[0127] Step 3: Filter and downsample the point cloud data, compare the filtered and downsampled data with the area map, and perform posture tracking.
[0128] Specific:
[0129] 1. Global initialization
[0130] The barometer is used to obtain the current altitude, and the Wi-Fi and base station are compared to obtain the current rough position on the global two-dimensional map, with an error of several meters. Through these two operations, the robot can obtain the specific area it is currently in, which is generally a specific room, a specific corridor, etc., but this step does not determine the specific position of the robot in the current area.
[0131] 2. Loading and reloading area maps
[0132] The area map of this embodiment has a hierarchical result, and the space can be divided into multiple areas, such as a certain park, a certain building, a specific floor in a building, etc. In order to achieve global positioning, Wifi is used to determine the approximate location, and a barometer is used to determine the rough height. The barometer of the robot is used to compare the air pressure with the barometer of the base station, and then the height information stored in the database such as osmAG is used to accurately calculate the floor. Through Wifi localization, we can get all the areas of the current floor. The localization method of this embodiment only relies on the precise polygon measurement information of walls and passages (such as doors). Therefore, the main focus is on the leaf part of the hierarchical osmAG of the floor; the hierarchical characteristics of osmAG are used when loading the leaf area of the current floor; semantic information is used to identify walls and passages; the most important thing is the measurement information about the position of the midpoint of the polygon, which is the key to posture tracking. These points are converted from longitude and latitude to x and y of the Cartesian coordinate system.
[0133] Whenever the robot uses an elevator or other means to transfer between stairs or floors, or has reached the boundary of the currently loaded area map, it needs to reload the specific area map for the corresponding floor and location.
[0134] 3. Point cloud filtering and downsampling
[0135] Both global positioning and posture tracking require the use of a two-dimensional clutter-free point set to match the area map. The area map represents walls (including special channels such as doors and windows) in the form of two-dimensional polygons, so the three-dimensional point cloud data obtained using the lidar also needs to filter out non-permanently fixed environmental factors such as furniture and people. Ideally, the point set after de-cluttering should only contain points on walls or closed doors. This de-cluttering sub-sampling assumes that: each column in the three-dimensional point cloud (this embodiment uses the radar to collect 64 points from top to bottom in the same vertical direction, and these points constitute a column) will have some light beams hitting the wall, and these points hitting the wall are the points farthest from the origin. Therefore, the farthest two-dimensional coordinates of each column are added to the two-dimensional clutter-free point set. This assumption is not necessarily always true, but it is rarely not true, and this embodiment designs a weight function to process these points.
[0136] Specifically, a radar scan frame can be regarded as an [N,M] Matrix, where N represents the number of circles (for example, set to 64) and M represents the number of points (for example, 600 is used). The radar point cloud is divided into 600 columns according to the offset angle of the radar, and each circle contributes one point to each column. Defined by the following formula:
[0137]
[0138] Here Represents the Euclidean distance of point i, j from the sensor origin (ignoring the Z axis).
[0139] In addition to filtering out the clutter in the point cloud and converting it from 3D to 2D, this step also saves significant time because the number of points that need to be processed in the following steps is greatly reduced. This means that by only retaining the points with the farthest horizontal distance in each vertical column to construct a sparse 2D point set, the amount of data required for subsequent algorithms is greatly reduced, thereby improving operational efficiency.
[0140] 4. Corridor environment optimization
[0141] In an environment like a long corridor without clutter, it is difficult for the robot to obtain its specific position in the environment due to the characteristics of the Iterative Closest Point (ICP) algorithm that performs registration through iteration. To solve this problem, the two-dimensional clutter-free point set is further sub-sampled to reduce the influence of the dominant direction. Correspondingly, the influence of the non-dominant direction is increased, which helps ICP converge to the correct posture. To this end, the "corridor degree" value Cor of the intersection of the current scan and the area map is first calculated. The more points in the same direction, the closer this value is to 1.
[0142] Specifically, a histogram with the direction of the area graph as the group is constructed (for example, a 5° interval is designed, with a total of 36 interval groups). Every time a point matches these lines, the corresponding group count value will increase. Then the "corridor degree" value Cor is defined as ,in are the points in the densest grouping (main direction), is the total number of points. In an ordinary room, about half of the sensor points will fall in one direction, and the other half will fall on the wall perpendicular to the first direction. The "corridor degree" value obtained in this way is If the sensor only scans one vertical wall, the value of its "corridor degree" is .
[0143] Then a downsampling rate is defined , the downsampling is applied only to the points that match the lines in the group of intervals with the largest number of points in the noise-free set:
[0144]
[0145] In normal environments, downsampling is usually not performed, because the downsampling rate is only Greater than 1.
[0146] 5. Posture tracking
[0147] First, the intersection of the area map and the noise-free point set is calculated to obtain several positioning guesses of the specific position at this time; then the error function and the score calculation function are used to score the several guesses, and the guess with the highest score is considered to be the specific positioning at this time.
[0148] 5.1. Intersection calculation
[0149] Given a region map, a guess of the robot pose, and a set of clutter-free points, we can compute the intersection of each point’s ray with the region polygon. To the polygon that intersects its ray Signed distance to the closest point on a line segment , positive values indicate outside the room, and negative values indicate inside the room.
[0150] ;
[0151]
[0152] In order to speed up the calculation, the initial area of the area map generated by the lidar scan is determined ( ). Channels in area graphs can represent gates, which are not known to be open or closed at the time of positioning and are therefore handled specially. Is it greater than the threshold? (For example, the threshold is set to 0.1m), if a point If the value is greater than the threshold, the nearest intersection point between the ray corresponding to the point and any loaded area map polygon is calculated. The same process is performed for polygons marked as "transparent" or "see-through" (such as glass and railings) in the area map semantic information.
[0153] 5.2. “Guess” scoring
[0154] The robot's posture has two-dimensional coordinates and offset angle Based on the initial positioning of WIFI and barometer, sample n guesses within a radius of r meters, a certain distance and direction interval, and calculate which area each guess is in:
[0155]
[0156]
[0157] Three error functions are used to evaluate the similarity between each changed noise-free point set and the regional polygon. Four different score calculation functions are designed by combining these three error functions. All four score calculation functions are tested, among which functions S1 and S3 have the best performance. Here, the faster S1 can be selected. For each pose guess, according to its intersection distance and area polygons for calculations.
[0158] 5.2.1. Three error functions
[0159] (1) Neighborhood error: Use a small threshold d to make the graph contain only those points that are very close. The smaller the error, the more points are within the threshold, which means better matching effect, because the error used for points exceeding the threshold is set very high, for example, it can be designed to be 2m.
[0160]
[0161] (2) Weighted external error: Ignore points within the guess area (i.e., the part inside the room in the area map) because these points are more likely to hit non-permanent environmental factors (such as furniture and people). At the same time, a weight function can be used to ignore points that are too far away.
[0162]
[0163] The weight function will also perform weighted ICP calculations on the ICP algorithm, which will be detailed in the weighted ICP section.
[0164] (3) Unweighted external error:
[0165]
[0166] The four score functions in this embodiment are as follows:
[0167] ;
[0168] ;
[0169] 5.3 “Guess” Scoring and Weighted ICP Algorithm
[0170] The weight function is as follows:
[0171]
[0172] There are three reasons for constructing the weighting function in this way:
[0173] Filtering clutter: In scenes with high clutter, even with the previously proposed filtering sampling method, the laser hitting the inner area may still just hit the clutter. Therefore, designing a smaller threshold may better exclude those points that are far away from the expected intersection with the area map.
[0174] Weight function The curve graph can be shown as Figure 5As shown, the function calculates the weight of the weighted point-to-line ICP based on the minimum signed distance (positive behind walls / outside) between the point and the line that its ray intersects. This function mostly ignores long error beams in the room due to reflections etc. If a point is close to the polygon, it obviously helps with pose tracking. Therefore, the function grows superlinearly around 0.
[0175] A schematic diagram of the scanning points for ICP performance issues in a corridor-like environment can be shown as follows: Figure 6 As shown, only a few (e.g., 2) points match the vertical lines, while many match the horizontal lines, which fixes the translation in the vertical direction and prevents the correct solution. The "corridor degree" downsampling reduces the points in the main direction, alleviating this problem.
[0176] If the length of the ray intersecting the wall exceeds the actual distance to the wall, it is likely to be a strong indication that the pose guess is wrong. Therefore, these errors are included in the scoring function to ensure that the score of such guesses is low. On the other hand, very long external rays may be caused by ray reflections, so the present invention truncates external rays that exceed a certain threshold to avoid them causing errors in the results.
[0177] 5.4 Posture Tracking via Weighted Point-to-Line ICP
[0178] At this step, there is a relatively accurate initial pose guess, which comes either from the initial global positioning or from the previous pose tracking. Registration method A variant of the ICP algorithm defines registration as:
[0179]
[0180] in Calculate the corresponding value according to the area map, and convert the current point from the clean two-dimensional point set . R is a rotation matrix, t represents the translation vector, and W is the weight function.
[0181] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0182] In this embodiment, a robot positioning device is also provided to implement the above-mentioned embodiments and preferred implementation modes, which have been described and will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0183] Figure 7 is a structural block diagram of a robot positioning device according to an embodiment of the present application, such as Figure 7 As shown, the device includes: an acquisition module 100, used to acquire an area map and three-dimensional point cloud data of the area where the robot is located; an integration module 200, used to integrate the two-dimensional coordinate data of the point farthest from the robot position in each column of the three-dimensional point cloud data to obtain a two-dimensional point set; a matching module 300, used to match the area map based on the two-dimensional point set to obtain a plurality of alternative posture data; a scoring module 400, used to determine the score of the alternative posture data based on a predetermined function; the score represents the matching degree of the alternative posture data with the area map; a determination module 500, used to determine that the alternative posture data with the highest score is the current posture data of the robot.
[0184] Furthermore, the matching module 300 is specifically used to: determine the boundary of the area map that intersects with the ray where each point in the two-dimensional point set is located; determine the distance value between each point and the boundary; and determine multiple alternative posture data based on the distance value.
[0185] Furthermore, the scoring module 400 is specifically used to: determine the error value of the alternative position data based on the distance value corresponding to the alternative posture data and a predetermined threshold through at least one error function; the error value represents the degree of matching between the alternative posture data and the area map; and determine the score of the alternative posture data based on at least one of the error values and the scoring function.
[0186] Furthermore, the determination module 500 is specifically used to: determine a weighting coefficient based on a distance value corresponding to the highest-scoring alternative posture data and multiple distance thresholds through a weight function; perform alignment based on the weighting coefficient, the point corresponding to the highest-scoring alternative posture data, and a translation vector; and determine that the aligned alternative posture data is the current posture data of the robot.
[0187] Furthermore, the matching module 300 is specifically used to: divide the area map into a predetermined number of direction intervals; determine the ratio of the number of points in the second point set that fall into each direction interval to the total number of points in the second point set; in response to the existence of a target direction interval in which the ratio of the number of points to the total number of points is greater than a predetermined ratio, determine the downsampling rate of the target direction interval, and the downsampling rate is greater than 1; downsample the points that fall into the target direction interval based on the downsampling rate; match each point in the two-dimensional point set after downsampling with the area map to obtain multiple alternative posture data.
[0188] Furthermore, the acquisition module 100 is specifically used to: obtain first air pressure information of the robot's current environment; compare the first air pressure information with the second air pressure information of the base station to determine the altitude information of the robot; determine the area where the robot is located based on the altitude information; and obtain an area map corresponding to the area in a predetermined database.
[0189] Furthermore, the area map includes multiple edges, and the edges represent boundaries or channels of the area; the acquisition module 100 is specifically used to: obtain the area map of the area where the robot is located, the measurement information of the area map, and the semantic information of the multiple edges in the area map; the matching module 300 is specifically used to: match each point in the two-dimensional point set with the area map, the measurement information, and the semantic information.
[0190] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0191] An embodiment of the present application also provides an electronic device, which may be a robot or used in a robot. Figure 8 is a structural diagram of an electronic device according to an embodiment of the present application, such as Figure 8As shown, it includes a processor 41, a communication interface 42, a memory 43 and a communication bus 44, wherein the processor 41, the communication interface 42 and the memory 43 communicate with each other through the communication bus 44, and the memory 43 is used to store computer programs; the processor 41 is used to implement the following steps when executing the program stored in the memory 43: obtaining an area map and three-dimensional point cloud data of the area where the robot is located; integrating the two-dimensional coordinate data of the point farthest from the robot position in each column of the three-dimensional point cloud data to obtain a two-dimensional point set; matching the two-dimensional point set with the area map to obtain multiple candidate posture data; determining the score of the candidate posture data based on a predetermined function; the score represents the matching degree of the candidate posture data with the area map; determining the candidate posture data with the highest score as the current posture data of the robot.
[0192] Furthermore, the method of obtaining a plurality of candidate pose data based on matching the two-dimensional point set with the area map comprises: determining a boundary of the area map that intersects with the ray where each point in the two-dimensional point set is located; determining a distance value from each point to the boundary; and determining a plurality of candidate pose data based on the distance value.
[0193] Furthermore, determining the score of the alternative posture data based on a predetermined function includes: determining the error value of the alternative position data based on the distance value corresponding to the alternative posture data and a predetermined threshold through at least one error function; the error value represents the degree of matching between the alternative posture data and the area map; and determining the score of the alternative posture data based on at least one of the error values and a scoring function.
[0194] Further, the determining of the highest-scoring alternative posture data as the current posture data of the robot includes: determining a weighting coefficient based on a distance value corresponding to the highest-scoring alternative posture data and multiple distance thresholds through a weight function; performing alignment based on the weighting coefficient, the point corresponding to the highest-scoring alternative posture data, and a translation vector; and determining the aligned alternative posture data as the current posture data of the robot.
[0195] Furthermore, the method obtains a plurality of candidate pose data based on matching the two-dimensional point set with the area map, including: dividing the area map into a predetermined number of direction intervals; determining the ratio of the number of points in the second point set that fall into each direction interval to the total number of points in the second point set; in response to the existence of a target direction interval in which the ratio of the number of points to the total number of points is greater than a predetermined ratio, determining a downsampling rate of the target direction interval, and the downsampling rate is greater than 1; downsampling the points that fall into the target direction interval based on the downsampling rate; and obtaining a plurality of candidate pose data based on matching each point in the two-dimensional point set after downsampling with the area map.
[0196] Furthermore, obtaining a regional map of the area where the robot is located includes: obtaining first air pressure information of the robot's current environment; comparing the first air pressure information with second air pressure information of a base station to determine the altitude information of the robot; determining the area where the robot is located based on the altitude information; and obtaining a regional map corresponding to the area in a predetermined database.
[0197] Furthermore, the area map includes multiple edges, and the edges represent boundaries or channels of the area; the obtaining of the area map of the area where the robot is located includes: obtaining the area map of the area where the robot is located, measurement information of the area map, and semantic information of multiple edges in the area map; the matching based on each point in the two-dimensional point set with the area map includes: matching based on each point in the two-dimensional point set with the area map, the measurement information, and the semantic information.
[0198] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0199] The communication interface is used for communication between the above terminal and other devices.
[0200] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0201] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0202] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the robot positioning method described in any one of the above embodiments.
[0203] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the robot positioning method described in any one of the above embodiments.
[0204] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0205] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
[0206] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A robot positioning method, characterized in that: include: Acquiring a regional map and three-dimensional point cloud data of the area where the robot is located, including: acquiring first air pressure information of the current environment of the robot; comparing the first air pressure information with second air pressure information of a base station to determine the altitude information of the robot; determining the area where the robot is located based on the altitude information; acquiring a regional map corresponding to the area in a predetermined database; the regional map is a polygonal structure, and multiple edges contained in the regional map represent boundaries or channels of the area; Integrate the two-dimensional coordinate data of the point farthest from the robot position in each column of the three-dimensional point cloud data to obtain a two-dimensional point set; Based on matching each point in the two-dimensional point set with the area map, a plurality of candidate pose data are obtained, including: determining a boundary of the area map intersecting with a ray where each point in the two-dimensional point set is located; determining a distance value between each point and the boundary; and determining a plurality of candidate pose data based on the distance value; Determining a score for the candidate pose data based on a predetermined function; the score represents a degree of matching between the candidate pose data and the area map; The candidate posture data with the highest score is determined as the current posture data of the robot.
2. The method according to claim 1, characterized in that The step of determining the score of the candidate posture data based on a predetermined function comprises: Determining an error value of the candidate pose data based on a distance value corresponding to the candidate pose data and a predetermined threshold value by at least one error function; the error value represents a degree of matching between the candidate pose data and the area map; A score for the candidate pose data is determined based on at least one of the error values and a scoring function.
3. The method according to claim 1, characterized in that The step of determining the candidate posture data with the highest score as the current posture data of the robot includes: Determining a weighting coefficient based on the distance value corresponding to the candidate posture data with the highest score and multiple distance thresholds through a weight function; Performing registration based on the weighting coefficient, the point corresponding to the candidate pose data with the highest score, and the translation vector; The registered candidate posture data is determined to be the current posture data of the robot.
4. A robot positioning device, characterized in that: include: The acquisition module is used to acquire a regional map and three-dimensional point cloud data of the area where the robot is located, including: acquiring first air pressure information of the current environment of the robot; comparing the first air pressure information with second air pressure information of a base station to determine the altitude information of the robot; determining the area where the robot is located based on the altitude information; acquiring a regional map corresponding to the area in a predetermined database; the regional map is a polygonal structure, and multiple edges contained in the regional map represent boundaries or channels of the area; An integration module, used for integrating the two-dimensional coordinate data of the point farthest from the position of the robot in each column of the three-dimensional point cloud data to obtain a two-dimensional point set; A matching module, used for matching each point in the two-dimensional point set with the area map to obtain a plurality of candidate pose data, including: determining a boundary of the area map intersecting with a ray where each point in the two-dimensional point set is located; determining a distance value between each point and the boundary; and determining a plurality of candidate pose data based on the distance value; A scoring module, configured to determine a score of the candidate pose data based on a predetermined function; the score represents a degree of matching between the candidate pose data and the area map; A determination module is used to determine that the candidate posture data with the highest score is the current posture data of the robot.
5. An electronic device, characterized in that: The electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the robot positioning method according to any one of claims 1 to 3 when executed by the processor.
6. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the steps of the robot positioning method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Robot positioning method, device and equipment and storage medium
CN116934851A
Cleaning robot repositioning method, cleaning robot and computer equipment
CN118319188A