Adaptive cleaning path planning method and system based on pool wall robot
Patent Information
- Application Number
- CN202511258191.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-03
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2045-09-03
AI Technical Summary
[0004]本发明实施例的主要目的在于提供一种基于泳池壁面机器人的自适应清洁路径规划方法及系统,旨在解决相关技术中存在的易出现清洁盲区或重复清洁,以及清洁效率低的技术问题
[0020] This invention provides an adaptive cleaning path planning method and system based on a swimming pool wall robot. The method involves acquiring a spatial structure model of the target swimming pool; this model is constructed based on the pool boundary contour and dynamically updated, which is obtained in real-time through a visual sensor. Next, an underwater camera acquires images of the pool wall; a deep learning algorithm is used to identify the types of dirt contained in the wall images, and pixel grayscale value analysis is used to identify the density of different types of dirt in the wall images, obtaining dirt density data. Then, real-time environmental information of the target swimming pool is collected to construct a wall environment map; the accuracy of the dirt density data is verified by combining the wall environment map to correct visual errors caused by water reflection. The dirt types and the corrected dirt density data are used to construct a dirt distribution heatmap. Finally, based on the spatial structure model and the dirt distribution heatmap, an irregular boundary fitting algorithm is used to generate a global path for the target robot to perform the wall cleaning task in the target swimming pool. Based on the aforementioned dirt distribution heatmap and the real-time operating status of the target robot, local path adjustments are made to each sub-region within the global path to match the cleaning intensity within the sub-region with the local path density. Finally, after the target robot enters each sub-region, the local path corresponding to the current sub-region is loaded into the target robot to control it to complete the wall cleaning task within each sub-region.
Smart Images

