A method and apparatus for in situ additive repair of an agricultural facility

CN122583598APending Publication Date: 2026-08-18GUANGDONG VOCATIONAL COLLEGE OF SCI & TRADE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611064892.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-17
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0002]传统农业设施修复采用人工巡检定位损伤、异地加工配件、现场安装修复的作业方式,整体流程依赖人工决策与操作,修复周期长、效率低,且易造成农业生产中断,难以满足规模化设施农业的高效运维需求

Benefits of technology

[0019]This invention discloses an in-situ additive repair method for agricultural facilities, which constructs an operational system that sequentially integrates environmental two-dimensional grid map construction, effective damage identification, repair task scheduling, repair navigation path planning, and in-situ additive repair. Compared to traditional repair methods that rely on manual inspection, off-site processing, and on-site installation, this method can autonomously complete all operational stages from environmental perception to repair completion. Through environmental perception, operational safety is ensured at the spatial planning level; through autonomous identification of effective damage, omissions, errors, and subjective judgment biases in manual inspections are avoided; through repair task scheduling, ineffective travel distances are reduced, driving energy consumption and operation time are lowered, and overall repair efficiency is improved; through navigation path planning, the optimality of the overall driving path is ensured, improving navigation flexibility and environmental adaptability; and through standardized execution of in-situ additive repair operations, the consistency of repair quality is ensured, avoiding quality fluctuations caused by differences in the level of manual repair.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122583598A_ABST
    Figure CN122583598A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of agricultural facility repair, and particularly relates to an agricultural facility in-situ additive repair method and device. Compared with the traditional repair mode which relies on manual inspection, off-site processing and on-site installation, the method can autonomously complete all work links from environmental perception to repair completion without manual intervention throughout the process, effectively shortening the repair cycle and reducing the labor cost of the operation and maintenance link. Through environmental perception, the safety of the work is ensured from the spatial planning level. Through autonomous identification of effective damage, the missed detection, wrong detection and subjective judgment deviation of manual inspection are avoided. Through repair task scheduling, the invalid moving distance is reduced, the driving energy consumption and work time consumption are reduced, and the overall repair efficiency is improved. Through navigation path planning, the optimality of the overall driving path is ensured, and the flexibility and environmental adaptability of navigation are improved. Through standardized execution of in-situ additive repair work, the consistency of repair quality is ensured, and the quality fluctuation caused by the level difference of manual repair is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of agricultural facility repair technology, and in particular to a method and apparatus for in-situ additive repair of agricultural facilities. Background Technology

[0002] Traditional agricultural facility repair relies on manual inspection to locate damage, off-site processing of parts, and on-site installation and repair. The entire process depends on manual decision-making and operation, resulting in long repair cycles, low efficiency, and potential disruption to agricultural production. This makes it difficult to meet the high-efficiency operation and maintenance needs of large-scale facility agriculture.

[0003] In recent years, mobile additive manufacturing and in-situ repair technologies have been gradually applied to multiple industrial fields, providing new technical paths for on-site repair operations. However, existing control methods and operation processes for in-situ repair still have many limitations and cannot be adapted to the operation and maintenance scenarios of agricultural facilities.

[0004] First, existing repair methods mostly adopt an open-loop control mode, relying on manual preset printing of target locations and repair models, or manual input of repair instructions by professionals after damage detection. They lack the ability to autonomously identify damage and make repair decisions, and cannot achieve unmanned inspection and repair operations.

[0005] Secondly, existing mobile repair systems rely heavily on satellite positioning signals for navigation. However, satellite positioning signals are weak or even ineffective in semi-enclosed or closed agricultural settings such as greenhouses. Deploying external positioning base stations would significantly increase application costs, making it difficult to achieve low-cost, high-precision autonomous navigation and positioning.

[0006] Furthermore, existing in-situ printing methods mostly employ fixed process parameters and lack real-time quality detection and parameter adaptive adjustment mechanisms during the printing process. They cannot dynamically optimize printing parameters to address issues such as unevenness of the repair surface or fluctuations in material properties, resulting in insufficient stability in repair quality.

[0007] It is evident that existing technologies still need improvement and enhancement. Summary of the Invention

[0008] In order to overcome the shortcomings of the existing technology, the purpose of this invention is to provide an in-situ additive repair method for agricultural facilities, which can autonomously complete all operation links from environmental perception to repair completion without human intervention throughout the process, effectively shortening the repair cycle and reducing the labor costs of operation and maintenance.

[0009] The first aspect of this invention provides a method for in-situ additive repair of agricultural facilities, comprising: acquiring multi-source sensing data and mapping image data; constructing a two-dimensional grid map based on the multi-source sensing data and mapping image data, wherein the location information of the agricultural facilities is marked in the two-dimensional grid map; acquiring an inspection image set collected based on a preset inspection path; generating multiple damage data entries based on the inspection image set; summarizing all the damage data entries; generating a repair task queue according to a preset priority rule; generating a repair navigation path corresponding to each damage data entry based on the two-dimensional grid map and the repair task queue; and performing in-situ additive repair of the agricultural facilities based on the repair task queue and the repair navigation path.

[0010] Optionally, in a first implementation of the first aspect of the present invention, the step of acquiring multi-source sensing data and mapping image data, and constructing a two-dimensional grid map based on the multi-source sensing data and mapping image data, includes: controlling an in-situ additive repair device for agricultural facilities to traverse the greenhouse area at a preset speed; continuously acquiring multi-source sensing data and mapping image data during the traversal; the multi-source sensing data including two-dimensional scanning data fed back by lidar, attitude data fed back by inertial measurement unit, and mileage data fed back by wheel encoder; the mapping image data including color images and depth images output by depth camera; sequentially performing timestamp alignment and data fusion processing on the multi-source sensing data, and performing inter-frame pose matching and motion state calculation to construct an initial two-dimensional grid map; extracting semantic features from the color images in the mapping image data to identify the pixel contours of agricultural facilities; converting the coordinates of the pixel contours into world coordinates and mapping them to the initial two-dimensional grid map to construct the two-dimensional grid map.

[0011] Optionally, in a second implementation of the first aspect of the present invention, the step of acquiring an inspection image set based on a preset inspection path and generating multiple damage data entries based on the inspection image set includes: controlling an agricultural facility in-situ additive repair device to travel along a preset inspection path; during the inspection process, acquiring environmental color images and corresponding depth images continuously acquired by a depth camera to construct an inspection image set; inputting each frame of color image in the inspection image set into a pre-trained target detection network, and determining whether there is effective damage in each frame of color image based on the output results; if there is effective damage in any frame of color image, acquiring the damage category, pixel bounding box, and confidence score of the effective damage, and mapping the pixel bounding box of the effective damage to the depth image corresponding to the color image to obtain the average depth value within the pixel bounding box; calculating the three-dimensional coordinates of the effective damage relative to the camera coordinate system based on the average depth value, and converting the three-dimensional coordinates into three-dimensional position coordinates in the world coordinate system; integrating the damage category, three-dimensional position coordinates, boundary size of the pixel bounding box, and confidence score as the damage data entry corresponding to the effective damage, and traversing all effective damages to obtain multiple damage data entries.

[0012] Optionally, in a third implementation of the first aspect of the present invention, the step of summarizing all the damage data entries and generating a repair task queue according to a preset priority rule includes: summarizing all damage data entries and extracting the damage category and three-dimensional position coordinates from each damage data entry; matching the corresponding emergency level according to the damage category and matching the standard repair model and recommended repair material corresponding to the damage category from a pre-built repair model library; calculating the estimated printing time corresponding to the damage data entry based on the volume of the matched standard repair model and the preset printing speed corresponding to the recommended repair material; performing an initial sorting of all damage data entries according to the emergency level, and performing a secondary sorting of damage data entries belonging to the same emergency level according to the three-dimensional position coordinates of the damage data entries; and integrating the standard repair model, recommended repair material, estimated printing time, and emergency level corresponding to each sorted damage data entry to generate a repair task queue.

[0013] Optionally, in a fourth implementation of the first aspect of the present invention, the step of generating a repair navigation path corresponding to each damage data entry based on the two-dimensional grid map and the repair task queue includes: for each damage data entry, extracting the three-dimensional position coordinates corresponding to the effective damage in the repair task queue, and simultaneously extracting obstacle grid information and agricultural facility location information from the two-dimensional grid map; based on the three-dimensional position coordinates of the effective damage, performing path search in the two-dimensional grid map using a global path planning algorithm to generate a globally collision-free path; based on the crop row area in the location information, setting crop row avoidance rules for the globally collision-free path with a distance not less than a preset safety distance; based on the crop row avoidance rules, adjusting the positions of each trajectory point of the globally collision-free path to obtain a safe collision-free path; and matching local dynamic obstacle avoidance algorithm parameters to the safe collision-free path to generate a repair navigation path corresponding to the damage data entry.

