Indoor repositioning method and device, electronic equipment and storage medium
By acquiring and analyzing the characteristics of the indoor environment, the calculation amount of indoor relocation is reduced, the problem of large calculations in the existing technology is solved, efficient and accurate indoor relocation in complex environments is achieved, and the navigation of mobile robots is improved ability.
Patent Information
- Application Number
- CN202411213647.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-01-03
AI Technical Summary
In the prior art, indoor repositioning calculations are large and difficult to apply to mobile robots, especially in complex indoor environments to achieve high precision, high robustness and high real-time positioning.
By obtaining the environmental characteristics of the current point cloud data, dimensionality reduction analysis obtains the current environmental characteristics, and then determining the current position based on these characteristics, reducing the calculation amount of indoor relocation and improving efficiency. The method includes obtaining the scanning area, target features, line segment features and point cloud distribution features, combining the correspondence between environmental features and poses, and matching them using a two-level search algorithm to determine the poses.
It realizes efficient and accurate indoor repositioning in complex indoor environments, reduces the calculation amount, improves the navigation and positioning capabilities of mobile robots, and has high accuracy and robustness.
Smart Images

Figure CN119245644A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robot positioning technology, and in particular to an indoor repositioning method, device, electronic equipment and storage medium. Background Art
[0002] Indoor relocalization refers to the process of initializing the position of an indoor mobile robot when it re-enters an indoor environment or regaining its position when an abnormal situation occurs during movement and the position is lost. Its purpose is to obtain the accurate global position of the current robot in the map, so as to correct the positioning offset, realize autonomous positioning repair and real-time correction, where the indoor environment is a typical 2D scene.
[0003] Existing technologies generally use traditional point cloud matching algorithms such as Iterative Closest Point (ICP) and Normal Distributions Transform (NDT) for indoor relocalization. The positioning calculation is large and difficult to apply to mobile robots. Summary of the invention
[0004] The present invention provides an indoor repositioning method to solve the defect of large positioning calculation amount in the prior art. The method reduces the indoor repositioning calculation amount and improves the indoor repositioning efficiency by obtaining the current environmental features corresponding to the current point cloud data, that is, performing dimensionality reduction analysis on the current point cloud data to obtain the current environmental features, and then determining the corresponding current posture according to the current environmental features.
[0005] The present invention provides an indoor relocation method, comprising the following steps: Acquire current environment features according to current point cloud data, wherein the current point cloud data is two-dimensional data obtained by scanning the current space environment by radar, and the current environment features are determined according to the positions between multiple scanning points after the current point cloud data is reduced in dimension; According to the current environmental characteristics, determine the corresponding current posture
[0006] According to an indoor repositioning method provided by the present invention, the current environment feature includes at least one of a first geometric feature, a second geometric feature and a point cloud distribution feature, the first geometric feature is determined based on the point features of the multiple scanning points in the radar coordinate system, the second geometric feature is determined based on the line segment features of the multiple scanning points in the radar coordinate system, and the point cloud distribution feature is determined based on the distribution positions of the multiple scanning points in space.
[0007] According to an indoor repositioning method provided by the present invention, the current environment feature includes the first geometric feature, and the step of obtaining the current environment feature according to the current point cloud data includes: Acquiring a scanning area, where the scanning area is obtained by calculating the area of a closed figure formed by adjacent scanning points among the plurality of scanning points; and / or,
[0008] Obtain target features, where the target features are obtained by extracting features of the current point cloud data through principal component analysis.
[0009] According to an indoor relocation method provided by the present invention, the acquiring target features comprises: Obtaining a target variance, where the target variance is obtained by calculating the variance of two target directions, where the two target directions are two directions orthogonal to two initial directions, where the two initial directions are two directions with the largest variance in the radar coordinate system, obtained by performing principal component analysis on the current point cloud data; and / or,
[0010] A target span value is obtained, where the target span value is obtained according to the span of the current point cloud data in two dimensions of the radar coordinate system and the rotated radar coordinate system, where the rotated radar coordinate system is determined by performing principal component analysis on the current point cloud data.
[0011] According to an indoor repositioning method provided by the present invention, the current environment feature includes a second geometric feature, and the step of obtaining the current environment feature according to the current point cloud data includes: Acquire a plurality of line segments corresponding to the current point cloud data, wherein the plurality of line segments are obtained by screening, segmenting and fitting the line segments corresponding to the plurality of scanning points; The second geometric feature is acquired according to the plurality of line segments.
[0012] According to an indoor repositioning method provided by the present invention, the step of obtaining a plurality of line segments corresponding to the current point cloud data includes: Screening the distances between the plurality of scanning points to determine a plurality of target scanning points, wherein the distances between adjacent target scanning points in the plurality of target scanning points are within a preset distance range; Recursively segmenting the multiple target scanning points according to the target discontinuity point to obtain multiple initial line segments, wherein the target discontinuity point is a discontinuity point that meets the preset discontinuity requirement, and the multiple initial line segments include line segments obtained by merging two line segments whose angle between two side line segments of the target scanning point is less than a preset angle threshold; The multiple initial line segments are screened to obtain multiple target line segments, where the multiple target line segments are line segments whose lengths are greater than a preset length threshold and are obtained by fitting using a least squares method.
[0013] According to an indoor repositioning method provided by the present invention, the second geometric feature includes a target distance, and the target distance is used to indicate the distance of the current point cloud data to a line segment, and the acquiring the second geometric feature according to the multiple line segments includes: Draw perpendicular lines to the surrounding line segments to determine at least two directly opposite line segments, wherein the at least two directly opposite line segments are line segments where the feet of the perpendicular lines are located; The at least two facing line segments are traversed to determine the target distance, where the target distance is the minimum distance between the electronic device and each facing line in the at least two facing line segments.
[0014] According to an indoor repositioning method provided by the present invention, the second geometric feature includes a target length, and the target length is the length of the longest line segment among the multiple line segments.
[0015] According to an indoor repositioning method provided by the present invention, the second geometric feature includes the number of targets, the number of targets is the number of target objects determined in the current point cloud data, the target objects are used to characterize door-type objects, and the acquiring the second geometric feature according to the multiple line segments includes: Acquire multiple corners corresponding to the current point cloud data, where the multiple corners are determined based on whether adjacent line segments are connected end to end and whether a normal angle difference meets a preset angle requirement; Based on the multiple corners, the number of targets corresponding to the target object is determined, and the target object is determined based on whether two adjacent corners among the multiple corners share the same line segment, whether they present a concave shape, and whether the lengths of three line segments constituting the two adjacent corners meet preset length requirements.
[0016] According to an indoor repositioning method provided by the present invention, the current environment feature includes a point cloud distribution feature, and the current environment feature is obtained according to the current point cloud data, including: Traversing the plurality of scanning points, and performing the following steps on each of the plurality of scanning points: determining, according to a position of each of the plurality of scanning points in the current point cloud data, a row and column position corresponding to a radial distance range and an angle range of each of the scanning points; The point cloud distribution matrix corresponding to each scanning point is updated according to the row and column positions to obtain an updated point cloud distribution matrix, and the updated point cloud distribution feature moment is the point cloud distribution feature.
[0017] According to an indoor repositioning method provided by the present invention, before determining the corresponding current posture according to the current environment feature, the method further includes: Obtain the correspondence between environmental features and posture; The step of determining the corresponding current posture according to the current environment feature includes: According to the current environmental features and the corresponding relationship between the environmental features and the pose, a target pose corresponding to the current environmental features is determined.
[0018] According to an indoor repositioning method provided by the present invention, the step of obtaining the correspondence between environmental features and postures includes: Dividing the target map into grids to obtain a plurality of target grids, wherein the target map is obtained by simultaneous positioning and map construction by radar; Placing a simulated radar in each target grid of the plurality of target grids and extracting point cloud features corresponding to each target grid; The point cloud features and the corresponding positions and postures corresponding to the target grids are stored to obtain the corresponding relationship between the environmental features and the positions and postures.
[0019] According to an indoor relocation method provided by the present invention, the target map is divided into grids to obtain a plurality of target grids, including: Determine a wall information matrix according to the grayscale image of the target map, the wall information matrix includes an active area and an obstacle area, the active area is used to indicate an area whose grayscale value is greater than or equal to a preset grayscale value threshold, and the obstacle area is used to indicate an area whose grayscale value is less than a preset grayscale threshold, and the wall information matrix is obtained by converting the grayscale image of the target map into a grayscale value matrix, and then converting the grayscale value matrix into a wall information matrix; Dividing the wall information matrix into grids of preset length and width to obtain the plurality of target grids; Placing a simulated radar in each of the plurality of target grids and extracting point cloud features corresponding to each of the target grids includes: Traversing each grid, if the grid is a target grid, placing a simulated radar to perform radar scanning to obtain a point cloud corresponding to the target grid, wherein the target grid is used to indicate the grid corresponding to the movable area, and the simulated radar is used to simulate the radar of the electronic device to perform scanning; Feature extraction is performed on the target point cloud corresponding to the target grid to obtain target environment features corresponding to the target point cloud, wherein the target environment features are determined according to the positions of multiple scanning points in the target point cloud data.
[0020] According to an indoor repositioning method provided by the present invention, storing the point cloud features corresponding to each target grid and the corresponding posture, and obtaining the corresponding relationship between the environmental features and the posture, includes: Calculate the coordinates of each grid in the map coordinate system; Determine the coordinates in the map coordinate system corresponding to each grid and the yaw angle corresponding to each grid as the corresponding posture; The point cloud features corresponding to the target grids and the corresponding positions and postures are stored in a tree structure to obtain the corresponding relationship between the environmental features and the positions and postures.
[0021] According to an indoor repositioning method provided by the present invention, the current environment feature includes a point cloud geometric feature and a point cloud distribution feature, the point cloud geometric feature includes at least one of the first geometric feature and the second geometric feature, and the determining of a target posture corresponding to the current environment feature according to the current environment feature and a correspondence between a preset environment feature and a posture comprises: Performing a nearest neighbor search based on the point cloud geometric features to determine K grids closest to the point cloud geometric features; Feature matching is performed on the point cloud distribution feature and the K grids to determine a target pose corresponding to the point cloud distribution feature, where the target pose is a pose of a target grid among the K grids that matches the point cloud distribution feature.
[0022] The present invention also provides an indoor relocation device, comprising the following modules: A feature acquisition module is used to acquire current environment features according to current point cloud data, wherein the current point cloud data is data obtained by scanning the current space environment by radar, and the current environment features are determined according to the positions between multiple scanning points after the dimension of the current point cloud data is reduced; The posture determination module is used to determine the corresponding current posture according to the current environmental characteristics, and the current posture is used to indicate the coordinates and yaw angle of the electronic device relative to the map coordinate system.
[0023] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the indoor repositioning method as described above is implemented.
[0024] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the indoor repositioning method as described in any one of the above methods is implemented.
[0025] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the indoor repositioning method as described above is implemented.
[0026] The indoor repositioning method, device, electronic device and storage medium provided by the present invention obtain the current environmental characteristics corresponding to the current point cloud data, that is, perform dimensionality reduction analysis on the current point cloud data to obtain the current environmental characteristics, and then determine the corresponding current posture according to the current environmental characteristics, thereby reducing the amount of indoor repositioning calculations and improving the efficiency of indoor repositioning. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0028] Figure 1 It is a schematic flow chart of the indoor relocation method provided by the present invention.
[0029] Figure 2 It is a schematic diagram of extracting the scanning area from the laser radar scanning point cloud provided by the present invention.
[0030] Figure 3 It is a schematic diagram of extracting line segments from a two-dimensional laser radar scanning point cloud provided by the present invention.
[0031] Figure 4 It is a schematic diagram of extracting the minimum distance facing the wall from the two-dimensional laser radar scanning point cloud provided by the present invention.
[0032] Figure 5 It is a schematic diagram of extracting the maximum length of a line segment from a two-dimensional laser radar scanning point cloud provided by the present invention.
[0033] Figure 6 It is a schematic diagram of extracting the number of door-like objects from a two-dimensional laser radar provided by the present invention.
[0034] Figure 7 It is a schematic diagram of extracting point cloud distribution features from two-dimensional laser radar scanning point cloud provided by the present invention.
[0035] Figure 8 It is a schematic diagram of the registration database construction process provided by the present invention.
[0036] Fig. 9 It is a schematic diagram of the first-level search in the two-level search algorithm provided by the present invention.
[0037] Fig.10 It is a schematic diagram for explaining the expression and significance of the point cloud distribution feature column shift provided by the present invention.
[0038] Fig.11A schematic diagram of the overall flow of an indoor relocation algorithm provided by an embodiment of the present invention.
[0039] Fig.12 It is a structural schematic diagram of the indoor repositioning device provided by the present invention.
[0040] Fig.13 It is a schematic diagram of the physical structure of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] Indoor relocalization refers to the process of initializing the position of an indoor mobile robot when it re-enters an indoor environment or regaining its position when an abnormal situation occurs during movement and the position is lost. Its purpose is to obtain the accurate global position of the current robot in the map, so as to correct the positioning offset, realize autonomous positioning repair and real-time correction, where the indoor environment is a typical 2D scene.
[0043] At present, the mainstream positioning and localization methods mainly include visual positioning, inertial navigation, radio signal positioning and laser radar-based positioning. The performance of these sensors in indoor environments is as follows: the visual positioning method relies on the visual features in the environment, but the positioning effect is poor when the light changes or the vision is blocked; inertial navigation is easily affected by cumulative errors, resulting in a decrease in positioning accuracy after long-term use; radio signal positioning is limited by the stability and coverage of the signal, and requires the deployment of wireless base stations; and laser radar can provide high-resolution environmental information, is not affected by light and magnetic fields, and is suitable for complex indoor environments.
[0044] Existing LiDAR positioning algorithms generally use traditional point cloud matching algorithms such as Iterative Closest Point (ICP) and Normal Distributions Transform (NDT) for indoor re-positioning, which requires large positioning calculations and is difficult to apply to mobile robots. Therefore, there is an urgent need for a high-precision, high-robust and high-real-time positioning method in complex indoor environments to improve the navigation and positioning capabilities of indoor mobile robots.
[0045] In view of this, an embodiment of the present invention provides an indoor repositioning method, which obtains current environmental characteristics based on current point cloud data, that is, performs dimensionality reduction analysis on the current point cloud data to obtain current environmental characteristics, and then determines the corresponding current posture based on the current environmental characteristics. This method can reduce the amount of indoor repositioning calculations and improve the efficiency of indoor repositioning.
[0046] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0047] Figure 1 : is a flow chart of the indoor relocation method provided by the present invention. The indoor relocation method can be applied to electronic devices. During the implementation, the electronic devices can be various types of devices with mobility and information processing capabilities. For example, the electronic devices can include indoor service robots, storage robots, logistics robots, etc. Figure 1 As shown, the method may include the following steps 101 to 102: Step 101: Acquire current environmental features based on current point cloud data, wherein the current point cloud data is two-dimensional data obtained by scanning the current spatial environment by radar, and the current environmental features are determined based on the positions between multiple scanning points after dimensionality reduction of the current point cloud data.
[0048] It should be noted that there are many methods for obtaining current environmental features based on current point cloud data, such as feature extraction, feature calculation, etc. The present invention reduces the dimension of the current point cloud data and determines the current environmental features based on the positions of multiple scanning points.
[0049] There are many ways to determine the current environment characteristics based on the positions of multiple scanning points. For example, the distance, angle, distribution, etc. between the multiple scanning points can be analyzed. The present invention does not limit the method for determining the current environment characteristics based on the positions of multiple scanning points.
[0050] Step 102: Determine the corresponding current posture according to the current environment characteristics.
[0051] It should be noted that there are many ways to determine the corresponding current posture based on the current environmental characteristics, such as feature matching or feature comparison. The present invention does not limit the method for determining the corresponding current posture based on the current environmental characteristics.
[0052] It can be understood that the present invention adopts a method of obtaining current environmental characteristics according to the positions of multiple scanning points after reducing the dimension of the current point cloud data, and then determining the corresponding current posture according to the current environmental characteristics. Since the current environmental characteristics are equivalent to the position description information, the information is simple and the calculation is also simple, which solves the problem of large positioning calculation amount in the prior art, can reduce the calculation amount of indoor repositioning, and improve the efficiency of indoor repositioning.
[0053] In some embodiments, the current environment feature includes at least one of a first geometric feature, a second geometric feature and a point cloud distribution feature, the first geometric feature is determined based on the point features of the multiple scanning points in the radar coordinate system, the second geometric feature is determined based on the line segment features of the multiple scanning points in the radar coordinate system, and the point cloud distribution feature is determined based on the distribution positions of the multiple scanning points in space.
[0054] It should be noted that the current environment feature may include at least one of the first geometric feature, the second geometric feature and the point cloud distribution feature, that is, it may include one feature, two features or three features, that is, it can be set according to requirements.
[0055] It is understandable that the accuracy of positioning using one feature is the lowest, the accuracy of positioning using two features is medium, and the accuracy of positioning using three features is the highest. The feature extraction solution provided by the present invention solves the problem of the lack of indoor repositioning feature solutions. The present technology proposes a solution to realize indoor repositioning by extracting the first geometric feature, the second geometric feature and the point cloud distribution feature based on the laser radar scanning map, which provides a feasible solution. Exemplarily, the first geometric feature and the second geometric feature may include typical indoor geometric features such as area, distance, angle, and length.
[0056] In some embodiments, the point cloud data obtained by the laser radar after scanning indoors can characterize indoor geometric features, such as walls, obstacles and doors. Walls correspond to obvious line segments, small obstacles correspond to independent point cloud clusters, and features such as doors and corners can also be extracted through point clouds. These coarse features are suitable for large-scale screening. That is, the first geometric feature and the second geometric feature can be coarse features used to narrow the range of precise positioning. The first geometric feature may include indoor geometric features based on the point features of the laser radar point cloud, and the second geometric feature may include indoor geometric features based on the line features of the laser radar. Point features refer to the coordinates of the point cloud in the laser radar coordinate system, and line features are line segments extracted from the laser radar point cloud. The extraction of indoor geometric features based on point features is simple and stable, but the amount of information is small; indoor geometric features based on line features need to be extracted through line segments of point clouds and then the line segments are processed. The extraction is cumbersome and not stable enough, and is easily affected by indoor moving obstacles, but it is rich in information.
[0057] In an embodiment of the present invention, the current environment feature includes the first geometric feature, and obtaining the current environment feature based on the current point cloud data may include: obtaining a scanning area, wherein the scanning area is obtained by calculating the area of a closed figure formed by adjacent scanning points among the multiple scanning points; and / or obtaining a target feature, wherein the target feature is obtained by extracting the features of the current point cloud data through principal component analysis.
[0058] It should be noted that the features extracted from the point cloud include the first geometric features, which are indoor geometric features based on point features. Point features may include the distance and angle information of each scanning point in the laser radar scanning data and its coordinates in the radar coordinate system. The first geometric features extracted based on the point features may include the area formed by the scanning point cloud and the target features extracted by principal component analysis (PCA).
[0059] Exemplarily, the first geometric feature based on the point feature may include a laser radar scanning area and a target feature extracted by principal component analysis (PCA), etc.
[0060] Figure 2 Schematic diagram of extracting scanning area from laser radar scanning point cloud provided by the present invention. The scanning area refers to the area of the closed figure formed by connecting adjacent scanning points in the laser radar scanning point cloud, i.e. the current point cloud data. The framed grid in the figure is the location of the laser radar, the dotted part is the laser radar scanning range, and the area of the indoor scanning range is represented by dots, respectively. and Represents the radial distance and angle of each point in a frame of laser radar scanning point cloud in the laser radar coordinate system, then the laser radar scanning area The formula for calculating this eigenvalue is as follows: .
[0061] In some embodiments, acquiring target features may include: acquiring target variance, wherein the target variance is obtained by calculating the variance of two target directions, wherein the two target directions are two directions orthogonal to two initial directions, wherein the two initial directions are two directions with the largest variance in the radar coordinate system obtained by performing principal component analysis on the current point cloud data; and / or acquiring target span value, wherein the target span value is obtained based on the span of the current point cloud data in two dimensions of the radar coordinate system and the rotated radar coordinate system, wherein the rotated radar coordinate system is determined by performing principal component analysis on the current point cloud data.
[0062] It should be noted that the eigenvalues, i.e., target features, obtained by PCA on the scanned point cloud can also be used as indoor geometric features. PCA is used to obtain the direction in which the variance of the original laser radar point cloud, i.e., the current point cloud data, in the radar coordinate system is the largest, and the direction orthogonal to it is determined. The variances in these two directions are used as features to determine whether the shape of the laser radar point cloud is closer to a long strip or closer to a square. The calculation method for obtaining the variances in these two orthogonal directions through PCA can be as follows: First, find the covariance matrix of the X and Y coordinates of the two-dimensional point cloud in the LiDAR Cartesian coordinate system: ,in, represents the covariance of the random variable representing the distribution of the laser radar scanning point cloud in the X coordinate of the Cartesian coordinate system, that is, the variance of the random variable, It refers to the covariance of the random variable representing the distribution of the laser radar scanning point cloud in the X coordinate of the Cartesian coordinate system and the random variable representing the distribution of the laser radar scanning point cloud in the Y coordinate of the Cartesian coordinate system. The covariance of the random variable representing the distribution of the LiDAR scan point cloud in the Cartesian coordinate system X coordinate and the random variable representing the distribution of the LiDAR scan point cloud in the Cartesian coordinate system Y coordinate, Represents the covariance of the random variable representing the distribution of the LiDAR scan point cloud in the Cartesian coordinate system Y coordinate and the random variable representing the distribution of the LiDAR scan point cloud in the Cartesian coordinate system X coordinate. and The values are equal.
[0063] The elements are calculated as follows: ,in , , respectively represent the coordinate averages of the two dimensions of the original point cloud in the laser radar coordinate system. The elements here refer to the calculation method of the four elements of the covariance matrix, that is, , , , .
[0064] Then, the target features are obtained according to the obtained covariance matrix, that is, , the target features are: ; ; in, represents the larger of the two eigenvalues of the above 2×2 covariance matrix C, represents the smaller of the two eigenvalues of the 2×2 covariance matrix C. The calculation formula is the calculation formula for a set of two-variable linear equations. , if and only if for any positive integer , both have (where k is a constant) or When the equality sign holds, it is easy to prove that , and from the above formula, it can be seen that the corresponding shape of the two-dimensional point cloud close to the long strip is and The difference is greater than that in the two-dimensional point cloud that is close to a square.
[0065] Calculate the corresponding feature vector based on the target feature and , and after normalization, we get the rotation matrix of the two-dimensional point cloud: ,
[0066] ,in, Indicates a The rotation matrix is used to rotate the X-axis of the Cartesian coordinate system of the original lidar two-dimensional point cloud to the direction of maximum variance of the two-dimensional point cloud; Represents the covariance matrix The eigenvalue of The corresponding eigenvector; Represents the covariance matrix The eigenvalue of The corresponding eigenvectors; this calculation formula is to respectively and Substitution
[0067] Then the coordinates in the original laser radar coordinate system are The coordinates of the point after rotation are , for the original data , get the coordinates of the origin cloud in the orthogonal coordinate system obtained from PCA Then we have: ,
[0068] in, It means that the direction with the maximum variance obtained after PCA of the original laser point cloud is the new X-axis, and the coordinate value of the original laser point cloud on the new X-axis; It means that the direction with the minimum variance obtained after PCA of the original laser point cloud is the new Y-axis, and the coordinate value of the original laser point cloud on the new Y-axis; and They respectively represent the coordinate values of the original laser point cloud in the original Cartesian coordinate system. The positive direction of the X-axis of the original coordinate system is the facing direction of the indoor mobile robot. The point cloud coordinates of the original laser radar are directly given by the laser radar.
[0069] In the new coordinate system, the maximum and minimum values of the coordinates in each dimension are calculated to obtain the span of the point cloud in these two directions. The spans of these two dimensions can also be used as indoor geometric features.
[0070] It can be understood that obtaining the scanning area and / or target feature as the first geometric feature can improve the accuracy of indoor repositioning.
[0071] In some embodiments, the current environment feature includes a second geometric feature, and obtaining the current environment feature based on the current point cloud data may include: obtaining multiple line segments corresponding to the current point cloud data, the multiple line segments are obtained by screening, segmenting and fitting the line segments corresponding to the multiple scanning points; and obtaining the second geometric feature based on the multiple line segments.
[0072] It should be noted that the line feature is an obvious line segment extracted from the laser radar scanning data, usually corresponding to a wall or an obstacle. The indoor geometric feature extracted based on the line feature, i.e., the second geometric feature, may include the minimum distance to the wall facing the robot and the length and corner information of the obvious line segment.
[0073] In some embodiments, obtaining multiple line segments corresponding to the current point cloud data may include: screening the distances between the multiple scanning points to determine multiple target scanning points, wherein the distances between adjacent target scanning points in the multiple target scanning points are within a preset distance range; recursively segmenting the multiple target scanning points according to target discontinuity points to obtain multiple initial line segments, wherein the target discontinuity points are discontinuity points that meet preset discontinuity requirements, and wherein the multiple initial line segments include line segments obtained by merging two line segments whose angles between the line segments on both sides of the target scanning point are less than a preset angle threshold; screening the multiple initial line segments to obtain multiple target line segments, wherein the multiple target line segments are line segments whose lengths are greater than a preset length threshold and are obtained by fitting using the least squares method.
[0074] Figure 3 Schematic diagram of extracting line segments from a two-dimensional laser radar scanning point cloud provided by the present invention, such as Figure 3 As shown, the framed grid is the location of the laser radar, the dotted line is the laser radar scanning range, and the marked thick line segment is the line segment extracted from the laser radar scanning point cloud.
[0075] Among them, the steps of extracting line segments are as follows: the first step is to perform distance screening on the point cloud data of the laser radar so that the distance of each point converges to the set minimum distance and maximum distance, and filter out abnormal points that are too far away from two adjacent points; the second step is to recursively segment the scan points, judge the discontinuity points point by point, find the discontinuity points with the greatest impact and the most obvious, break them here, and split the scan points on both sides respectively, and so on and so forth recursively until the number of points input into the segmentation recursive function is 1, at which point the segmentation is considered complete, and all line segments are found. After obtaining all line segments, it is also necessary to judge the two line segments on both sides of the point with the smallest angle. If the two line segments are on the same line segment, they are merged; the third step is to screen the line segments, retain the obviously longer line segments, and use the least squares method to find the fitted line segments to obtain the length, normal angle, head and tail coordinates and other information of each line segment.
[0076] The second geometric features based on the line features can include the minimum distance of the line segment facing the laser radar, the maximum length of all line segments, and the number of corners and door-like objects.
[0077] In an embodiment of the present invention, the second geometric feature includes a target distance, and the target distance is used to indicate the distance of the current point cloud data to the line segment facing the current point cloud data. The acquiring the second geometric feature based on the multiple line segments may include: drawing a perpendicular line to the surrounding line segments to determine at least two facing line segments, and the at least two facing line segments are the line segments where the feet of the perpendicular line are located; traversing the at least two facing line segments to determine the target distance, and the target distance is the minimum distance between the electronic device and each facing line of the at least two facing line segments.
[0078] Figure 4 This is a schematic diagram of extracting the minimum distance to the wall from the two-dimensional laser radar scanning point cloud provided by the present invention. At this time, the laser radar has two walls facing each other, and the distances to the walls facing each other are calculated respectively. The minimum distance is taken as the characteristic value of the minimum distance, which is framed by the smaller dotted line in the figure. Facing the wall means that the robot draws a perpendicular line to the obvious line segments around it. If the foot of the perpendicular line is on the line segment, it is considered that the robot is facing the wall, and the minimum value of the distance between the robot and all the walls facing each other is taken as the indoor geometric characteristic value of the minimum distance. If the starting and ending coordinates of a line segment are and , and its normal angle is , the distance from the robot to the line segment is , then the vertical foot coordinate of the robot about the segment is , if both satisfy
[0079] ,
[0080] The robot is considered to be facing the line segment. Traverse all the facing line segments to get the minimum distance, and use the minimum distance as the corresponding indoor geometric eigenvalue. If there is no facing line segment, this eigenvalue is assigned to 0.
[0081] In an embodiment of the present invention, the second geometric feature includes a target length, and the target length is the length of the longest line segment among the multiple line segments.
[0082] Figure 5 This is a schematic diagram of extracting the maximum length of a line segment from a two-dimensional laser radar scanning point cloud provided by the present invention, and calculating the length of each line segment , taking the maximum length of each line segment as the eigenvalue of the second geometric feature, marked with a dotted line.
[0083] In an embodiment of the present invention, the second geometric feature includes the number of targets, which is the number of target objects determined in the current point cloud data, and the target objects are used to characterize door-type objects. Acquiring the second geometric feature based on the multiple line segments may include: acquiring multiple corners corresponding to the current point cloud data, and the multiple corners are determined based on whether adjacent line segments are connected end to end and whether the normal angle difference meets the preset angle requirement; determining the number of targets corresponding to the target objects based on the multiple corners, and the target objects are determined based on whether two adjacent corners among the multiple corners share the same line segment, whether they present a concave shape, and whether the lengths of the three line segments constituting the two adjacent corners meet the preset length requirement.
[0084] Figure 6 This is a schematic diagram of extracting the number of door-like objects from a two-dimensional laser radar provided by the present invention. To determine the door-like objects, it is first necessary to determine the corner information within the laser radar scanning range. The corner information needs to determine whether the adjacent line segments in the line features are connected end to end and the normal angle difference is appropriate. and , the coordinates of the adjacent endpoints of the two line segments are and To determine whether two line segments are connected end to end, we need to calculate the distance between the adjacent endpoints of the two line segments. ,Regulation and are distance and angle thresholds. If the two line segments meet the following conditions: , then the two line segments are considered to form a corner, and all line segments are traversed to determine whether the adjacent line segments form a corner. To extract door information, it is necessary to first determine whether the two adjacent corners share the same line segment and whether they are concave in shape, and whether the lengths of the three line segments that form the two adjacent corners meet the requirements of a door in reality. If the two corners share the same longer line segment, the remaining line segments are shorter, and the overall shape is concave, then it is considered that there is a door there.
[0085] It is understandable that obtaining the target distance, target length and / or target number as the second geometric feature can improve the accuracy of indoor repositioning.
[0086] In some embodiments, in order to achieve higher precision positioning, the present invention proposes the concept of point cloud distribution features. The point cloud distribution features obtain the distribution features of each scanning point in space through the distance and angle information of a frame of scanning point cloud, and construct a two-dimensional point cloud distribution matrix. The point cloud distribution features can be precise features for precise positioning.
[0087] In an embodiment of the present invention, the current environment feature includes a point cloud distribution feature, and obtaining the current environment feature according to the current point cloud data may include: Traversing the plurality of scanning points, and performing the following steps on each of the plurality of scanning points: determining, according to a position of each of the plurality of scanning points in the current point cloud data, a row and column position corresponding to a radial distance range and an angle range of each of the scanning points; The point cloud distribution matrix corresponding to each scanning point is updated according to the row and column positions to obtain an updated point cloud distribution matrix, and the updated point cloud distribution feature moment is the point cloud distribution feature.
[0088] Figure 7 It is a schematic diagram of extracting point cloud distribution features from two-dimensional laser radar scanning point clouds provided by the present invention. Point cloud distribution features are position descriptors for box-coded projection of two-dimensional laser radar point clouds. The core idea is to map the point cloud distance and angle information into a two-dimensional matrix through spatial segmentation. The rows of the matrix correspond to the radial distances of the point clouds, the columns of the matrix correspond to the angles of the point clouds, and the values in the matrix correspond to the number of scanning points within the corresponding distance range and angle range. Therefore, the point cloud distribution features can intuitively represent the spatial distribution of two-dimensional point clouds, and are features directly targeting the point cloud distribution. Since the rotation of the laser radar almost only causes the column shift of the point cloud distribution features without numerical changes, the point cloud distribution features have rotational invariance.
[0089] Record a frame of laser radar scanning data The distance values of the scanning points are , the corresponding angle value is , set the maximum distance of the laser radar scan to . Set the number of rows of the point cloud distribution feature matrix to , the number of columns is , then a row in the point cloud distribution feature matrix corresponds to the distance range in reality: , a column in the point cloud distribution feature matrix corresponds to the angle range in reality: , expressed in radians The final scan context matrix is recorded as , its Line Listed as . Record the first Line The spatial range of the column corresponding to the two-dimensional point cloud is , the spatial range is The ring area and The overlapping area of the fan-shaped areas is Represents the radial distance of the scanning point within the space range, Represents the angle of the scanning point within the space range, which must satisfy: ,in, Indicates the maximum radial distance of the laser radar scanning range, Represents the number of rows of the point cloud distribution feature matrix, Indicates the radial distance step length of a row of the point cloud distribution feature matrix mapped to the lidar point cloud; Represents the number of columns of the point cloud distribution feature matrix, The angle step size of the lidar point cloud to which a column representing the distribution characteristics of the point cloud is mapped; Represents the point cloud distribution feature matrix Line The spatial range of the laser radar point cloud corresponding to the column, Represents the radial distance of the scanning point within the space range, Represents the angle of the scan point within the space range; and Used to index the rows and columns of the point cloud feature matrix.
[0090] For example, the process of extracting the point cloud distribution features of a frame of 2D laser radar point cloud is as follows: First, determine the specific position of each scanning point in the 2D point cloud, and calculate the row and column positions of the point cloud distribution features corresponding to its radial distance range and angle range. Scan points ( ), get its radial distance and angle , calculate the distance range and angle range of the scan point in the two-dimensional point cloud, and then determine its circular position on the mapping disk and sector position , corresponding to the first Row and The calculation formula is as follows:
[0091] in Points are rounded up. Explain the calculation method of sum, which corresponds to the mapping method of the above point cloud feature matrix in the lidar point cloud. Here is the inverse mapping of the above mapping.
[0092] The second step is to update the values of the relevant elements of the point cloud distribution feature matrix corresponding to the scan point, that is, ,in, The corresponding point cloud distribution feature matrix OK, The corresponding point cloud distribution feature matrix List, Represents the point cloud distribution feature matrix Line The value of the column.
[0093] The third step is to traverse all scanning points and repeat the above operation. Indicates that it falls on The ring and The spatial range of a sector The final result of extracting the point cloud distribution features is a two-dimensional point cloud containing the point distribution information in the spatial area. matrix: .
[0094] It can be understood that by performing a slight dimensionality reduction on the distance and angle information of the scanned point cloud, the spatial distribution characteristics of the point cloud can be obtained for accurate pose estimation, which can improve the accuracy of indoor repositioning.
[0095] In some embodiments, before determining the corresponding current posture according to the current environmental features, the method may further include: obtaining a corresponding relationship between environmental features and posture; Determining the corresponding current posture according to the current environment feature may include: According to the current environmental features and the corresponding relationship between the environmental features and the pose, a target pose corresponding to the current environmental features is determined.
[0096] It should be noted that a correspondence between environmental features and posture can be established, and after obtaining the current environmental features, the target posture corresponding to the current environmental features can be determined based on the current environmental features and the correspondence between the environmental features and posture.
[0097] In some embodiments, obtaining the correspondence between environmental features and posture may include: dividing the target map into grids to obtain multiple target grids, wherein the target map is obtained by simultaneous positioning and map construction by radar; placing a simulated radar in each of the multiple target grids and extracting point cloud features corresponding to each target grid; storing the point cloud features corresponding to each target grid, as well as the corresponding posture, to obtain the correspondence between the environmental features and posture.
[0098] Exemplarily, a method for building a database based on an indoor environment map and a feature extraction algorithm can be provided. The positioning algorithm matches the laser radar scanning data with the database, finds the posture corresponding to the most similar feature in the database as the output value of the algorithm, and the final result is the posture of the robot relative to the map coordinate system, including coordinates and yaw angles. Therefore, the input data of the positioning algorithm is a frame of scanning data released by the laser radar and a feature database established based on the indoor map.
[0099] Indoor map information is used to build a database and represent the robot's position and posture, including the position of the indoor map coordinate system relative to the map, the size of the map, and the side length of the area in reality corresponding to one pixel in the map image. The map is constructed by laser radar through Cartographer for simultaneous localization and mapping (SLAM). After the map is constructed, the height and width of the map, the grayscale image of the map, and the position of the origin of the map coordinate system relative to the map image can be stored simultaneously, as well as the side length of the area in reality corresponding to one pixel in the map image. In the present invention, one pixel in the map image is set to correspond to 5 cm in reality.
[0100] In some embodiments, dividing the target map into grids to obtain multiple target grids may include: determining a wall information matrix based on a grayscale image of the target map, the wall information matrix including an active area and an obstacle area, the active area being used to indicate an area whose grayscale value is greater than or equal to a preset grayscale value threshold, and the obstacle area being used to indicate an area whose grayscale value is less than a preset grayscale threshold, the wall information matrix being obtained by converting the grayscale image of the target map into a grayscale value matrix, and then converting the grayscale value matrix into a wall information matrix; dividing the wall information matrix into grids of preset length and width to obtain the multiple target grids.
[0101] Placing a simulated radar in each of the plurality of target grids and extracting point cloud features corresponding to each of the target grids may include: Traversing each grid, if the grid is a target grid, placing a simulated radar for radar scanning to obtain a point cloud corresponding to the target grid, wherein the target grid is used to indicate the grid corresponding to the movable area, and the simulated radar is used to simulate the radar of an electronic device for scanning; performing feature extraction on the target point cloud corresponding to the target grid to obtain target environment features corresponding to the target point cloud, wherein the target environment features are determined based on the positions of multiple scanning points in the target point cloud data.
[0102] In some embodiments, storing the point cloud features corresponding to the respective target grids, and the corresponding posture, to obtain the corresponding relationship between the environmental features and the posture, may include: calculating the coordinates in the map coordinate system corresponding to the respective grids; determining the coordinates in the map coordinate system corresponding to the respective grids, and the yaw angle corresponding to the respective grids, as the corresponding posture; and using a tree structure to store the point cloud features corresponding to the respective target grids, and the corresponding posture, to obtain the corresponding relationship between the environmental features and the posture.
[0103] It can be understood that the present invention establishes the correspondence between environmental features and posture by constructing a feature map, that is, after dividing the indoor map into grids, a simulated lidar is set in each grid and the features are extracted to build a database, so as to obtain a global descriptor of the target indoor environment, and obtain the positioning posture by matching the actual lidar features with the database, which is global and universal.
[0104] It can be seen that the first step of indoor relocalization is to analyze the indoor map, and then a database of indoor geometric features and point cloud features will be established through the map.
[0105] Figure 8 It is a schematic diagram of the registration database construction process provided by the present invention, such as Figure 8 As shown, the specific method is to divide the entire map into grids, place a simulated laser radar in each grid and extract the point cloud features here, and store the corresponding position and features of the grid. The detailed description is as follows: First, read the grayscale image of the map. The area with higher grayscale value is the robot active area in the indoor scene, and the area with lower grayscale value is the obstacle area where the robot cannot move. After reading the map image, first convert it into a grayscale value matrix, and then convert the grayscale value matrix into a wall information matrix, mark the active area and obstacle area respectively, and after obtaining the wall information matrix, divide the matrix into grids with fixed length and width, which are used to place simulated laser radar in each grid and extract the features of the laser point cloud. In the present invention, the size of the grid is one pixel of the map image, corresponding to the real area.
[0106] After that, each grid is traversed. If the grid is within the robot's actionable area, a simulated laser radar is placed there and a laser radar scanning process is completed to simulate the robot laser radar moving to the area corresponding to the grid in reality. The simulated laser radar point cloud must have a high degree of similarity with the scanning point cloud of the laser radar at that location in reality. Therefore, it is necessary to obtain the parameters of the real laser radar, such as the minimum angle of the point cloud, angle increment, maximum angle, number of scanning points, ranging range, etc. When setting up the simulated laser radar, these parameters need to be set to keep them consistent with the various parameters of the real laser radar, so that the simulated laser radar is as similar to the real laser radar as possible. The idea of obtaining simulated laser radar scanning data of a certain grid is to calculate the distance between the center of the grid and the obstacle area in each direction. The specific method is to set a probe. The distance between the probe and the center of the grid is the scanning distance in the corresponding direction. In a certain direction, the distance between the probe and the center of the grid is gradually increased from zero according to a certain step length, and it is judged whether the probe is in the obstacle area. If the probe is in the obstacle area, stop increasing the distance of the probe, and use the distance as the distance information of the simulated laser in this direction. If there is no obstacle area in this direction, the distance in this direction is set to the set maximum distance. The ranging angle is gradually increased from the minimum angle according to the angle increment to obtain the ranging distance in the corresponding direction until the maximum angle is reached, so as to obtain a frame of simulated laser radar scanning data in the corresponding grid for the next step of feature extraction and database construction.
[0107] The method for obtaining the current environment features provided by the present invention is used to extract the first geometric features, the second geometric features and the point cloud distribution features of the simulated laser radar point cloud in each grid. These features are rotationally invariant, and there is no requirement for the yaw angle of the simulated laser radar. The orientation of the robot here can be set to the positive direction of the X-axis in the map coordinate system, and the yaw angle in the corresponding posture is PoseYaw=0. The corresponding features are extracted for each grid, and the coordinates (PositionX, PositionY) in the map coordinate system corresponding to the grid are calculated. The coordinates are calculated by the coordinates (OriginX, OriginY) of the lower left corner of the map relative to the map coordinate system recorded in the map configuration file and the position (MapX, MapY) of the grid relative to the lower left corner of the map.
[0108] .
[0109] The above coordinates and the yaw angle The pose corresponding to the grid , the posture and the features extracted from the grid constitute the indoor information of the grid, and are converted into JSON format and recorded. JSON is a lightweight data exchange format. Data read and written based on JSON can be indexed by string key values. Therefore, when multiple features need to be read and written at the same time, the JSON format has the advantages of accuracy, speed, and simplicity. When building a database, you can build a main JSON, first store map information, such as the location of the indoor scene, the timestamp of building the database, etc., and then set a sub-JSON to store the features of each grid, marking it as Feature. Traverse the grids in the robot's movable area, package the posture and features of each grid into JSON format, and store them in the sub-JSON marked as Feature. After the traversal is completed, the main JSON containing the map information and the posture and feature information of each grid is stored in a file, and the database is built. Figure 8 The table on the right shows the storage format of the features extracted from a grid in the grid map. The JSON corresponding to the information of each grid is stored in the database. The two-level search algorithm in the positioning process reads information from the database and filters it.
[0110] The present invention uses a laser point cloud mapping algorithm to map the indoor environment, generate a map image, and divide the grid by pixels. The coordinates of each grid in the map coordinate system are calculated by the position of the map image relative to the map coordinate system and the position of the grid in the map image, and the yaw angles of all grids are set to 0°. The grids are divided according to the grayscale value of the map image: the grids with grayscale values higher than the threshold are the robot's active area, and the grids with grayscale values lower than the threshold are obstacle areas (corresponding to walls). A simulated laser radar is placed in the grid of each active area, and feature extraction is performed on the two-dimensional laser radar scanning point cloud corresponding to each grid. The obtained indoor geometric features and point cloud distribution features are stored in JSON format together with the grid number and the corresponding posture to generate a database.
[0111] The method for obtaining the correspondence between environmental features and posture, i.e., a database, provided by the present invention solves the problem of large storage space occupied by the positioning database. The present invention only stores scalar information such as area, distance, angle, length, etc. in each grid, and manages data with a tree structure, so that the map occupies a relatively small storage space. In addition, the present invention divides the map of the indoor environment into grids, places a simulated laser radar in each grid, extracts the features of the simulated laser radar point cloud as a database, and stores the posture and features corresponding to each grid in the database, without requiring a large amount of training data, and the database is highly targeted and concise.
[0112] In some embodiments, the current environment feature includes a point cloud geometric feature and a point cloud distribution feature, the point cloud geometric feature includes at least one of the first geometric feature and the second geometric feature, and determining the target posture corresponding to the current environment feature according to the current environment feature and the correspondence between the preset environment feature and the posture may include: A nearest neighbor search is performed based on the point cloud geometric features to determine K grids that are closest to the point cloud geometric features; feature matching is performed on the point cloud distribution features and the K grids to determine a target pose corresponding to the point cloud distribution features, wherein the target pose is the pose of the target grid among the K grids that matches the point cloud distribution features.
[0113] It should be noted that the present invention can adopt a two-level search algorithm based on an incremental kd tree ikd-Tree and a two-dimensional matrix similarity score. The first-level search is intended to narrow the scope of the second-level search. The input is the first geometric feature extracted from the actual laser radar scanning point cloud, the second geometric feature and the indoor geometric feature in the database. The method is to use the three indoor geometric features of all grids in the database to establish a three-dimensional ikd-Tree, and the node contains the grid number and the indoor geometric feature. The indoor geometric features of the actual laser radar are used as the target node to perform a K nearest neighbor search KNN search to obtain the most similar K nodes and obtain the corresponding grid number. In the second-level search, a candidate point cloud distribution feature set is extracted from the database according to the grid number, and a column shift is performed to generate a candidate point cloud distribution feature set containing a column shift. The similarity between the point cloud distribution features corresponding to the actual laser radar and the candidate set containing the column shift is calculated, and the matching item with the highest similarity score is found, and the corresponding grid coordinates are used as the current position of the robot, and the yaw angle of the robot is calculated by column shift, and finally the positioning result posture is obtained.
[0114] Fig. 9It is a schematic diagram of the first-level search in the two-level search algorithm provided by the present invention, wherein each node of the ikd-Tree corresponds to a grid, including the indoor geometric features (i.e., the first geometric features and the second geometric features) extracted from the grid and the grid number, and the second-level search will retrieve the point cloud distribution features through the number. The indoor geometric features of the actual laser radar are used as the target indoor geometric features for KNN search. The indoor geometric features used for the first-level search in the present invention are the area of the laser radar scanning range, the minimum distance facing the wall, and the maximum length of the wall within the scanning range. Since the size range of each feature value is different, it is necessary to normalize each indoor geometric feature. Therefore, the key value of each dimension in the search tree is the ratio of the original value of each indoor geometric feature to the maximum value of the indoor geometric feature corresponding to each grid. The output result of the first-level search is a subset in the database, which is the K tree nodes obtained by the KNN search. Through the index values in the database corresponding to these K tree nodes, the corresponding postures and point cloud distribution features of the indoor geometric features corresponding to the K tree nodes can be obtained, which are respectively recorded as and .
[0115] The input data for the second level search is obtained from the first level search The candidate point cloud distribution features corresponding to the tree nodes are calculated by calculating the similarity scores between the point cloud distribution features of the actual lidar point cloud and the candidate point cloud distribution features to find the candidate point cloud distribution features with the highest similarity, thereby obtaining the corresponding pose. The similarity score here refers to the average value of the cosine distance of the corresponding column vectors of the two two-dimensional matrices. The cosine distance of two column vectors is the ratio of their inner product to the product of the two module values.
[0116] The point cloud distribution characteristics are The two-dimensional matrix , record the matrix The column vector is , find the similarity of two point cloud distribution feature matrices, which are point cloud distribution features extracted from real laser radar point clouds, and are recorded as query matrices , and the candidate point cloud distribution features read from the database, recorded as the candidate matrix , the first of the two The columns are and , then the cosine distance between the two columns is: .
[0117] in represents the inner product of two vectors, and Each represents the modulus of the corresponding vector. Since each element in all column vectors is a non-negative integer, the inner product of any two column vectors is non-negative, so and Cosine distance between two vectors The value of , The closer to 0, the and The lower the similarity, the , it means that the two column vectors are orthogonal and the similarity is the lowest; The closer it is to 1, the and The higher the similarity, the , it means that the two column vectors point to the same direction and have the highest similarity.
[0118] When calculating the similarity of two point cloud distribution feature matrices, it is necessary to calculate The similarity of the column vectors at the same position is calculated and the average value is taken as the similarity score of the two point cloud distribution feature matrices. The score is recorded as , the specific calculation formula is as follows: .
[0119] The similarity score indicates the overall similarity of the distribution features of the two point clouds, and its value is , The larger it is, the closer it is to 1, indicating that the greater the similarity between the query point cloud distribution features and the candidate scanning context, the greater the probability that the robot will be in this candidate pose. Therefore, by calculating the similarity scores between the query point cloud distribution features and several candidate scanning contexts, and selecting the candidate scanning context corresponding to the score with the largest similarity, the final pose with the highest probability can be determined.
[0120] It can be understood that the present invention provides a two-level search algorithm based on ikd-Tree indoor geometric feature screening and matrix similarity scoring of point cloud distribution features. The purpose of the first-level search is to narrow the scope of the second-level search, because the second-level search requires matrix similarity calculation, which requires a large amount of calculation. The first-level search is required to filter out the two-dimensional point cloud that obviously does not meet the conditions, and use the indoor geometric features to perform KNN search. The final result is the K closest indoor geometric feature points and corresponding grid numbers that are closest to the target indoor geometric features. The purpose of the second-level search is to determine the final positioning posture, and its input is the point cloud distribution features corresponding to the indoor geometric features of the K tree nodes obtained in the first-level search, and the final output is the posture of the robot in the map coordinate system.
[0121] The yaw angle of the actual LiDAR posture is often different from the yaw angle of the posture in the database, so it is necessary to calculate the yaw angle of the actual LiDAR by column shifting of the point cloud distribution features.
[0122] Fig.10It is a schematic diagram provided by the present invention for explaining the expression and significance of the point cloud distribution feature column shift. The figure shows the distribution diagram of the point cloud distribution features of the two-dimensional point cloud scanned by the laser radar at the same position before and after horizontal rotation. The only variable that changes in the upper and lower cases is the yaw angle of the robot. Fig.10 (a) is the point cloud distribution feature of the current point cloud data, Fig.10 (b) is the point cloud distribution feature after rotating 84° counterclockwise. When the robot only changes the yaw angle, the only impact on the point cloud distribution feature is to cause it to shift the column accordingly. The rotation invariance is explained from the construction method of the point cloud distribution feature. When box encoding the two-dimensional point cloud, each scanning point with the same angle range is mapped to the same column of the two-dimensional matrix. Each element in this column of the two-dimensional matrix is then mapped and assigned according to different radial distances. When the robot's yaw angle increases in the counterclockwise direction, After that, the angle of the same obstacle point in the indoor LiDAR coordinate system increases by , which means that the 2D point cloud scanned by the LiDAR rotates horizontally around the origin of the LiDAR coordinate system, and the rotation angle is , and it is easy to prove that the yaw angle and the column shift of the point cloud distribution feature matrix are linear mapping relations, and the corresponding relationship between the column shift number and the yaw angle increment is Based on this principle, when calculating the similarity between the query scan context and the candidate scan context, the candidate point cloud distribution feature matrix can be transformed from 1 column to Column by column, record the The candidate scan context matrix for column-by-column shifting is , and then calculate With query scan context The similarity of the two point cloud distribution features is determined by taking the column shift number with the largest similarity, and the relative yaw angle with the largest probability of distribution features of the two point clouds can be determined. The distribution features of two point clouds are After the column shift, we get The maximum value among the similarities is recorded as , then: .
[0123] The second level search is essentially from The distribution features of each point cloud in the set are found after column shifting. The one with the highest similarity is A point cloud distribution feature in Move left column The point cloud distribution characteristics obtained are: , then The point cloud distribution feature set for similarity calculation should be , the collection has elements. Assume that The point cloud distribution feature with the highest similarity including column shift is , which is In Move left column The formula for calculating the distribution characteristics of the point cloud is: .
[0124] So far, the second-level search has obtained the distribution characteristics of the query point cloud after traversal matching. The point cloud distribution features with the highest similarity , that is, the corresponding point cloud distribution characteristics in the database are obtained The column corresponding to the highest similarity value is shifted , can be Get the corresponding position of the grid in the map coordinate system , in the present invention, the database is set , the coordinates in this pose That is, it represents the coordinate with the highest probability of the robot in the map coordinate system. The final position determined by the positioning algorithm is: .
[0125] It can be understood that the indoor repositioning method provided by the present invention has a simple algorithm, low computational complexity, and short positioning time. The most similar features are obtained through a two-level search and matching algorithm of eigenvalues. The first-level search uses the ikd-Tree search tree to perform KNN search to narrow the scope. The second-level search calculates the similarity score of the point cloud distribution feature matrix, and selects the grid corresponding feature with the highest similarity score to obtain the resulting pose. The algorithm is relatively easy to implement and has a low computational complexity, and real-time positioning can be achieved.
[0126] The indoor repositioning method provided by the present invention also solves the problem of initial posture dependence in the prior art. The present invention uses feature matching search to determine the final accurate posture, finds the most similar feature in the database to the feature extracted from the real lidar point cloud through a two-level search algorithm, and uses the posture corresponding to the feature as the positioning result, without the need to input the initial posture.
[0127] In some embodiments, the database in the present invention can be updated in real time as the indoor environment changes. When the indoor environment changes, it is only necessary to re-map the indoor environment and then input the target map into the offline database establishment part of the present invention. It only takes a few minutes to generate a database adapted to the new environment.
[0128] The present invention provides a method for extracting features and realizing indoor rapid positioning by using a two-dimensional single-line laser radar. The present invention aims to solve the problems that there is a lack of research on indoor relocation algorithms and most indoor relocation research has too much computational effort. The present invention proposes to extract typical indoor features such as area, distance, angle, length and point cloud distribution features (two-dimensional scanning context information) based on the laser radar scan map, and store them in a database, and use the current scanning laser radar point cloud to calculate the above information and match the corresponding features in the database to realize rapid positioning. The present invention also proposes to use a two-level search algorithm to realize the matching process. The first-level search searches for features similar to the current laser radar scan point cloud features in the pre-stored database through the K nearest neighbor search (KNN) based on indoor features to obtain the candidate position range; the second-level search calculates the similarity score between the two-dimensional scanning context of the current laser radar point cloud and the two-dimensional scanning context of the candidate position, performs similarity matching, and determines the precise posture of the robot. Experimental results show that the method performs well in a variety of indoor environments and has high accuracy and robustness.
[0129] The following describes an exemplary application of an embodiment of the present invention in a practical application scenario.
[0130] Fig.11 The overall flow diagram of the indoor relocation algorithm provided by the embodiment of the present invention is shown in FIG. Fig.11 As shown, the indoor repositioning algorithm of the present invention includes an offline part and a real-time part. The offline part refers to the construction of the database, and the real-time part refers to the processing, feature extraction, two-level search, etc. of the actual LiDAR point cloud. The external input of the algorithm is only the actual LiDAR scanning data subscribed by the Robot Operating System (ROS), and the output result is the position and posture of the robot in the map coordinate system. The purpose of the offline part is to build a database of the position and characteristics of all grids in the robot's movable area, without receiving external LiDAR data. Assume that the database stores The pose and features of the grids, then the pose set corresponding to all grids is , the indoor geometric feature set corresponding to all grids is , the point cloud distribution characteristics (also called two-dimensional scanning context information) corresponding to all grids are The real-time part can only be carried out after the offline part has been completed and the database has been established. Its core is the two-level search algorithm. The detailed steps are as follows: the positioning algorithm receives a frame of scan data from the real lidar through ROS and extracts indoor geometric features from the scan data. And point cloud distribution characteristics , combined with the database established in the offline part, the final pose is obtained after a two-level search algorithm.
[0131] The indoor relocation method provided by the present invention solves the indoor two-dimensional scene positioning problem, and provides a complete indoor relocation solution. A large number of tests have been carried out to determine the effectiveness. The present invention makes full use of the high-precision ranging characteristics of the laser radar, and combines effective feature extraction and matching algorithms to build a stable and reliable indoor relocation system.
[0132] Based on the foregoing embodiments, an embodiment of the present invention provides an indoor repositioning device. The modules included in the device and the units included in the modules can be implemented by a processor; of course, they can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0133] The indoor repositioning device provided by the present invention is described below. The indoor repositioning device described below and the indoor repositioning method described above can be referenced to each other.
[0134] Fig.12 Schematic diagram of the structure of the indoor relocation device provided by the present invention. Fig.12 As shown, the device 200 includes a feature acquisition module 201 and a posture determination module 202, wherein: The feature acquisition module 201 is used to acquire the current environment feature according to the current point cloud data, wherein the current point cloud data is data obtained by scanning the current space environment by radar, and the current environment feature is determined according to the position between multiple scanning points after the dimension reduction of the current point cloud data; The posture determination module 202 is used to determine the corresponding current posture according to the current environmental characteristics, and the current posture is used to indicate the coordinates and yaw angle of the electronic device relative to the map coordinate system.
[0135] In some embodiments, the current environment feature includes at least one of a first geometric feature, a second geometric feature and a point cloud distribution feature, the first geometric feature is determined based on the point features of the multiple scanning points in the radar coordinate system, the second geometric feature is determined based on the line segment features of the multiple scanning points in the radar coordinate system, and the point cloud distribution feature is determined based on the distribution positions of the multiple scanning points in space.
[0136] In some embodiments, the current environment feature includes the first geometric feature, and the feature acquisition module 201 is specifically used to: obtain a scanning area, where the scanning area is obtained by calculating the area of a closed figure formed by adjacent scanning points among the multiple scanning points; and / or obtain a target feature, where the target feature is obtained by extracting the features of the current point cloud data through principal component analysis.
[0137] In some embodiments, acquiring target features includes: acquiring target variance, wherein the target variance is obtained by calculating the variance of two target directions, wherein the two target directions are two directions orthogonal to two initial directions, wherein the two initial directions are two directions with the largest variance in the radar coordinate system obtained by performing principal component analysis on the current point cloud data; and / or acquiring target span value, wherein the target span value is obtained based on the span of the current point cloud data in two dimensions of the radar coordinate system and the rotated radar coordinate system, wherein the rotated radar coordinate system is determined by performing principal component analysis on the current point cloud data.
[0138] In some embodiments, the current environment feature includes a second geometric feature.
[0139] In some embodiments, the feature acquisition module 201 is specifically used to: obtain multiple line segments corresponding to the current point cloud data, wherein the multiple line segments are obtained by screening, segmenting and fitting the line segments corresponding to the multiple scanning points; and obtain the second geometric features based on the multiple line segments.
[0140] In some embodiments, the obtaining of multiple line segments corresponding to the current point cloud data includes: screening the distances between the multiple scanning points to determine multiple target scanning points, wherein the distances between adjacent target scanning points in the multiple target scanning points are within a preset distance range; recursively segmenting the multiple target scanning points according to target discontinuity points to obtain multiple initial line segments, wherein the target discontinuity points are discontinuity points that meet preset discontinuity requirements, and wherein the multiple initial line segments include line segments obtained by merging two line segments whose angles between the line segments on both sides of the target scanning point are less than a preset angle threshold; screening the multiple initial line segments to obtain multiple target line segments, wherein the multiple target line segments are line segments whose lengths are greater than a preset length threshold and are obtained by fitting using the least squares method.
[0141] In some embodiments, the second geometric feature includes a target distance, and the target distance is used to indicate the distance of the current point cloud data facing the line segment. The acquiring the second geometric feature based on the multiple line segments includes: drawing a perpendicular line to the surrounding line segments to determine at least two facing line segments, and the at least two facing line segments are the line segments where the feet of the perpendicular line are located; traversing the at least two facing line segments to determine the target distance, and the target distance is the minimum distance between the electronic device and each facing line of the at least two facing line segments.
[0142] In some embodiments, the second geometric feature includes a target length, and the target length is the length of the longest line segment among the plurality of line segments.
[0143] In some embodiments, the second geometric feature includes a target number, which is the number of target objects determined in the current point cloud data, and the target objects are used to characterize door-type objects. The acquiring of the second geometric feature based on the multiple line segments includes: acquiring multiple corners corresponding to the current point cloud data, and the multiple corners are determined based on whether adjacent line segments are connected end to end and whether the normal angle difference meets a preset angle requirement; determining the target number corresponding to the target objects based on the multiple corners, and the target objects are determined based on whether two adjacent corners among the multiple corners share the same line segment, whether they present a concave shape, and whether the lengths of the three line segments constituting the two adjacent corners meet a preset length requirement.
[0144] In some embodiments, the current environment feature includes a point cloud distribution feature, and the feature acquisition module 201 is specifically used to: traverse the multiple scanning points, and perform the following steps on each of the multiple scanning points: determine the row and column positions corresponding to the radial distance range and angle range of each scanning point according to the position of each scanning point in the current point cloud data; update the point cloud distribution matrix corresponding to each scanning point according to the row and column positions to obtain an updated point cloud distribution matrix, and the updated point cloud distribution feature matrix is the point cloud distribution feature.
[0145] In some embodiments, the device further comprises a correspondence module for acquiring a correspondence between environmental features and postures; The posture determination module 202 is specifically used to determine the target posture corresponding to the current environmental feature according to the current environmental feature and the corresponding relationship between the environmental feature and the posture.
[0147] In some embodiments, the correspondence module is specifically used to: divide the target map into grids to obtain multiple target grids, wherein the target map is obtained by simultaneous positioning and map construction by radar; place a simulated radar in each target grid of the multiple target grids and extract the point cloud features corresponding to each target grid; store the point cloud features corresponding to each target grid, as well as the corresponding posture, to obtain the correspondence between the environmental features and the posture.
[0148] In some embodiments, the target map is divided into grids to obtain multiple target grids, including: determining a wall information matrix according to the grayscale image of the target map, the wall information matrix including an active area and an obstacle area, the active area is used to indicate an area with a grayscale value greater than or equal to a preset grayscale value threshold, and the obstacle area is used to indicate an area with a grayscale value less than a preset grayscale threshold, the wall information matrix is obtained by converting the grayscale image of the target map into a grayscale value matrix, and then converting the grayscale value matrix into a wall information matrix; dividing the wall information matrix into grids of preset length and width to obtain the wall information matrix. A plurality of target grids; the simulated radar is placed in each target grid of the plurality of target grids and point cloud features corresponding to each target grid are extracted, including: traversing each grid, if the grid is a target grid, placing a simulated radar for radar scanning to obtain a point cloud corresponding to the target grid, the target grid is used to indicate the grid corresponding to the movable area, the simulated radar is used to simulate the radar of the electronic device for scanning; feature extraction is performed on the target point cloud corresponding to the target grid to obtain the target environment features corresponding to the target point cloud, the target environment features are determined according to the positions of multiple scanning points in the target point cloud data.
[0149] In some embodiments, the storing of the point cloud features corresponding to the respective target grids and the corresponding posture to obtain the corresponding relationship between the environmental features and the posture includes: calculating the coordinates in the map coordinate system corresponding to the respective grids; determining the coordinates in the map coordinate system corresponding to the respective grids and the yaw angle corresponding to the respective grids as the corresponding posture; and using a tree structure to store the point cloud features corresponding to the respective target grids and the corresponding posture to obtain the corresponding relationship between the environmental features and the posture.
[0150] In some embodiments, the current environment features include point cloud geometric features and point cloud distribution features, the point cloud geometric features include at least one of the first geometric features and the second geometric features, and the posture determination module is specifically used to: perform nearest neighbor search based on the point cloud geometric features to determine the K grids closest to the point cloud geometric features; perform feature matching on the point cloud distribution features and the K grids to determine the target posture corresponding to the point cloud distribution features, and the target posture is the posture of the target grid among the K grids that matches the point cloud distribution features.
[0151] In an embodiment of the present invention, the current environmental features corresponding to the current point cloud data can be obtained, that is, the current environmental features are obtained by dimensionality reduction analysis of the current point cloud data, and then the corresponding current posture is determined according to the current environmental features, thereby reducing the amount of indoor repositioning calculations and improving the indoor repositioning efficiency.
[0152] Fig.13 is a schematic diagram of the physical structure of the electronic device provided by the present invention, such as Fig.13 As shown, the electronic device may include: a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302 and the memory 303 communicate with each other through the communication bus 304. The processor 301 may call the logic instructions in the memory 303 to execute the indoor repositioning method, which includes: obtaining current environmental features according to current point cloud data, the current point cloud data is two-dimensional data obtained by scanning the current spatial environment by radar, and the current environmental features are determined according to the positions between multiple scanning points after the current point cloud data is reduced in dimension; and determining the corresponding current posture according to the current environmental features.
[0153] In addition, the logic instructions in the above-mentioned memory 303 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0154] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the indoor repositioning method provided by the above methods, and the method includes: obtaining current environmental characteristics based on current point cloud data, the current point cloud data is two-dimensional data obtained by scanning the current spatial environment by radar, and the current environmental characteristics are determined according to the positions between multiple scanning points after the current point cloud data is reduced in dimension; and determining the corresponding current posture based on the current environmental characteristics.
[0155] 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 invention 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 one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated therein. 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.
[0156] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the indoor repositioning method provided by the above-mentioned methods, the method comprising: obtaining current environmental characteristics based on current point cloud data, the current point cloud data is two-dimensional data obtained by scanning the current spatial environment by radar, and the current environmental characteristics are determined according to the positions between multiple scanning points after the dimensionality of the current point cloud data is reduced; and determining the corresponding current posture based on the current environmental characteristics.
[0157] The above-mentioned computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0158] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0159] The program code embodied on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
[0160] Computer program code for performing the operations of the present specification may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0161] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0162] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An indoor repositioning method, characterized in that: Used in electronic equipment, including: Acquire current environment features according to current point cloud data, wherein the current point cloud data is two-dimensional data obtained by scanning the current space environment by radar, and the current environment features are determined according to the positions between multiple scanning points after the current point cloud data is reduced in dimension; According to the current environment characteristics, a corresponding current posture is determined.
2. The indoor relocation method according to claim 1, characterized in that: The current environment feature includes at least one of a first geometric feature, a second geometric feature and a point cloud distribution feature, the first geometric feature is determined based on the point features of the multiple scanning points in the radar coordinate system, the second geometric feature is determined based on the line segment features of the multiple scanning points in the radar coordinate system, and the point cloud distribution feature is determined based on the distribution positions of the multiple scanning points in space.
3. The indoor relocation method according to claim 2, characterized in that: The current environment feature includes the first geometric feature, and the acquiring the current environment feature according to the current point cloud data includes: Acquiring a scanning area, where the scanning area is obtained by calculating the area of a closed figure formed by adjacent scanning points among the plurality of scanning points; and / or, Obtain target features, where the target features are obtained by extracting features of the current point cloud data through principal component analysis.
4. The indoor relocation method according to claim 3, characterized in that: The acquisition of target features comprises: Obtaining a target variance, where the target variance is obtained by calculating the variance of two target directions, where the two target directions are two directions orthogonal to two initial directions, where the two initial directions are two directions with the largest variance in the radar coordinate system, obtained by performing principal component analysis on the current point cloud data; and / or, A target span value is obtained, where the target span value is obtained according to the span of the current point cloud data in two dimensions of the radar coordinate system and the rotated radar coordinate system, where the rotated radar coordinate system is determined by performing principal component analysis on the current point cloud data.
5. The indoor relocation method according to claim 2, characterized in that: The current environment feature includes a second geometric feature, and the obtaining of the current environment feature according to the current point cloud data includes: Acquire a plurality of line segments corresponding to the current point cloud data, wherein the plurality of line segments are obtained by screening, segmenting and fitting the line segments corresponding to the plurality of scanning points; The second geometric feature is acquired according to the plurality of line segments.
6. The indoor relocation method according to claim 5, characterized in that: The obtaining of a plurality of line segments corresponding to the current point cloud data includes: Screening the distances between the plurality of scanning points to determine a plurality of target scanning points, wherein the distances between adjacent target scanning points in the plurality of target scanning points are within a preset distance range; Recursively segmenting the multiple target scanning points according to the target discontinuity point to obtain multiple initial line segments, wherein the target discontinuity point is a discontinuity point that meets the preset discontinuity requirement, and the multiple initial line segments include line segments obtained by merging two line segments whose angle between two side line segments of the target scanning point is less than a preset angle threshold; The multiple initial line segments are screened to obtain multiple target line segments, where the multiple target line segments are line segments whose lengths are greater than a preset length threshold and are obtained by fitting using a least squares method.
7. The indoor relocation method according to claim 5 or 6, characterized in that: The second geometric feature includes a target distance, and the target distance is used to indicate the distance of the current point cloud data to the line segment. The acquiring the second geometric feature according to the plurality of line segments includes: Draw perpendicular lines to the surrounding line segments to determine at least two directly opposite line segments, wherein the at least two directly opposite line segments are line segments where the feet of the perpendicular lines are located; The at least two facing line segments are traversed to determine the target distance, where the target distance is the minimum distance between the electronic device and each facing line in the at least two facing line segments.
8. The indoor relocation method according to claim 5 or 6, characterized in that: The second geometric feature includes a target length, which is the length of the longest line segment among the plurality of line segments.
9. The indoor relocation method according to claim 5 or 6, characterized in that: The second geometric feature includes a target number, the target number is the number of target objects determined in the current point cloud data, and the target objects are used to characterize door-type objects. The acquiring the second geometric feature according to the plurality of line segments includes: Acquire multiple corners corresponding to the current point cloud data, where the multiple corners are determined based on whether adjacent line segments are connected end to end and whether a normal angle difference meets a preset angle requirement; Based on the multiple corners, the number of targets corresponding to the target object is determined, and the target object is determined based on whether two adjacent corners among the multiple corners share the same line segment, whether they present a concave shape, and whether the lengths of three line segments constituting the two adjacent corners meet preset length requirements.
10. The indoor relocation method according to claim 2, characterized in that: The current environment feature includes a point cloud distribution feature, and the obtaining of the current environment feature according to the current point cloud data includes: Traversing the plurality of scanning points, and performing the following steps on each of the plurality of scanning points: determining, according to a position of each of the plurality of scanning points in the current point cloud data, a row and column position corresponding to a radial distance range and an angle range of each of the scanning points; The point cloud distribution matrix corresponding to each scanning point is updated according to the row and column positions to obtain an updated point cloud distribution matrix, and the updated point cloud distribution feature moment is the point cloud distribution feature.
11. The indoor relocation method according to claim 1, characterized in that: Before determining the corresponding current posture according to the current environment feature, the method further includes: Obtain the correspondence between environmental features and posture; The step of determining the corresponding current posture according to the current environment feature includes: According to the current environmental features and the corresponding relationship between the environmental features and the pose, a target pose corresponding to the current environmental features is determined.
12. The indoor relocation method according to claim 11, characterized in that: The obtaining of the correspondence between the environmental features and the position and posture includes: Dividing the target map into grids to obtain a plurality of target grids, wherein the target map is obtained by simultaneous positioning and map construction by radar; Placing a simulated radar in each target grid of the plurality of target grids and extracting point cloud features corresponding to each target grid; The point cloud features and the corresponding positions and postures corresponding to the target grids are stored to obtain the corresponding relationship between the environmental features and the positions and postures.
13. The indoor relocation method according to claim 12, characterized in that: The target map is divided into grids to obtain a plurality of target grids, including: Determine a wall information matrix according to the grayscale image of the target map, the wall information matrix includes an active area and an obstacle area, the active area is used to indicate an area whose grayscale value is greater than or equal to a preset grayscale value threshold, and the obstacle area is used to indicate an area whose grayscale value is less than a preset grayscale threshold, and the wall information matrix is obtained by converting the grayscale image of the target map into a grayscale value matrix, and then converting the grayscale value matrix into a wall information matrix; Dividing the wall information matrix into grids of preset length and width to obtain the plurality of target grids; The step of placing a simulated radar in each of the plurality of target grids and extracting point cloud features corresponding to each of the target grids includes: Traversing each grid, if the grid is a target grid, placing a simulated radar to perform radar scanning to obtain a point cloud corresponding to the target grid, wherein the target grid is used to indicate the grid corresponding to the movable area, and the simulated radar is used to simulate the radar of the electronic device to perform scanning; Feature extraction is performed on the target point cloud corresponding to the target grid to obtain target environment features corresponding to the target point cloud, wherein the target environment features are determined according to the positions of multiple scanning points in the target point cloud data.
14. The indoor relocation method according to claim 12, characterized in that: The storing of the point cloud features and the corresponding positions and postures corresponding to the target grids to obtain the corresponding relationship between the environmental features and the positions and postures includes: Calculate the coordinates of each grid in the map coordinate system; Determine the coordinates in the map coordinate system corresponding to each grid and the yaw angle corresponding to each grid as the corresponding posture; The point cloud features corresponding to the target grids and the corresponding positions and postures are stored in a tree structure to obtain the corresponding relationship between the environmental features and the positions and postures.
15. The indoor relocation method according to claim 2, characterized in that: The current environment feature includes a point cloud geometric feature and a point cloud distribution feature, the point cloud geometric feature includes at least one of the first geometric feature and the second geometric feature, and determining the target posture corresponding to the current environment feature according to the current environment feature and a correspondence between a preset environment feature and a posture, comprises: Performing a nearest neighbor search based on the point cloud geometric features to determine K grids closest to the point cloud geometric features; Feature matching is performed on the point cloud distribution feature and the K grids to determine a target pose corresponding to the point cloud distribution feature, where the target pose is a pose of a target grid among the K grids that matches the point cloud distribution feature.
16. An indoor repositioning device, characterized in that: Used in electronic equipment, including: A feature acquisition module is used to acquire current environment features according to current point cloud data, wherein the current point cloud data is data obtained by scanning the current space environment by radar, and the current environment features are determined according to the positions between multiple scanning points after the dimension of the current point cloud data is reduced; The posture determination module is used to determine the corresponding current posture according to the current environmental characteristics, and the current posture is used to indicate the coordinates and yaw angle of the electronic device relative to the map coordinate system.
17. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the indoor repositioning method according to any one of claims 1 to 15 is implemented.
18. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the indoor repositioning method according to any one of claims 1 to 15 is implemented.
19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the indoor repositioning method according to any one of claims 1 to 15 is implemented.
Citation Information
Cited By
Home service robot repositioning method, home service robot and system
CN120593766A
Object positioning method and device, electronic equipment and stacking mechanical arm
CN121132699A