Figure CN121165709B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to an adaptive cleaning path planning method and system based on a pool wall robot. Background Technology
[0002] Currently, in scenarios such as home swimming pools, commercial swimming pools (such as hotel and gym pools), and public swimming pools, pollutants such as moss, scale, mud, and fallen leaf debris on the walls can be removed through physical or chemical methods.
[0003] Since most home and commercial swimming pools are not ideally rectangular, they may have circular, elliptical, irregular polygonal, or even irregularly shaped pool edges and varying corner curvatures. Traditional cleaning technologies, using fixed paths (such as zigzag or spiral patterns), cannot accommodate these irregular boundaries, easily leading to cleaning blind spots (e.g., uncovered corners) or repetitive cleaning (e.g., repeatedly cleaning curved walls). Furthermore, pool wall dirt is not evenly distributed; for example, algae easily grows in sunlit areas, sediment accumulates in corners, and oil stains easily adhere near the surface. Traditional technologies, with their full-coverage fixed paths, cannot differentiate dirt density, wasting time in areas with low cleaning needs and resulting in low cleaning efficiency. For instance, areas that should be focused on algae are repeatedly moved across smooth, dirt-free walls. Therefore, there is an urgent need for a technical solution to address at least one of these problems. Summary of the Invention
[0004] The main objective of this invention is to provide an adaptive cleaning path planning method and system based on a pool wall robot, aiming to solve the technical problems of easy cleaning blind spots or repeated cleaning, and low cleaning efficiency in related technologies.
[0005] In a first aspect, embodiments of the present invention provide an adaptive cleaning path planning method based on a pool wall robot, comprising:
[0006] A spatial structure model of the target swimming pool is obtained; the spatial structure model is constructed based on the pool boundary contour of the target swimming pool and is dynamically updated, and the pool boundary contour is obtained by real-time scanning through a visual sensor;
[0007] An underwater camera is used to acquire images of the wall surface; a deep learning algorithm is used to identify the types of dirt contained in the wall surface images, and the density of different types of dirt in the wall surface images is identified by pixel grayscale value analysis to obtain dirt density data;
[0008] Real-time environmental information of the target swimming pool is collected to construct a wall environment map; the accuracy of the dirt density data is verified by combining the wall environment map to correct the visual error caused by water reflection in the dirt density data;
[0009] The aforementioned dirt types and the corrected dirt density data are used to construct a dirt distribution heatmap;
[0010] Based on the spatial structure model and the dirt distribution heat map, an irregular boundary fitting algorithm is used to generate the global path for the target robot to perform wall cleaning tasks in the target swimming pool;
[0011] Based on the aforementioned dirt distribution heat map and the real-time operating status of the target robot, local path adjustments are made to each sub-region in the global path to match the cleaning intensity within the sub-region with the local path density.
[0012] After the target robot enters each sub-region, the local path corresponding to the current sub-region is loaded into the target robot to control the target robot to complete the wall cleaning task in each sub-region.
[0013] Secondly, embodiments of the present invention provide an adaptive cleaning path planning system based on a pool wall robot, comprising:
[0014] The modeling module is used to obtain the spatial structure model of the target swimming pool; the spatial structure model is constructed based on the pool boundary contour of the target swimming pool and is dynamically updated, and the pool boundary contour is obtained by real-time scanning through a visual sensor;
[0015] The correction module is used to acquire wall images using an underwater camera; identify the types of dirt contained in the wall images using a deep learning algorithm, and identify the density of different types of dirt in the wall images through pixel grayscale value analysis to obtain dirt density data; collect real-time environmental information of the target swimming pool to construct a wall environment map; verify the accuracy of the dirt density data by combining the wall environment map to correct visual errors caused by water reflection in the dirt density data; and construct a dirt distribution heat map by combining the dirt types and the corrected dirt density data.
[0016] The planning module is used to generate a global path for the target robot to perform wall cleaning tasks in the target swimming pool based on the spatial structure model and the dirt distribution heat map, using an irregular boundary fitting algorithm; and to adjust the local path of each sub-region in the global path based on the dirt distribution heat map and the real-time operating status of the target robot, so as to match the cleaning intensity in the sub-region with the local path density.
[0017] The execution module is used to load the local path corresponding to the current sub-region into the target robot after the target robot enters each sub-region, so as to control the target robot to complete the wall cleaning task in each sub-region.
[0018] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device including a processor and a memory for storing a computer program; the processor is used to execute the computer program and, when executing the computer program, implement the adaptive cleaning path planning method based on a pool wall robot as described in the first aspect or any embodiment of the present invention.
[0019] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer software program, which, when executed by a processor, implements the adaptive cleaning path planning method based on a pool wall robot as described in the first aspect or any embodiment of the present invention.
[0020] This invention provides an adaptive cleaning path planning method and system based on a swimming pool wall robot. The method involves acquiring a spatial structure model of the target swimming pool; this model is constructed based on the pool boundary contour and dynamically updated, which is obtained in real-time through a visual sensor. Next, an underwater camera acquires images of the pool wall; a deep learning algorithm is used to identify the types of dirt contained in the wall images, and pixel grayscale value analysis is used to identify the density of different types of dirt in the wall images, obtaining dirt density data. Then, real-time environmental information of the target swimming pool is collected to construct a wall environment map; the accuracy of the dirt density data is verified by combining the wall environment map to correct visual errors caused by water reflection. The dirt types and the corrected dirt density data are used to construct a dirt distribution heatmap. Finally, based on the spatial structure model and the dirt distribution heatmap, an irregular boundary fitting algorithm is used to generate a global path for the target robot to perform the wall cleaning task in the target swimming pool. Based on the aforementioned dirt distribution heatmap and the real-time operating status of the target robot, local path adjustments are made to each sub-region within the global path to match the cleaning intensity within the sub-region with the local path density. Finally, after the target robot enters each sub-region, the local path corresponding to the current sub-region is loaded into the target robot to control it to complete the wall cleaning task within each sub-region.
[0021] In this embodiment of the invention, a global path can be pre-generated using a spatial structure model and a dirt distribution heatmap, adapting to different pool types and avoiding bottlenecks in transition zones. Within each sub-region, the local path is adjusted based on the dirt distribution heatmap and the robot's real-time status, balancing efficiency and energy consumption, and prioritizing cleaning high-demand areas. Thus, through the pre-loaded global path and the real-time loaded local path, the system can flexibly respond to dynamic changes in the environment and equipment during the cleaning task, ensuring that cleaning parameters match the current pool wall area requiring cleaning, improving cleaning efficiency, guaranteeing cleaning coverage, effectively reducing blind spots, and significantly improving the quality of pool wall cleaning. Attached Figure Description
[0022] Figure 1 A flowchart illustrating an adaptive cleaning path planning method based on a pool wall robot, provided for an embodiment of the present invention;
[0023] Figure 2 This is a schematic diagram of a scanning scenario based on a pool wall robot, provided as an embodiment of the present invention.
[0024] Figure 3 This is a schematic diagram of a cleaning scenario based on a pool wall robot, provided as an embodiment of the present invention. Detailed Implementation
[0025] This invention provides an adaptive cleaning path planning method and system based on a pool wall robot. The adaptive cleaning path planning method based on the pool wall robot can be applied to a terminal device, which can be a mobile terminal, such as a mobile phone, virtual reality device, tablet computer, laptop computer, desktop computer, wearable device, or other electronic device. The terminal device can be a server connected to a cloud service system or a server cluster. The connection can be implemented through hardware circuitry or a communication module.
[0026] The following detailed description, with reference to the accompanying drawings, illustrates some embodiments of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other. Please refer to... Figure 1 , Figure 1 This is a flowchart illustrating an adaptive cleaning path planning method based on a pool wall robot, provided as an embodiment of the present invention.
[0027] like Figure 1 As shown, the adaptive cleaning path planning method based on a pool wall robot includes the following steps:
[0028] Step S101: Obtain the spatial structure model of the target swimming pool.
[0029] In this embodiment of the invention, the target swimming pool can be a public swimming pool, a family swimming pool, or an underwater space structure in any location.
[0030] Alternatively, the spatial structure model is constructed based on the pool boundary contour of the target pool and is dynamically updated.
[0031] The pool boundary profile refers to the outline shape formed by the interface between the target pool's walls and water, air, or other structures in three-dimensional space. It is the fundamental data source for constructing the spatial structural model. Here, the pool boundary profile encompasses all boundary features of the pool, including but not limited to: horizontal pool edges, vertical wall transitions, and boundaries of special structures. Examples include the four sides of a rectangular pool, the circumference of a circular pool, and the irregular broken lines or curves of an irregularly shaped pool. Other examples include the connecting edges between vertical sidewalls and the pool bottom, and the interface between vertical sidewalls and the pool rim. Additionally, examples include the outer edge of pool ladders, the outline edge of underwater light fixtures, and the opening edge of drain outlets.
[0032] Alternatively, the pool boundary contour can be obtained through real-time scanning using a visual sensor. For example, Figure 2 In the scanning scene shown, the target robot is scanning the pool, and the scanning direction is indicated by a dashed arrow.
[0033] For example, the pool boundary contour is a set of contour features obtained in real time through visual sensors (such as underwater cameras), including the geometric parameters and coordinate information of the boundary. This data directly reflects the actual boundary shape of the pool and serves as the raw material for subsequently constructing a spatial structure model. Examples include the length of straight segments, the radius of curvature of curved segments, the angle of turning points, and the length of transition areas. It also includes the three-dimensional coordinates of boundary feature points in the pool coordinate system.
[0034] The spatial structure model is a digital and structured representation of the pool space, constructed based on the pool boundary contour data and combined with the pool's three-dimensional spatial features (such as depth distribution, wall tilt angle, and the location of special structures). It serves as a core reference for robots to perform path planning. It not only includes the digital mapping of the pool boundary contour (converting the geometric parameters and coordinate information of the boundary contour into computer-readable digital model data), but also integrates the pool's internal spatial parameters (such as the slope distribution of the pool bottom, water depth values in different areas, and the height of the vertical sidewalls) and the spatial locations of fixed structures (such as the three-dimensional coordinate range of the ladder within the pool and the installation coordinates of the underwater light fixtures), forming a complete digital description of the pool's overall spatial morphology.
[0035] Functionally, the spatial structure model has dynamic update capabilities. When the visual sensor or other auxiliary sensors (such as ultrasonic sensors) detect changes in the pool boundary contour (such as a temporary swimming ring forming a new boundary or the contour of newly added maintenance equipment in the pool), the boundary contour data will be corrected in real time, and the spatial structure model will be updated synchronously to ensure that the model is always consistent with the actual spatial structure of the pool. This provides a precise spatial framework for the robot to adapt to irregular pools, avoid obstacles, and plan blind-spot-free paths.
[0036] As an optional embodiment, in step S101, the target robot is controlled to execute a boundary cruise mode. Real-time images are acquired along the edge of the target pool using a vision sensor mounted on the target robot. An image edge detection algorithm, including an adaptive weighted Canny algorithm, is used to process the real-time images to extract the pool boundary contour. After extracting the pool boundary contour, it is divided into straight and curved segments. The straight segments include the rectangular pool sidewalls, and the curved segments include the curved walls of circular pools and the corners of irregularly shaped pool edges. Contour feature parameters are generated based on the radius of curvature of the curved segments and the length of the transition area between the vertical wall and the pool bottom. The distance between the target robot and the pool wall is measured using an ultrasonic sensor, and the pool boundary contour is corrected based on the measurement results. The corrected pool boundary contour is used to construct a spatial structure model of the target pool.
[0037] In step S101 above, the contour feature parameters include the length of a straight line segment, the radius of curvature of a curve segment, the length of a transition region, the coordinates of the vertices of an irregular polygon, the coordinates of the center and radius of a circular pool, and the coordinates of the center and the lengths of the major and minor axes of an elliptical pool.
[0038] In step S101, the target robot is first controlled to activate the boundary cruise mode. The target robot will slowly move along the edge of the target pool. During this process, its onboard visual sensors (such as an underwater high-definition camera) continuously collect real-time images of the pool wall to ensure coverage of all boundary areas of the pool, including key locations such as the vertical sidewalls, the junction between the pool bottom and the sidewalls, and the pool edge. The collected real-time images are transmitted to the robot's embedded controller in real time. The controller uses an adaptive weighted Canny algorithm to process the images to extract the pool boundary contours. This algorithm first performs block preprocessing on the image, dynamically adjusts the filtering parameters according to the turbidity of the water in different areas, and then strengthens the boundary features and suppresses interference from water impurities and reflections through improved gradient calculation and dynamic threshold segmentation, ensuring that clear boundary contours can be accurately extracted even in deep water or turbid water.
[0039] After extracting the pool boundary contour, the controller further classifies the contour, distinguishing between straight and curved segments. For example, for a rectangular pool, its four sides are identified as straight segments. For a circular pool, the entire circumference is identified as a curved segment. For pools with irregularly shaped edges, the corners of the edge (such as curved corners or irregular polygonal corners) are classified as curved segments, while the straight sections of the edge are classified as straight segments. Based on the classification, the controller generates contour feature parameters. These parameters cover the actual length of straight segments, such as the length of a side of a rectangular pool; the radius of curvature of curved segments, such as the radius of curvature of the circumference of a circular pool or the radius of curvature of a corner of an irregularly shaped edge; and the length of the transition area between the vertical wall and the pool bottom, i.e., the length of the transition section from the bottom of the vertical wall to the flat area of the pool bottom. For irregular polygonal pools, the coordinates of each vertex in a preset coordinate system are recorded. For circular pools, the coordinates of the center and the radius in the coordinate system are determined. For an elliptical swimming pool, the coordinates of the center, the length of the major axis, and the length of the minor axis are calculated. These parameters together constitute a complete set of features describing the shape of the pool boundary.
[0040] Subsequently, the boundary contour is corrected using ultrasonic sensors mounted on the target robot. At key feature points of the contour, such as the endpoints of straight segments, inflection points of curved segments, and the starting points of transition areas, the ultrasonic sensors emit sound waves and receive reflected signals, calculating the actual distance between the target robot and the corresponding pool wall based on the signal propagation time. The controller compares this actual distance with the distance of the corresponding feature points obtained when the contour is extracted by the vision sensor. If there is a discrepancy, and the discrepancy exceeds a preset reasonable range, the actual distance measured by the ultrasonic sensor is used as the basis to adjust the position of the corresponding feature points in the contour, thereby correcting the entire pool boundary contour. For example, if the distance from the inflection point of a curved segment to the pool wall identified by the vision sensor deviates from the actual distance measured by the ultrasonic sensors, the coordinates of the inflection point will be adjusted to correct the shape of the curved segment, ensuring that the contour perfectly matches the actual pool boundary.
[0041] Finally, the controller integrates the corrected pool boundary contour with the generated contour feature parameters, transforming it into digital three-dimensional spatial data to construct a spatial structure model of the target pool. This model fully presents the overall spatial form of the pool, such as the length, width, and depth distribution of a rectangular pool, the radius and depth variations of a circular pool, and the irregular boundaries and internal structural positions of an irregularly shaped pool. When the target robot performs path planning, it can accurately adapt to the actual spatial structure of the pool based on this model, avoiding path deviations or blind spots in cleaning.
[0042] It is worth noting that in the above optional embodiments, the implementation process of the adaptive weighted Canny algorithm is as follows: First, the wall image is preprocessed by segmentation. The controller divides the pool wall image acquired by the vision sensor into multiple image blocks of the same size. For example, a 1920×1080 resolution image is divided into several 64×64 image blocks. Then, the grayscale variance of each image block is calculated. Grayscale variance reflects the degree of difference in pixel brightness within an image block. If an image block corresponds to the deep water area of the pool (with more impurities and weak light), its pixel grayscale value fluctuates greatly, and the grayscale variance will be higher. If it corresponds to the shallow water area of the pool (with clear water and uniform light), the pixel grayscale value is more stable, and the grayscale variance is lower. According to a preset grayscale variance threshold, the image blocks are divided into turbid areas and clear areas. For example, image blocks in the deep water area are classified as turbid areas because their grayscale variance exceeds the threshold, and image blocks in the shallow water area are classified as clear areas because their grayscale variance is below the threshold. This classification provides a basis for subsequent differential processing.
[0043] Next, Gaussian filtering is applied to different areas for noise reduction. For turbid areas, due to the high levels of water impurities and strong image noise interference, a Gaussian filter with a larger standard deviation is needed to filter noise more effectively. For clear areas, where noise interference is weaker, a Gaussian filter with a smaller standard deviation is sufficient to avoid over-filtering and loss of boundary details. Furthermore, the filter's standard deviation is dynamically adjusted based on the grayscale variance of the image patch. For example, if the grayscale variance of a turbid area image patch is much higher than other turbid patches, its corresponding standard deviation will increase further. Conversely, for image patches in clear areas with slightly higher grayscale variance, the corresponding standard deviation will be appropriately adjusted upwards to ensure that the noise reduction effect of each image patch is precisely matched to its own noise level. Taking a circular swimming pool as an example, the image patch in the deep water area at the center of the pool bottom is classified as a turbid area and uses a filter with a larger standard deviation, while the image patch in the shallow water area at the pool edge is classified as a clear area and uses a filter with a smaller standard deviation. After noise reduction, impurities and noise in the deep water area are removed while the boundary details of the shallow water wall are preserved.
[0044] Then, the image gradient information is calculated using the improved Sobel operator. The traditional Sobel operator uses the same weights to calculate gradients across all regions, while the improved operator dynamically sets the directional weight coefficients based on the region where each pixel is located. Pixels in murky regions, whose boundary features are easily masked by noise, have larger directional weight coefficients to enhance the gradient response in the boundary direction and highlight the blurred boundaries. Pixels in clear regions have more distinct boundary features, so the directional weight coefficients are set relatively smaller to avoid over-enhancement that could interfere with non-boundary regions. For example, in the transition region between the vertical wall and the bottom of a swimming pool (often curved and potentially blurred due to water refraction), if an image patch in this region is classified as a murky region, the improved Sobel operator will assign it a higher directional weight coefficient, focusing more on capturing the directional changes of the curved boundary when calculating the gradient, making the gradient value of the originally blurred transition boundary more significant and facilitating subsequent identification.
[0045] Next, non-maximum suppression is performed on the gradient image using a dynamic window mechanism. In hazy areas, the image boundaries are blurred and the gradient values are scattered. A smaller 3×3 suppression window allows for more precise location of the pixel corresponding to the maximum gradient value, avoiding boundary shift caused by an excessively large window. In clear areas, the image boundaries are sharper and the gradient values are concentrated. A larger 5×5 suppression window allows for a more comprehensive comparison of the gradient values of neighboring pixels, ensuring the preservation of true boundary pixels. During suppression, bilinear interpolation is used to calculate the gradient values of adjacent pixels along the gradient direction. For example, if the gradient direction of a pixel is not horizontal or vertical but at a 45° angle, bilinear interpolation can accurately estimate the gradient values of adjacent pixels in that direction. This value is then compared with the current pixel's gradient value. If the current pixel's gradient value is the maximum, it is retained as an edge candidate point; otherwise, it is suppressed. Taking the corner area of an irregularly shaped pool edge as an example, this image patch is classified as a hazy area. Using a 3×3 window for suppression accurately captures the gradient peak at the corner, preserving candidate points for the curved boundary and preventing the corner boundary from being smoothed due to an excessively large window.
[0046] Finally, adaptive dual-threshold segmentation is performed. The controller calculates the average gray value of each image patch. The average gray value reflects the overall brightness of the image patch. For example, image patches in the shadow areas of a swimming pool have lower average gray values due to weak light, so the corresponding high and low thresholds are lowered accordingly to avoid misclassifying dark boundaries as noise due to excessively high thresholds. Image patches in directly sunlight areas have higher average gray values, so the corresponding thresholds are appropriately raised to prevent noise in bright areas from being misclassified as boundaries. Furthermore, the ratio of the high to low thresholds is always kept within a reasonable range to ensure consistency in the segmentation criteria. During segmentation, edge candidate points with gradient values exceeding the high threshold are marked as strong edges; these are the defined boundary pixels. Candidate points with gradient values between the high and low thresholds and connected to strong edges are marked as weak edges; their connectivity with strong edges is verified to confirm that they are part of the true boundary. Candidate points with gradient values below the low threshold are directly suppressed. Taking the sunlit area of a hotel swimming pool as an example, the average gray value of the image blocks in this area is high, and the threshold setting is relatively high. After segmentation, the interference caused by the reflection of bright water can be eliminated, and only the real strong edges and connected weak edges of the wall are retained. Finally, a complete pool boundary contour image is generated, which provides more accurate boundary data for the subsequent construction of a spatial structure model.
[0047] In the above optional embodiments, further optionally, at the key feature point locations of the pool boundary contour, an ultrasonic sensor is controlled to emit sound waves and receive reflected signals. The key feature point locations include the endpoints of straight line segments, the inflection points of curved segments, and the starting points of transition areas. The actual relative distance between the target robot and the corresponding pool wall is calculated based on the time difference between emitting sound waves and receiving reflected signals. The measured actual relative distance is compared with the boundary distance of the corresponding key feature point obtained by the visual sensor, where the boundary distance of the corresponding key feature point obtained by the visual sensor is the visual recognition distance. If the difference between the actual relative distance and the visual recognition distance exceeds a set upper limit, the extracted pool boundary contour is corrected using a multi-feature fusion correction algorithm based on the actual relative distance measured by the ultrasonic sensor to eliminate contour deviations caused by image blurring due to water impurities. Contour deviations include misidentifying curved pool edges as straight line segments.
[0048] During the correction of the pool boundary contour, the first step is to locate the key feature points of the contour. Based on the pool boundary contour previously extracted using the adaptive weighted Canny algorithm, the controller automatically identifies and marks the locations of these key feature points. These locations include the endpoints of straight segments, the inflection points of curved segments, and the starting points of transition areas. Taking a rectangular home pool as an example, its four sides are considered straight segments, and the two ends of each side are the endpoints of these straight segments. If the pool has a curved rim, the connection point between the curved portion and the straight rim is the inflection point of the curved segment. The starting point of the transition from the vertical wall to the pool bottom is the starting point of the transition area. The controller records the coordinates of these key feature points in the image coordinate system, providing a positioning basis for subsequent ultrasonic measurements.
[0049] Next, the ultrasonic sensors are controlled to measure distances. The robot moves to the actual spatial position corresponding to each key feature point, ensuring that the ultrasonic sensor's emission direction is directly facing the pool wall. For example, when measuring the endpoint of a straight line segment, the sensor's emission direction is perpendicular to the corresponding pool wall. When measuring the inflection point of a curved segment, the emission direction is aligned with the tangent direction of the pool wall at the inflection point, avoiding measurement errors due to angular deviations. The sensor then emits an ultrasonic signal, which propagates to the pool wall and reflects back to the sensor. The controller records the time difference between signal emission and reception. Since the propagation speed of ultrasound in water is relatively stable, the actual relative distance between the robot and the corresponding pool wall position can be calculated by combining the time difference. Each key feature point receives independent actual distance data, forming a complete measurement dataset.
[0050] The actual relative distance is then compared with the visual recognition distance. The visual recognition distance is the distance from the key feature point to the pool wall obtained by the visual sensor through image analysis. The controller compares the actual relative distance of each key feature point with the corresponding visual recognition distance one by one, calculating the difference between the two. If the difference for a certain key feature point does not exceed the set upper limit, it means that the visually recognized contour at that point is accurate and no correction is needed. If the difference exceeds the set upper limit, it indicates that the image at that point is blurred due to water impurities, resulting in contour deviation, and correction is required. For example, at the curved edge of an irregularly shaped pool, due to water turbidity, the visual sensor may misidentify the curved edge as a straight line. The visual recognition distance at the inflection point of the corresponding curved segment will have a large difference from the actual relative distance measured by ultrasound, thus triggering the correction process.
[0051] Finally, a multi-feature fusion correction algorithm is used to refine the contour. This algorithm comprehensively adjusts the contour by combining various geometric features of key feature points. For example, the correction of the endpoints of straight segments references the length and angle of adjacent straight segments to ensure that the overall shape of the corrected straight segments conforms to the actual structure of the pool. The correction of the inflection points of curved segments combines the radius of curvature of the curved segments and adjusts the coordinates of the inflection points to make the curvature of the curved segments consistent with the actual curved pool wall. The correction of the starting point of the transition area is associated with the length parameters of the transition area to ensure accurate connection between the vertical wall and the pool bottom. Taking a hotel pool with a curved pool edge as an example, if the visual sensor misidentifies the curved pool edge as a straight segment, the actual relative distance of the corresponding inflection point of the curved segment is less than the visual recognition distance. The multi-feature fusion correction algorithm uses the actual distance measured by ultrasound as a benchmark, adjusts the coordinate position of the inflection point, and refits the contour of the curved segment so that the corrected curved contour perfectly matches the actual pool edge. After the correction is completed, the controller integrates the correction results of all key feature points and updates the entire pool boundary contour to ensure that the contour accurately reflects the actual spatial shape of the pool, providing reliable basic data for subsequent construction of the spatial structure model.
[0052] Optionally, the correction of the pool boundary contour employs a multi-feature fusion correction algorithm. This algorithm's implementation includes: extracting the geometric features of the pool boundary contour, including the curvature of feature points, the distance between adjacent feature points, and the concavity / convexity of the contour. Key feature points are classified based on these geometric features. Feature points with curvature greater than a preset curvature threshold are classified as curve feature points, while those with curvature less than or equal to the preset curvature threshold are classified as straight feature points. Further, the classification is based on a preset curvature threshold. Feature points with curvature greater than this threshold are classified as curve feature points; these feature points are mostly distributed in the curved areas of the pool, such as the circumferential inflection points of a circular pool or the curved corners of an irregularly shaped pool edge. Feature points with curvature less than or equal to this threshold are classified as straight feature points; these feature points are mainly distributed in the straight areas of the pool, such as the four side endpoints of a rectangular pool or the straight edge endpoints of an irregularly shaped pool. Taking a hotel pool with a curved edge as an example, the feature points corresponding to the curved transition portion of the edge have curvature greater than the threshold and are classified as curve feature points. The feature points whose curvature is less than the threshold are classified as straight line feature points, and the classification results provide a clear basis for subsequent differential correction.
[0053] Furthermore, for curved feature points, ultrasonic distance measurement is used for priority correction. If the difference between the actual relative distance and the visual recognition distance exceeds 5cm, the feature point coordinates are directly adjusted based on the actual relative distance. For straight feature points, a weighted average of the actual relative distance and the visual recognition distance is calculated. The weighting coefficient is dynamically set according to the length of the straight segment; the longer the straight segment, the greater the weighting coefficient of the visual recognition distance.
[0054] In the above steps, for curved feature points, since the arc-shaped contour they occupy is prone to visual misjudgment due to water impurities, the algorithm will prioritize using ultrasonic distance measurement for correction. The controller will compare the actual relative ultrasonic distance corresponding to the curved feature point with the visual recognition distance. If the difference exceeds a set range, the coordinate position of the feature point will be adjusted directly based on the actual relative distance measured by the ultrasonic wave. For example, if the visual recognition distance of a curved feature point along the arc-shaped pool is too large due to water turbidity, while the actual relative distance measured by the ultrasonic wave is closer to the true value, the feature point will be adjusted towards the pool wall according to the actual relative distance to ensure that the curvature of the arc-shaped contour is consistent with the actual pool edge.
[0055] For straight line feature points, since the visual recognition of the straight contours they occupy is relatively stable, the algorithm calculates a weighted average of the actual relative ultrasonic distance and the visual recognition distance for correction. The weighting coefficient is dynamically set according to the length of the straight line segment containing the straight line feature point. The longer the straight line segment, the higher the reliability of visual recognition in that straight area, and the larger the weighting coefficient of the visual recognition distance. Conversely, the shorter the straight line segment, the relatively weaker the stability of visual recognition, and the weighting coefficient of the actual relative ultrasonic distance is correspondingly increased. Taking the long side of a rectangular swimming pool as an example, the longer the long side, the larger the weighting coefficient of the visual recognition distance when correcting the corresponding straight line feature points. The weighted average is closer to the visual recognition result, and only the ultrasonic data is used for fine-tuning, avoiding the bending of the straight line segment due to over-reliance on a single data point. When correcting the straight line feature points corresponding to the short side of the pool, the weight of the ultrasonic data is slightly higher to ensure the accuracy of the short side contour.
[0056] After correction, B-spline curves are used to smoothly fit the adjusted feature points, ensuring that the corrected pool boundary contour is continuous and conforms to the actual pool structure. Specifically, the controller inputs the corrected curved and straight feature points into the B-spline curve fitting model in contour order. The model calculates the optimal fitting curve between feature points, ensuring a natural and smooth transition between adjacent feature points. For example, after correcting the curved feature points and straight feature points at both ends of an arc-shaped pool edge, B-spline curve fitting allows for a seamless connection between the arc and straight contours, without noticeable breaks or discontinuities. Fitting the straight feature points of a rectangular pool further ensures the straightness of the four sides, avoiding slight bending of straight segments due to minor adjustments at individual feature points. Ultimately, the smoothly fitted pool boundary contour not only has accurate individual point positions but also perfectly matches the actual spatial structure of the pool, providing high-quality boundary data for subsequent construction of the spatial structure model.
[0057] It's worth noting that the multi-feature fusion correction algorithm is primarily used to integrate multiple geometric attributes and sensor data of key feature points at the pool boundary, rather than relying on a single type of information. This eliminates visual misjudgments caused by water impurities, ensuring that the corrected outline matches the actual structure of the pool. The algorithm mainly combines three core features: First, the geometric correlation features of key feature points. For example, the endpoints of straight segments are associated with the lengths and inclination angles of adjacent straight segments; the inflection points of curved segments are associated with the curvature trend of the curve and the connection relationship between adjacent curved segments; and the starting points of transition areas are associated with parameters such as vertical wall height and pool bottom slope. These features reflect the overall structural logic of the boundary, avoiding outline breaks caused by correction of a single feature point. Second, sensor data features, namely the actual relative distance measured by the ultrasonic sensor and the image texture features collected by the visual sensor (such as the texture of wall tiles and the distribution of stains). The former provides a precise spatial distance benchmark, while the latter helps determine the true material boundary of the boundary (such as distinguishing the texture differences between the pool wall and the water). The combination of these two can eliminate interference caused by water reflection and impurity occlusion. Thirdly, there are historical correction features. If the robot has previous cleaning records for the same type of pool (such as a curved pool edge pool), it will call historical correction parameters (such as the adjustment range of similar curved inflection points) as a reference to improve correction efficiency and accuracy.
[0058] For example, the multi-feature fusion correction algorithm can be an improved DS evidence theory algorithm. This algorithm was originally used for uncertainty fusion of multi-source information. When adapted to this application, geometric correlation features (such as the angle of a straight line segment, the curvature of a curve segment), sensor data (ultrasonic distance, image texture), and historical correction features (adjustment parameters for inflection points in similar swimming pools) can be treated as independent evidence bodies. By calculating the basic probability allocation function of each evidence body, the support of each type of feature for the causes of contour deviation (such as visual blur, measurement error) is quantified. For example, if ultrasonic distance shows a large inflection point deviation in a certain curve segment (Evidence 1 support 0.8), image texture shows many impurities in the water in that area (Evidence 2 support 0.7), and historical data shows that similar scenes are prone to arc-shaped misjudgments (Evidence 3 support 0.6), the improved DS evidence theory algorithm will fuse the three types of support through evidence synthesis rules (such as Yager synthesis rules), ultimately determining that the deviation originates from visual blur with a comprehensive support (e.g., 0.9). Then, based on ultrasonic distance, the inflection point coordinates are adjusted in combination with geometric features to avoid misjudgments caused by a single piece of evidence. This algorithm is particularly suitable for handling scenarios where multiple features have slight conflicts, such as when the ultrasonic distance and geometric angle at the endpoint of a straight line segment are slightly contradictory. It can find the optimal correction solution through evidence fusion.
[0059] In addition to the improved DS evidence theory algorithm, several other multi-feature fusion correction algorithms can be used, all of which are adaptable to the actual needs of different swimming pool scenarios. These include federated learning-driven multi-feature fusion algorithms, fuzzy logic fusion algorithms, and Kalman filter fusion algorithms. For example, when a robot cleans a curved pool for the first time, the federated learning-driven multi-feature fusion algorithm allows the local model to accurately correct visually misjudged straight line contours by utilizing feature weight data of similar pools in the global model (e.g., the ultrasonic data weight at the curved inflection point is 0.45). This avoids correction bias caused by insufficient single-machine data and adapts to diverse pool structures. Taking the correction of the transition zone from the vertical wall to the bottom of the pool as an example, if the deviation between the visually recognized transition zone length and the ultrasonic measurement is moderate, and the similarity of corrections for similar transition zones in historical data is high, the fuzzy logic will output the instruction "fusion of historical transition zone length parameters and ultrasonic distance, adjusting the starting point coordinates of the transition zone" based on the rule base. This effectively addresses the problem of feature data ambiguity caused by water impurities, making it particularly suitable for scenarios where sensor data is severely interfered with. For example, during pool cleaning, when the robot's movement causes dynamic changes in the position of feature points, Kalman filtering can fuse new ultrasonic data and geometric predictions in real time to continuously correct the contour and avoid path deviation caused by robot movement. It is especially suitable for dynamic boundary scenarios (such as boundary changes caused by temporary placement of swimming rings) to ensure the real-time and continuous nature of contour correction.
[0060] In the above optional embodiments, it is further optional to construct a spatial structure model of the target pool by modifying the pool boundary contour, including: converting the modified pool boundary contour and contour feature parameters into digital data; constructing a spatial structure model of the target pool using a three-dimensional reconstruction algorithm based on the converted digital data; during the subsequent cleaning process of the target robot, if a dynamic change in the pool boundary contour is detected by a visual sensor or an ultrasonic sensor, wherein the dynamic change includes a new boundary formed by temporary items, then the pool boundary contour is re-scanned and modified, and the spatial structure model is updated synchronously to ensure that the spatial structure model is consistent with the actual spatial structure of the target pool.
[0061] Specifically, the controller converts the positional information of all key feature points on the boundary contour (such as the 3D coordinates of the endpoints of straight segments and the inflection points of curved segments) and contour feature parameters (such as the length of straight segments, the radius of curvature of curved segments, and the length of transition areas) into a computer-recognizable digital format. For example, it stores the feature point coordinates as coordinate arrays and the parameters such as curvature and length as numerical lists. Simultaneously, it adds identification labels to different types of contour elements (straight segments, curved segments, and transition areas) to ensure that the digital data clearly reflects the structural attributes of the contour. Taking a rectangular swimming pool as an example, the corrected coordinates of the endpoints of the four side straight segments, the length of each side, and the length of the transition area between the vertical wall and the pool bottom are all converted into corresponding digital data, forming a basic data set describing the pool boundary.
[0062] Based on the converted digital data, a spatial structure model of the target swimming pool is constructed using 3D reconstruction algorithms. Common 3D reconstruction algorithms first generate a 3D framework of the pool based on 2D digital data of the boundary contours, combined with pool depth information (such as analyzing water depth distribution from pool bottom images captured by visual sensors, or using preset pool depth parameters). Then, contour feature parameters are integrated into the framework to refine the model details. For example, for curved sections, the algorithm generates a smooth, arc-shaped 3D structure based on the radius of curvature. For transition areas, it combines the transition length and the pool wall tilt angle to construct a connecting structure that conforms to the actual shape. Taking a commercial irregularly shaped swimming pool as an example, after the digital data of its boundary contour with an arc-shaped pool edge is input into the algorithm, the algorithm first determines the horizontal contour shape of the pool, and then combines the water depth data of different areas (such as the water depth near the pool edge is shallower and the water depth in the center area is deeper) to generate a three-dimensional model that includes the height dimension. At the same time, the curvature characteristics of the arc-shaped pool edge and the length characteristics of the straight pool edge are incorporated into the model, so that the model can fully present the three-dimensional spatial structure of the pool, including not only the planar shape of the boundary, but also the vertical depth and wall inclination, providing a three-dimensional spatial reference for robot path planning.
[0063] During the subsequent cleaning process by the target robot, dynamic updates are achieved through real-time detection. The target robot's onboard visual and ultrasonic sensors continuously monitor the pool boundary status. If a dynamic change in the boundary contour is detected—for example, a temporary swimming ring creating a new boundary, or moving equipment altering the local boundary shape—the sensors transmit this information to the controller. The controller immediately triggers a rescanning process for the boundary contour, re-identifying, measuring, and correcting the boundary of the changed area according to the previous scanning and correction steps, generating a new, corrected boundary contour and corresponding digital data. The controller then integrates the new digital data into the existing spatial structure model, adjusting the model structure of the changed area using a model update algorithm. For example, it adds a 3D structure of the new boundary to the model where the swimming ring is located, while retaining the model data for the unchanged areas, ensuring that the updated model accurately reflects the actual spatial structure of the pool. Taking a hotel swimming pool as an example, if a guest temporarily places a float into the pool during the cleaning process, creating a new boundary, the target robot will rescan the boundary near the float after the sensor detects the change, correct the original contour data, and update the spatial structure model simultaneously. The model will add the boundary shape corresponding to the float to avoid collisions with the float when the target robot cleans along the original model path, while ensuring that the cleaning path of other areas is not affected, and always maintaining the consistency between the model and the actual situation of the pool.
[0064] In the above optional embodiments, whether the three-dimensional structure of the pool is restored by a three-dimensional reconstruction algorithm during the initial construction or the model details are adjusted for temporary changes during dynamic updates, the spatial structure model can ensure that it provides a reliable spatial basis for the robot's cleaning path planning, avoid cleaning blind spots or collision risks caused by deviations between the model and the actual structure, and further improve the environmental adaptability of the cleaning path.
[0065] Step S102: Use an underwater camera to acquire images of the wall surface.
[0066] Step S103: Use a deep learning algorithm to identify the types of dirt contained in the wall image, and use pixel grayscale value analysis to identify the density of different types of dirt in the wall image to obtain dirt density data.
[0067] In this embodiment of the invention, the wall image refers to a visualized image of the target swimming pool wall directly captured by an underwater camera. It covers all wall areas of the pool that require cleaning, including vertical side walls (such as the concrete or tiled walls around the pool), pool bottom walls (such as the bottom of a flat pool or the sloping bottom of a ramped pool), and walls with special structures (such as the sides of pool ladders or the walls surrounding underwater light fixtures). From an image characteristics perspective, it is a real-time dynamic image in an underwater environment, needing to accurately reflect the surface condition of the wall. For example, the texture of tiled walls, the rough texture of concrete walls, and the forms of various pollutants adhering to the wall surface; at the same time, it will inevitably be affected by underwater environmental factors, such as image blurring due to water turbidity, water reflection from direct sunlight, and low image brightness due to insufficient light in deep water areas. These characteristics also determine that subsequent image quality needs to be improved through algorithmic processing (such as noise reduction and enhancement) to lay the foundation for dirt identification. The wall images are the raw data carriers for dirt identification and density analysis. The deep learning algorithm in the subsequent step S103 needs to distinguish the type of dirt based on the pixel information (such as color, grayscale, and texture) in the image and quantify the dirt density through pixel grayscale value analysis. Therefore, the collected wall images need to cover the entire wall of the pool to ensure that no area is missed and to avoid dirt omissions due to incomplete image acquisition.
[0068] The types of dirt refer to different categories of contaminants adhering to the pool walls, identified from wall images using deep learning algorithms. These contaminants are the core targets of pool cleaning, and due to their different causes, forms, and adhesion characteristics, they require differentiated cleaning strategies. Specifically, they can be divided into four core types: First, algae, which mostly grows in areas of the pool wall under direct sunlight and with suitable water temperatures (20-30℃) (such as the south vertical wall of the pool and the bottom of the shallow water area). It appears as green or dark green flocculent or patchy forms, with strong adhesion and easy growth. Second, limescale, which is formed by the long-term deposition of calcium and magnesium ions in the water. It is mostly distributed in areas with high evaporation rates (such as near the pool water level and the walls of hot water pools). It appears as white or pale yellow hard patches with a rough surface that are difficult to remove by conventional scrubbing. Thirdly, there is silt, which is formed by silt brought in from outside (such as silt carried by swimmers or silt washed away by rainwater) deposited on the pool walls. It is mostly concentrated in the corners of the pool bottom and the lowest point of the bottom of the sloping pool. It appears as a loose layer of brown or yellowish-brown particles, with weak adhesion but easy accumulation. Fourthly, there is leaf debris, which consists of fallen leaves, petals, or hair and fibers left by swimmers. It mostly floats and adheres to the walls near the water surface (such as the area within 10cm above and below the water level) or in flat areas of the pool bottom. It has an irregular shape and is easily moved by the water flow. The classification of these types requires accurate extraction of image features based on deep learning algorithms. For example, the green pixel features of moss, the white high grayscale features of scale, and the brown texture features of silt, ensuring that each type of dirt can be accurately identified, providing a basis for subsequent differential density analysis and cleaning intensity matching.
[0069] Dirt density data refers to structured data obtained by quantifying the distribution density of various types of dirt in wall images through pixel grayscale value analysis. Its core function is to reflect the urgency of cleaning needs for dirt in different areas and provide data support for subsequent path adjustments (such as using dense paths in high-density areas).
[0070] As an optional embodiment, in step S103, the wall image acquired by the underwater camera is preprocessed by sequentially performing image denoising, image enhancement, and image segmentation operations. The image segmentation employs a combination of threshold segmentation and edge segmentation to divide the wall image into several independent dirt candidate regions. The area of each dirt candidate region is not less than a preset minimum region area threshold, avoiding misclassification of tiny impurities in the water as dirt candidate regions; for example, excluding excessively small bubble regions. Further optionally, the image denoising uses an adaptive median filtering algorithm. The controller first analyzes the distribution density of water impurities in the wall image. For example, images of deep water areas in a home swimming pool have high impurity density due to high impurity levels and low visibility; in this case, the algorithm automatically increases the filter window size to more effectively filter particulate noise in the water. Conversely, images of shallow water areas have fewer impurities and higher clarity, so the filter window size is correspondingly reduced to avoid over-filtering that could lead to the loss of dirt edge details. Image enhancement employs the Retinex enhancement algorithm, which decomposes the wall image into illumination and reflection components. For low-light environments such as deep water areas of swimming pools, it suppresses the non-uniformity of the illumination component and enhances the grayscale difference between dirt and the wall surface in the reflection component, making the originally blurry dirt outline clear. For example, the mud and sand at the bottom of the deep water area of a hotel swimming pool can form a clear contrast with the texture of the pool bottom tiles after enhancement.
[0071] Furthermore, an improved convolutional neural network model was constructed for dirt type recognition. This improved model uses MobileNetV3 as its backbone network, adding a CBAM attention module at the network neck and a multi-classification output layer at the network head. The CBAM attention module strengthens the weighting of dirt features and suppresses interference from background reflections and water glare on feature extraction. For example, when encountering bright spots near the pool water level caused by reflections, the module reduces the feature weights of these bright spots to prevent them from affecting dirt feature extraction. The multi-classification output layer includes categories such as moss, scale, silt, and leaf debris, and uses a Softmax activation function to output the probability value of each dirt candidate region corresponding to each dirt category.
[0072] It is worth noting that traditional multi-classification output layers often merge similar pollutants, making it difficult to match differentiated cleaning strategies. This application accurately classifies the output categories into four types: moss, scale, silt, and fallen leaf debris, with each output node deeply bound to the specific features of the corresponding dirt. During model training, the feature weights of the output nodes are optimized in a targeted manner for the unique visual features of each type of dirt, ensuring that the nodes only strongly respond to the features of the corresponding dirt and suppress other features. Even with interference from water reflections, misjudgments can be reduced, significantly improving category recognition accuracy and avoiding mismatch of cleaning strategies. Secondly, the probability distribution adaptation of the Softmax activation function is improved, solving the problem of probability shift in traditional Softmax under small sample and high interference scenarios. Pool wall images often suffer from incomplete feature extraction of some dirt candidate areas due to water turbidity and uneven lighting. Traditional Softmax functions are prone to problems such as excessive concentration of probability in a certain category or dispersion of probability without clear direction (e.g., misjudging blurry silt areas as moss, with an artificially high probability value of 0.8). In contrast, this application's embodiment adds a feature confidence preprocessing step before applying the Softmax function. First, the feature evaluation module within the model determines the feature completeness (such as edge sharpness, texture recognition, and color saturation) of the current dirt candidate region. If the feature completeness is below a preset threshold (e.g., due to insufficient light in deep water causing feature blurring), the original output value of that region is adjusted for probability suppression before being input into the Softmax function to calculate the probability. For example, if a leaf debris region has incomplete features due to water impurities obscuring it, the feature evaluation module will first reduce the weight of its original output value and then process it through Softmax to avoid false judgments such as an artificially high debris probability of 0.7, ensuring that the probability value truly reflects the degree of feature matching, rather than a false confidence level influenced by interference factors. Furthermore, while traditional models only use Softmax probability values for category determination and discard them after determination, this application transforms them into a quantitative basis for cleaning decisions, forming a probability-strategy linkage mechanism: the probability value determines the cleaning intensity level; high-confidence regions are matched with high-intensity cleaning parameters, and medium-confidence regions adjust parameters to ensure thorough cleaning; for regions to be verified with probability values below the threshold, the probability distribution features are transmitted to subsequent verification stages to provide category tendency references. This end-to-end application improves the precision of cleaning.
[0073] Next, the preprocessed wall image is input into the improved CNN model. If the probability value of a certain type of dirt in a candidate area is greater than a preset probability threshold, the dirt type of the current candidate area is determined to be the current category. For example, for a candidate area on the south vertical wall of a family swimming pool, if the model outputs a probability value of moss that is much higher than other categories and exceeds the threshold, then the area is determined to be moss. If the probability values of all categories are less than the preset probability threshold, it indicates that the dirt features in the area are not obvious and there may be ambiguity in identification. The current dirt candidate area is marked as a region to be verified so that it can be reconfirmed by combining the wall environment map. For example, a candidate area in the corner of the pool, if the model cannot clearly determine whether it is mud or fallen leaf debris due to dim lighting, is classified as a region to be verified.
[0074] Next, pixel grayscale value analysis is performed on candidate areas of the identified dirt types to achieve density identification. The grayscale values of all pixels within each candidate area are extracted, and the statistical characteristics of the grayscale values are calculated, including the grayscale mean, grayscale variance, and grayscale distribution frequency. Then, differentiated density grading standards are set for different types of dirt. Specifically, if the dirt type is moss, the grayscale mean is used as the core indicator. Areas with lower grayscale mean values indicate darker and denser moss coverage, and are classified as high-density moss areas. For example, the moss areas in the direct sunlight areas of a hotel swimming pool are classified as high-density areas due to their vigorous growth, dark color, and low grayscale mean. If the dirt type is limescale, the grayscale variance is used as the core indicator. Areas with smaller grayscale variance indicate more uniform limescale crystal distribution and denser coverage, and are classified as high-density limescale areas. For example, the limescale areas near the water level line in a swimming pool have dense and uniform crystal distribution and small grayscale variance, thus classified as high-density areas. If the dirt type is silt or leaf debris, the grayscale distribution frequency is used as the core indicator. The percentage of pixels with grayscale values below a preset threshold is counted. Areas with a high percentage indicate denser dirt distribution and are classified as high-density areas. For example, the silt area in the corner of a home swimming pool bottom has a high percentage of low-grayscale pixels due to the accumulation of a large amount of silt. For instance, if the dirt type is moss, the mean grayscale value is used as the core indicator. A mean grayscale value between 0 and 40 is classified as a high-density moss area, between 41 and 80 as a medium-density moss area, and between 81 and 120 as a low-density moss area. If the dirt type is limescale, the grayscale variance is used as the core indicator. A grayscale variance between 0 and 20 is classified as a high-density limescale area, between 21 and 50 as a medium-density limescale area, and between 51 and 80 as a low-density limescale area. If the dirt type is mud or fallen leaf debris, the grayscale distribution frequency is used as the core indicator. The percentage of pixels with grayscale values lower than the preset grayscale threshold for mud or fallen leaves is counted. When the percentage of pixels is above 60%, it is determined to be a high-density area; when the percentage of pixels is between 30% and 60%, it is determined to be a medium-density area; and when the percentage of pixels is below 30%, it is determined to be a low-density area.
[0075] Finally, the dirt type, density level, area coordinates, and area of each candidate dirt region are integrated into structured data to form dirt density data. The density level corresponds one-to-one with the density quantization value: high-density areas correspond to a density quantization value of 3, medium-density areas to a density quantization value of 2, and low-density areas to a density quantization value of 1. This structured data clearly presents the distribution location, type, and density of dirt in the pool, providing accurate data support for subsequent construction of dirt distribution heat maps and planning of cleaning paths, ensuring that the robot can formulate differentiated cleaning strategies for different areas of dirt.
[0076] Step S104: Collect real-time environmental information of the target swimming pool to construct a wall environment map.
[0077] Step S105: Verify the accuracy of the dirt density data by combining the wall environment map, so as to correct the visual error caused by water reflection in the dirt density data.
[0078] In this embodiment of the invention, the real-time environmental information of the target swimming pool collected in step S104 refers to multi-dimensional dynamic data that reflects the underwater and surrounding environmental conditions of the pool and is related to the identification and verification of dirt. The core purpose is to provide real and real-time basic data for the subsequent construction of the wall environment map, making up for the limitations of a single visual sensor in underwater environments. For example, temperature-related information is collected by an infrared thermal imaging sensor and a water temperature sensor. The infrared thermal imaging sensor captures the surface temperature distribution of different areas of the pool wall (e.g., in areas directly exposed to sunlight, the surface temperature of moss is 2-3°C higher than the surrounding wall due to photosynthesis; near the water surface, oil stains have a slightly higher temperature than the water due to poor thermal conductivity), generating temperature matrix data. The water temperature sensor collects the real-time temperature of the water near the wall (e.g., the water temperature in shallow water is higher due to sunlight, while the water temperature in deep water is relatively stable), forming a water temperature distribution curve. This temperature data can provide key evidence for the verification of dirt such as moss and oil stains. For example, information related to lighting is collected by lighting sensors to monitor real-time lighting intensity in different areas of the pool (e.g., high lighting intensity in direct sunlight areas near the pool edge, and low lighting intensity in deep water or shaded areas at the bottom). The type of lighting (direct light, diffused light, low light) is also differentiated. This information helps determine the source of visual errors. For instance, areas with high lighting intensity are prone to misjudgment by visual sensors due to water reflection, while areas with low light intensity are prone to missed detection of dirt due to low image contrast. This provides a lighting scenario reference for subsequent corrections. Similarly, information related to water quality is collected by water quality sensors to monitor parameters such as turbidity, oil concentration, and pH value. Turbidity data reflects the impurity content in the water (high turbidity leads to blurred visual images), oil concentration data directly relates to the oil adhesion on the walls near the water surface (high concentrations require verification of the reliability of oily area identification), and pH value indirectly affects scale formation (high pH levels lead to easier scale deposition, requiring enhanced verification of scale identification results in the corresponding areas). This data can explain the causes of visual recognition errors from the perspective of the water environment. For example, spatial dynamic information is collected through the collaborative collection of visual and ultrasonic sensors, including the location of temporary items in the pool (such as new boundaries formed by swimming rings and floats), water flow speed and direction (in areas with fast water flow, sediment is more likely to accumulate in specific locations on the wall), and dynamic changes in the wall structure (such as wall protrusions caused by temporary repairs). This type of information can ensure that the wall environment map is synchronized with the actual spatial state of the pool, avoiding verification deviations caused by dynamic factors.
[0079] In addition, the wall environment map constructed in step S104 is a structured and visualized comprehensive representation of the pool wall environment based on the above multi-dimensional real-time environmental information. Essentially, it transforms the scattered environmental data into an environment-location association model bound to the spatial location of the wall, which can provide a more intuitive and accurate environmental reference framework for verifying and correcting the dirt density data in step S105.
[0080] As an optional embodiment, in step S104, real-time environmental information of the target swimming pool is collected to construct a wall environment map. Specifically, real-time environmental information is first collected using multiple types of sensors. Infrared thermal imaging sensors capture the temperature distribution in different areas of the wall, generating a temperature matrix that reflects temperature differences at different wall locations. Light sensors monitor the light intensity in different areas of the pool, distinguishing between direct sunlight areas, shaded areas, and deep water areas based on intensity differences. For example, areas with light intensity less than 500 lux are considered deep water areas, areas with light intensity between 500-1500 lux are shaded areas, and areas with light intensity greater than 1500 lux are considered direct sunlight areas, thus clarifying the lighting conditions of each area. Water temperature sensors focus on collecting temperature changes in the water near the wall, forming a water temperature distribution curve that reflects the water temperature characteristics around different wall locations. Water quality sensors detect the turbidity and oil content of the water, compiling a water quality parameter distribution table reflecting the water quality status in the pool. These sensors, obtaining information from dimensions such as temperature, light, water temperature, and water quality, collectively constitute the basic data for constructing the map.
[0081] Next, a multi-source information fusion model was constructed to standardize and fuse the collected environmental information. First, temperature distribution data, light intensity data, water temperature data, and water quality parameter data were mapped to the same spatial coordinate system (consistent with the coordinate system of the wall image). An improved DS evidence theory algorithm was then used to fuse the multi-source data. Each sensor data point was treated as an independent piece of evidence, and the basic probability allocation function (BPA) for each piece of evidence was calculated. Evidence conflicts (such as conflicts between infrared temperature data and light intensity data) were handled using evidence synthesis rules (e.g., Yager synthesis rules), generating a fused environmental feature matrix. Each element in the matrix contains comprehensive characteristics of the corresponding wall area in terms of temperature, light intensity, water temperature, turbidity, and oil concentration, achieving structured integration of dispersed environmental data.
[0082] Finally, a wall environment map is constructed based on the fused environmental feature matrix. The map adopts a layered structure to meet different usage needs. The bottom layer is the raw environmental data layer, used to store unprocessed raw data collected by various sensors, facilitating subsequent traceability and verification. The middle layer is the feature fusion layer, which specifically stores the fused environmental feature matrix, providing data support for the core functions of the map. The top layer is the semantic annotation layer, which performs semantic classification and annotation of the wall areas according to the fused environmental features. During the annotation process, the corresponding category is matched according to the environmental characteristics of each area. For example, areas with sufficient light and suitable temperature are marked as areas prone to moss growth, areas with weak light and high water turbidity are marked as areas prone to sediment accumulation in deep water, areas with high oil content and close to the water surface are marked as areas prone to oil accumulation on the water surface, and areas without these special characteristics are marked as regular clean areas. Through this annotation process, a structured wall environment map is finally formed, providing a clear environmental reference for subsequent verification and correction of dirt density data.
[0083] As an optional embodiment, in step S105, the dirt density data is matched with the wall environment map using spatial coordinates to determine the semantic labeling category corresponding to each area to be verified in the wall environment map. For example, if an area to be verified is located in the shallow water area on the south side of the pool, its semantic labeling in the map can be determined to be a sun-loving moss-prone area through coordinate matching. Next, differentiated verification rules are set for dirt candidate areas with different semantic labeling categories. Here, the verification rules are formulated based on the correlation between environmental characteristics and dirt types to ensure that the verification results conform to the logic of the actual scenario. For example, an area semantically labeled as a sun-loving moss-prone area is itself a high-incidence area for moss due to sufficient sunlight and suitable temperature. The verification rules will focus on confirming whether there are moss characteristics in this area, rather than excessively checking other dirt. On the other hand, an area semantically labeled as a deep-water silt-prone area is prone to silt deposition due to slow water flow and weak sunlight. The verification rules will focus on whether the density of silt matches the environmental characteristics to avoid misjudging other dirt as silt. This differentiated approach avoids the limitations of uniform verification standards, making the verification process more targeted and reducing efficiency losses from invalid verifications. Furthermore, for the marked areas to be verified, the type and density level of dirt are directly determined based on the semantic annotations of the area in the wall environment map. For example, if the semantic annotation of an area to be verified is "sunlight-prone moss-growing area," then considering the environmental characteristics suitable for moss growth in that area, it can be directly identified as a medium-density moss area. This aligns with the typical growth density of moss in that environment and avoids missed or incorrect judgments due to visual ambiguity. If the semantic annotation of an area to be verified is "deep-water silt-prone area," then it is identified as a high-density silt area. For instance, if the semantic annotation of an area to be verified is "deep-water silt-prone area," considering the tendency for large amounts of silt to accumulate in that area, it can be directly identified as a high-density silt area, ensuring that the silt density is not underestimated due to unclear visual identification, thus affecting the subsequent cleaning intensity. Finally, the verified transfer data and the corrected optimized data are integrated to form the final dirt density data, eliminating visual errors caused by water reflection, weak light, and turbidity. Verified correct data refers to data in the identified areas that matches the semantic labeling category and requires no correction. Corrected optimized data includes newly added data in the areas to be verified after semantic labeling, as well as data in some identified areas that conflict with semantic labels and have been adjusted. During the integration process, erroneous data caused by visual errors (such as misjudging reflections in direct sunlight areas as oil stains) will be removed, and previously missed dirt data (such as unidentified sediment data in low-light conditions in deep water areas) will be added. The resulting dirt density data can completely and accurately reflect the true distribution of dirt in the pool, completely eliminating the interference of water reflections, low light, turbidity, and other factors on visual recognition, providing reliable data support for the subsequent construction of accurate dirt distribution heat maps.
[0084] Optionally, in the above steps of setting differentiated verification rules, if the semantic label of the dirt candidate area is a sun-loving moss-prone area, then the dirt type of the dirt candidate area is verified to be moss. If it is determined to be moss and the density level is high or medium, and the temperature of the dirt candidate area in the wall environment map is higher than the surrounding area by a preset degree, then the dirt density data is determined to be accurate. If it is determined to be oil, then the dirt type is corrected to moss, and the density level is adjusted according to the temperature difference in the wall environment map; if the temperature difference in the wall environment map is greater than 2.5℃, the density level is corrected to high density; if the temperature difference is within the range of 2-2.5℃, the density level is corrected to medium density.
[0085] If the semantic label of the dirt candidate area is "water surface oil-prone area," then verify whether the dirt type of the dirt candidate area is oil. If it is determined to be oil and the density level is medium / low density, and the oil concentration of the dirt candidate area in the wall environment map is greater than 5 mg / L, then the determination data is accurate. If it is determined to be a smooth wall surface, then correct the dirt type of the dirt candidate area to oil and modify the density level of the dirt candidate area to medium density.
[0086] If the semantic label of the dirt candidate area is a deep-water area prone to sediment accumulation, then verify whether the dirt type of the dirt candidate area is sediment. If it is determined to be sediment and the density level is high, and the turbidity of the dirt candidate area in the wall environment map is greater than 20 NTU, then the determination data is accurate. If it is determined to be scale, then correct the dirt type of the dirt candidate area to sediment, while keeping the density level unchanged.
[0087] Step S106: Construct a dirt distribution heatmap using the dirt type and the corrected dirt density data. The dirt distribution heatmap is an intuitive map of the pool wall dirt distribution constructed based on the corrected dirt type and density data through spatial mapping, density calculation, and color visualization. Essentially, it transforms abstract dirt location, type, and density data into a visualized image, making the distribution, density, and type differences of dirt within the pool more intuitive and providing a direct reference for robot cleaning path planning and strategy formulation.
[0088] As an optional embodiment, in step S106, a spatial mapping relationship of the heat map is established. The controller will accurately align the information such as the area coordinates, dirt type, and density quantification value contained in the corrected dirt density data with the digital model of the pool structure, and clarify the specific location of each dirt candidate area in the three-dimensional space of the pool, including different heights of the vertical wall, various areas of the pool bottom, and the corresponding positions of the pool edge. Finally, a density-space mapping table that can reflect the relationship between density data and spatial position is formed to ensure that the subsequent heat map can accurately match the actual structure of the pool.
[0089] Furthermore, a dynamic heatmap generation model was constructed, and an improved Gaussian kernel density estimation algorithm was used to interpolate the data in the density-space mapping table. Differentiated Gaussian kernel function bandwidths were set according to the distribution characteristics of different dirt types. For example, a smaller bandwidth was set for moss due to its relatively concentrated distribution, a larger bandwidth was set for silt due to its more dispersed distribution, and a moderate bandwidth was set for scale and oil. The density weighted value of each pixel on the pool wall was calculated through kernel density estimation, transforming the originally discrete dirt candidate area data into continuous density distribution data, ensuring that the heatmap can smoothly present the dirt density changes of the entire pool.
[0090] For example, first, the basic data required for the calculation is defined. Key information for each dirt candidate region is extracted from the density-space mapping table, including the region's density quantification value (the value corresponding to the density level), center coordinates (the region's specific location in the pool wall coordinate system), and the Gaussian kernel bandwidth corresponding to the dirt type of the region. For example, if the candidate region is moss, the bandwidth uses the value set for moss. If it's silt, the bandwidth corresponding to silt is used, ensuring that each candidate region has calculation parameters that match its own dirt distribution characteristics. Next, for each pixel on the pool wall, the density weighting value is calculated. During the calculation, the coordinates of the pixel are first compared one by one with the center coordinates of all dirt candidate regions in the density-space mapping table to determine the spatial relationship between each candidate region and the current pixel. For each candidate region, its contribution to the density of the current pixel is calculated; this contribution is obtained by multiplying a weight coefficient by the kernel function value. The weighting coefficient is the density quantization value of the candidate region. The higher the quantization value, the greater the contribution of the region to the density of surrounding pixels. The kernel function value is calculated based on the coordinate difference between the candidate region and the current pixel, and the Gaussian kernel bandwidth for that dirt type. The smaller the coordinate difference (i.e., the closer the pixel is to the center of the candidate region) and the smaller the bandwidth (e.g., in a moss area), the larger the kernel function value, meaning the candidate region has a more significant impact on the density of the current pixel. Then, the contributions of all dirt candidate regions to the current pixel are summed, and the resulting sum is the density weighted value of that pixel. For example, if a pixel is surrounded by a high-density moss area and a medium-density silt area, the calculation will first calculate the contribution of the moss area to the pixel (high-density quantization value multiplied by the corresponding kernel function value) and the contribution of the silt area (medium-density quantization value multiplied by the corresponding kernel function value), and then sum these two contribution values to obtain the final density weighted value of the pixel. This calculation method transforms the originally discrete candidate dirt area data into continuous density distribution data covering the entire pool wall, allowing each pixel on the heat map to reflect the comprehensive influence of the surrounding dirt distribution. This smoothly presents the changing trend of dirt density in the pool, avoiding heat map breaks or distortions caused by discrete data.
[0091] Then, the heatmap color mapping rules are set, using the HSV color space to achieve a precise correspondence between density weighting values and colors. High-density areas correspond to specific red tones, medium-density areas to specific yellow tones, and low-density areas to specific green tones. Simultaneously, color gradient transition zones are set between adjacent density areas. Linear changes in color parameters avoid blurring of area boundaries caused by abrupt color changes, making the distinction between different density areas clear and natural, facilitating intuitive judgment of the density of dirt distribution. For example, density weighting value 3 (high-density area) corresponds to H=0°, S=100%, V=100% (pure red); density weighting value 2 (medium-density area) corresponds to H=60°, S=100%, V=100% (pure yellow); and density weighting value 1 (low-density area) corresponds to H=120°, S=100%, V=100% (pure green).
[0092] Next, dirt type identification and spatial information are overlaid. The corresponding dirt type abbreviation is marked at the center of each candidate area on the heatmap, allowing users to quickly identify the type of dirt in each area. A scale bar and coordinate scale are added to the edge of the heatmap, with the scale consistent with the coordinates of the pool's structural digital model, facilitating the location of specific areas. For transition areas of the pool, such as the junctions between the vertical walls and the pool bottom, and between the vertical walls and the pool edge, a semi-transparent color overlay is used for marking. This ensures that the density information of the transition areas is clearly visible without obscuring their spatial structural information, thus ensuring the integrity of the heatmap.
[0093] Finally, a dynamically updated heatmap of dirt distribution is generated and stored in a vector format that can be rendered in real time, facilitating rapid retrieval and updates later. When the target robot acquires new dirt data through sensors during the cleaning process, such as discovering previously undetected areas of fallen leaves and debris, the heatmap update process is automatically triggered. This process repeats the steps of spatial mapping, model generation, color rule setting, and information overlay, integrating the new data into the existing heatmap. This ensures that the heatmap always remains consistent with the actual dirt distribution in the pool, providing real-time and accurate visual data support for the robot to adjust its cleaning path.
[0094] Step S107: Based on the spatial structure model and the dirt distribution heat map, an irregular boundary fitting algorithm is used to generate the global path for the target robot to perform wall cleaning tasks in the target swimming pool.
[0095] As an optional embodiment, in step S107, the spatial structure model is used for pool type identification and parameter extraction. By analyzing the contour feature parameters in the spatial structure model, the pool type is determined to be circular, elliptical, irregular polygonal, or irregularly shaped pool, and the core parameters corresponding to different pool types are extracted. Specifically, for circular pools, the center coordinates and radius are extracted; for elliptical pools, the major / minor axis lengths and center coordinates are extracted; for irregular polygons, the vertex coordinates and side lengths are extracted; and for irregularly shaped pools, the corner radius parameters and the curvature radius of the transition area are extracted. The contour feature parameters include at least one of the following: the proportion of straight segments, the curvature distribution of curved segments, and the vertex coordinate distribution. That is, if the proportion of curved segments in the spatial structure model is extremely high and the curvature distribution is uniform with no obvious vertices, it is determined to be a circular pool, and the center coordinates and radius are extracted. If the curved segments exhibit periodic curvature changes and there is a difference in the direction of the major and minor axes, it is determined to be an elliptical pool, and the major and minor axis lengths and center coordinates are extracted. If the spatial structure model contains multiple defined vertices connected by straight line segments, and the proportion of straight line segments is high, it is identified as an irregular polygonal swimming pool, and the coordinates of each vertex and its corresponding side length are extracted. If the spatial structure model contains multiple corner arc structures, and the curvature of the transition area is diverse, it is identified as an irregularly shaped pool, and the corner arc parameters and the curvature radius of the transition area are extracted. These core parameters provide accurate structural basis for subsequent differentiated path generation, avoiding the path from being out of sync with the actual boundary of the pool.
[0096] Furthermore, an irregular boundary fitting algorithm is constructed, employing differentiated path generation methods for different pool types to obtain boundary paths. For circular and elliptical pools, a spiral trajectory is generated with the center as the reference, ensuring the path uniformly covers the entire wall surface. For irregular polygonal pools, parallel paths are generated along the perpendicular direction of each side, while the path turning angle is adjusted based on vertex coordinates to avoid path breaks at corners. For irregularly shaped pool edges, a curved path conforming to the curved wall surface is generated by combining corner curvature parameters. After path generation, the boundary paths are optimized for connection. For the first transition area between the vertical wall and the pool bottom, and the second transition area between the vertical wall and the pool edge, B-spline curve fitting is used to generate transition connection segments. The optimal fitting curve for the transition area curvature is calculated using the least squares method, reducing the deviation between the path curvature and the transition area curvature to a preset value, ensuring a smooth transition without abrupt turns. Simultaneously, dynamic parameter adjustment rules are set in the connection segments, causing the robot's movement speed to decrease linearly with the path curvature, preventing instability caused by excessive curvature. The negative pressure adsorption pressure increases with the wall tilt angle, enhancing the robot's adhesion to the tilted wall and ensuring smooth operation in the transition zone without slippage or detachment. For example, dynamic parameter adjustment rules are set in the transition section, where the moving speed decreases linearly with the curvature, and the negative pressure adsorption pressure increases with the wall tilt angle to obtain a global path. For instance, the speed decreases to 0.1 m / s when the curvature radius is 0.5 m, and the pressure increases by 20% when the tilt angle is >45°, ensuring smooth operation of the robot in the transition zone.
[0097] Finally, the generated global path is compared with the spatial structure model for collision detection. If the distance between the global path and the boundary contour is less than the robot's preset safe distance, an offset algorithm is used to correct the path. For example, if a collision node is close to the straight segment boundary of the pool's vertical wall, the algorithm will offset the node and its adjacent path segment away from the vertical wall. The offset amount is based on the distance between the node and the boundary reaching the safe distance, while ensuring that the offset path smoothly connects with the original path to avoid abrupt bends that could cause the robot to lag. If the collision node is located at the curved corner of the pool, the algorithm will first calculate the center of curvature of the corner, and then offset the path outward along the radius of curvature, so that the offset path still conforms to the curved shape of the corner, meeting the safe distance requirement without deviating from the original cleaning coverage area. After correction, collision detection is performed again on the adjusted path nodes until the distance between all nodes and the boundary contour meets the safety standard, forming a basic path with no collision risk. The ratio of the overlapping coverage area to the total cleaning area is calculated as the path repetition rate. The total cleaning area refers to all areas of the pool walls that need to be cleaned in the spatial structure model (including vertical walls, the pool bottom, and transition zones). The overlapping coverage area refers to the wall areas covered by overlapping segments of the global path (such as the overlapping portion of two adjacent loops in a spiral path, or the intersection of partitioned paths). The controller compares the coverage coordinate range of each path segment, calculates the area of the overlapping area, and then calculates the ratio with the total cleaning area to obtain the path repetition rate. If the repetition rate is greater than a set percentage, it indicates excessive path overlap, which will cause the robot to repeatedly clean the same area, wasting time and energy (such as large-area overlap caused by too small a spacing between spiral paths in a circular pool). In this case, a genetic algorithm is needed to optimize the path nodes. If the path repetition rate is greater than a set percentage, the genetic algorithm optimizes the path nodes, using the lowest path repetition rate as the fitness function to generate a global path that satisfies blind-spot coverage and has a path repetition rate less than the set percentage. For example, when designing a partitioned path for an irregular polygonal swimming pool, if the initial path has excessive repetition at vertex junctions, the genetic algorithm will adjust the node positions and path directions at the partition boundaries to reduce overlapping areas at junctions. Simultaneously, it ensures that the walls of each partition are covered, ultimately forming a highly efficient cleaning path with low repetition and complete coverage. This optimization method guarantees that all wall areas are cleaned and covered, avoids unnecessary path repetition, improves the robot's cleaning efficiency, and ensures that the path perfectly matches the pool's spatial structure model, preventing cleaning blind spots or collision risks caused by structural misjudgments.
[0098] Optionally, in the above steps, an irregular boundary fitting algorithm is constructed, employing differentiated path generation methods for different pool types to obtain boundary paths. This includes: if the pool type is circular or elliptical, an improved spiral interpolation algorithm is used to generate a global path. A polar coordinate system is established with the center of the circle as the origin. The dynamic adjustment coefficient of the spiral radius is calculated based on the length of the major or minor axis of the ellipse. The dynamic adjustment coefficient is the ratio of the minor axis length to the major axis length. The polar angle increment of each spiral rotation is dynamically set according to the proportion of high-demand areas in the dirt distribution heatmap. The spiral radius starts from the initial radius parameter, and the robot cleaning width increases with each rotation until the entire pool area is covered. The initial radius parameter is the minor axis length divided by 2 and multiplied by 0.8.
[0099] If the pool type is an irregular polygon or a non-standard pool, a boundary-following partition fusion algorithm is used to generate a boundary path along the pool boundary. The path transition method is dynamically adjusted according to the type of pool wall corners. 90° right-angle corners use a Bézier curve transition, with the control point 0.3m from the corner vertex. Curved corners use a constant curvature curve transition, with the path curvature consistent with the corner curvature. The distance between the boundary path and the pool wall is maintained at 10-15cm. Further, dynamic fine-tuning is performed based on the wall flatness; the distance increases to 15cm when flatness is poor. Adaptive partitioning is performed based on the polygon vertex coordinates and the aforementioned dirt distribution heatmap. An improved seed region growth algorithm is used, with high-demand areas as seed points. A pre-defined set of constraints—where the dirt density difference within the area is less than 20% and the area is no larger than the target robot's 10-minute cleaning range—is used to divide the area into triangular or trapezoidal sub-regions. Each sub-region generates an adaptive mesh path based on the A* algorithm, with the mesh node spacing dynamically set according to the maximum dirt density of the sub-region. The node spacing is set to 5cm in high-density areas and 10cm in medium-low density areas.
[0100] Step S108: Based on the aforementioned dirt distribution heatmap and the real-time operating status of the target robot, local path adjustments are made to each sub-region in the global path to match the cleaning intensity within the sub-region with the local path density. For example, Figure 3 In the cleaning scenario shown, when the target robot cleans the pool, it can move along a local path represented by a spiral trajectory. This local path density matches the cleaning intensity required for the ground area.
[0101] As an optional embodiment, in step S108, a mapping model between cleaning intensity and path density is first established. This establishes a clear correlation between different density quantification values in the dirt distribution heatmap and their corresponding path parameters, forming a structured mapping relationship. For areas with high cleaning needs, a smaller path spacing is set, employing a dense zigzag path pattern, combined with a higher brush speed and a longer residence time coefficient, ensuring that this area receives thorough and meticulous cleaning, completely removing dense dirt. For areas with medium cleaning needs, the path spacing is appropriately increased, using a conventional reciprocating path pattern, with the brush speed and residence time coefficient set to a medium level, improving coverage speed while ensuring cleaning quality. For areas with low cleaning needs, the path spacing is further increased, employing a unidirectional sweeping path pattern, eliminating the need for turning and returning, while simultaneously reducing the brush speed and residence time coefficient, maximizing cleaning efficiency while ensuring basic cleaning effects and avoiding resource waste. This mapping relationship provides a clear basis for the path parameters of different cleaning need areas, laying the foundation for subsequent local adjustments.
[0102] Next, the target robot's operational status parameters are collected in real time, including remaining battery power, current position, cleaning time, and brush wear calculated using the rate of change of current. These parameters are then integrated to construct an operational status evaluation matrix. Each element in the matrix is a normalized value of the corresponding parameter, with differentiated weights assigned to different parameters. Remaining battery power has the highest weight because it directly determines the robot's remaining operating time. Brush wear and cleaning time are next, relating to cleaning capability and overall operational progress, respectively. This weighted allocation allows for a more accurate assessment of the robot's current operational capabilities and constraints.
[0103] Then, a reinforcement learning algorithm is used to dynamically adjust the local path in sub-regions, with the core reward function being maximizing cleaning effectiveness and energy efficiency. The state space encompasses the density quantification value of the sub-region and the numerical values of the operational status evaluation matrix, while the action space includes the adjustment range of path spacing, brush rotation speed, and dwell time coefficient. For high-demand areas, the algorithm's learning objective focuses on maximizing cleaning coverage while keeping energy consumption increases within a certain range, ensuring effective removal of dense dirt. For low-demand areas, the learning objective shifts to minimizing energy consumption and extending the robot's overall runtime while keeping the decrease in cleaning coverage controllable. Through continuous learning and iteration, path parameters can be dynamically adjusted based on real-time state data, allowing the path in each sub-region to adapt to the current dirt density and robot state.
[0104] Subsequently, a dynamic priority adjustment mechanism is implemented, triggering priority reconstruction based on key parameters in the operational status evaluation matrix. When the normalized value of the remaining battery power is detected to be lower than a specific threshold, it indicates insufficient robot endurance. At this point, a cleaning priority index for each sub-region is calculated based on the dirt distribution heatmap. This index comprehensively considers the density quantification value, area, and distance from the charging dock of the sub-region. Sub-regions with higher density, larger area, and closer to the charging dock have higher priority indices. All sub-regions are sorted from high to low priority indices, and only the paths of the top few sub-regions are retained. The cleaning tasks of these sub-regions must be completed with sufficient remaining battery power. The paths of the remaining sub-regions are temporarily suspended until the robot is recharged to avoid cleaning interruptions due to insufficient power. If the normalized value of brush wear is detected to exceed a specific threshold during the cleaning process, it indicates a decrease in brush cleaning ability. At this point, the brush speed in high-demand areas is automatically reduced, while the dwell time coefficient is increased. This extends the cleaning time to compensate for the impact of reduced speed on cleaning effectiveness, ensuring that the cleaning quality of high-demand areas is not compromised.
[0105] Finally, local path adjustment instructions for sub-regions are generated, precisely binding the dynamically adjusted path parameters to the coordinates of the corresponding sub-regions in the global path, forming a structured local path data package. When the target robot enters a sub-region, the data package corresponding to that region is loaded in real time, and cleaning operations are performed according to the adjusted path spacing, turning angle, brush speed, dwell time, and other parameters. This ensures that the cleaning intensity of each sub-region is precisely matched with the local path density, meeting the cleaning needs of different areas while adapting to the robot's real-time operating status, achieving an optimal balance between cleaning effect and operating efficiency.
[0106] Step S109: After the target robot enters each sub-region, the local path corresponding to the current sub-region is loaded into the target robot to control the target robot to complete the wall cleaning task in each sub-region.
[0107] Specifically, in step S109, when the target robot detects that it has entered a preset sub-area through its own positioning module (such as visual positioning or laser positioning), it immediately triggers the local path loading process. The robot's control unit retrieves the previously generated structured local path data packet bound to the coordinates of the sub-area from the storage module. The data packet contains dynamically adjusted complete path parameters, such as path spacing and turning angle adapted to the dirt density of the area, as well as brush rotation speed and dwell time matching the robot's current state. During the loading process, the control unit first verifies the completeness and validity of the data packet to confirm that the path parameters are not missing or incorrect, and that they match the spatial structure of the current sub-area (such as the wall tilt angle and the presence of protrusions), to avoid cleaning deviations due to abnormal parameters.
[0108] Once the path is loaded, the control unit generates real-time control commands based on the path parameters, driving the robot's motion system and cleaning system to work together. The motion system moves along the wall according to the set path pattern (such as a dense zigzag pattern in high-demand areas and a unidirectional sweeping pattern in low-demand areas). By adjusting the speed and steering angle of the drive wheels, it ensures that the robot runs strictly along the path trajectory, and the path spacing is always kept within the set range, without deviation or excessive overlap. The cleaning system adjusts the brush speed according to the parameters, using a higher speed in high-demand areas to enhance cleaning power and a lower speed in low-demand areas to save energy. At the same time, it controls the robot's dwell time on a unit area of wall according to the dwell time coefficient, ensuring that there is enough time to remove stubborn dirt in high-demand areas and to efficiently complete basic cleaning in low-demand areas.
[0109] During the cleaning process, the robot continuously collects its own operational data and wall cleaning status data, such as real-time position, brush current (reflecting wear and load), and wall images (to aid in judging the cleaning effect), and feeds this data back to the control unit. The control unit will fine-tune the control commands in real time based on the feedback data. For example, if a slight deviation between the actual path and the preset path is detected, the drive wheel steering will be adjusted to correct the position immediately; if residual dirt is found in a certain area after cleaning (identified by the wall image), the dwell time in that area will be temporarily increased or the brush speed will be fine-tuned to ensure thorough cleaning.
[0110] Once the robot has completed the cleaning of all walls in a sub-area according to the local path, the control unit will automatically determine that the cleaning task for that sub-area is complete, stop the execution of the current path, and prepare to move to the next sub-area. If the local path data package for the next sub-area has been preset, the robot will repeat the above path loading and control process when it moves to the boundary of the next sub-area; if the cleaning tasks for all sub-areas have been completed, the task end procedure will be triggered, such as returning to the charging dock or sending a cleaning completion signal to the control console, ensuring that the cleaning task of the entire pool wall is completed in an orderly and complete manner.
[0111] It's worth noting that during the cleaning process, the target robot is equipped with attitude and displacement sensors to monitor its movement on the wall in real time. When a path deviation is detected, such as lateral sliding during vertical wall movement, the attitude sensor captures the abnormal change in the robot's posture, while the displacement sensor records the specific details of the deviation. The controller immediately calculates the direction and distance of the deviation based on the sensor feedback data and quickly adjusts the parameters of the movement module. By appropriately increasing the track speed in the opposite direction of the deviation, the sliding trend of the robot is gradually corrected, allowing it to return to the preset path trajectory. When moving on an inclined pool bottom, if a sudden change in the slope causes abnormal speed fluctuations in the target robot, such as an increased slope causing faster descent, the displacement sensor promptly reports the speed deviation. Upon receiving the signal, the controller automatically reduces the motor power, bringing the operating speed back to a preset reasonable range. This prevents further path deviation due to speed loss and ensures stability when moving on inclined surfaces.
[0112] Regarding temporary obstacle avoidance, when the target robot's ultrasonic sensors detect temporary obstacles in the pool, such as swim rings or toys left behind by swimmers, the obstacle information is immediately transmitted to the controller. The controller then initiates a local obstacle avoidance path generation program. First, the specific location and approximate size of the obstacle are calculated based on the data fed back from the ultrasonic sensors. Then, an arc-shaped detour path is generated based on the shape of the obstacle, ensuring that the radius of curvature of the path around the obstacle is large enough to completely avoid the obstacle without colliding with surrounding walls or other objects. After the robot avoids the obstacle, the controller seamlessly connects the obstacle avoidance path with the original planned global path. By adjusting the path parameters of the connecting segment, the target robot can smoothly transition from the obstacle avoidance path back to the original path. At the same time, it ensures that the cleaning of subsequent areas can still be strictly performed according to the preset irregular boundary adaptation logic and dirt classification cleaning logic, without creating new cleaning blind spots due to temporary obstacle avoidance, thus ensuring the integrity of the entire sub-area cleaning task.
[0113] In this embodiment of the invention, a visual sensor scans and dynamically updates the pool's spatial structure model in real time, accurately capturing irregular boundary features and avoiding incomplete path coverage. Then, an underwater camera and deep learning algorithm are used to distinguish dirt types and quantify density, laying the foundation for precise resource allocation. Next, a map is constructed using multi-source environmental information to correct dirt identification errors caused by water reflection, ensuring data accuracy. This data is then converted into a dirt distribution heatmap, visually presenting the priority of cleaning needs. Finally, using the spatial structure model and dirt distribution heatmap, a global path is generated through an irregular boundary fitting algorithm, adapting to different pool types and avoiding bottlenecks in transition zones. Within each sub-region, the local path is adjusted based on the dirt distribution heatmap and the robot's real-time status, balancing efficiency and energy consumption, prioritizing cleaning high-demand areas. Thus, through pre-loaded global paths and real-time loaded local paths, the system can flexibly respond to dynamic changes in the environment and equipment during cleaning tasks, ensuring that cleaning parameters match the current pool wall area requiring cleaning, improving cleaning efficiency, ensuring cleaning coverage, effectively reducing blind spots, and significantly improving the quality of pool wall cleaning.
[0114] This invention provides an adaptive cleaning path planning system based on a swimming pool wall robot. The system includes: a modeling module for acquiring a spatial structure model of a target swimming pool; the spatial structure model is constructed based on the pool boundary contour and dynamically updated, the pool boundary contour being obtained through real-time scanning by a visual sensor; a correction module for acquiring wall images using an underwater camera; identifying the types of dirt contained in the wall images using a deep learning algorithm, and performing density identification of different types of dirt in the wall images through pixel grayscale value analysis to obtain dirt density data; collecting real-time environmental information of the target swimming pool to construct a wall environment map; and verifying the accuracy of the dirt density data by combining the wall environment map to correct errors in the dirt density data. The system addresses visual errors caused by water reflection; it constructs a dirt distribution heatmap by combining the dirt type and corrected dirt density data; a planning module generates a global path for the target robot to perform wall cleaning tasks in the target swimming pool using an irregular boundary fitting algorithm based on the spatial structure model and the dirt distribution heatmap; it adjusts the local paths of each sub-region in the global path based on the dirt distribution heatmap and the real-time operating status of the target robot to match the cleaning intensity within the sub-region with the local path density; and an execution module pre-loads the global path into the target robot and, after the target robot enters each sub-region, loads the local path corresponding to the current sub-region into the target robot to control the target robot to complete the wall cleaning task within each sub-region. In some embodiments, the adaptive cleaning path planning system based on the swimming pool wall robot can be applied to terminal devices. It should be noted that, for the sake of convenience and brevity, the specific working process of the adaptive cleaning path planning system based on the swimming pool wall robot described above can be referred to the corresponding process in the aforementioned embodiments of the adaptive cleaning path planning method based on the swimming pool wall robot, and will not be repeated here.
[0115] This invention provides a terminal device. The terminal device 300 includes a processor 301 and a memory 302, connected via a bus 303, such as an I2C bus. Specifically, the processor 301 provides computing and control capabilities to support the operation of the entire terminal device. The processor 301 can be a central processing unit, or it can be other general-purpose processors, digital signal processors, application-specific integrated circuits, field-programmable gate arrays (FPGAs), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Those skilled in the art will understand that the structures shown in the above embodiments are merely block diagrams of some structures related to the embodiments of this invention and do not constitute a limitation on the terminal device to which the embodiments of this invention are applied. A specific server may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. The processor is used to run a computer program stored in the memory and, when executing the computer program, implements any of the adaptive cleaning path planning methods based on a pool wall robot provided in this invention. It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the terminal device described above can be referred to the aforementioned embodiment of the adaptive cleaning path planning method based on a pool wall robot, and will not be repeated here.
[0116] This invention also provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs that can be executed by one or more processors to implement the steps of any of the adaptive cleaning path planning methods based on a pool wall robot as described in the specification of this invention.
Claims
1. An adaptive cleaning path planning method based on a pool wall robot, characterized in that, The method includes: A spatial structure model of the target swimming pool is obtained; the spatial structure model is constructed based on the pool boundary contour of the target swimming pool and is dynamically updated, and the pool boundary contour is obtained by real-time scanning through a visual sensor; An underwater camera is used to acquire images of the wall surface; a deep learning algorithm is used to identify the types of dirt contained in the wall surface images, and the density of different types of dirt in the wall surface images is identified by pixel grayscale value analysis to obtain dirt density data; Real-time environmental information of the target swimming pool is collected to construct a wall environment map. The accuracy of the fouling density data is verified by combining the wall environment map to correct visual errors caused by water reflection in the fouling density data. This includes: matching the fouling density data with the wall environment map in terms of spatial coordinates to determine the semantic labeling category of each area to be verified in the wall environment map; setting differentiated verification rules for candidate areas of fouling with different semantic labeling categories; for the marked areas to be verified, the fouling type and density level are directly determined based on the semantic labeling of the areas to be verified in the wall environment map; where the semantic labeling of the area to be verified is a sun-loving area prone to moss growth, it is determined to be a medium-density moss area; the semantic labeling of the area to be verified is a deep-water area prone to sediment accumulation, it is determined to be a high-density sediment area; the verified transfer data and the corrected optimized data are integrated to form the final fouling density data to eliminate visual errors caused by water reflection, weak light, and turbidity. A dirt distribution heatmap was constructed by combining the dirt types with the corrected dirt density data. Based on the spatial structure model and the dirt distribution heatmap, an irregular boundary fitting algorithm is used to generate a global path for the target robot to perform wall cleaning tasks in the target swimming pool. This includes: identifying the pool type and extracting parameters from the spatial structure model; analyzing the contour feature parameters in the spatial structure model to determine the pool type as circular, elliptical, irregular polygonal, or irregularly shaped pool, and extracting the core parameters corresponding to different pool types; specifically, for circular pools, extracting the center coordinates and radius; for elliptical pools, extracting the major / minor axis lengths and center coordinates; for irregular polygons, extracting the vertex coordinates and side lengths; and for irregularly shaped pools, extracting the corner radius parameters and the curvature radius of the transition area. The contour feature parameters include at least one of the following: the proportion of straight segments, the curvature distribution of curve segments, and the vertex coordinate distribution; constructing an irregular boundary fitting algorithm, using differentiated path generation methods for different pool types to obtain the boundary path; and then processing the boundary path... The path connection optimization is performed. For the first transition area between the vertical wall and the bottom of the pool, and the second transition area between the vertical wall and the edge of the pool, B-spline curve fitting is used to generate transition connection segments. The optimal fitting curve of the transition area arc is calculated by least squares method to reduce the deviation between the path curvature and the curvature of the transition area arc to a preset value. Dynamic parameter adjustment rules are set in the connection segment. The moving speed decreases linearly according to the curvature change, and the negative pressure adsorption pressure increases according to the wall tilt angle to obtain a global path. The generated global path is collision detected with the spatial structure model. If the distance between the global path and the boundary contour is less than the robot's preset safety distance, the path is corrected by an offset algorithm, and the path repetition rate is calculated. If the path repetition rate is greater than a set percentage, the path nodes are optimized by a genetic algorithm. The fitness function is the lowest path repetition rate, generating a global path that satisfies blind zone coverage and a path repetition rate less than a set percentage. The irregular boundary fitting algorithm is used to generate boundary paths in different pool types. The algorithm includes: if the pool type is circular or elliptical, an improved spiral interpolation algorithm is used to generate a global path. A polar coordinate system is established with the center of the circle as the origin. The dynamic adjustment coefficient of the spiral radius is calculated based on the length of the major or minor axis of the ellipse. The dynamic adjustment coefficient is the ratio of the minor axis length to the major axis length. The polar angle increment of each spiral is dynamically set according to the proportion of high-demand areas in the dirt distribution heat map. The spiral radius starts from the initial radius parameter and increases the robot cleaning width with each spiral until the entire pool area is covered. Based on the aforementioned dirt distribution heat map and the real-time operating status of the target robot, local path adjustments are made to each sub-region in the global path to match the cleaning intensity within the sub-region with the local path density. The global path is preloaded into the target robot, and after the target robot enters each sub-region, the local path corresponding to the current sub-region is loaded into the target robot to control the target robot to complete the wall cleaning task in each sub-region.
2. The adaptive cleaning path planning method based on a pool wall robot according to claim 1, characterized in that, The process of obtaining the spatial structure model of the target swimming pool includes: The target robot is controlled to execute a boundary cruise mode. Real-time images are collected along the edge of the target pool using the vision sensor on the target robot. The real-time images are processed using an image edge detection algorithm to extract the pool boundary contour. The image edge detection algorithm includes the adaptive weighted Canny algorithm. After extracting the pool boundary contour, the pool boundary contour is divided into straight segments and curved segments. The straight segments include the rectangular pool side, and the curved segments include the circular pool arc wall and the irregular pool edge corner. Contour feature parameters are generated based on the radius of curvature of the curve segment and the length of the transition area between the vertical wall and the pool bottom. The contour feature parameters include the length of the straight line segment, the radius of curvature of the curve segment, the length of the transition area, the vertex coordinates of the irregular polygon, the center coordinates and radius of the circular pool, and the center coordinates and major and minor axis lengths of the elliptical pool. The distance between the target robot and the pool wall is measured using ultrasonic sensors, and the pool boundary profile is corrected based on the measurement results. The corrected pool boundary contours are used to construct a spatial structure model of the target pool.
3. The adaptive cleaning path planning method based on a pool wall robot according to claim 2, characterized in that, The step of combining ultrasonic sensors to measure the distance between the target robot and the pool wall, and correcting the pool boundary profile based on the measurement results, includes: At key feature points of the pool boundary contour, ultrasonic sensors are controlled to emit sound waves and receive reflected signals. Key feature points include the endpoints of straight segments, the inflection points of curved segments, and the starting points of transition areas. The actual relative distance between the target robot and the corresponding pool wall is calculated based on the time difference between the emitted sound wave and the received reflected signal. The actual relative distance measured is compared with the boundary distance of the corresponding key feature point obtained by the visual sensor scanning. The boundary distance of the corresponding key feature point obtained by the visual sensor scanning is the visual recognition distance. If the difference between the actual relative distance and the visual recognition distance exceeds the set upper limit of the difference, the actual relative distance measured by the ultrasonic sensor will be used as the benchmark, and a multi-feature fusion correction algorithm will be used to correct the extracted pool boundary contour in order to eliminate the contour deviation caused by image blurring due to water impurities. The contour deviation includes misidentifying the curved pool edge as a straight line segment.
4. The adaptive cleaning path planning method based on a pool wall robot according to claim 3, characterized in that, The step of constructing a spatial structure model of the target swimming pool from the corrected pool boundary contour includes: The corrected pool boundary contour and contour feature parameters are converted into digital data. Based on the transformed digital data, a spatial structure model of the target swimming pool is constructed using a 3D reconstruction algorithm. If, during the subsequent cleaning process of the target robot, a dynamic change is detected in the outline of the pool boundary using a visual sensor or an ultrasonic sensor, including new boundaries formed by temporary objects, the outline of the pool boundary will be rescanned and corrected, and the spatial structure model will be updated simultaneously to ensure that the spatial structure model is consistent with the actual spatial structure of the target pool.
5. The adaptive cleaning path planning method based on a pool wall robot according to claim 1, characterized in that, The method involves using deep learning algorithms to identify the types of dirt contained in the wall image, and using pixel grayscale value analysis to identify the density of different types of dirt in the wall image, obtaining dirt density data, including: The underwater camera preprocesses the wall image, performing image denoising, image enhancement, and image segmentation operations in sequence. The image segmentation uses a combination of threshold segmentation and edge segmentation to divide the wall image into several independent dirt candidate regions, with the area of each dirt candidate region not less than a preset minimum region area threshold. An improved convolutional neural network model was constructed for dirt type identification. The improved convolutional neural network model is based on MobileNetV3 as the backbone network, with a CBAM attention module added to the neck of the network and a multi-classification output layer set at the head of the network. The CBAM attention module is used to strengthen the weight ratio of dirt features and suppress the interference of wall background and water reflection on feature extraction. The categories of the multi-classification output layer include moss, scale, silt, and fallen leaf debris, and the output layer uses the Softmax activation function to output the probability value of each dirt candidate region corresponding to each category of dirt. The preprocessed wall image is input into the improved CNN model. If the probability value of a certain type of dirt corresponding to a certain dirt candidate region is greater than the preset probability threshold, the dirt type of the current dirt candidate region is determined to be the current category. If the probability values of all categories are less than the preset probability threshold, the current dirt candidate region is marked as a region to be verified, so as to perform secondary confirmation of the region to be verified in combination with the wall environment map. Pixel grayscale value analysis is performed on the candidate dirt regions whose dirt types have been determined to achieve density identification. The grayscale values of all pixels in each dirt candidate region are extracted, and the statistical characteristics of the grayscale values are calculated, including grayscale mean, grayscale variance and grayscale distribution frequency. Different density grading standards are set for different types of dirt; The dirt type, density level, region coordinates, and region area of each dirt candidate region are integrated into structured data to form dirt density data. Among them, the density level corresponds one-to-one with the density quantization value, with a density quantization value of 3 for high-density areas, a density quantization value of 2 for medium-density areas, and a density quantization value of 1 for low-density areas.
6. The adaptive cleaning path planning method based on a pool wall robot according to claim 1, characterized in that, The method for setting differentiated verification rules for dirt candidate regions with different semantic annotation categories includes: If the semantic label of the dirt candidate area is a sun-loving moss-prone area, then verify whether the dirt type of the dirt candidate area is moss; if it is determined to be moss and the density level is high or medium density, and the temperature of the dirt candidate area in the wall environment map is higher than the surrounding area by a preset degree, then the dirt density data is determined to be accurate; if it is determined to be oil, then correct the dirt type to moss, and adjust the density level according to the temperature difference in the wall environment map; if the temperature difference in the wall environment map is greater than 2.5℃, then correct the density level to high density, and if the temperature difference is within the range of 2-2.5℃, then correct the density level to medium density. If the semantic label of the dirt candidate area is an area where oil easily adheres to the water surface, then verify whether the dirt type of the dirt candidate area is oil. If it is determined to be oil and the density level is medium / low density, and the oil concentration of the dirt candidate area in the wall environment map is greater than 5 mg / L, then the determination data is accurate. If it is determined to be a smooth wall surface, then correct the dirt type of the dirt candidate area to oil and modify the density level of the dirt candidate area to medium density. If the semantic label of the dirt candidate area is a deep water area prone to sediment accumulation, then verify whether the dirt type of the dirt candidate area is sediment; if it is determined to be sediment and the density level is high density, and the turbidity of the dirt candidate area in the wall environment map is greater than 20 NTU, then the determination data is accurate; if it is determined to be scale, then correct the dirt type of the dirt candidate area to sediment, while keeping the density level unchanged.
7. The adaptive cleaning path planning method based on a pool wall robot according to claim 4, characterized in that, The algorithm for constructing irregular boundary fitting uses differentiated path generation methods for different pool types to obtain boundary paths, including: If the pool type is an irregular polygon or a non-standard pool, a boundary-following partition fusion algorithm is used to generate a boundary path along the pool boundary. The path transition method is dynamically adjusted according to the type of pool wall corners. A Bézier curve transition is used for 90° right-angle corners, and an equal curvature curve transition is used for arc corners. The distance between the boundary path and the pool wall is maintained at 10-15cm. Adaptive partitioning is performed based on the polygon vertex coordinates and the dirt distribution heat map. An improved seed region growth algorithm is used, with high-demand areas as seed points. Triangular or trapezoidal sub-regions are divided according to a constraint preset kit that the dirt density difference within the region is less than 20% and the area of the region is not greater than the cleaning range of the target robot in 10 minutes. Each sub-region generates an adaptive mesh path based on the A* algorithm. The mesh node spacing is dynamically set according to the maximum dirt density of the sub-region.
8. An adaptive cleaning path planning system based on a pool wall robot, characterized in that, The system includes: The modeling module is used to obtain the spatial structure model of the target swimming pool; the spatial structure model is constructed based on the pool boundary contour of the target swimming pool and is dynamically updated, and the pool boundary contour is obtained by real-time scanning through a visual sensor; The correction module is used to acquire wall images using an underwater camera; identify the types of dirt contained in the wall images using a deep learning algorithm, and identify the density of different types of dirt in the wall images through pixel grayscale value analysis to obtain dirt density data; collect real-time environmental information of the target swimming pool to construct a wall environment map; verify the accuracy of the dirt density data by combining the wall environment map to correct visual errors caused by water reflection in the dirt density data; and construct a dirt distribution heat map by combining the dirt types and the corrected dirt density data. The correction module, in conjunction with the wall environment map, verifies the accuracy of the dirt density data to correct visual errors caused by water reflection in the dirt density data. Specifically, it performs spatial coordinate matching between the dirt density data and the wall environment map to determine the semantic label category corresponding to each area to be verified in the wall environment map; sets differentiated verification rules for dirt candidate areas with different semantic label categories; for the marked areas to be verified, directly determines the dirt type and density level based on the semantic label of the area to be verified in the wall environment map; where the semantic label of the area to be verified is a sun-prone area for moss growth, it is determined to be a medium-density moss area; the semantic label of the area to be verified is a deep-water area prone to sediment accumulation, it is determined to be a high-density sediment area; and integrates the verified data and the corrected optimized data to form the final dirt density data to eliminate visual errors caused by water reflection, weak light, and turbidity. The planning module is used to generate a global path for the target robot to perform wall cleaning tasks in the target swimming pool based on the spatial structure model and the dirt distribution heat map, using an irregular boundary fitting algorithm; and to adjust the local path of each sub-region in the global path based on the dirt distribution heat map and the real-time operating status of the target robot, so as to match the cleaning intensity in the sub-region with the local path density. The planning module, based on the spatial structure model and the dirt distribution heatmap, uses an irregular boundary fitting algorithm to generate a global path for the target robot to perform wall cleaning tasks in the target swimming pool. Specifically, it identifies the swimming pool type and extracts parameters from the spatial structure model. By analyzing the contour feature parameters in the spatial structure model, it determines the swimming pool type as circular, elliptical, irregular polygonal, or irregularly shaped pool, and extracts the core parameters corresponding to different pool types. Specifically, for circular pools, it extracts the center coordinates and radius; for elliptical pools, it extracts the major / minor axis lengths and center coordinates; for irregular polygons, it extracts the vertex coordinates and side lengths; and for irregularly shaped pools, it extracts the corner radius parameters and the curvature radius of the transition area. The contour feature parameters include at least one of the following: the proportion of straight segments, the curvature distribution of curve segments, and the vertex coordinate distribution. An irregular boundary fitting algorithm is constructed, employing differentiated path generation methods for different pool types to obtain the boundary paths. The boundary path is optimized by using B-spline curve fitting to generate transition sections for the first transition area between the vertical wall and the bottom of the pool, and the second transition area between the vertical wall and the edge of the pool. The optimal fitting curve of the transition area arc is calculated using the least squares method to reduce the deviation between the path curvature and the curvature of the transition area arc to a preset value. Dynamic parameter adjustment rules are set for the transition sections: the moving speed decreases linearly according to the curvature change, and the negative pressure adsorption pressure increases according to the wall tilt angle to obtain a global path. Collision detection is performed between the generated global path and the spatial structure model. If the distance between the global path and the boundary contour is less than the robot's preset safety distance, the path is corrected using an offset algorithm, and the path repetition rate is calculated. If the path repetition rate is greater than a set percentage, the path nodes are optimized using a genetic algorithm, with the lowest path repetition rate as the fitness function, to generate a global path that satisfies blind-spot coverage and a path repetition rate less than a set percentage. The planning module constructs an irregular boundary fitting algorithm and adopts differentiated path generation methods for different pool types. When obtaining the boundary path, it is specifically used as follows: If the pool type is circular or elliptical, an improved spiral interpolation algorithm is used to generate a global path. A polar coordinate system is established with the center of the circle as the origin. The dynamic adjustment coefficient of the spiral radius is calculated based on the length of the major or minor axis of the ellipse. The dynamic adjustment coefficient is the ratio of the minor axis length to the major axis length. The polar angle increment of each spiral is dynamically set according to the proportion of high-demand areas in the dirt distribution heat map. The spiral radius starts from the initial radius parameter and increases the robot cleaning width with each spiral until the entire pool area is covered. The execution module is used to preload the global path into the target robot, and after the target robot enters each sub-region, it loads the local path corresponding to the current sub-region into the target robot, so as to control the target robot to complete the wall cleaning task in each sub-region.
Citation Information
Patent Citations
Cleaning path planning management system and method for swimming pool cleaning robot
CN115648255A
Swimming pool robot path planning method and related equipment
CN117052205A
Path planning method, device and equipment for swimming pool cleaning equipment and storage medium
CN117928564A
Bow-shaped path planning method, system and equipment based on cleaning robot
CN120066058A
Water Surface Profile Cleaning Method and System of Robot Swimming Pool Cleaner, and Readable Storage Medium
US20240240482A1