[0014] Optionally, in a fifth implementation of the first aspect of the present invention, the step of performing in-situ additive repair of agricultural facilities based on the repair task queue and the repair navigation path includes: for any valid damage, controlling the in-situ additive repair device of agricultural facilities to travel along the corresponding repair navigation path to the three-dimensional position coordinates, and reading the current real-time pose of the in-situ additive repair device of agricultural facilities; determining the target pose based on the standard repair model, comparing the current real-time pose and the target pose, and adjusting the position and attitude of the in-situ additive repair device of agricultural facilities based on the comparison result until the preset pose requirements are met; determining the three-dimensional bounding rectangle of the valid damage, determining the scanning reference plane based on the three-dimensional bounding rectangle, and constructing a height compensation matrix based on the scanning reference plane; performing in-situ additive repair on the valid damage based on the height compensation matrix and the standard repair model; when the in-situ additive repair of the valid damage is completed, detecting the repair quality, and determining whether the in-situ additive repair is completed based on the repair quality detection result.

[0015] Optionally, in a sixth implementation of the first aspect of the present invention, the in-situ additive repair device for agricultural facilities includes an air blowing device and a leveling sensor; the step of determining the three-dimensional circumscribed rectangle of the effective damage, determining the scanning reference plane based on the three-dimensional circumscribed rectangle, and constructing a height compensation matrix based on the scanning reference plane includes: determining the clean area of ​​the repair surface based on the three-dimensional circumscribed rectangle of the effective damage, activating the air blowing device to perform surface pretreatment on the clean area to obtain a clean repair surface; and planning a grid scanning path according to a preset number of rows and columns based on the planar range of the scanning reference plane, and determining each grid in the grid scanning path. The planar coordinates of the sampling points within the scanning reference plane are determined, and the reference sampling points are identified. The leveling sensor is controlled to move sequentially along the grid scanning path to directly above each grid sampling point, and the vertical distance between the leveling sensor and the clean repair surface is collected point by point to obtain the actual height value corresponding to each grid sampling point. The actual height value of the reference sampling point is extracted as the reference zero point. Using the reference zero point as a reference, the height difference between the actual height value of each grid sampling point and the reference zero point is calculated to obtain the height compensation value corresponding to each grid sampling point. The height compensation values ​​of each grid sampling point are integrated to generate a height compensation matrix that matches the clean repair surface.

[0016] Optionally, in a seventh implementation of the first aspect of the present invention, the in-situ additive repair device for agricultural facilities includes a print head; the step of performing in-situ additive repair on the effective damage based on the height compensation matrix and the standard repair model includes: registering and aligning the coordinate system of the standard repair model with the coordinate system of the three-dimensional bounding rectangle of the effective damage to generate a layered slicing path and determine the printing start position; matching the grid area compensation value corresponding to the printing start position from the height compensation matrix, and adjusting the initial Z-axis height of the print head based on the grid area compensation value, so that the distance between the extrusion end of the print head and the clean repair surface is... The process involves: meeting the preset first-layer printing thickness requirement; acquiring preset basic printing parameters; controlling the print head to perform melt extrusion printing layer by layer along the layer slicing path based on these parameters; pausing the printing process after completing a preset number of layers, acquiring the surface image and depth data of the current printed layer, detecting the interlayer bonding quality and edge warping using a texture analysis algorithm, and generating a printing quality detection result; adjusting the printing parameters based on the printing quality detection result, replacing the basic printing parameters with the adjusted parameters, and returning to execute the melt extrusion printing process based on the basic printing parameters.

[0017] Optionally, in the eighth implementation of the first aspect of the present invention, the step of detecting the repair quality when the in-situ additive repair of the effective damage is completed, and determining whether the in-situ additive repair is completed based on the repair quality detection result, includes: when the in-situ additive repair of the effective damage is completed, collecting the repair point cloud data of the repaired part, registering and aligning the repair point cloud data with the point cloud data of the standard repair model, and establishing a unified comparison coordinate system; under the comparison coordinate system, calculating the average deviation values ​​between the measured dimensions of the repaired part in the X-axis, Y-axis, and Z-axis directions and the corresponding dimensions of the standard repair model, and generating a three-dimensional dimension deviation dataset; comparing the three-dimensional dimension deviation dataset with a preset qualified deviation threshold one by one, and if the average deviation values ​​in all three directions are less than the qualified deviation threshold, then the in-situ additive repair is deemed qualified and the operation is marked as completed; if there is an average deviation value ≥ the qualified deviation threshold in at least one direction, then a supplementary printing path is generated based on the average deviation value in the corresponding direction.

[0018] A second aspect of the present invention provides an in-situ additive repair device for agricultural facilities, comprising a control unit and an omnidirectional mobile chassis, an environmental sensing unit, and an additive repair execution unit, all electrically connected to the control unit. The omnidirectional mobile chassis includes a chassis frame, three sets of omnidirectional wheels, and three drive servo motors. The three sets of omnidirectional wheels are evenly distributed and installed at the bottom of the chassis frame. Each drive servo motor is fixed to the inner side of the chassis frame, and the output shaft of each drive servo motor is drively connected to the corresponding omnidirectional wheel. The environmental sensing unit includes a lidar, a depth camera, an inertial measurement unit, and a wheel encoder. The lidar and the inertial measurement unit are respectively located at the center of the upper part of the chassis frame, the depth camera is located at the edge of the upper part of the chassis frame, and the wheel encoder is coaxially mounted with each drive servo motor in a one-to-one correspondence. The additive repair execution unit includes a robotic arm, a print head, and a leveling sensor. The fixed end of the robotic arm is fixed to the center of the upper part of the chassis frame by a mounting base. The print head is fixed to the end flange of the robotic arm. The leveling sensor is fixed to the side of the print head, and the orientation of the detection end of the leveling sensor is consistent with the printing extrusion end.

[0019] This invention discloses an in-situ additive repair method for agricultural facilities, which constructs an operational system that sequentially integrates environmental two-dimensional grid map construction, effective damage identification, repair task scheduling, repair navigation path planning, and in-situ additive repair. Compared to traditional repair methods that rely on manual inspection, off-site processing, and on-site installation, this method can autonomously complete all operational stages from environmental perception to repair completion. Through environmental perception, operational safety is ensured at the spatial planning level; through autonomous identification of effective damage, omissions, errors, and subjective judgment biases in manual inspections are avoided; through repair task scheduling, ineffective travel distances are reduced, driving energy consumption and operation time are lowered, and overall repair efficiency is improved; through navigation path planning, the optimality of the overall driving path is ensured, improving navigation flexibility and environmental adaptability; and through standardized execution of in-situ additive repair operations, the consistency of repair quality is ensured, avoiding quality fluctuations caused by differences in the level of manual repair. Attached Figure Description

[0020] Figure 1 A logic flowchart of the in-situ additive repair method for agricultural facilities provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of the in-situ additive repair device for agricultural facilities provided in an embodiment of the present invention; Explanation of key component symbols: 11-Chassis frame, 12-Omnidirectional wheel, 21-Depth camera, 31-Robotic arm, 32-Print head. Detailed Implementation

[0021] This invention provides a method, apparatus, device, and storage medium for in-situ additive repair of agricultural facilities. In this invention, the terms "first," "second," "third," "fourth," etc. (if applicable) in the specification, claims, and accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0022] This application discloses an in-situ additive repair method for agricultural facilities. For ease of understanding, the specific process of the embodiments of the present invention is described below, such as... Figure 1 As shown, one embodiment of the in-situ additive repair method for agricultural facilities in this invention includes: 101. Acquire multi-source sensing data and image data for mapping, and construct a two-dimensional grid map based on the multi-source sensing data and image data for mapping, wherein the location information of agricultural facilities is marked in the two-dimensional grid map; In this embodiment, a two-dimensional grid map is constructed using multi-source sensing data, which can eliminate the dependence on satellite positioning signals and adapt to the positioning needs of closed and semi-closed scenarios such as greenhouses. At the same time, the location information of agricultural facilities is marked on the constructed two-dimensional grid map, which allows subsequent navigation and operation processes to avoid crops and fixed facilities in advance, thus ensuring the safety of operations from the perspective of spatial planning.

[0023] 102. Obtain an inspection image set based on a preset inspection path, and generate multiple damage data entries based on the inspection image set; In this embodiment, the device acquires an inspection image set based on a preset inspection path, replacing the traditional manual inspection and damage identification mode. It can cover narrow areas that are difficult to reach by manual inspection, and the detection standard is uniform, avoiding missed detections, false detections, and subjective judgment biases in manual inspection. The generated structured damage data entries can be directly connected to the subsequent repair task scheduling without the need for manual secondary input and calibration, eliminating the positional errors of manual recording and improving the accuracy and efficiency of damage information transmission.

[0024] 103. Summarize all the damage data entries and generate a repair task queue according to a preset priority rule; In this embodiment, high-risk damage can be prioritized through priority rules to prevent the continuous expansion of high-risk damage from causing facility failure and ensuring agricultural production safety. Damage of the same level can be optimized and sorted according to spatial location to reduce the invalid travel distance of the device between different damage points, reduce travel energy consumption and operation time, and improve overall repair efficiency.

