Lawn mower and method for global repositioning thereof
Patent Information
- Application Number
- CN202611180745.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-05
- Publication Date
- 2026-10-30
AI Technical Summary
粒子滤波方法需要在较大的作业区域中维持大量粒子,计算量较大,且草坪环境中的重复纹理和相似局部结构容易造成粒子退化
[0017]上述割草机全局重定位方法及割草机通过先将非负描述子归一化为离散分布再计算巴氏系数,降低整体幅值变化对场景相似度的影响;通过遍历扇区循环移位显式补偿水平旋转,并将最佳偏移量用于候选初始航向估计,使被搬运后的任意朝向重定位成为可能;通过Top-K候选保留、动态视场子地图和NDT-ICP级联配准,兼顾候选召回率、配准收敛域、最终精度和嵌入式计算效率;通过基于全局地图静态最近邻结构计算内点比例,以独立几何一致性指标剔除重复草坪环境下的误匹配;通过离线数据库预构建、在线只读加载、定位状态感知阈值及失败回退机制,提高产品运行的确定性和安全性。
Smart Images

Figure CN123007764A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robot positioning and navigation technology, and in particular to a global repositioning method for a lawnmower and a lawnmower. Background Technology
[0002] Lawn mowers are used in residential yards, parks, and golf courses. In actual operation, lawn mowers may lose global positioning due to human handling, wheel slippage, collisions, waking from a prolonged sleep state, or temporary sensor failure. This situation is commonly referred to as the robot kidnapping problem. Once positioning is lost, if the global pose cannot be reliably recovered, the robot will be unable to safely continue path planning and mowing operations.
[0003] To address the global relocalization problem, existing solutions employ particle filtering or candidate retrieval based on global point cloud descriptors. Particle filtering requires maintaining a large number of particles over a large working area, resulting in significant computational overhead. Furthermore, repetitive textures and similar local structures in the lawn environment can easily lead to particle degradation. Solutions based on global descriptors such as ScanContext can quickly obtain candidate keyframes, but existing similarity metrics are easily affected by changes in descriptor amplitude. In addition, the heading angle of the lawnmower becomes uncertain after it is moved, and descriptors at the same location under different orientations can experience sector misalignment, leading to matching failures.
[0004] Meanwhile, the poses obtained from candidate retrieval usually still have some translation and rotation errors. The iterative nearest point algorithm is quite sensitive to the initial registration value, and although the normal distribution transformation has a relatively large convergence region, it is difficult to simultaneously consider the convergence range and the final accuracy when used alone. In environments with weak geometric features and repetitive local structures, such as lawns, relying solely on the highest-scoring candidate descriptor or the internal fitness of the registration algorithm can easily accept erroneous positions.
[0005] Therefore, a global relocalization scheme is needed that can quickly filter multiple candidates under any orientation using offline map databases and current single-frame laser point clouds, solve the problem step by step through coarse registration with a large convergence domain and high-precision fine registration, and eliminate mismatches using independent geometric consistency indices. Summary of the Invention
[0006] Therefore, it is necessary to provide a global repositioning method for lawnmowers to address the aforementioned technical problems, and to enable lawnmowers to quickly, accurately, and reliably restore their global pose while reducing the probability of erroneous repositioning.
[0007] In a first aspect, this application provides a global relocation method for a lawnmower, characterized by comprising the following steps: S1, obtain the pre-built map database and the current scan point cloud of the lawnmower. The map database includes the global point cloud map of the work area, global descriptors of multiple reference point cloud frames and their corresponding global poses. S2, Generate a global descriptor for query based on the current scanned point cloud, perform non-negative normalization on the global descriptor of the query global descriptor and the global descriptors of each reference point cloud frame, and generate multiple relative cyclic displacements along the angular dimension for the two global descriptors to be compared, calculate the distribution overlap similarity under each relative cyclic displacement, and use the maximum distribution overlap similarity and its corresponding relative cyclic displacement to characterize the matching result between the query global descriptor and the corresponding reference point cloud frame. S3, determine multiple candidate reference point cloud frames based on the matching results, and determine multiple candidate initial poses based on the global pose and corresponding relative cyclic displacement of each candidate reference point cloud frame; S4. For each candidate initial pose, a local sub-map is determined from the global point cloud map. Voxel filtering downsampling is performed on the current scanned point cloud and the local sub-map respectively. Using the corresponding candidate initial pose as the initial value, coarse registration and fine registration are performed on the downsampled current scanned point cloud and the local sub-map in sequence to obtain multiple candidate registration poses. S5, based on the spatial proximity relationship between the current scanned point cloud and the global point cloud map after transformation according to each candidate registration pose, calculates the geometric consistency score, which is independent of the internal evaluation value of coarse registration and fine registration. Based on the geometric consistency score, the target pose is determined from multiple candidate registration poses, and the target pose is output when the target pose meets the acceptance condition corresponding to the current positioning state of the lawnmower.
[0008] In some implementations, step S1 includes: S11, control the lawnmower to traverse the work area, integrate the data from lidar, odometer and inertial measurement unit to perform synchronous positioning and mapping, and obtain the global point cloud map and the global pose of each point cloud frame; S12, filter reference point cloud frames based on the moving distance and / or rotation angle between adjacent point cloud frames, generate global descriptors for each reference point cloud frame, and bind the global descriptors to the corresponding global poses; S13, downsample the global point cloud map, store it together with the global descriptor and global pose of the reference point cloud frame as a map database, and load the map database when performing global relocalization.
[0009] In some implementations, both the global descriptor for querying the global descriptor and the global descriptor for the reference point cloud frame are polar coordinate grid descriptors; generating the global descriptor in step S2 includes: S21, map the horizontal azimuth of each point in the point cloud to [0, 2π), and remove points whose horizontal distance is not within the preset effective distance range; S22, divides multiple ring areas along the horizontal distance direction and multiple sectors along the horizontal azimuth direction; S23, using the maximum height of points falling within the grid defined by each ring area and sector as the encoding value of the corresponding grid, generates a descriptor matrix.
[0010] In some implementations, step S2 includes: nonnegating and normalizing each component of the global descriptor to a nonnegative distribution, using the Bach coefficient as the distribution overlap similarity; performing cyclic shifts along the sector direction on each ring of the descriptor matrix, with each ring using the same integer sector offset t, and traversing t from 0 to S-1, where S is the total number of sectors; and determining the heading angle compensation amount of the query point cloud relative to the reference point cloud frame according to 2πt / S based on the sector offset that obtains the maximum Bach coefficient.
[0011] In some implementations, step S3 includes: sorting multiple reference point cloud frames from high to low according to the maximum distribution overlap similarity, and selecting the top K reference point cloud frames as candidate reference point cloud frames; and / or, selecting reference point cloud frames whose maximum distribution overlap similarity satisfies a preset similarity condition as candidate reference point cloud frames.
[0012] In some implementations, determining candidate submaps in step S4 includes: S410, transform the map points in the global point cloud map to the vehicle coordinate system of the lawnmower based on the candidate initial pose; S420: Retain map points whose radial distance is within the effective detection range of the lidar and whose horizontal azimuth angle is within the horizontal field of view of the lidar; perform sparse sampling on the retained map points to obtain candidate sub-maps corresponding to the corresponding candidate initial poses.
[0013] In some implementations, step S4 further includes: S430 uses the first voxel filtering parameter to perform voxel filtering downsampling on the current scanned point cloud Pscan, and uses the second voxel filtering parameter to perform voxel filtering downsampling on the local sub-map M. k Voxel filtering downsampling is performed to obtain the downsampled current scan point cloud and the downsampled local sub-map, wherein the first voxel filtering parameters and the second voxel filtering parameters are independent of each other; S440, using the k-th candidate initial pose as the initial value, perform normal distribution transformation registration based on the downsampled current scanned point cloud and local sub-map to obtain the coarse registration pose Tndt,k, and using the coarse registration pose Tndt,k as the initial value, perform iterative nearest point registration based on the current scanned point cloud and local sub-map to obtain the k-th candidate registration pose Ticp,k.
[0014] In some implementations, step S5 includes: S51, based on the global point cloud map, pre-builds and reuses the static nearest neighbor search data structure; S52, transform the current scanned point cloud to the map coordinate system according to each candidate registration pose, and query the nearest neighbor distance of each point to the global point cloud map after transformation; S53, points whose nearest neighbor distance is less than a preset distance threshold are identified as interior points, and the geometric consistency score is calculated as the ratio of the number of interior points to the total number of points participating in the verification.
[0015] In some implementations, the acceptance conditions in step S5 include: when the lawnmower is in an uninitialized state, comparing the geometric consistency score with a first threshold; when the lawnmower is in an initialized state, comparing the geometric consistency score with a second threshold higher than the first threshold; updating the global pose of the lawnmower only when the geometric consistency score is greater than the threshold corresponding to the current positioning state; when the lawnmower is in an initialized state and has not obtained a target pose that meets the second threshold for a consecutive preset number of frames, determining that the positioning is lost and switching to a repositioning waiting state, and repeating steps S2 to S5 for subsequent scanning point clouds.
[0016] Secondly, this application provides a lawnmower, including a lidar, a processor, and a memory. The memory stores a pre-built map database and a computer program executable by the processor. The map database includes a global point cloud map of the work area, global descriptors of multiple reference point cloud frames, and corresponding global poses. The processor, when executing the computer program, is configured to: acquire the currently scanned point cloud collected by the lidar; generate a query global descriptor based on the currently scanned point cloud; perform non-negative normalization on the query global descriptor and the global descriptors of each reference point cloud frame, causing the two global descriptors to be compared to generate multiple relative cyclic displacements along the angular dimension, and calculate each relative cyclic displacement. The distribution overlap similarity is used to determine multiple candidate initial poses. For each candidate initial pose, a local sub-map is determined from the global point cloud map. Voxel filtering at different scales is performed on the current scanned point cloud and the local sub-map to construct a point cloud pyramid. Coarse registration is performed based on the coarse registration layer point cloud and fine registration is performed based on the fine registration layer point cloud to obtain multiple candidate registration poses. Geometric consistency score is calculated based on the spatial proximity relationship between the current scanned point cloud after transformation according to each candidate registration pose and the global point cloud map. The target pose is determined based on the geometric consistency score, and the target pose is output when the target pose meets the acceptance condition corresponding to the current positioning state of the lawnmower.
[0017] The aforementioned global relocation method for lawnmowers reduces the impact of overall amplitude changes on scene similarity by first normalizing the non-negative descriptor to a discrete distribution and then calculating the Bach coefficient. It explicitly compensates for horizontal rotation through cyclic shifting of traversed sectors and uses the optimal offset for candidate initial heading estimation, enabling relocation to any orientation after being moved. It balances candidate recall, registration convergence region, final accuracy, and embedded computational efficiency through Top-K candidate retention, dynamic field-of-view sub-maps, and NDT-ICP cascaded registration. It eliminates mismatches in repetitive lawn environments by calculating the proportion of interior points based on the static nearest neighbor structure of the global map and using an independent geometric consistency index. Finally, it improves the determinism and security of product operation through offline database pre-construction, online read-only loading, positioning status awareness thresholds, and failure fallback mechanisms. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the structure of a lawnmower in one embodiment; Figure 2 This is a flowchart illustrating a global relocation method in one embodiment; Figure 3 This is a software structure block diagram of one embodiment; Figure 4 This is a flowchart illustrating step S1 in one embodiment; Figure 5 This is a flowchart illustrating step S2 in one embodiment; Figure 6 This is a flowchart illustrating step S4 in one embodiment; Figure 7 This is a flowchart illustrating step S5 in one embodiment. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0020] like Figure 1As shown, this embodiment provides a lawnmower 100. The lawnmower includes a body 10, a drive system, a mowing system, a sensing system, a control system, and a power supply system. The body 10 serves as the base for the entire machine, supporting all functional modules. The drive system includes drive wheels 20, a drive motor, and a transmission mechanism, used to drive the lawnmower to move within the work area. The mowing system performs lawn trimming operations and includes a blade assembly and a cutting motor. The cutting motor drives the blade assembly to rotate, cutting the lawn. The blade assembly can be a single-blade, double-blade, or multi-blade structure. The sensing system acquires environmental information and the lawnmower 100's own status information. Preferably, the sensing system includes at least a lidar 30 and a vision module 40. The lidar 30 scans the surrounding environment, acquiring environmental point cloud data and obstacle distance information; the vision module 40 collects environmental image information and identifies lawn areas, non-lawn areas, boundary areas, and obstacle information. The control system includes a processor and a memory, with the memory storing a global relocation control program. The processor invokes the global relocation control program and executes the global relocation control method. The power supply system provides operating power to all modules of the machine. This system includes a battery pack and a power management module. The battery pack stores electrical energy; the power management module performs functions such as voltage detection, battery protection, power management, charge / discharge control, and power distribution.
[0021] In this embodiment, the “global pose” can be represented as a rigid body transformation T∈SE(3), which includes the three-dimensional translation and rotation of the lawnmower in the map coordinate system. For a lawnmower that mainly moves on the lawn plane, only the translations x and y and the heading angle yaw around the vertical axis can be used, or the six-degree-of-freedom pose can be retained to adapt to undulating terrain.
[0022] The lidar coordinate system can be defined as x-axis forward, y-axis left, and z-axis upward. If the lidar coordinate system does not coincide with the vehicle coordinate system, the extrinsic parameter transformation between the two is pre-calibrated, and the coordinate transformation is performed during point cloud processing.
[0023] like Figure 2 and Figure 3 As shown, the global relocation method for lawnmowers includes the following steps: S1, obtain the pre-built map database and the current scan point cloud of the lawnmower. The map database includes a global point cloud map of the work area, global descriptors of multiple reference point cloud frames and their corresponding global poses. like Figure 4 As shown, in one embodiment, step S1 includes: S11 controls the lawnmower to traverse the work area, integrates data from lidar, odometer and inertial measurement unit for synchronous positioning and mapping, and obtains a global point cloud map and the global pose of each point cloud frame. S12, filter reference point cloud frames based on the moving distance and / or rotation angle between adjacent point cloud frames, generate global descriptors for each reference point cloud frame, and bind the global descriptors to the corresponding global poses; S13, downsample the global point cloud map, store it together with the global descriptor and global pose of the reference point cloud frame as a map database, and load the map database in read-only mode when performing global relocalization.
[0024] Offline mapping is performed before online relocation. The lawnmower is controlled to cover the predetermined work area via remote control or autonomous traversal. The LiDAR collects environmental point clouds, the odometry provides short-term motion constraints, and the inertial measurement unit provides angular velocity and attitude change information. A globally consistent 3D point cloud map is generated through laser-synchronized localization and mapping algorithms, and the global pose corresponding to each laser frame is saved.
[0025] The laser frames in the mapping trajectory are traversed. A frame is selected as a keyframe when its translation distance relative to the previous keyframe exceeds a distance threshold and / or its rotation angle exceeds an angle threshold. For each keyframe, a polar coordinate mesh descriptor is generated using the method described below, and the descriptor is bound to the global pose of that frame. Keyframe timestamps, sensor extrinsic parameters, or local point cloud indexes associated with the keyframe can also be saved.
[0026] Voxel downsampling and compression are performed on the global point cloud map, and the global point cloud map and keyframe descriptor subset {D} are combined. n} and the keyframe global pose set {T n The data is serialized into a database file. During online relocation, the database file is loaded in read-only mode, and no online incremental updates are performed on the map and keyframe descriptors to reduce resource contention and improve the determinism of the calculation results.
[0027] After entering the online global relocalization stage, the processor reads-only from the memory to load the map database and obtains a point cloud frame collected by the LiDAR at the current moment as the current scan point cloud. The current scan point cloud can be denoised and cropped based on the effective range of the radar, the envelope of the lawnmower body, and the height range; the preprocessed current scan point cloud is used as the input for step S2.
[0028] S2. Generate a global descriptor for the query based on the current scanned point cloud. Perform non-negative normalization on the global descriptor of the query and the global descriptors of each reference point cloud frame. Then, generate multiple relative cyclic displacements along the angular dimension for the two global descriptors to be compared. Calculate the distribution overlap similarity under each relative cyclic displacement. Use the maximum distribution overlap similarity and its corresponding relative cyclic displacement to characterize the matching result between the global descriptor of the query and the corresponding reference point cloud frame.
[0029] like Figure 5As shown, in one implementation, both the global descriptor for the query and the global descriptor for the reference point cloud frame are polar coordinate grid descriptors; step S2, generating the global descriptor for the query, includes: S21, map the horizontal azimuth of each point in the point cloud to [0, 2π), and remove points whose horizontal distance is not within the preset effective distance range; S22, divides multiple ring areas along the horizontal distance direction and multiple sectors along the horizontal azimuth direction; S23, using the maximum height of points falling within the grid defined by each ring area and sector as the encoding value of the corresponding grid, generates a descriptor matrix.
[0030] Let P be the point cloud after preprocessing of the current frame, and let the point cloud contain N points Pᵢ. This point cloud set can be represented as:
[0031] Where, any point P ᵢ =(x ᵢ ,y ᵢ ,z ᵢ Defined in the lidar coordinate system, with the x-axis pointing forward, the y-axis pointing left, and the z-axis pointing upward. For each point, calculate its horizontal distance ρ. ᵢ and the original horizontal azimuth angle θ ᵢ :
[0032] To ensure the periodicity and continuity of the descriptor, the original azimuth angle θ0 is mapped from (−π,π] to [0,2π]. The piecewise mapping rule is as follows:
[0033] In the formula, θ0 represents the original azimuth angle before mapping, and θ represents the normalized azimuth angle after mapping. For the i-th point, it can be correspondingly denoted as θ i .
[0034] Set the near distance threshold ρ min and the farthest effective distance ρ max If ρ ᵢ <ρ min If ρ is not a valid value, then that point is discarded because lidar has a detection blind zone, and the robot itself will produce invalid near-field reflections, introducing noise characteristics; ᵢ >ρ max If the distance is too far, the point will be removed because the point cloud is extremely sparse and the ranging noise increases exponentially, which cannot provide reliable geometric height information and will significantly increase the computational burden.
[0035] The valid points are divided into R concentric rings and S equiangular sectors according to polar coordinates. The ring index rᵢ and sector index sᵢ are calculated as follows:
[0036] Where ⌊·⌋ represents the floor function; the min operation restricts the index to 0 to R−1 and 0 to S−1 respectively. ρ min Used for filtering valid points, ρ max It is also used for valid point filtering and ring index normalization.
[0037] Initialize a zero matrix M ∈ R with R rows and S columns. R×S For each valid point P i The corresponding mesh is updated using the maximum height (Max-Z) projection strategy:
[0038] Among them, the height z in the lidar coordinate system ᵢ As a grid encoding value. In other implementations, ground correction or height reference correction can be performed beforehand, with h i =max(z ᵢ -z ref ,0) replace z ᵢ , where z ref The radar installation height, the estimated ground height for the current frame, or a preset height reference are used; the maximum height within the grid is also used for encoding.
[0039] To facilitate efficient similarity calculations, matrix M is expanded into a one-dimensional vector D using row-major order. The mapping relationship between matrix elements and vector components is expressed as:
[0040] Therefore, the complete mapping process from the original point cloud P to the descriptor vector D can be formally defined as a descriptor generation function:
[0041] Among them, F SC This represents the polar coordinate grid descriptor generation mapping. Under the same sensor pose and environment, when the same frame of point cloud is input, the output descriptors remain consistent. When the lawnmower rotates around its vertical axis, the descriptors undergo a corresponding cyclic shift in the sector dimension. This allows for subsequent explicit cyclic shifts to compensate for changes in the heading angle, thus achieving rotational invariance matching. To perform the cyclic shift, the index mapping between D and matrix M can also be preserved, eliminating the need to repeatedly store two copies of the descriptor data.
[0042] In one embodiment, step S2 includes: performing non-negative processing on each component of the global descriptor and normalizing it into a non-negative distribution, and using the Bhattacharyya coefficient as the distribution overlap similarity; performing cyclic shift on each ring of the descriptor matrix along the sector direction, where all rings adopt the same integer sector offset t, and t traverses from 0 to S-1, where S is the total number of sectors; and determining the heading angle compensation amount of the query point cloud relative to the reference point cloud frame according to the sector offset that achieves the maximum Bhattacharyya coefficient as 2πt / S.
[0043] For two descriptor vectors D⁽ᵃ⁾ and D⁽ᵇ⁾, which respectively represent the polar coordinate histogram distributions of the vertical environment structure under two point cloud frames. The Bhattacharyya coefficient similarity function S without rotation compensation is defined as:
[0044] Where I(·) is an indicator function, which takes the value of 1 when both conditions in the parentheses are satisfied, and 0 otherwise; ε is a very small positive number, which is used to exclude zero or near-zero components and prevent invalid components from participating in square root calculation and similarity accumulation.
[0045] To cope with the rotation of the lawn mower around the vertical Z axis, sector direction compensation is performed on the descriptor. Let the value of the r-th ring and the s-th sector in the original descriptor be D(r,s), then the cyclic shift operation T is defined :
[0046] Where ⌊·⌋ denotes the floor function; t is the integer sector offset, which satisfies 0≤t<S; r is the ring index, 0≤r<R; s is the original sector index, 0≤s<S. The expression s−t−S⌊(s−t) / S⌋ constrains the shifted sector index to the range from 0 to S-1. This operation is performed independently for each ring, and all rings use the same offset t. The shifted descriptor vector is denoted as:
[0047] For the query descriptor of the current frame and any reference descriptor in the database , the similarity function with rotation compensation is defined as S :
[0048] The above formula traverses all integer sector offsets t, cyclically shifts the reference descriptor in sequence, and takes the obtained maximum similarity as the matching score between the query descriptor and this reference descriptor.
[0049] S3, determine multiple candidate reference point cloud frames based on the matching results, and determine multiple candidate initial poses based on the global pose and corresponding relative cyclic displacement of each candidate reference point cloud frame; In one implementation, step S3 includes: sorting multiple reference point cloud frames from high to low according to the maximum distribution overlap similarity, and selecting the top K reference point cloud frames as candidate reference point cloud frames.
[0050] Calculate the maximum similarity S between the query descriptor and each of the K reference point cloud frame descriptors in the database. n * According to S n * The candidate set C is formed by sorting the data from highest to lowest similarity. K can be set from 10 to 30 depending on the performance of the embedded processor and the map size; alternatively, minimum similarity, spatial deduplication radius, or non-maximum suppression conditions can be set simultaneously to avoid adjacent reference point cloud frames from filling the candidate set.
[0051] For the k-th candidate keyframe (k=1,2,...,K), its global pose in the database is combined with the heading compensation represented by the corresponding optimal sector offset to obtain the candidate initial pose T. k0 If the system retains a reliable local odometer trajectory, the keyframe pose, heading compensation, and current odometer relative pose can be combined to establish a candidate initial pose for the current frame.
[0052] like Figure 6 As shown, S4 specifically includes the following steps: S410, transform the map points in the global point cloud map to the vehicle coordinate system of the lawnmower based on the k-th candidate initial pose; directly using the complete global point cloud map to perform registration for each candidate would cause a large memory access and computational burden, so coordinate transformation and local clipping are performed independently for each candidate.
[0053] S420: Retain map points whose radial distance is within the effective detection range of the lidar and whose horizontal azimuth angle is within the horizontal field of view of the lidar, and perform sparse sampling on the retained map points to obtain the local sub-map M corresponding to the k-th candidate initial pose. k .
[0054] In the vehicle coordinate system, calculate the radial distance d and horizontal azimuth angle α = atan2(y,x) of map points. Only retain map points that satisfy d ≤ Dmax and |α| ≤ FOV / 2, where Dmax is the effective detection range of the lidar and FOV is the horizontal field of view of the lidar. Height range constraints or candidate position bounding box constraints can also be added. Perform equal-interval sampling or voxel sparse sampling on the retained map points to obtain the local sub-map M corresponding to the k-th candidate initial pose. k .
[0055] In one implementation, step S4 further includes: S430 uses the first voxel filtering parameter to perform voxel filtering downsampling on the current scanned point cloud Pscan, and uses the second voxel filtering parameter to perform voxel filtering downsampling on the local sub-map M. k Voxel filtering downsampling is performed to obtain the downsampled current scan point cloud and the downsampled local sub-map, wherein the first voxel filtering parameters and the second voxel filtering parameters are independent of each other; S440, using the k-th candidate initial pose as the initial value, perform normal distribution transformation registration based on the downsampled current scanned point cloud and local sub-map to obtain the coarse registration pose Tndt,k, and using the coarse registration pose Tndt,k as the initial value, perform iterative nearest point registration based on the current scanned point cloud and local sub-map to obtain the k-th candidate registration pose Ticp,k.
[0056] Step S430, point cloud downsampling. To reduce the impact of uneven point cloud density on registration calculations and decrease the computational load on the processor, this embodiment performs voxel filtering downsampling on the current scanned point cloud Pscan using the first voxel filtering parameter before formally performing registration, and uses the second voxel filtering parameter to downsampling the local sub-map M generated in step S420. k Voxel filtering downsampling is performed to obtain the downsampled current scanned point cloud and the downsampled local sub-map. The first and second voxel filtering parameters are independent and can be determined based on the point density of the current scanned point cloud, the map resolution of the local sub-map, and the processor performance. Different voxel filtering parameters are only used to adapt to different point cloud data densities and achieve downsampling; they do not represent coarse and fine registration parameters respectively, nor do they form a one-to-one correspondence with coarse and fine registration.
[0057] Step S440: Cascaded point cloud registration. See [link / reference] Figure 3First, using the k-th candidate initial pose as the initial value, the Normal Distribution Transform (NDT) algorithm is employed to perform initial registration based on the downsampled current scanned point cloud and the downsampled local sub-map, yielding the coarse registration pose Tndt,k. NDT is a robust point cloud registration method. Its core idea is to discretize the local sub-map into a regular voxel grid and model the point cloud contained within each voxel using a Gaussian distribution. The pose transformation is solved by maximizing the sum of probabilities that the scanned point falls into the corresponding voxel's Gaussian distribution. This method has a large convergence region for initial errors and is suitable for coarsely correcting candidate poses. After obtaining the NDT-refined pose Tndt,k, further fine registration is performed using this pose as the initial value, employing the Iterative Closest Point (ICP) algorithm based on the current scanned point cloud and the local sub-map, yielding the final fine registration pose Ticp,k. ICP can use the original point cloud, the point cloud downsampled in step S430, or a point cloud downsampled separately, depending on the computational accuracy and efficiency requirements. The selection of the input point cloud is not limited by the fixed correspondence between the first and second voxel filter parameters and the registration stage. ICP iteratively finds the nearest point correspondence between two point clouds and minimizes the sum of squared Euclidean distances between all corresponding point pairs, thereby further improving positioning accuracy based on the good initial values provided by NDT.
[0058] While maintaining the technical relationship of coarse registration followed by fine registration and using the previous registration result as the initial value for the subsequent registration, coarse and fine registration can also employ other point cloud registration algorithms with corresponding convergence domains and accuracy characteristics; NDT and ICP constitute the preferred combination in this embodiment.
[0059] S5, based on the spatial proximity relationship between the current scanned point cloud and the global point cloud map after transformation according to each candidate registration pose, calculates the geometric consistency score, which is independent of the internal evaluation value of coarse registration and fine registration. Based on the geometric consistency score, the target pose is determined from multiple candidate registration poses, and the target pose is output when the target pose meets the acceptance condition corresponding to the current positioning state of the lawnmower.
[0060] In one implementation, such as Figure 7 As shown, step S5 includes: S51, based on the global point cloud map, pre-builds and reuses the static nearest neighbor search data structure; S52, transform the current scanned point cloud to the map coordinate system according to each candidate registration pose, and query the nearest neighbor distance of each point to the global point cloud map after transformation; S53, points whose nearest neighbor distance is less than a preset distance threshold are identified as interior points, and the geometric consistency score is calculated as the ratio of the number of interior points to the total number of points participating in the verification.
[0061] When loading the map database, a static KD-Tree or other nearest neighbor index is built based on the global point cloud map. This index is reused in all candidate verifications and subsequent frame relocalizations. The current original scanned point cloud is downsampled to the verification point cloud P. down For P down The j-th point P in J According to the precise alignment posture T ICP Transforming it to a map coordinate system, the transformation is expressed as:
[0062] Here, M represents the global point cloud map. This notation is used in a different formulaic context than the aforementioned descriptor matrix M. Given a distance threshold δ, the inlier scale evaluation function Φ is defined as:
[0063] Among them, |P down | represents the total number of points participating in the verification; m represents the map points in the global point cloud map M; Represents the transformed point ⱼ The nearest neighbor distance to the global point cloud map; I(·) is an indicator function, which takes the value 1 when the condition is true, and 0 otherwise. The range of the function Φ is [0,1], and the larger the value, the higher the geometric overlap between the currently scanned point cloud and the global point cloud map.
[0064] For the k-th candidate pose ( Let its final pose after NDT and ICP cascade registration be T. icp If ⁽ᵏ⁾, then the matching score of the candidate is defined as:
[0065] Therefore, we choose k*=argmax k φ k and T icp ⁽ᵏ * ⁾ is the target pose to be accepted. The above φ k This refers to the geometric consistency score calculated based on spatial proximity. It does not directly use the internal optimization values of NDT or ICP, thus reducing the probability of accepting registration results that are locally optimal but physically misplaced. As an extension, φ can also be... k The overall confidence level is formed by combining descriptor similarity, registration convergence flags, or the number of visible points.
[0066] In one implementation, the acceptance conditions in step S5 include: when the lawnmower is in an uninitialized state, comparing the geometric consistency score with a first threshold; when the lawnmower is in an initialized state, comparing the geometric consistency score with a second threshold higher than the first threshold; updating the global pose of the lawnmower only when the geometric consistency score is greater than the threshold corresponding to the current positioning state; when the lawnmower is in an initialized state and has not obtained a target pose that meets the second threshold for a consecutive preset number of frames, determining that the positioning is lost and switching to a repositioning waiting state, and repeating steps S2 to S5 for subsequent scanning point clouds.
[0067] The system adopts acceptance conditions corresponding to the current positioning state. When the system is not initialized, there is no reliable global pose prior, so a first threshold τ can be used. init To obtain the initial pose more quickly; when the system is initialized, a second threshold τ higher than the first threshold is used. track This is to reduce erroneous transitions. That is, in the uninitialized state, when φ... k* >τ init Output the target pose in real time; in the initialized state, when φ k* >τ track Output the target pose and update the transformation from the map coordinate system to the odometer coordinate system.
[0068] If the best candidate does not reach the corresponding threshold, the result is rejected. The system maintains the original reliable pose or enters a waiting state for the next frame, without outputting control commands generated by low-confidence results. In the initialized state, if τ is not satisfied for m consecutive frames... track It can determine that the positioning is lost and switch to the repositioning waiting state; in this state, the influence of the cumulative odometer drift pose on the path planning is suppressed, and the complete repositioning process is continuously performed on subsequent laser frames until a reliable target pose is obtained.
[0069] This embodiment provides a lawnmower for performing the above-described global relocation method, as follows: A lawnmower includes a lidar, a processor, and a memory. The memory stores a pre-built map database and a computer program executable by the processor. The map database includes a global point cloud map of the work area, global descriptors of multiple reference point cloud frames, and corresponding global poses. The processor, when executing the computer program, is configured to: acquire the currently scanned point cloud collected by the lidar; generate a query global descriptor based on the current scanned point cloud; perform non-negative normalization on the query global descriptor and the global descriptors of each reference point cloud frame, causing the two global descriptors to be compared to generate multiple relative cyclic displacements along the angular dimension, and calculate the distribution overlap similarity under each relative cyclic displacement to determine multiple candidate initial poses; for each candidate initial pose, determine candidate sub-maps from the global point cloud map, and sequentially perform coarse registration and fine registration to obtain multiple candidate registered poses; and calculate a geometric consistency score based on the spatial proximity relationship between the current scanned point cloud transformed according to each candidate registered pose and the global point cloud map, determine the target pose based on the geometric consistency score, and output the target pose when the target pose meets the acceptance condition corresponding to the current positioning state of the lawnmower.
[0070] Those skilled in the art will understand that the execution order of the steps in this invention can be adjusted without changing the technical logic, and some steps can be executed in parallel; for example, sub-map extraction and registration of different candidate keyframes can be processed in parallel. All equivalent substitutions, combinations, or improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A global relocation method for a lawnmower, characterized in that, Includes the following steps: S1, obtain a pre-built map database and the current scanned point cloud of the lawnmower. The map database includes a global point cloud map of the work area, global descriptors of multiple reference point cloud frames, and corresponding global poses. S2, Generate a query global descriptor based on the current scanned point cloud, perform non-negative normalization on the query global descriptor and the global descriptors of each reference point cloud frame, and generate multiple relative cyclic displacements along the angular dimension for the two global descriptors to be compared, calculate the distribution overlap similarity under each relative cyclic displacement, and use the maximum distribution overlap similarity and its corresponding relative cyclic displacement to characterize the matching result between the query global descriptor and the corresponding reference point cloud frame. S3, determine multiple candidate reference point cloud frames based on the matching results, and determine multiple candidate initial poses based on the global pose and corresponding relative cyclic displacement of each candidate reference point cloud frame. S4. For each candidate initial pose, a local sub-map is determined from the global point cloud map. Voxel filtering downsampling is performed on the current scanned point cloud and the local sub-map respectively. Using the corresponding candidate initial pose as the initial value, coarse registration and fine registration are performed on the downsampled current scanned point cloud and the local sub-map in sequence to obtain multiple candidate registration poses. S5. Based on the spatial proximity relationship between the current scanned point cloud after transformation according to each candidate registration pose and the global point cloud map, calculate the geometric consistency score, which is independent of the internal evaluation value of the coarse registration and fine registration. Determine the target pose from multiple candidate registration poses according to the geometric consistency score, and output the target pose when the target pose meets the acceptance condition corresponding to the current positioning state of the lawnmower.
2. The method according to claim 1, characterized in that, Step S1 includes: S11, the lawnmower robot traverses the work area, integrates data from lidar, odometer and inertial measurement unit for synchronous positioning and mapping, and obtains the global point cloud map and the global pose of each point cloud frame; S12, filter the reference point cloud frames according to the moving distance and / or rotation angle between adjacent point cloud frames, generate a global descriptor for each reference point cloud frame, and bind the global descriptor to the corresponding global pose; S13, downsample the global point cloud map, store it together with the global descriptor and global pose of the reference point cloud frame as the map database, and load the map database when performing global relocalization.
3. The method according to claim 1, characterized in that, Both the global descriptor for the query and the global descriptor for the reference point cloud frame are polar coordinate grid descriptors; generating the global descriptor in step S2 includes: S21, map the horizontal azimuth of each point in the point cloud to [0, 2π), and remove points whose horizontal distance is not within the preset effective distance range; S22, divides multiple ring areas along the horizontal distance direction and multiple sectors along the horizontal azimuth direction; S23, using the maximum height of points falling within the grid defined by each ring area and sector as the encoding value of the corresponding grid, generates a descriptor matrix.
4. The method according to claim 3, characterized in that, Step S2 includes: nonnegating and normalizing each component of the global descriptor to a nonnegative distribution, using the Bach coefficient as the distribution overlap similarity; performing cyclic shifts along the sector direction on each ring of the descriptor matrix, with each ring using the same integer sector offset t, and traversing t from 0 to S-1, where S is the total number of sectors; and determining the heading angle compensation amount of the query point cloud relative to the reference point cloud frame according to 2πt / S based on the sector offset that obtains the maximum Bach coefficient.
5. The method according to claim 1, characterized in that, Step S3 includes: sorting multiple reference point cloud frames from high to low according to the maximum distribution overlap similarity, and selecting the top K reference point cloud frames as the candidate reference point cloud frames, or selecting reference point cloud frames whose maximum distribution overlap similarity meets the preset similarity condition as the candidate reference point cloud frames.
6. The method according to claim 1, characterized in that, Determining the candidate sub-map in step S4 includes: S410, transform the map points in the global point cloud map to the vehicle coordinate system of the lawnmower according to the candidate initial pose; S420: Retain map points whose radial distance is within the effective detection range of the lidar and whose horizontal azimuth angle is within the horizontal field of view of the lidar; perform sparse sampling on the retained map points to obtain candidate sub-maps corresponding to the corresponding candidate initial poses.
7. The method according to claim 1, characterized in that, Step S4 further includes: S430, the current scanned point cloud Pscan is downsampled using voxel filtering with the first voxel filtering parameter, and the local sub-map M is downsampled using the second voxel filtering parameter. k Voxel filtering downsampling is performed to obtain the downsampled current scan point cloud and the downsampled local sub-map, wherein the first voxel filtering parameters and the second voxel filtering parameters are independent of each other; S440, using the k-th candidate initial pose as the initial value, perform normal distribution transformation registration based on the downsampled current scanned point cloud and the local sub-map to obtain the coarse registration pose Tndt,k. Then, using the coarse registration pose Tndt,k as the initial value, perform iterative nearest point registration based on the current scanned point cloud and the local sub-map to obtain the k-th candidate registration pose Ticp,k.
8. The method according to claim 1, characterized in that, Step S5 includes: S51, Based on the global point cloud map, a static nearest neighbor search data structure is pre-constructed and reused; S52, transform the current scanned point cloud to the map coordinate system according to each candidate registration pose, and query the nearest neighbor distance of each point to the global point cloud map after transformation; S53, points whose nearest neighbor distance is less than a preset distance threshold are identified as interior points, and the ratio of the number of interior points to the total number of points participating in the verification is used as the geometric consistency score.
9. The method according to claim 1, characterized in that, The acceptance conditions in step S5 include: when the lawnmower is in an uninitialized state, comparing the geometric consistency score with a first threshold; when the lawnmower is in an initialized state, comparing the geometric consistency score with a second threshold higher than the first threshold; updating the global pose of the lawnmower only when the geometric consistency score is greater than the threshold corresponding to the current positioning state; when the lawnmower is in an initialized state and has not obtained a target pose that meets the second threshold for a consecutive preset number of frames, determining that positioning is lost and switching to a repositioning waiting state, and repeating steps S2 to S5 for subsequent scanned point clouds until a target pose that meets the first threshold is obtained.
10. A lawnmower, comprising a lidar, a processor, and a memory, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 9.