[0025] 104. Based on the two-dimensional grid map and the repair task queue, generate a repair navigation path corresponding to each damage data entry; In this embodiment, a repair navigation path is generated based on a two-dimensional grid map with labeled agricultural facility information. This path can actively avoid crop rows and fixed facilities, ensuring that crops are not crushed or facilities are not collided during the journey, thus adapting to the special passage requirements of greenhouse scenarios. The combination of global path planning and local dynamic obstacle avoidance not only ensures the optimization of the overall driving path but also copes with temporary obstacles that may appear during the operation, improving the flexibility and environmental adaptability of navigation.

[0026] 105. Based on the repair task queue and the repair navigation path, perform in-situ additive repair operations on agricultural facilities; In this embodiment, in-situ additive repair enables direct in-situ repair of effective damage without disassembling damaged facility components or waiting for finished parts to arrive. This significantly reduces waiting and transportation time, speeds up the restoration of facilities, and minimizes the duration of agricultural production interruptions caused by facility damage. Furthermore, the standardized in-situ additive repair process ensures consistent repair quality and avoids quality fluctuations caused by differences in the level of manual repair.

[0027] The in-situ additive repair method for agricultural facilities disclosed in this application constructs an operational system that sequentially integrates environmental two-dimensional grid map construction, effective damage identification, repair task scheduling, repair navigation path planning, and in-situ additive repair. Compared to traditional repair methods that rely on manual inspection, off-site processing, and on-site installation, this method can autonomously complete all operational stages from environmental perception to repair completion. Through environmental perception, operational safety is ensured at the spatial planning level; through autonomous identification of effective damage, omissions, errors, and subjective judgment biases in manual inspections are avoided; through repair task scheduling, ineffective travel distances are reduced, driving energy consumption and operation time are lowered, and overall repair efficiency is improved; through navigation path planning, the optimality of the overall driving path is ensured, improving navigation flexibility and environmental adaptability; and through standardized execution of in-situ additive repair operations, the consistency of repair quality is ensured, avoiding quality fluctuations caused by differences in the level of manual repair.

[0028] Furthermore, in this embodiment of the invention, the step of acquiring multi-source sensing data and mapping image data, and constructing a two-dimensional raster map based on the multi-source sensing data and mapping image data, includes: 201. Control the in-situ additive repair device for agricultural facilities to traverse the greenhouse area at a preset speed. During the traversal, continuously acquire multi-source sensing data and mapping image data. The multi-source sensing data includes two-dimensional scanning data fed back by lidar, attitude data fed back by inertial measurement unit, and mileage data fed back by wheel encoder. The mapping image data includes color images and depth images output by depth cameras. The timestamps of the color images and the corresponding depth images are synchronized and pixel-level registered. In this embodiment, the preset speed is the driving speed under mapping conditions, preferably 0.3m / s; the traversal path adopts grid-based path planning, traversing line by line along the greenhouse passage, and the coverage of adjacent paths retains a certain degree of overlap to ensure no mapping blind spots, providing a complete spatial foundation for subsequent full-area inspection and navigation.

[0029] 202. The multi-source sensing data is sequentially processed by timestamp alignment and data fusion, and inter-frame pose matching and motion state calculation are performed to construct an initial two-dimensional grid map. In this embodiment, the three types of sensing data are first aligned in a unified time dimension. Taking the sampling time point of the lidar as the reference, the discrete data of the inertial measurement unit and the wheel encoder are interpolated to the corresponding sampling time point using linear interpolation. This achieves timestamp synchronization of the three types of data, eliminates time misalignment caused by differences in sampling frequencies of different sensors, and avoids fusion pose distortion caused by time misalignment. After timestamp alignment, an extended Kalman filter algorithm is used for multi-source data fusion. The mileage data of the wheel encoder is used as the motion state prediction value, the attitude data of the inertial measurement unit is used as the high-frequency motion correction value, and the pose transformation obtained by inter-frame matching of the lidar is used as the observation update value. The three are fused to calculate the real-time pose of the device. Among them, the inter-frame pose matching adopts the iterative nearest point algorithm to perform registration operation on the lidar point clouds of two adjacent frames to obtain the pose transformation between the two frames. This is used to correct the cumulative drift of the wheel encoder and the inertial measurement unit, which can effectively offset the limitations of a single sensor and improve the accuracy and stability of pose calculation. Finally, based on the calculated continuous poses, all laser point clouds are projected onto the same coordinate system, and an initial two-dimensional grid map is generated using the grid occupancy method. In the constructed initial two-dimensional grid map, each grid is marked with an occupied or vacant state, indicating whether there are obstacles at the corresponding location, thus providing reliable spatial constraints for subsequent navigation planning.

[0030] 203. Extract semantic features from the color images in the image data used for mapping to identify the pixel outlines of agricultural facilities; In this embodiment, semantic feature extraction is achieved using a lightweight semantic segmentation network, specifically the BiSeNetV2 lightweight network, which is trained specifically for greenhouse scenarios. The training samples include images of three types of agricultural facilities—skeleton pillars, crop rows, and irrigation pipes—under different lighting conditions and angles, with no fewer than 500 images for each type. The lightweight semantic segmentation network outputs pixel-level classification results, where each pixel corresponds to its facility category. The pixel contours of each type of facility are obtained through edge extraction algorithms. During the recognition process, semantic extraction is performed only on areas within the depth camera's field of view and within 3 meters of the device. Areas beyond 3 meters have insufficient image precision and are not included in the extraction range to eliminate interference from low-precision images at long distances and improve the overall accuracy of facility recognition. The pixel-level facility contours obtained through semantic extraction provide accurate pixel references for subsequent coordinate transformation and map labeling, ensuring the accuracy of facility location labeling in the two-dimensional raster map.

[0031] 204. Convert the coordinates of the pixel outline into world coordinates and map them onto the initial two-dimensional raster map to construct the two-dimensional raster map; In this embodiment, the coordinate transformation is divided into two levels. The first level uses the intrinsic parameter matrix of the depth camera to convert the contour coordinates in the pixel coordinate system into three-dimensional coordinates in the camera coordinate system. The second level combines the real-time pose of the device when acquiring the color image frame and the extrinsic parameters of the depth camera relative to the device origin, and uses a homogeneous coordinate transformation matrix to convert the contour coordinates in the camera coordinate system into coordinates in the world coordinate system. This world coordinate system is consistent with the coordinate system of the initial two-dimensional raster map, realizing accurate mapping from pixel contours to the global map. After coordinate transformation, the world coordinates of the facility outline are mapped to the corresponding grids in the initial grid map. Different attribute labels are set for different types of facilities to distinguish the avoidance levels of crop rows, skeleton columns, and irrigation pipes, providing a reference for the subsequent implementation of differentiated avoidance strategies. Finally, the same facility outlines obtained from multiple frames are fused and deduplicated to eliminate random errors in single-frame recognition and avoid path planning anomalies caused by repeated labeling, ultimately resulting in a two-dimensional grid map labeled with the location information of agricultural facilities.

[0032] Furthermore, in this embodiment of the invention, the step of acquiring an inspection image set based on a preset inspection path and generating multiple damage data entries based on the inspection image set includes: 301. Control the in-situ additive repair device for agricultural facilities to travel along a preset inspection path. During the inspection, acquire environmental color images and corresponding depth images continuously collected by the depth camera to construct an inspection image set. In this embodiment, the preset inspection path is generated based on the constructed two-dimensional grid map and is laid out along the passage between crop rows. The path maintains a preset safe distance from the crop rows, that is, the safe distance between the path and the crop rows is not less than 0.3 meters, to ensure that the device will not scratch the crops during the movement. The depth camera realizes the synchronous acquisition of color images and depth images through a hardware triggering mechanism. Each set of output images includes a color image and a depth image with perfectly aligned timestamps, which can simultaneously provide visual features of damage and distance information, and the two correspond one-to-one at the pixel level, without spatial misalignment. The acquisition frame rate of the depth camera is set according to the inspection speed to ensure sufficient overlap of the field of view between two adjacent images and avoid missing damage targets. All continuously acquired synchronous image pairs are summarized to form an inspection image set, which is used to completely record the facility status of the entire inspection area and provide a comprehensive data source for damage identification.

[0033] 302. Input each frame of color image in the inspection image set into the pre-trained target detection network, and determine whether there is effective damage in each frame of color image based on the output results; In this embodiment, the pre-trained target detection network adopts a lightweight single-stage target detection architecture and is specifically trained for three types of typical agricultural facility damage in greenhouse scenarios. The training samples cover sample images with different lighting conditions, different shooting angles, and different damage degrees. The network output results include three types of information: damage category, bounding box pixel coordinates, and confidence level. A confidence level threshold is set as the criterion for determining valid damage, for example, 0.7. When the network output confidence level is greater than or equal to the preset confidence level threshold, the detection result is determined to be valid damage; otherwise, it is determined to be a false detection and is discarded.

[0034] 303. If there is a valid defect in any frame of color image, obtain the defect category, pixel bounding box and confidence level of the valid defect, and map the pixel bounding box of the valid defect to the depth image corresponding to the color image to obtain the average depth value within the pixel bounding box. In this embodiment, since the color image and depth image have been registered at the pixel level through hardware, the bounding box coordinates of the effective damage pixels in the color image can be directly applied to the same coordinate positions in the corresponding depth image to obtain a depth image block corresponding to the effective damage area. When calculating the depth value, invalid depth values ​​that are outside the effective detection range in the depth image block are first removed, that is, pixels with depth values ​​exceeding the range of 0.5 to 3 meters are removed. Then, the arithmetic mean of the remaining effective depth pixels is taken to obtain the average depth value of the effective damage area relative to the depth camera. Using the regional average value instead of the single-point depth value can offset the errors caused by noise fluctuations in the depth image and minor surface bumps, thereby improving the stability of depth detection.

[0035] 304. Calculate the three-dimensional coordinates of the effective damage relative to the camera coordinate system based on the average depth value, and convert the three-dimensional coordinates into three-dimensional position coordinates in the world coordinate system; In this embodiment, the center point of the pixel bounding box of the effective damage is first taken as the pixel representative point of the effective damage. Combined with the average depth value of the camera's intrinsic parameters, the three-dimensional coordinates of the center point in the camera coordinate system are calculated by the pinhole imaging model. Then, the real-time pose of the device when the color image frame is acquired is obtained. Combined with the extrinsic parameters of the depth camera relative to the device origin, the three-dimensional coordinates in the camera coordinate system are converted into three-dimensional position coordinates in the world coordinate system through a homogeneous coordinate transformation matrix. The world coordinate system is consistent with the coordinate system of the two-dimensional grid map, ensuring that the three-dimensional position coordinates of the effective damage area can be directly used for subsequent navigation.

[0036] 305. Integrate the damage category, three-dimensional location coordinates, and the boundary size and confidence of the pixel bounding box as the damage data entry corresponding to the effective damage. Iterate through all effective damages to obtain multiple damage data entries. In this embodiment, the boundary size of the pixel bounding box combined with the average depth value can be converted into the actual physical size of the effective damage, which is used to assist in assessing the severity of the damage. Each damage data entry is assigned a unique identification number to distinguish different damages. After traversing all image frames, all identified damages are deduplicated: if two damage data entries have the same damage category and the distance between their three-dimensional position coordinates is less than a preset overlap judgment threshold (preferably 10 cm), they are determined to be the same damage. The data entry with higher confidence is retained, and duplicate damage data entries are removed to avoid generating multiple duplicate tasks for the same damage, reduce invalid operations, and improve the accuracy of the task queue and the overall operation efficiency.

[0037] Furthermore, in this embodiment of the invention, the step of summarizing all the damage data entries and generating a repair task queue according to a preset priority rule includes: 401. Summarize all damage data entries and extract the damage category and three-dimensional location coordinates from each damage data entry; In this embodiment, the aggregation process incorporates all deduplicated valid damage data entries into the task scheduling cache and initially arranges them according to their identification numbers. The core damage categories and three-dimensional location coordinates are extracted as the core basis for scheduling and sorting, while the remaining information is stored synchronously for subsequent task content completion. During the extraction process, data validity is simultaneously verified to exclude invalid data with coordinates outside the map range or with abnormal categories, thus avoiding interference with subsequent scheduling logic.

[0038] 402. Match the corresponding emergency level according to the damage category, and match the standard repair model and recommended repair materials corresponding to the damage category from the pre-built repair model library; In this embodiment, the emergency level is divided into three levels based on the degree of impact of the damage on the facility's function and safety: Level 1 is emergency, corresponding to frame fracture damage, which directly affects the overall structural stability of the greenhouse and carries the highest risk, requiring priority repair; Level 2 is moderate, corresponding to pipe crack damage, which can lead to irrigation leaks and affect crop growth, and carries the next highest risk; Level 3 is minor, corresponding to support detachment damage, which is mostly due to non-load-bearing component failures and carries the lowest risk. Matching the emergency level to the damage type allows for the establishment of a risk-oriented scheduling principle, prioritizing the handling of high-risk damages, minimizing the risk of facility failure escalation, and ensuring agricultural production safety. The pre-built repair model library stores standardized repair models for three types of damage: skeleton fracture damage corresponds to the U-shaped reinforcement connector model, pipe crack damage corresponds to the clamp-type repair clip model, and support detachment damage corresponds to the L-shaped support bracket model. All models are parametric models and can adaptively adjust their specifications according to the damage size. Recommended repair materials are matched according to the stress and weather resistance requirements of the damage. For load-bearing frame repair, glass fiber reinforced nylon is recommended due to its high structural strength; for pipe repair, PETG is recommended due to its good sealing performance and water corrosion resistance; and for ordinary bracket repair, PLA is recommended due to its low cost and fast molding.

[0039] 403. Based on the volume of the matched standard repair model and the preset printing speed corresponding to the recommended repair material, calculate the estimated printing time corresponding to the damage data entry; In this embodiment, the total length of filament required for repair is first calculated based on the solid volume of the standard repair model and the filament diameter of the corresponding recommended repair material. Then, the pure printing time is calculated based on the standard printing speed corresponding to the recommended repair material. A 10% margin is reserved on the pure printing time to cover the time consumed by leveling, start-stop, interlayer detection, and other operations, and the estimated printing time is finally obtained. The quantified estimated printing time can provide an accurate basis for the overall work progress planning, which facilitates the device to reasonably plan the work sequence and improves the reliability of task planning.

[0040] 404. Sort all damage data entries initially according to the emergency level, and sort damage data entries belonging to the same emergency level a second time according to the three-dimensional location coordinates of the damage data entries. In this embodiment, the initial sorting follows the principle of priority based on urgency level. All Level 1 emergency damages are placed at the front of the task queue, followed by Level 2 general damages, and finally Level 3 minor damages. This ensures that high-risk tasks are executed first, follows the principle of risk control, and improves the safety of facility operation and maintenance. The secondary sorting within the same level adopts the nearest neighbor greedy algorithm. Starting from the current position of the device, the straight-line distance between the starting point and all damage points of the same level is calculated, and the closest one is selected as the next task to be executed. After the task is completed, the distance of the remaining damage points of the same level is recalculated from the position of the task as the new starting point, and so on, until all tasks of the same level are sorted. By sorting according to the distance of the same level, the total travel distance of the device can be effectively shortened, the time and energy consumption of ineffective movement can be reduced, and the overall operation efficiency can be improved.

[0041] 405. Integrate the standard repair model, recommended repair materials, estimated printing time and emergency level corresponding to each damage data item after sorting to generate a repair task queue; In this embodiment, each task node includes core information such as damage identification number, damage category, three-dimensional location coordinates, emergency level, standard repair model number, recommended repair materials, and estimated printing time. These are arranged sequentially according to the sorting results to form a structured repair task queue, which can provide complete task instructions for subsequent navigation and printing modules without the need for additional data queries, thus improving execution efficiency.

[0042] Furthermore, in this embodiment of the invention, generating a repair navigation path corresponding to each damage data entry based on the two-dimensional grid map and the repair task queue includes: 501. For each damage data entry, extract the three-dimensional location coordinates corresponding to the effective damage in the repair task queue, and at the same time extract the obstacle grid information and the location information of agricultural facilities in the two-dimensional grid map. In this embodiment, the location information of agricultural facilities includes crop rows, skeleton pillars, and irrigation pipe areas with attribute labels on the map. Crop rows belong to avoidance areas that require additional safety distance. During the extraction process, all impassable and avoidable areas are integrated into a set of constraints for path planning to avoid the risk of collision or squeezing of facilities during operation and improve navigation safety.

[0043] 502. Based on the three-dimensional location coordinates of effective damage, a global path planning algorithm is used to perform path search in a two-dimensional grid map to generate a globally collision-free path; In this embodiment, the global path planning algorithm adopts Dijkstra's shortest path search algorithm. Starting from the grid where the device is currently located, and ending at the dockable grid corresponding to the effective damage point, the algorithm searches for the shortest collision-free path from the starting point to the ending point within the passable area of ​​the two-dimensional grid map. The generated global collision-free path includes a series of continuous grid points, providing a clear execution benchmark for subsequent smoothing and chassis control.

[0044] 503. Based on the crop row area in the location information, set crop row avoidance rules with a minimum preset safety distance for the global collision-free path; In this embodiment, the preset safety distance is the minimum distance from the edge of the path to the edge of the crop row, for example, 0.3 meters. The value of the preset safety distance is set in combination with the chassis dimensions and the natural extension range of the crop branches, leaving sufficient safety margin to avoid the chassis scraping against the crop stems or branches during driving, causing crop damage. This is suitable for the characteristics of greenhouse agriculture and ensures agricultural production safety. The crop row avoidance rule is as follows: all trajectory points on the global collision-free path are at least a preset safe distance from the nearest crop row boundary; if there are trajectory points that do not meet the requirements, they are shifted away from the crop row until the safe distance constraint is met, so as to avoid damage to the crops during the operation.

[0045] 504. Based on the crop row avoidance rules, adjust the positions of each trajectory point of the global collision-free path to obtain a safe collision-free path; In this embodiment, the path adjustment adopts the local offset method. It sequentially traverses each trajectory point of the global collision-free path and calculates the distance of the trajectory point to the nearest crop row. If the safe distance requirement is not met, the trajectory point is translated away from the crop row along the direction perpendicular to the extension of the crop row until the safe distance requirement is met. During the translation, it is simultaneously checked whether the offset trajectory point is still in the passable area. If it enters the obstacle area after offset, the offset direction is adjusted and finely adjusted along the tangent direction of the path to meet the obstacle avoidance requirement as much as possible while ensuring passability. After the adjustment is completed, the discrete grid points are smoothed by cubic spline interpolation to obtain a continuous and smooth safe collision-free path, avoiding frequent turning during driving, reducing driving vibration and energy consumption, and reducing the adverse effects of vibration on subsequent printing operations.

[0046] 505. Match local dynamic obstacle avoidance algorithm parameters to the safe collision-free path and generate a repair navigation path corresponding to the damage data entry; In this embodiment, the local dynamic obstacle avoidance algorithm adopts the dynamic window method, which is adapted to the motion characteristics of the omnidirectional mobile chassis. It can dynamically adjust the driving speed and direction according to real-time LiDAR data to avoid temporarily appearing obstacles. The matched local dynamic obstacle avoidance algorithm parameters include maximum linear velocity, maximum angular velocity, and safe distance, all of which are set according to the chassis performance and the characteristics of the greenhouse scene. The final generated repair navigation path includes a global reference path and local obstacle avoidance parameters. During navigation execution, the global path is used as the reference, and the local algorithm responds to environmental changes in real time, taking into account both the optimization of the overall path and the adaptability to the on-site environment. It can effectively deal with unknown obstacles such as temporarily fallen branches and leaves and placed farm tools in the greenhouse, improving the flexibility and reliability of navigation.

[0047] Furthermore, in this embodiment of the invention, the step of performing in-situ additive repair work on agricultural facilities based on the repair task queue and the repair navigation path includes: 601. For any valid damage, after controlling the agricultural facility in-situ additive repair device to travel along the corresponding repair navigation path to the three-dimensional position coordinates, read the current real-time pose of the agricultural facility in-situ additive repair device; In this embodiment, the device autonomously travels along the repair navigation path during the driving process. Based on the data collected by the lidar, inertial measurement unit, and wheel encoder of the environmental perception unit, the real-time pose of the device is calculated through synchronous positioning and mapping algorithms, thereby realizing real-time positioning and pose correction. When the device reaches the vicinity of the target point, that is, when the straight-line distance from the corresponding effective damage three-dimensional position coordinate point is less than 0.1 meters, the omnidirectional moving chassis decelerates and enters the fine-tuning alignment mode. The current real-time pose, including the values ​​of the three dimensions of plane x-coordinate, plane y-coordinate and heading angle, is used as the benchmark for subsequent pose verification.

[0048] 602. Determine the target pose based on the standard repair model, compare the current real-time pose with the target pose, and adjust the position and attitude of the in-situ additive repair device for agricultural facilities based on the comparison results until the preset pose requirements are met. In this embodiment, the target pose is determined based on the location of the effective damage and the posture requirements of the in-situ repair operation. The target pose includes a target position and a target heading angle, used to ensure that the print head is directly facing the repair surface. The target position is a suitable stopping position directly in front of the damage point, ensuring that the robotic arm can completely cover the damaged area after extension. The target heading angle is the normal direction of the repair surface. Specifically, the target heading angle is obtained by fitting the plane containing the damaged area using point cloud data collected by a depth camera and employing a plane fitting algorithm, such as the RANSAC algorithm. The plane normal vector is calculated, and the target heading angle is obtained. The preset pose requirements include two parts: position deviation requirements and attitude deviation requirements. For example, the position deviation is no more than 5cm and the attitude deviation is no more than 5°. Both must be met simultaneously to determine that the positioning is qualified. Position and attitude adjustment is achieved through the motion characteristics of the omnidirectional moving chassis. When there is a positional deviation, it is corrected by omnidirectional translation based on the positional deviation value, achieving translation in any direction without turning. When there is an attitude deviation, it is corrected by zero-radius rotation in place based on the attitude deviation value, adjusting the heading without moving the position. The translation and rotation characteristics of the omnidirectional moving chassis enable precise position and attitude adjustment in narrow greenhouse passages without requiring a large turning space, making it highly adaptable to various scenarios.

[0049] 603. Determine the three-dimensional bounding rectangle of the effective damage, determine the scanning reference plane based on the three-dimensional bounding rectangle, and construct a height compensation matrix based on the scanning reference plane; In this embodiment, the three-dimensional circumscribed rectangle is the smallest rectangle that encloses the entire damaged area. It extends along the plane of the repair surface, with both its length and width being 20 mm larger than the damaged area to allow for printing margins and prevent incomplete repair at the edges. The scanning reference plane is a plane parallel to the repair surface and 20 mm away from it. The leveling sensor moves and scans along this plane to ensure that the leveling sensor maintains a reasonable detection distance from the surface, thus improving the accuracy of height detection. By constructing a height compensation matrix, the unevenness of the repair surface can be offset, ensuring the adhesion of the first layer and the consistency of the overall printed layer height.

[0050] 604. Based on the height compensation matrix and the standard repair model, perform in-situ additive repair on the effective damage; In this embodiment, before the operation, the standard repair model is registered and aligned with the damaged area, and the model coordinates of the standard repair model are matched with the world coordinates to ensure that the model accurately covers the damaged location, thereby improving the repair strength and sealing performance. During the printing process, each time the print head moves to a grid position, the corresponding compensation value in the height compensation matrix is ​​called to adjust the Z-axis height of the print head in real time to compensate for the surface undulations. The printing process parameters are preset according to the recommended repair material, including printing temperature, printing speed, infill density, layer thickness, etc., to ensure stable printing quality and eliminate the differences caused by manual operation.

[0051] 605. When the in-situ additive repair work for the effective damage is completed, the repair quality is tested, and the in-situ additive repair work is judged based on the repair quality test results. In this embodiment, the repair quality inspection adopts the three-dimensional point cloud comparison method. The three-dimensional point cloud of the repaired part is collected by a depth camera and registered and compared with the point cloud of the standard repair model to calculate the dimensional deviation. If the deviation in all directions is within the qualified range, the repair is judged to be qualified and the operation is completed. If the deviation exceeds the range, a reprint path is generated for supplementary printing. After reprinting, the inspection is carried out again until it is qualified. The completion quality inspection can ensure that the repair quality meets the requirements, and the reprinting mechanism can supplement the repair of parts with insufficient dimensions, improve the pass rate of repair, and avoid rework. The two work together to ensure the repair strength and service life of agricultural facilities.

[0052] Further, in this embodiment of the invention, the in-situ additive repair device for agricultural facilities includes an air blowing device and a leveling sensor; the process of determining the three-dimensional circumscribed rectangle of the effective damage, determining the scanning reference plane based on the three-dimensional circumscribed rectangle, and constructing a height compensation matrix based on the scanning reference plane includes: 701. Based on the three-dimensional bounding rectangle of the effective damage, determine the clean area of ​​the repair surface, and start the air blowing device to perform surface pretreatment on the clean area to obtain a clean repair surface. In this embodiment, the cleaning area is 10 mm larger than the three-dimensional circumscribed rectangle to ensure that the entire repair area is cleaned. The air blowing device is a miniature high-pressure air pump with a nozzle aimed at the repair surface. Its preset operating parameters include an air pressure of 0.2 MPa and a blowing time of 3 seconds. The blowing direction is at a 30° to 45° angle to the repair surface to avoid blowing dust towards the print head or camera lens. By using the air blowing device to perform pre-cleaning of the repair area surface based on the preset operating parameters, the influence of dust, dirt, and water stains on the printing adhesion strength can be eliminated, ensuring that the repair material is tightly bonded to the original facility surface, thereby improving the repair strength and durability.

[0053] 702. Based on the planar range of the scanning reference plane, plan a grid scanning path according to a preset number of rows and columns, determine the planar coordinates of each grid sampling point in the scanning reference plane, and determine the reference sampling point; In this embodiment, the preset number of rows and columns is 5 rows and 5 columns, with a total of 25 sampling points. The grid sampling points are evenly distributed in the scanning reference plane, and the planar coordinates of each grid sampling point correspond to the corresponding position on the repair surface. The reference sampling point is set as the center point of the grid, that is, the sampling point in the 3rd row and 3rd column. This point is located in the core position of the damaged area. Using this as a height reference can ensure the layer height accuracy of the core area.

[0054] 703. Control the leveling sensor to move sequentially along the grid scanning path to directly above each grid sampling point, collect the vertical distance between the leveling sensor and the clean repair surface point by point, and obtain the actual height value corresponding to each grid sampling point; In this embodiment, the leveling sensor is a non-contact proximity sensor installed on the side of the printhead, with the detection end facing the same direction as the printing extrusion end. The height difference between the two is pre-calibrated, and the distance from the printhead end face to the repair surface can be directly calculated. During the scanning process, the robotic arm drives the printhead and the leveling sensor to move synchronously, moving point by point along the grid scanning path. Each grid sampling point is paused for 0.2 seconds, and the distance value is collected after the reading stabilizes. If the reading exceeds the sensor's range during the collection process, it is marked as an abnormal point and recorded. Subsequently, a compensation value is calculated through neighborhood interpolation to ensure the accuracy of the collected actual height value.

[0055] 704. Extract the actual height value of the reference sampling point as the reference zero point. Using the reference zero point as a reference, calculate the height difference between the actual height value of each grid sampling point and the reference zero point to obtain the height compensation value corresponding to each grid sampling point. In this embodiment, the height difference = actual height value - reference zero value. A positive result indicates that the surface of the grid sampling point is higher than the reference sampling point, and a negative result indicates that the surface of the grid sampling point is lower than the reference sampling point. The height compensation value is equal in magnitude and opposite in direction to the height difference value. That is, the print head is raised accordingly when the surface is higher and lowered accordingly when the surface is lower, ensuring that the distance between the print head extrusion end and the repair surface is always maintained at the first layer set height, avoiding problems such as local poor adhesion or local filament blockage.

[0056] 705. Integrate the height compensation values ​​of each grid sampling point to generate a height compensation matrix that matches the clean repair surface; In this embodiment, the height compensation matrix is ​​a two-dimensional array of 5 rows and 5 columns. The array elements correspond one-to-one with the grid sampling points and store the height compensation values ​​at the corresponding positions in millimeters. For the area between grids, the compensation value at the corresponding position is calculated using bilinear interpolation to ensure a smooth transition of compensation in the entire repair area, avoid abrupt changes in compensation between grid sampling points, thereby avoiding the occurrence of abrupt steps and improving the printing quality of uneven surfaces.

[0057] Furthermore, in this embodiment of the invention, the in-situ additive repair device for agricultural facilities includes a printhead; the in-situ additive repair operation on the effective damage based on the height compensation matrix and the standard repair model includes: 801. Register and align the coordinate system of the standard repair model with the coordinate system of the three-dimensional bounding rectangle of the effective damage to generate a layered slicing path and determine the printing start position; In this embodiment, the registration and alignment adopts the three-point feature registration method, which selects three feature corner points of the damaged area and matches them one by one with the three corresponding reference points of the standard repair model. The standard repair model is aligned to the damaged position through coordinate transformation to ensure that the model covers the damaged area. The layered slicing adopts an equal-thickness layered slicing algorithm based on the STL 3D model. First, the registered standard repair model is sliced ​​at equal intervals along the Z-axis with a preset layer thickness, such as 0.2 mm, to obtain the cross-sectional contour of each layer. Then, the wall thickness path is generated by the contour offset algorithm, and the internal filling path is generated by the scan line filling algorithm. Finally, the contour path and the filling path are combined to form the complete printing path of each layer. The sum of the printing paths of all layers is the layered slicing path. The printing start position is selected at the corner of the repair area, which is not a core stress position, to avoid the printing start defect appearing in the main stress area, affecting the repair strength and improving the overall structural reliability of the repaired part.

[0058] 802. Match the grid area compensation value corresponding to the printing start position from the height compensation matrix, and adjust the initial Z-axis height of the print head based on the grid area compensation value so that the distance between the extrusion end of the print head and the clean repair surface meets the preset first layer printing thickness requirement. In this embodiment, the printing start point is first determined to fall within a specific grid area of ​​the height compensation matrix. The corresponding height compensation value is then called and superimposed onto the initial Z-axis height of the print head to complete the initial height adjustment. This initial height compensation ensures the accuracy of the first layer's print height, maintaining a suitable extrusion gap between the print head and the repair surface. This prevents the gap from being too large, leading to poor adhesion, or too small, causing filament blockage or nozzle scratching. After adjustment, the distance between the print head and the repair area surface is re-verified using a leveling sensor to confirm that the gap meets the 0.2 mm requirement for the first layer's print thickness. If any deviation exists, a minor correction is made to ensure that the first layer of filament can be fully extruded and bonded to the repair area surface.

[0059] 803. Obtain preset basic printing parameters, and control the print head to perform melt extrusion printing operations layer by layer along the layered slicing path based on the basic printing parameters; In this embodiment, the basic printing parameters are the standard parameters corresponding to the recommended repair materials. Taking PETG material as an example, its basic printing parameters are set as follows: printing temperature 230°C, heated bed temperature none, printing speed 30 mm / s, fill density 80%, wall thickness 3 mm, and cooling fan speed 50%. The printing process is driven by a robotic arm to move the print head, and the extruder feeds filaments synchronously. The print head is printed layer by layer according to the layer slicing path. After each layer is printed, the print head is raised to the height of one layer thickness and then continues to print the next layer.

[0060] 804. After printing a preset number of layers, pause the printing action, collect the surface image and depth data of the current printed layer, and use a texture analysis algorithm to detect the interlayer bonding quality and edge warping, and generate print quality detection results. In this embodiment, the preset number of layers is 5, meaning a quality inspection is performed every 5 layers. During the printing quality inspection, the robotic arm moves the print head away, allowing the depth camera to face the surface of the current printed layer and acquire clear surface color images and depth data. Texture analysis uses a gray-level co-occurrence matrix algorithm: first, the color image is converted to a gray-level image; then, a gray-level co-occurrence matrix is ​​constructed by selecting adjacent pixels with a distance of 1 and simultaneously covering four directions: 0°, 45°, 90°, and 135°; and the generated gray-level co-occurrence matrix is ​​then subjected to probability normalization. Subsequently, based on the normalized gray-level co-occurrence matrix, four texture feature parameters—contrast, energy, entropy, and correlation—are calculated. The extreme value normalization of each of the four texture feature parameters is then performed, mapping the values ​​of each parameter uniformly to (0, 0, ...). Within the numerical range of [1], the influence of differences in the dimensions of different feature parameters is eliminated; then, the four texture feature parameters after extreme value normalization are weighted and summed according to their corresponding weight coefficients to obtain the texture consistency index. Among them, the weight coefficient corresponding to contrast is 0.3, the weight coefficient corresponding to energy is 0.25, the weight coefficient corresponding to entropy is 0.25, and the weight coefficient corresponding to correlation is 0.2. The final value range of the texture consistency index is (0, 1]. The lower the calculated texture consistency index, the more obvious the interlayer gaps and unevenness, and the worse the interlayer bonding quality. At the same time, the height difference of the printed edge is extracted by the depth data. The larger the height difference, the more serious the warping. The final output includes the printing quality detection result including the interlayer bonding quality level and the warping level. Regular interlayer quality inspections can detect early defects in the printing process in a timely manner, preventing defects from continuing to expand and causing the entire repair part to be scrapped, thus reducing the waste of materials and time. It can detect two common defects, interlayer bonding and warping, covering the main quality problems of FDM printing, and has the advantage of comprehensive inspection.

[0061] 805. Adjust the printing parameters according to the printing quality test results, replace the basic printing parameters with the adjusted printing parameters, and return to execute the melt extrusion printing operation layer by layer along the layered slicing path based on the basic printing parameters. In this embodiment, when the texture consistency index is <0.6, it is determined to be poor interlayer bonding. At this time, the printing temperature is increased by 5°C and the printing speed is reduced by 10%. When the height difference is >0.3mm, it is determined to be a warping defect. At this time, the printing temperature is reduced by 5°C and the printing speed is reduced by 10%. If both types of defects exist simultaneously, the warping defect is dealt with first, and the printing is adjusted according to the warping rules. After the printing parameters are adjusted, subsequent printing is performed according to the new parameters. After two consecutive layers are tested and found to be qualified, the parameters are gradually restored to the basic value to ensure printing efficiency. Targeted parameter adjustment strategies can effectively improve the corresponding defects and improve printing quality. Dynamic parameter adjustment can adapt to the fluctuations in the working conditions during the printing process, such as changes in ambient temperature and fluctuations in material properties, thereby improving the stability of printing quality.

[0062] Further, in this embodiment of the invention, when the in-situ additive repair work on the effective damage is completed, detecting the repair quality and determining whether the in-situ additive repair work is completed based on the repair quality detection result includes: 901. When the in-situ additive repair of the effective damage is completed, the repair point cloud data of the repaired part is collected, and the repair point cloud data is registered and aligned with the point cloud data of the standard repair model to establish a unified comparison coordinate system. In this embodiment, the repair component refers to a solid structure printed on the damaged part of the agricultural facility through in-situ additive manufacturing. This solid structure is bonded to the original agricultural facility substrate and is used to reinforce the fractured part, seal the cracked part, or support the detached part, thereby restoring the structural function and performance of the agricultural facility. When collecting and repairing point cloud data, a depth camera is used to acquire the depth point cloud of the repaired part, and a complete 3D point cloud model of the repaired part is obtained through a point cloud stitching algorithm. Point cloud registration adopts an iterative nearest point algorithm. The point cloud of the standard repair model is used as a reference, and the coordinate transformation of the measured point cloud of the repaired part is performed to minimize the distance between the corresponding points of the two, so as to achieve accurate alignment. Finally, the two are incorporated into a unified comparison coordinate system to ensure that the reference for subsequent deviation calculation is consistent.

[0063] 902. Under the comparison coordinate system, calculate the average deviation between the measured dimensions of the repaired part and the corresponding dimensions of the standard repair model in the three directions of X-axis, Y-axis and Z-axis, respectively, and generate a three-dimensional dimension deviation dataset. In this embodiment, the dimension calculation selects the characteristic dimensions of the repaired part, with the X-axis representing the length direction, the Y-axis representing the width direction, and the Z-axis representing the height direction. Three characteristic sections are selected for each direction to calculate the dimension, and the average value is taken as the measured dimension in that direction. The average deviation value = measured dimension - standard dimension. A positive value indicates that the dimension is too large, and a negative value indicates that the dimension is too small. The three-dimensional dimension deviation dataset includes the average deviation value in the three directions and the overall maximum deviation value to reflect the dimension deviation of the repaired part.

[0064] 903. Compare the three-dimensional size deviation dataset with the preset qualified deviation threshold one by one. If the average deviation value in all three directions is less than the qualified deviation threshold, the in-situ additive repair operation is deemed qualified and the operation is marked as completed. In this embodiment, the preset acceptable deviation threshold is 1 mm, that is, when the absolute value of the average deviation in all three directions is less than 1 mm, it is judged as acceptable; after being judged as acceptable, the system marks the in-situ additive repair operation as completed, updates the status of the repair task queue, and records the quality inspection results to facilitate task progress tracking.

[0065] 904. If the average deviation value in at least one direction is greater than or equal to the acceptable deviation threshold, a supplementary printing path shall be generated based on the average deviation value in the corresponding direction. In this embodiment, the supplementary printing thickness is calculated based on the deviation value. The supplementary printing thickness is the absolute value of the deviation value, plus an additional 0.2 mm margin to ensure that the size meets the standard after supplementary printing. The supplementary printing path of the supplementary printing area is generated using the same scan line filling algorithm as the original slice. After the supplementary printing is completed, the printing quality is checked again until it is qualified.

[0066] In this embodiment of the invention, after a single in-situ additive repair operation is completed, all data of the entire operation process are summarized and archived, including damage identification records, navigation driving data, printing process parameters, process quality inspection data, finished quality inspection data, consumable usage, operation time and other full-dimensional information to form a complete repair file. Each repair file is associated with the unique identifier and damage number of the corresponding facility, and can be queried and traced by facility number, damage number, time range and other dimensions. Once all tasks in the repair task queue are completed, an operation and maintenance report is generated, summarizing key indicators such as the coverage area of ​​this inspection, the total number of damages found, the number of repairs completed, the quality pass rate, and the total amount of consumables used, providing data support for facility operation and maintenance management.

[0067] The above describes the in-situ additive repair method for agricultural facilities in embodiments of the present invention. The following describes the in-situ additive repair device for agricultural facilities in embodiments of the present invention. Please refer to [link / reference]. Figure 2 One embodiment of the in-situ additive repair device for agricultural facilities in this invention includes a control unit and an omnidirectional mobile chassis, an environmental sensing unit, and an additive repair execution unit, all of which are electrically connected to the control unit. The omnidirectional mobile chassis includes a chassis frame 11, three sets of omnidirectional wheels 12 and three drive servo motors. The three sets of omnidirectional wheels 12 are evenly distributed and installed on the bottom of the chassis frame. Each drive servo motor is fixed inside the chassis frame 11, and the output shaft of the drive servo motor is connected to the corresponding omnidirectional wheel 12 for transmission. In this embodiment, an installation platform is laid on the upper part of the chassis frame 11; the omnidirectional wheels 12 are adaptable to various greenhouse ground surfaces such as soil and cement, and the three omnidirectional wheels 12 are evenly distributed at 120° and installed at the bottom of the chassis frame 11; the wheel frame of each omnidirectional wheel 12 is fixed to the bottom profile of the chassis frame 11 by bolts, and the wheel axle is installed in the wheel frame by a deep groove ball bearing; the drive servo motor is fixed to the corresponding mounting position inside the chassis frame 11 by a motor mount, and its output shaft is coaxially connected to the wheel axle of the omnidirectional wheel 12 by a flexible coupling; the three drive servo motors are driven independently, and by the speed difference, they can realize translation in any direction in the plane and rotation in place with zero radius, adapting to the passage requirements of narrow passages.

[0068] The environmental perception unit includes a lidar, a depth camera 21, an inertial measurement unit, and a wheel encoder. The lidar and the inertial measurement unit are respectively located at the center of the upper part of the chassis frame 11, the depth camera 21 is located at the edge of the upper part of the chassis frame 11, and the wheel encoder is coaxially mounted with each drive servo motor in a corresponding manner. In this embodiment, the lidar is a two-dimensional lidar, which is fixed to the center of the mounting platform by a mounting column. The bottom of the mounting column is locked to the mounting platform by bolts, and its top flange is connected to the lidar base. The scanning plane of the lidar is parallel to the horizontal plane of the chassis, which can realize 360° horizontal scanning without obstruction. It is used to collect two-dimensional contour point cloud data of the environment, providing a data source for mapping, navigation and obstacle avoidance.

[0069] In this embodiment, the depth camera 21 is an integrated RGB-D depth camera, which is fixed to the middle of the front edge of the mounting platform by an adjustable angle bracket. The bottom of the adjustable angle bracket is fixed to the mounting platform by bolts. The upper part of the adjustable angle bracket is provided with a rotating shaft and a locking knob, which can adjust the pitch angle of the camera. After adjustment, the camera is locked by the knob. The lens of the depth camera faces the forward direction of the chassis frame 11, and can simultaneously acquire color images and depth images of the environment. The two are hardware synchronized and pixel-level registered, providing data for facility identification, damage detection, and 3D measurement.

[0070] The inertial measurement unit is a nine-axis inertial measurement unit, which is directly fixed to the center of the mounting platform with countersunk screws. It can collect motion data such as angular velocity, acceleration, and attitude angle, providing an attitude data source for SLAM positioning and motion control.

[0071] The wheel encoder is a photoelectric encoder, which is fixed to the tail end cover of the corresponding drive servo motor by screws. The input shaft of the wheel encoder is coaxially connected to the rear end of the output shaft of the drive servo motor, which can collect the motor speed and angle data in real time, calculate the mileage of the wheel, and provide data support for odometer and SLAM positioning.

[0072] The additive repair execution unit includes a robotic arm 31, a print head 32, and a leveling sensor. The fixed end of the robotic arm 31 is fixed to the center position of the upper part of the chassis frame 11 by a mounting base. The print head 32 is fixed to the end flange of the robotic arm 31. The leveling sensor is fixed to the side of the print head 32, and the orientation of the detection end of the leveling sensor is consistent with the printing extrusion end. In this embodiment, the robotic arm 31 is a 3-DOF robotic arm, and its root is fixed to one side of the mounting platform by a flange mounting seat. A rubber shock-absorbing pad is provided between the flange mounting seat and the connection surface of the root of the robotic arm 31, which can attenuate the vibration generated by the movement of the chassis and transmit it to the robotic arm 31 and the print head 32, thereby improving printing stability. The printhead 32 is an FDM (Fused Deposition Modeling) printhead, equipped with a dual-gear extrusion mechanism to ensure stable feeding. The printhead 32 is fixed to the end flange of the robotic arm 31 by a ring clamp. The ring clamp is an aluminum alloy open structure, which is fitted onto the housing of the printhead 32 and locked in place by bolts. The extrusion end of the printhead 32 faces the working space outside the robotic arm 31. Through the joint movement of the robotic arm 31, it can extend to the outside of the chassis contour and directly contact the surface to be repaired to achieve in-situ printing. The leveling sensor is a non-contact proximity sensor, which is fixed to the side of the print head 32 by an L-shaped mounting bracket. The vertical side of the L-shaped bracket is fixed to the side wall of the print head 32 housing by bolts, and the horizontal side has a mounting hole. The leveling sensor passes through the mounting hole and is locked in place by a nut. The detection end of the leveling sensor is aligned with the extrusion end of the print head 32.

[0073] The control unit adopts an embedded industrial control board, which is fixed in the inner cavity of the installation platform. The control unit is connected to the hardware unit through signal lines to realize data acquisition, calculation and processing, instruction issuance and full-process scheduling.

[0074] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for in-situ additive repair of agricultural facilities, characterized in that, include: Acquire multi-source sensing data and image data for mapping, and construct a two-dimensional grid map based on the multi-source sensing data and image data for mapping. The location information of agricultural facilities is marked in the two-dimensional grid map. Obtain a set of inspection images collected based on a preset inspection path, and generate multiple damage data entries based on the inspection image set; All damage data entries are aggregated, and a repair task queue is generated according to a preset priority rule; Based on the two-dimensional grid map and the repair task queue, a repair navigation path is generated corresponding to each damage data entry; Based on the repair task queue and the repair navigation path, in-situ additive repair operations are performed on agricultural facilities.

2. The in-situ additive repair method for agricultural facilities according to claim 1, characterized in that, The acquisition of multi-source sensing data and image data for mapping, and the construction of a two-dimensional raster map based on the multi-source sensing data and image data for mapping, includes: The in-situ additive repair device for agricultural facilities is controlled to traverse the greenhouse area at a preset speed. During the traversal, multi-source sensing data and mapping image data are continuously acquired. The multi-source sensing data includes two-dimensional scanning data fed back by lidar, attitude data fed back by inertial measurement unit, and mileage data fed back by wheel encoder. The mapping image data includes color images and depth images output by depth camera. The multi-source sensing data is sequentially processed by timestamp alignment and data fusion, and inter-frame pose matching and motion state calculation are performed to construct an initial two-dimensional grid map. Semantic features are extracted from the color images in the image data used for mapping to identify the pixel outlines of agricultural facilities; The coordinates of the pixel outline are converted into world coordinates and mapped onto the initial two-dimensional raster map to construct the two-dimensional raster map.

3. The in-situ additive repair method for agricultural facilities according to claim 2, characterized in that, The process involves acquiring a set of inspection images based on a preset inspection path, and generating multiple damage data entries based on the inspection image set, including: The in-situ additive repair device for agricultural facilities is controlled to travel along a preset inspection path. During the inspection, environmental color images and corresponding depth images are continuously acquired by a depth camera to construct an inspection image set. Each frame of color image in the inspection image set is input into a pre-trained target detection network, and the output results are used to determine whether there is any effective damage in each frame of color image. If there is a valid defect in any frame of the color image, the defect category, pixel bounding box and confidence level of the valid defect are obtained, and the pixel bounding box of the valid defect is mapped to the depth image corresponding to the color image to obtain the average depth value within the pixel bounding box. The three-dimensional coordinates of the effective damage relative to the camera coordinate system are calculated based on the average depth value, and the three-dimensional coordinates are converted into three-dimensional position coordinates in the world coordinate system. The damage category, 3D location coordinates, pixel bounding box boundary size and confidence level are integrated as the damage data entry corresponding to the valid damage. Multiple damage data entries are obtained by traversing all valid damages.

4. The in-situ additive repair method for agricultural facilities according to claim 3, characterized in that, The process of summarizing all the damage data entries and generating a repair task queue according to a preset priority rule includes: Summarize all damage data entries and extract the damage category and three-dimensional location coordinates from each damage data entry; The emergency level is matched according to the damage category, and the standard repair model and recommended repair materials corresponding to the damage category are matched from the pre-built repair model library. Based on the volume of the matched standard repair model and the preset printing speed corresponding to the recommended repair material, calculate the estimated printing time corresponding to the damage data entry; All damage data entries are initially sorted according to their urgency level, and then a second sort is performed on damage data entries belonging to the same urgency level based on their three-dimensional location coordinates. The standard repair model, recommended repair materials, estimated printing time, and emergency level corresponding to each damage data entry are integrated to generate a repair task queue.

5. The in-situ additive repair method for agricultural facilities according to claim 3, characterized in that, The step of generating a repair navigation path corresponding to each damage data entry based on the two-dimensional grid map and the repair task queue includes: For each damage data entry, extract the three-dimensional location coordinates corresponding to the effective damage from the repair task queue, and at the same time extract the obstacle grid information and the location information of agricultural facilities from the two-dimensional grid map; Based on the three-dimensional location coordinates of the effective damage, a global path planning algorithm is used to perform path search in a two-dimensional grid map to generate a global collision-free path. Based on the crop row region in the location information, set crop row avoidance rules with a distance not less than a preset safety distance for the global collision-free path; Based on the crop row avoidance rules, the positions of each trajectory point of the global collision-free path are adjusted to obtain a safe collision-free path; The local dynamic obstacle avoidance algorithm parameters are matched to the safe collision-free path to generate the repair navigation path corresponding to the damage data entry.

6. The in-situ additive repair method for agricultural facilities according to claim 4, characterized in that, The in-situ additive repair operation of agricultural facilities based on the repair task queue and the repair navigation path includes: For any valid damage, after controlling the agricultural facility in-situ additive repair device to travel along the corresponding repair navigation path to the three-dimensional position coordinates, the current real-time pose of the agricultural facility in-situ additive repair device is read. The target pose is determined based on the standard repair model. The current real-time pose and the target pose are compared. Based on the comparison results, the position and attitude of the in-situ additive repair device for agricultural facilities are adjusted until the preset pose requirements are met. The three-dimensional bounding rectangle of the effective damage is determined, the scanning reference plane is determined based on the three-dimensional bounding rectangle, and the height compensation matrix is ​​constructed based on the scanning reference plane; Based on the height compensation matrix and standard repair model, in-situ additive repair is performed on the effective damage. When the in-situ additive repair work for the effective damage is completed, the repair quality is tested, and the completion of the in-situ additive repair work is determined based on the repair quality test results.

7. The in-situ additive repair method for agricultural facilities according to claim 6, characterized in that, The in-situ additive repair device for agricultural facilities includes an air blowing device and a leveling sensor; the process of determining the three-dimensional circumscribed rectangle of the effective damage, determining the scanning reference plane based on the three-dimensional circumscribed rectangle, and constructing a height compensation matrix based on the scanning reference plane includes: Based on the three-dimensional bounding rectangle of the effective damage, the clean area of ​​the repair surface is determined, and the air blowing device is activated to perform surface pretreatment on the clean area to obtain a clean repair surface. Based on the planar range of the scanning reference plane, a grid scanning path is planned according to a preset number of rows and columns. The planar coordinates of each grid sampling point in the grid scanning path within the scanning reference plane are determined, and the reference sampling point is determined. The leveling sensor is controlled to move sequentially along the grid scanning path to directly above each grid sampling point, and the vertical distance between the leveling sensor and the clean repair surface is collected point by point to obtain the actual height value corresponding to each grid sampling point; Extract the actual height value of the reference sampling point as the reference zero point. Using the reference zero point as a reference, calculate the height difference between the actual height value of each grid sampling point and the reference zero point to obtain the height compensation value corresponding to each grid sampling point. By integrating the height compensation values ​​of each grid sampling point, a height compensation matrix matching the cleaned and repaired surface is generated.

8. The in-situ additive repair method for agricultural facilities according to claim 7, characterized in that, The in-situ additive repair device for agricultural facilities includes a printhead; the in-situ additive repair operation on the effective damage based on the height compensation matrix and the standard repair model includes: The coordinate system of the standard repair model is registered and aligned with the coordinate system of the three-dimensional bounding rectangle of the effective damage to generate a layered slicing path and determine the printing start position. Match the grid area compensation value corresponding to the printing start position from the height compensation matrix, and adjust the initial Z-axis height of the print head based on the grid area compensation value so that the distance between the print head extrusion end and the clean repair surface meets the preset first layer printing thickness requirement. Obtain preset basic printing parameters, and control the print head to perform melt extrusion printing operations layer by layer along the layered slicing path based on the basic printing parameters; After printing a preset number of layers, the printing action is paused, the surface image and depth data of the current printed layer are collected, and the interlayer bonding quality and edge warping are detected by texture analysis algorithm to generate print quality detection results; Based on the print quality test results, adjust the print parameters, replace the base print parameters with the adjusted print parameters, and return to execute the melt extrusion print job layer by layer along the layered slicing path, controlling the print head based on the base print parameters.

9. The in-situ additive repair method for agricultural facilities according to claim 6, characterized in that, When the in-situ additive repair work for the effective damage is completed, the repair quality is detected, and the completion of the in-situ additive repair work is determined based on the repair quality detection results, including: When the in-situ additive repair of the effective damage is completed, the repair point cloud data of the repaired part is collected, and the repair point cloud data is registered and aligned with the point cloud data of the standard repair model to establish a unified comparison coordinate system. Under the comparison coordinate system, the average deviation values ​​between the measured dimensions of the repaired part and the corresponding dimensions of the standard repair model in the three directions of X-axis, Y-axis and Z-axis are calculated respectively, and a three-dimensional dimension deviation dataset is generated. The three-dimensional size deviation dataset is compared with the preset acceptable deviation threshold one by one. If the average deviation value in all three directions is less than the acceptable deviation threshold, the in-situ additive repair operation is deemed acceptable and the operation is marked as complete. If the average deviation value in at least one direction is greater than or equal to the acceptable deviation threshold, a supplementary printing path is generated based on the average deviation value in the corresponding direction.

10. An in-situ additive repair device for agricultural facilities, characterized in that, It includes a control unit, an omnidirectional mobile chassis, an environmental sensing unit, and an additive repair execution unit, all of which are electrically connected to the control unit. The omnidirectional mobile chassis includes a chassis frame, three sets of omnidirectional wheels and three drive servo motors. The three sets of omnidirectional wheels are evenly distributed and installed on the bottom of the chassis frame. Each drive servo motor is fixed inside the chassis frame, and the output shaft of the drive servo motor is connected to the corresponding omnidirectional wheel via a transmission. The environmental perception unit includes a lidar, a depth camera, an inertial measurement unit, and a wheel encoder. The lidar and the inertial measurement unit are respectively located at the center of the upper part of the chassis frame, the depth camera is located at the edge of the upper part of the chassis frame, and the wheel encoder is coaxially mounted with each drive servo motor in a one-to-one correspondence. The additive repair execution unit includes a robotic arm, a print head, and a leveling sensor. The fixed end of the robotic arm is fixed to the center of the upper part of the chassis frame via a mounting base. The print head is fixed to the end flange of the robotic arm. The leveling sensor is fixed to the side of the print head, and the detection end of the leveling sensor is oriented in the same direction as the printing extrusion end.