Adaptive tree opening and closing tree whitewashing recognition and spraying method and system

CN122807850APending Publication Date: 2026-09-25ZHEJIANG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610656022.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-13
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0004]本发明是为了克服现有技术中,现有自动化涂白设备存在采用轮式移动结构,在非结构化地形通行能力受限,以及缺乏树木形态自适应识别与精准涂白控制的问题,提供了一种高通过性、精准识别与自适应喷涂的自适应开合树木涂白识别与喷涂方法及系统

Benefits of technology

[0058]本发明与现有技术相比,有益效果是:(1)环境适应性强:采用履带式移动底盘替代传统轮式结构,显著提高了在林地、崎岖坡地、泥泞等非结构化地形中的通过能力,有效避免了打滑、陷车问题,可广泛适用于各类复杂林业作业环境;(2)识别与定位精准:基于改进的YOLOv5模型(融合AGFD注意力模块、GSConv轻量化卷积及Inner-IoU损失函数),显著提升了对未涂白树木主干的目标检测精度(mAP达92.75%)和实时性,结合结构光深度相机与坐标转换算法,实现了树木三维位置的准确定位;(3)路径规划高效平滑:采用改进A*算法(切比雪夫距离、动态衰减因子启发函数)与关键节点提取方法,减少了冗余节点,并融合动态窗口法生成平滑的运动路径,保证了机器人导航的实时性和安全性;(4)喷涂自适应且全覆盖:设计360度自动开合圆环喷射器,可根据树干直径自动调节开合度,结合升降机构在1.2m~0.3m高度区间内匀速升降,配合周向多喷嘴雾化喷涂,实现树干全周无死角、厚度均匀的涂白,对粗大树干可执行往复喷涂,确保质量;(5)控制精度高:采用泵阀协同模糊PID流量控制与位置式PID高度控制,实时调节涂白剂供给量和升降速度,动态响应快、稳态误差小,避免了涂白剂浪费及流挂现象;(6)自动化与智能化水平高:系统集成了视觉感知、路径规划、自适应开合、闭环控制及故障报警功能,能够自主完成树木识别、导航、对位、喷涂、复位全流程作业,大幅提升了涂白效率,降低了人工劳动强度与安全风险。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122807850A_ABST
    Figure CN122807850A_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of robot control, and particularly relates to a self-adaptive opening and closing tree whitening recognition and spraying method and system. The method comprises the following steps: S1, collecting images through a depth camera, detecting the main stem of a tree without whitening by using an improved YOLOv5 model, converting the image coordinates to a world coordinate system in combination with depth information, and obtaining the three-dimensional position of the tree; S2, planning a global path by using an improved A* algorithm based on a grid map, and navigating the mobile robot to the side of the target tree; S3, controlling the 360-degree automatic opening and closing circular ring sprayer to open, measuring the diameter of the tree trunk and matching the opening and closing angle, and driving the sprayer to close around the tree trunk; S4, driving the sprayer to rise to the target height, starting the ring-shaped nozzle to spray, and dynamically adjusting the supply amount of whitening agent; and S5, switching to the descending stroke continuous spraying after the sprayer reaches the upper limit, and opening and resetting after completing the full-height coverage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of robot control technology, specifically relating to an adaptive method and system for identifying and spraying whitewashed trees. Background Technology

[0002] Whitewashing trees in winter is a core protective measure against extreme low temperatures, frost damage, and pests and diseases. However, traditional manual whitewashing suffers from problems such as low efficiency, high safety risks for workers, and significant waste of whitewashing agents. Existing automated whitewashing equipment mostly uses a wheeled mobile structure, which is prone to slipping and getting stuck in unstructured terrains such as woodlands and rugged slopes, limiting its mobility. At the same time, it lacks adaptive recognition of tree morphology and precise whitewashing control, making it difficult to meet the operational needs in different environments.

[0003] Therefore, it is very important to design an adaptive tree whitening identification and spraying method and system that can capture images through visual acquisition devices, identify unpainted trees through the YOLOv5 system, obtain location information, generate a movement path based on the A* algorithm, navigate to the target tree through obstacle avoidance, and then precisely control the spray volume through the PID algorithm to operate a 360-degree automatic opening and closing circular sprayer to spray the tree trunk at a height of 1.2 meters. Summary of the Invention

[0004] The present invention aims to overcome the problems of existing automated whitewashing equipment, which uses a wheeled mobile structure, has limited mobility in unstructured terrain, and lacks adaptive tree morphology recognition and precise whitewashing control. It provides an adaptive opening and closing tree whitewashing recognition and spraying method and system with high passability, precise recognition and adaptive spraying.

[0005] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:

[0006] An adaptive method for identifying and spraying whitewashed trees with open or closed branches includes the following steps:

[0007] Step S1, Target Identification and Localization:

[0008] Environmental images are acquired using a depth camera, and the improved YOLOv5 model is used to detect the unpainted tree trunks, outputting bounding boxes and categories. Combined with depth information, the target center coordinates in the image coordinate system are transformed to the world coordinate system to obtain the three-dimensional position information of the target tree.

[0009] Step S2, Route Planning and Navigation:

[0010] Based on a grid map, an improved A* algorithm is used to plan a global path from the current location to the target tree, generating a path point sequence; the mobile robot navigates to the target tree according to the path point sequence.

[0011] Step S3, Adaptive opening and closing and alignment:

[0012] After the robot arrives, it controls the 360-degree automatic opening and closing ring sprayer to open; it measures the trunk diameter, matches the opening and closing angle according to the diameter, and drives the sprayer to close and hug the trunk.

[0013] Step S4, Lifting and Spraying with Flow Control:

[0014] The drive sprayer rises from the initial height to the target height, and spraying is started simultaneously, spraying whitewash onto the tree trunk through nozzles arranged in a ring; during the spraying process, the supply of whitewash is dynamically adjusted.

[0015] Step S5, reciprocating spraying and resetting:

[0016] Once the sprayer reaches its upper limit, it automatically switches to a descent stroke and continues spraying to achieve full height coverage; after spraying is completed, the sprayer opens and resets.

[0017] Preferably, in step S1, the depth information Calculated using structured light triangulation: ;

[0018] Where B is the camera baseline length, f is the focal length, and d is the pixel offset value;

[0019] Image coordinates (u,v) to world coordinates (u,v) , , The conversion includes the following process:

[0020] First, the intrinsic parameter matrix K is converted into camera coordinates. The formula is as follows: , ;

[0021] Among them, f x f y These are the focal lengths of the camera in the x and y directions, respectively. , The coordinates of the camera's principal point;

[0022] Then, the external parameter rotation matrix R and translation matrix T are used to convert the coordinates to world coordinates: ;

[0023] Where R is a 3×3 rotation matrix and T is a 3×1 translation matrix, both obtained through camera calibration.

[0024] Preferably, in step S1, the improved YOLOv5 model specifically includes:

[0025] The original feature fusion network is replaced by an AGFD module (Adaptive Global Feature Fusion and Detection Module), and the SimAm (Simple No-Parameter Note) attention mechanism is embedded in the AGFD module.

[0026] The neck network's ordinary convolutions are replaced with GSConv (grouped shuffled convolutions) lightweight convolutions, and the C3 module (a cross-stage bottleneck module with 3 convolutions) is built based on Res2Net (residual 2 network) to replace the C3 module.

[0027] The Inner-IoU loss function is used instead of the CIoU loss function. The formula for calculating the Inner-IoU loss function is as follows: ; ; ;

[0028] in, , These represent the left and right x-coordinates of the ground truth bounding box, respectively. , These represent the y-coordinates of the upper and lower boundaries of the ground truth bounding box, respectively. ;

[0029] The Inner-IoU loss function value, which is the internal intersection-union ratio between the predicted bounding box and the ground truth bounding box, is used as a loss term for model training. for: ;

[0030] in, and Represents the height and width of the ground truth bounding box; u represents the area where the ground truth bounding box and the predicted bounding box are joined; i represents the area where the ground truth bounding box and the predicted bounding box intersect.

[0031] Among them, h, w, (x c ,y c ) represent the height, width, and center coordinates of the predicted bounding box, respectively; r is the scaling factor; b l b r These represent the x-coordinates of the left and right boundaries of the predicted bounding box, respectively; b t b b These represent the y-coordinates of the upper and lower boundaries of the prediction box, respectively.

[0032] Preferably, in step S1, when the improved YOLOv5 model fails to detect tree targets in its first detection, a secondary detection mechanism is initiated, as follows:

[0033] Adjust the image enhancement parameters and re-detect the target in the same frame. If no valid target is detected after the second detection, control the robot to rotate 20° clockwise around its own geometric center, pause for 0.3 seconds after rotation, then re-acquire the image and start a new round of detection. If no target is detected, repeat the 20° clockwise rotation, 0.3-second pause, re-acquire the image and start detection until the cumulative rotation angle reaches 360°. If no unpainted trees are detected after the cumulative rotation angle reaches 360°, sound an alarm and control the robot to stop searching and wait in place.

[0034] The image enhancement parameters include contrast.

[0035] Preferably, in step S2, the improved A* algorithm uses Chebyshev distance as the heuristic function and introduces a dynamic decay factor to adaptively adjust the weights of the heuristic function; after path generation, redundant nodes are removed using a key node extraction method, as follows:

[0036] Starting from the initial point P1, connect the subsequent nodes P in sequence. i If the line P1P i If it collides with an obstacle, then P i-1 As key turning points, store them in the key point set O, and use P as the key point set O. i For a new starting point, repeat the operation of connecting the subsequent nodes sequentially from the current starting point and judging collisions until the target point is reached; use the extracted key nodes as intermediate guide points of the dynamic window method to generate a smooth velocity sampling motion path.

[0037] Preferably, in step S2, the mobile robot adopts a differential drive method, and the corresponding kinematic model satisfies the following formula: ;

[0038] J is the kinematic Jacobian matrix of the differential-driven robot, i.e.: ;

[0039] Where k is the linear velocity of the robot. Angular velocity, Let d be the radius of the drive wheel and d be the distance between the two wheels. , These are the angular velocities of the left and right wheels, respectively. During navigation, the speed of the left and right track motors is adjusted by a PID speed controller. The PID controller executes once every 10ms, and the control quantity is the pulse width modulation (PWM) duty cycle correction value.

[0040] Preferably, in step S4, the height control of the lifting spraying adopts a position-based PID algorithm, and the specific formula is as follows: ;

[0041] in, , where is the altitude error value at time k; This represents the altitude error value at time k-1. Let be the height error value at time i;

[0042] Target spraying height This is the actual spraying height; This is the amount of correction for the output pulse frequency; The sampling period.

[0043] Preferably, in step S4, the adjustment of the whitewash supply adopts a pump-valve coordinated optimized PID control strategy, as follows:

[0044] The total control quantity U(t) is decomposed into the pump frequency increment and the valve opening increment. The pump frequency is adjusted first, followed by valve fine-tuning. The controller parameters are corrected online through fuzzy inference, and the specific formula is as follows: ; ; ; ;

[0045] in, This refers to the online correction scaling factor that varies over time. For online correction of integral coefficients that vary over time, This is the correction amount for the integral coefficient; For online correction of differential coefficients that vary with time, This is the correction amount for the differential coefficients.

[0046] Let t be the error value of the whitewash supply at time t, that is, the difference between the target supply and the actual supply. Let be the error variable in the integration process.

[0047] , , These are the proportionality coefficients. Integral coefficient Differential coefficients The initialization result; This is the adjustment amount for the controller parameters.

[0048] Preferably, in step S5, for thick tree trunks with a trunk diameter greater than 30cm, the sprayer is controlled to spray once repeatedly within a height range of 1.2m to 0.3m.

[0049] The present invention also provides an adaptive tree whitening recognition and spraying system, including:

[0050] The mobile tracked chassis uses differential drive, with the left and right tracks driven by a motor and an encoder, respectively.

[0051] The main control unit is used to receive motion commands sent by the path planning module, adjust the speed of the track motor through PID speed closed-loop control, and control the opening, closing, lifting and spraying actions of the sprayer.

[0052] The environment perception module, including a depth camera and a ranging sensor, is used to run an improved YOLOv5 model;

[0053] The path planning and navigation module is used to execute the improved A* algorithm, generate a smooth path, and send motion commands to the main control unit.

[0054] A 360-degree automatic opening and closing annular injector, wherein the injector has a two-lobed opening structure and is driven to open and close by a micro stepper motor. 8-12 high-pressure atomizing nozzles are evenly arranged circumferentially on the inner side of the injector, with a nozzle orifice diameter of 0.3mm and a spray angle of 60°.

[0055] The lifting actuator is used to drive the injector to rise and fall.

[0056] The liquid supply and flow control unit, including a liquid storage tank, pump, flow regulating valve and flow sensor, is used to supply whitening agent to the injector;

[0057] The host computer monitoring module communicates with the main control unit to display operation parameters and fault alarm information in real time.

[0058] Compared with the prior art, the beneficial effects of this invention are: (1) Strong environmental adaptability: The use of a tracked mobile chassis to replace the traditional wheeled structure significantly improves the ability to pass through unstructured terrains such as forests, rugged slopes, and muddy areas, effectively avoiding slippage and getting stuck. It can be widely applied to various complex forestry operation environments; (2) Accurate identification and positioning: Based on the improved YOLOv5 model (integrating AGFD attention module, GSConv lightweight convolution and Inner-IoU loss function), the target detection accuracy (mAP up to 92.75%) and real-time performance of the unpainted tree trunk are significantly improved. Combined with the structured light depth camera and coordinate transformation algorithm, the accurate positioning of the three-dimensional position of the tree is realized; (3) Efficient and smooth path planning: The improved A* algorithm (Chebyshev distance, dynamic decay factor heuristic function) and key node extraction method are used to reduce redundant nodes and integrate the dynamic window method to generate a smooth motion path. The system ensures the real-time performance and safety of robot navigation; (4) Adaptive and full-coverage spraying: The system is designed with a 360-degree automatic opening and closing ring sprayer, which can automatically adjust the opening and closing degree according to the trunk diameter. Combined with the lifting mechanism, it can lift and lower at a uniform speed in the height range of 1.2m to 0.3m. With the circumferential multi-nozzle atomization spraying, it can achieve whitening of the entire trunk without dead angles and with uniform thickness. It can perform reciprocating spraying on thick trunks to ensure quality; (5) High control precision: The system adopts pump-valve coordinated fuzzy PID flow control and position-type PID height control to adjust the whitening agent supply and lifting speed in real time. The dynamic response is fast and the steady-state error is small, avoiding the waste and dripping of whitening agent; (6) High level of automation and intelligence: The system integrates visual perception, path planning, adaptive opening and closing, closed-loop control and fault alarm functions. It can autonomously complete the entire process of tree identification, navigation, alignment, spraying and resetting, which greatly improves the whitening efficiency and reduces the labor intensity and safety risks of manual labor. Attached Figure Description

[0059] Figure 1 This is a schematic diagram of a tree target detection and secondary search process in this invention; Figure 2 This is a schematic diagram of a structure of the improved YOLOv5 model in this invention; Figure 3 This is an example diagram illustrating the detection effect of unpainted trees under different lighting conditions provided by an embodiment of the present invention; Figure 4 This is a comparative diagram of the training loss curve and accuracy curve of the YOLOv5 model in this invention; Figure 5 This is a schematic diagram of the overall structure of the tracked whitening robot in this invention; Figure 6 This is a schematic diagram of the differential drive chassis kinematic model in this invention; Figure 7This is a flowchart of the PID speed control of the motor in this invention; Figure 8 This is a schematic diagram of the key node extraction and path reconstruction steps of the improved A* algorithm in this invention; Figure 9 This is a schematic diagram showing a connection between the liquid storage device and the 360-degree automatic opening and closing annular injector in this invention. Detailed Implementation

[0060] To more clearly illustrate the embodiments of the present invention, specific implementation methods will be described below with reference to the accompanying drawings. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings and other implementation methods can be obtained based on these drawings without any creative effort.

[0061] This invention provides an adaptive tree whitening recognition and spraying system, comprising:

[0062] The mobile tracked chassis uses differential drive, with the left and right tracks driven by a motor and an encoder, respectively.

[0063] The main control unit is used to receive motion commands sent by the path planning module, adjust the speed of the track motor through PID speed closed-loop control, and control the opening, closing, lifting and spraying actions of the sprayer.

[0064] The environment perception module, including a depth camera and a ranging sensor, is used to run an improved YOLOv5 model;

[0065] The path planning and navigation module is used to execute the improved A* algorithm, generate a smooth path, and send motion commands to the main control unit.

[0066] A 360-degree automatic opening and closing annular injector, wherein the injector has a two-lobed opening structure and is driven to open and close by a micro stepper motor. 8-12 high-pressure atomizing nozzles are evenly arranged circumferentially on the inner side of the injector, with a nozzle orifice diameter of 0.3mm and a spray angle of 60°.

[0067] The lifting actuator is used to drive the injector to rise and fall.

[0068] The liquid supply and flow control unit, including a liquid storage tank, pump, flow regulating valve and flow sensor, is used to supply whitening agent to the injector;

[0069] The host computer monitoring module communicates with the main control unit to display operation parameters and fault alarm information in real time.

[0070] This invention also provides an adaptive method for identifying and spraying whitewashed trees, comprising the following steps:

[0071] Step S1, Target Identification and Localization:

[0072] Environmental images are acquired using a depth camera, and the improved YOLOv5 model is used to detect the unpainted tree trunks, outputting bounding boxes and categories. Combined with depth information, the target center coordinates in the image coordinate system are transformed to the world coordinate system to obtain the three-dimensional position information of the target tree.

[0073] Step S2, Route Planning and Navigation:

[0074] Based on a grid map, an improved A* algorithm is used to plan a global path from the current location to the target tree, generating a path point sequence; the mobile robot navigates to the target tree according to the path point sequence.

[0075] Step S3, Adaptive opening and closing and alignment:

[0076] After the robot arrives, it controls the 360-degree automatic opening and closing ring sprayer to open; it measures the trunk diameter, matches the opening and closing angle according to the diameter, and drives the sprayer to close and hug the trunk.

[0077] Step S4, Lifting and Spraying with Flow Control:

[0078] The drive sprayer rises from the initial height to the target height, and spraying is started simultaneously, spraying whitewash onto the tree trunk through nozzles arranged in a ring; during the spraying process, the supply of whitewash is dynamically adjusted.

[0079] Step S5, reciprocating spraying and resetting:

[0080] Once the sprayer reaches its upper limit, it automatically switches to a descent stroke and continues spraying to achieve full height coverage; after spraying is completed, the sprayer opens and resets.

[0081] Specifically, step S1 includes the following process:

[0082] The core of the identification and positioning system consists of three parts: an Astra depth camera, a YOLOv5 detection and localization algorithm module, and a mobile robot execution unit. These modules interact in real-time via serial communication. The Astra series features dual capabilities: RGB color imaging and infrared structured light depth sensing. It can simultaneously acquire environmental images and corresponding depth images in a 640×640×3 resolution color image stream, with a stable frame rate of 30fps and latency below 50ms. This meets the real-time detection requirements in dynamic outdoor scenarios, and the device boasts low power consumption, adapting to the battery life requirements of mobile robots.

[0083] During system operation, the Astra camera continuously captures ambient data and transmits two types of data to the Jetson Nano via a USB 3.0 interface: a 640×640×3 color image stream and an infrared structured light image. The transmission protocol is UVC, requiring no additional driver development and meeting real-time requirements.

[0084] like Figure 1 As shown in the process, after the Jetson Nano module preprocesses the input image (including grayscale correction and noise filtering), it calls the improved YOLOv5s model to detect whether there are unpainted tree targets in the image. The model optimizes the convolution kernel parameters for the tree trunk features, which can effectively distinguish trees from shrubs, rocks and other interference objects in the background. According to the grid map built by Jetson Nano, each grid is marked as "passable (0)" or "obstacle (1)". If a valid tree target is detected, the module will quickly parse the bounding box information output by the model, calculate the two-dimensional coordinates (u,v) of the detection box center in the image pixel coordinate system, and combine it with the target depth value obtained by the camera. Through the transformation of the intrinsic and extrinsic parameters, it is mapped to the world coordinate system to obtain the accurate three-dimensional coordinates / distance relative to the robot and find the target tree.

[0085] The YOLOv5 target detection bounding box, target 3D world coordinates, real-time color image, and depth image are transmitted to the host computer via WiFi / Ethernet using TCP / IP or UDP protocols. The host computer uses a visualization interface written in LabVIEW / OpenCV to display the detection results and positioning coordinates in real time, while storing the data for subsequent model optimization and camera calibration parameter correction. After receiving data via serial port interrupt, the STM32 uses orthogonal encoding mode to collect the pulse count of the left and right motors, converts it into the current position (currentx, currenty) and current attitude angle (yaw), calculates the difference between the current position and the target position and the target speed, and adjusts the speed difference between the left and right motors to ensure accurate movement along the path to the target tree.

[0086] Simultaneously, the current location information is fed back to the Jetson Nano's algorithm module at a frequency of 10ms / time via a TTL serial port (reusing the same serial port as the transmission path) to update the grid map and path planning, completing one detection-localization-movement process. If the tree target is not captured in the first detection, the system will immediately start a secondary detection mechanism. Instead of re-acquiring the image, it will recalculate the same frame image by adjusting the image enhancement parameters (increasing the contrast by 20% and adjusting the gamma value to 1.2) to eliminate false judgments caused by insufficient lighting, shadow occlusion, etc., and ensure the accuracy of recognition.

[0087] If the second detection fails to detect a valid target, the algorithm module will determine that there are no target trees in the current field of view and send a rotation search command to the moving part. The mobile robot rotates 20° clockwise around its own geometric center as the rotation axis. After the rotation is completed, it pauses for 0.3 seconds to stabilize the camera focus and avoid motion blur affecting the detection effect. Then, it re-acquires images and starts a new round of detection. This rotation search process can be repeated, with the rotation angle remaining consistent each time. The maximum rotation range is 360°. If no unpainted tree is detected after one full rotation, the system will issue a buzzer alarm. The buzzer alarm will also send an alarm command to the host computer, allowing remote debugging personnel to intervene in a timely manner. At the same time, the robot will stop searching and wait in place for manual intervention or a change of work area.

[0088] The YOLOv5 model mainly consists of five parts: input, backbone network, neck network, head network, and output. The input is an image with a size of (640×640×3) pixels. The backbone network is responsible for extracting features from the input image. The neck network is responsible for multi-scale feature fusion of the features extracted by the backbone network and passing these features to the prediction layer. The head network is mainly responsible for the final regression prediction, that is, using the feature maps extracted by the backbone network to detect the location and category of the target. Finally, the output is the result of the model's prediction, including the category of each target and its corresponding bounding box coordinates.

[0089] To ensure high-accuracy tree recognition in varying environments, enable rapid real-time detection, and address deployment challenges on edge devices, the following three improvements were made, and the proposed network structure adjustments are as follows:

[0090] 1. Tree recognition faces limitations such as uncertain distances between the target tree and the detection device, as well as relatively low pixel values. To overcome these problems, the original feature fusion network is replaced with an AGFD module. This module improves the fusion of effective information by compressing useless feature information, thereby enhancing the model's extraction capabilities.

[0091] 2. A lightweight convolutional method, GSConv, is used to modify the Conv module of the original neck network. The VOV-GSCSP network is improved using Res2Net, and a Res-GS module is proposed to replace the C3 module of the neck network. This reduces model complexity and accelerates inference speed.

[0092] 3. Replace the original CIoU with Inner-IoU. This improves model convergence speed and regression accuracy. The improved model structure design is as follows: Figure 2 As shown.

[0093] SimAm attention mechanism and AGFD module:

[0094] The YOLOv5s network uses PANet to fuse feature and semantic information. However, this fusion process relies solely on simple addition operations, making it difficult to effectively integrate information. Therefore, the SimAm attention mechanism is used, and a feature fusion network AGFD is built upon it to address this issue. The SimAm attention mechanism enhances the detection model's ability to extract foreign object features by spatially inhibiting neighboring neurons of the target.

[0095] This module learns the importance of each channel autonomously to enhance the network's focus on key features; it strengthens the extraction of useful information and reduces invalid information, thereby improving the accuracy of gesture recognition to some extent.

[0096] In the AGFD module, the number of channels in the input feature maps is first adjusted to ensure that the two feature maps have the same number of channels before concatenation. Then, the two feature maps are concatenated, doubling their number of channels. The SimAm attention mechanism is used to enhance useful parts of the feature maps while suppressing unimportant parts, thereby improving feature representation. Next, the attention-processed feature map is multiplied by the original feature map. Then, the processed P1 feature map is added to the original P2 feature map, and the processed P2 feature map is added to the original P1 feature map. Finally, these two sums are concatenated. This module, on the one hand, learns important information in the feature maps through the attention mechanism and weights it, thereby enhancing key features in the image; on the other hand, it re-merges the weighted feature maps with the original feature maps. This helps to retain and integrate information from different feature maps, further enhancing the model's understanding of image content and thus improving the performance of the deep learning model.

[0097] Ordinary convolutions suffer from feature coupling issues, and computational costs increase with network depth. While depthwise separable convolutions can significantly reduce convolution parameters, they cannot guarantee model accuracy. Therefore, based on the two aforementioned convolution methods, the lightweight convolution method GSConv can replace ordinary convolutions in the neck network, balancing the accuracy and real-time performance of gesture target detection models. GSConv uses ordinary convolutions to compensate for the feature extraction capabilities of depthwise separable convolutions.

[0098] First, the input undergoes a regular convolution. Then, the result of the regular convolution is downsampled and subjected to a depthwise separable convolution. The results of the two convolutions are then concatenated. Finally, channel shuffling is performed, which combines the corresponding channels from the two previous convolutions, making the output of the depthwise separable convolution closer to that of a regular convolution. Simultaneously, information generated by the regular convolution can permeate every part of the information generated by the depthwise separable convolution, thus enhancing the feature extraction capability of the depthwise separable convolution.

[0099] Res2Net constructs hierarchical residual connections within its residual modules to represent multi-scale features in greater detail. The Res2_B module is obtained by replacing some convolutional modules of Res2Net with 3×3 GSConv modules, and then this module replaces the Bot-tleneck structure in the VOV-GSCSP module, resulting in the proposed Res-GS module.

[0100] The Res2_B module first uses 1×1 convolutions to reduce the dimensionality of the feature maps, then divides the convolution results equally according to the number of channels. The first feature map X1 is left unprocessed. Each feature map after X2 undergoes a 3×3 convolution, and the result of each convolution is residually concatenated before the next convolution operation. All processed feature results are then concatenated and fused using a 1×1 convolution. Finally, the fused features are added to the original features. The Res-GS module, built using GSConv and Res2Net, not only increases the network's receptive field but also reduces the model's computational cost and parameter count.

[0101] Using Inner-IoU considers both location information and shape features when calculating the similarity of bounding boxes, and explores the overlap of regions within the bounding boxes more deeply, providing a more comprehensive and reasonable loss evaluation mechanism. This improvement not only further enhances the model's adaptability in complex scenes, but also provides more accurate guidance for optimizing bounding box regression tasks. The Inner-IoU calculation formula is shown below: ; ; ;

[0102] In the formula, , These represent the left and right x-coordinates of the ground truth bounding box, respectively. , These represent the y-coordinates of the upper and lower boundaries of the true bounding box, respectively.

[0103] ;

[0104] The Inner-IoU loss function value, which is the internal intersection-union ratio between the predicted bounding box and the ground truth bounding box, is used as a loss term for model training: ;

[0105] In the formula: and The height and width of the ground truth bounding box are represented by 'u', the area of ​​the combined ground truth bounding box and the predicted bounding box is represented by 'i', and the area of ​​the intersection of the ground truth bounding box and the predicted bounding box is represented by 'i'.

[0106] Among them, h, w, (x c ,yc ) represent the height, width, and center coordinates of the predicted bounding box, respectively; r is the scaling factor; b l b r These represent the x-coordinates of the left and right boundaries of the predicted bounding box, respectively; b t b b These represent the y-coordinates of the upper and lower boundaries of the prediction box, respectively.

[0107] After YOLOv5 detects a target object, it first calculates the target's center coordinates (u, v) in the image coordinate system by parsing the detection bounding box information. Then, it locates the target in 3D space, following these steps:

[0108] 1. Image coordinate system → Camera coordinate system:

[0109] By using the intrinsic parameter matrix K of the camera calibration, the position in the image coordinate system can be transformed to the camera coordinate system, allowing the use of depth information acquired by the depth camera. The real-time infrared image is matched with the calibration reference image, and the pixel deviation value d is calculated using the SAD algorithm. Based on the structured light triangulation method, combined with the camera baseline length B and focal length f, the result is obtained using the formula... The depth value is calculated by matching the currently acquired infrared structured light image with a pre-calibrated reference structured light image. During the matching process, the deviation values ​​of each pixel between the images are obtained. Finally, based on the principle of structured light triangulation, these deviation values ​​are used to calculate the depth value. The formula for the coordinate transformation relationship is as follows: , ;

[0110] Among them, f x f y These are the focal lengths of the camera in the x and y directions, respectively. , The coordinates of the camera's principal point are obtained through camera calibration. Let K be the position coordinates of the target in the camera coordinate system; K is the intrinsic parameter matrix.

[0111] 2. Camera coordinate system → World coordinate system:

[0112] The influence of camera pose on localization is eliminated by using camera extrinsic parameters (rotation matrix R, translation matrix T) (the camera is fixed to the mobile robot, and its pose changes with the robot), and the position in the camera coordinate system is transformed to the world coordinate system. The specific transformation relationship is shown below: ;

[0113] In the formula: R is the target's position coordinates in the world coordinate system; R is a 3×3 rotation matrix (describing the camera's rotation attitude relative to the world coordinate system, including rotation angles α, β, and γ around the x / y / z axes); and T is a 3×1 translation matrix (describing the position of the camera origin in the world coordinate system), both obtained through camera calibration.

[0114] These steps ensure the accurate positioning of the target in three-dimensional space.

[0115] Since YOLOv5 is a single-stage object detection algorithm based on anchor boxes, the size and proportion of the anchor boxes directly adapt to the morphological features of the target object, and their rationality has a crucial impact on detection accuracy and recall. Therefore, before starting model training and formal detection tasks, it is necessary to generate anchor boxes adapted to the current data distribution based on the specific dataset for this tree detection, rather than directly using the original YOLOv5 anchor boxes (the original anchor boxes are designed for general targets and are difficult to match the long and narrow shape of tree trunks).

[0116] First, samples were obtained through on-site collection and scene expansion. On-site collection covered different lighting conditions such as sunny days, cloudy days, and backlighting in the morning and evening, collecting a total of 5,000 valid images to ensure the diversity and representativeness of the dataset and improve the generalization ability of the model.

[0117] After sample collection, the LabelImg annotation tool was used to manually select and annotate the tree targets in each image. During annotation, the unwhitened tree trunk was the core target, ensuring the bounding box accurately covered the trunk area, without including excessive background or omitting key parts of the trunk. After annotation, an XML format label file was generated for each image. This file contained complete target and image information, specifically: the bounding box coordinates of the tree target (x1, y1 pixels at the top left and x2, y2 pixels at the bottom right), the target category (uniformly labeled "unwhitened_tree" for easy model classification and recognition), and basic image parameters (image width, height, 3-channel RGB image, 8-bit pixel depth), etc. This data will serve as the label basis for model training, used to calculate the loss function and iteratively optimize parameters.

[0118] This experiment used a dataset of 5000 tree images, organized with the assistance of Labeling software. To ensure the independence of model training, validation, and testing, and to avoid performance misjudgments due to data leakage, the dataset was randomly divided in a 7:2:1 ratio: 3500 images were used as the training set for iterating the model's core parameters and learning features. Prediction results were calculated through forward propagation, and network weights were adjusted through backpropagation to gradually optimize the model's ability to identify tree targets. 1000 images were used as the validation set, which did not participate in model parameter updates but was only used for periodic performance evaluation during the training process. After each epoch of training, the model's precision, recall, loss, and other metrics were calculated using the validation set, and hyperparameters such as learning rate and batch size were adjusted accordingly to prevent overfitting or underfitting. 500 images were used as the test set for final model performance validation. The test set samples were never involved in the training or validation process and can objectively reflect the model's detection performance in real-world scenarios.

[0119] The high average accuracy after model training indicates that the system is feasible and has a high accuracy rate in tree detection and localization. Figure 3 The image shows the detection performance of unpainted trees under different lighting conditions (sunny day, cloudy day, backlight). The red box represents the tree trunk area identified by the algorithm, with an accuracy of ≥90%. The upper part of Figure 4 shows the loss curve and accuracy curve of the training set; the lower part shows the mean accuracy and loss curve of the validation set. After 100 training rounds, the final mAP_0.5 reached 92.75%.

[0120] The improved YOLOv5s model achieves a 7.43% increase in mAP and a 5.5% reduction in parameters compared to the original model. Compared to the traditional two-stage algorithm Faster R-CNN, it offers nearly three times faster inference speed and is better suited for edge computing scenarios in mobile robots.

[0121] Specifically, step S2 includes the following process:

[0122] Establish a coordinate system and complete kinematic modeling:

[0123] First, we need to establish the fundamental theories describing the positions and postures of the robot's various parts. The robot's motion can essentially be decomposed into overall pose motion (translation and rotation of the robot body in global space) and local component motion (such as the relative motion of the whitening actuator and the spray tip). To accurately describe the motion state of the tracked harvesting (whitening) robot, we need to establish multiple local coordinate systems on the robot:

[0124] Global inertial coordinate system (world coordinate system): As the reference system for the entire motion analysis, it is usually fixed at a certain stationary point in the robot's work scene (such as the starting corner of the work area). The coordinate axis directions follow the right-hand rule (X-axis along the direction of work forward, Y-axis horizontally arranged perpendicular to the X-axis, and Z-axis vertically upward). It is used to describe the absolute position and attitude of the robot body and its components in the work space and is the global reference benchmark for robot trajectory planning.

[0125] Robot body coordinate system (body base coordinate system): As the core local coordinate system of the robot, it is usually fixed at the center of mass of the robot body (or the midpoint of the line connecting the centers of the track wheel axles). The origin of the coordinate system coincides with the center of mass of the body. The X-axis moves forward along the longitudinal central axis of the body (in the same direction as the track movement), the Y-axis points horizontally to the left side of the robot, and the Z-axis moves vertically upward and perpendicular to the longitudinal direction of the body. It is used to describe the relative motion of the robot's various local components relative to the body and is the intermediate link connecting the global coordinate system and the component coordinate system.

[0126] Local coordinate system for actuators: A corresponding coordinate system for each actuator is established based on the robot's task type. For a harvesting robot, coordinate systems for each joint of the robotic arm and the end effector (gripper) are required; for a whitening robot, coordinate systems for the whitening nozzle and the lifting mechanism are required. These coordinate systems are fixed to the corresponding actuators, and the origin is usually selected from the key motion center of the actuator (such as the joint rotation center or the nozzle outlet center). This is used to accurately describe the attitude and position of the actuator, providing data support for precise control of the operation.

[0127] Tracked drive coordinate system (optional auxiliary coordinate system): For the drive control analysis of tracked robots, an additional tracked coordinate system can be established, with the origin located at the center of the track drive wheel axle. This system is used to describe parameters such as the rotation speed and ground contact length of the track, providing a basis for solving the motion speed of the robot body.

[0128] Based on the above construction of multiple local coordinate systems, the transformation relationship between the coordinate systems will be established through homogeneous coordinate transformation method, and the forward kinematic equations (the robot pose output is solved from the drive input) and inverse kinematic equations (the drive input is solved from the target pose) of the tracked robot will be derived.

[0129] like Figure 5 The diagram shown is a schematic representation of the overall structure of the tracked whitening robot provided in this invention. Based on this tracked whitening robot structure, kinematic modeling is performed:

[0130] 1. Velocity-level kinematic model (basic)

[0131] The core relationships of planar motion in tracked robots: ;

[0132] We derive that: ;

[0133] 2. Pose-level kinematic model (trajectory integral)

[0134] Integrating the velocity model, we obtain the pose update equation in the global coordinate system (discrete time step dt): ; ; ;

[0135] 3. Mapping between motor speed and track speed

[0136] The relationship between track linear velocity and motor speed: ,

[0137] D: Track drive wheel diameter (m)

[0138] Left and right motor speeds (r / min);

[0139] 4. Kinematics Correct Solution Formula ; ;

[0140] Where B is the track center distance, specifically the horizontal distance between the centers of the left and right track drive wheel axles, in meters; The linear velocity of the left track, specifically the forward speed of the left track contact point, is expressed in m / s. is the linear velocity of the right track, specifically the forward speed of the right track contact point, in m / s; v represents the linear velocity of the fuselage, specifically the forward speed of the fuselage center of gravity, in m / s; R is the fuselage angular velocity, specifically the angular velocity of the fuselage about the Z-axis, in rad / s; R is the turning radius, specifically the radius of rotation of the fuselage when turning, in meters; (X,Y,θ) are the global coordinates, specifically the position of the fuselage's center of mass in the global coordinate system plus the yaw angle, in meters, meters, and rad.

[0141] The robot uses a differential-driven odometer, and its motion coordinate system and simplified model are shown in Figure 6.

[0142] In the differential drive chassis kinematics model, OXY represents the world coordinate system, and OrXrYr represents the body coordinate system. The point is the robot's center of mass. For the robot's instantaneous speed, Let this be the robot's position and orientation in the world coordinate system. The kinematic model of the two-wheeled differential chassis needs to satisfy the following two assumptions: 1) The drive wheels will only experience rolling friction with the ground, and there will be no sliding friction in any direction. 2) The left and right drive wheels are exactly the same size and shape, and are rigid bodies.

[0143] The robot's motion at any given moment can be decomposed into the linear velocity v at the center of the chassis and the instantaneous center of the orbital velocity. The forward kinematic equations for the rotational angular velocity w are as follows: ;

[0144] v and w are the linear velocity (m / s) and angular velocity (rad / s) of the robot's chassis center, respectively. denoted as angular velocities (rad / s) for the left and right drive wheels of the robot, d is the distance between the two drive wheels (m), and r is the radius of the drive wheel (m).

[0145] Robot orbiting the instantaneous center of velocity The instantaneous radius R is calculated using the following formula: ;

[0146] The inverse kinematics of the robot can be obtained: ;

[0147] like Figure 7 The illustrated process simplifies the motion interface of the underlying microcontroller and converts the (v, ...) signal from the host computer into a more intuitive and efficient interface. The robot's kinematics inverse kinematics is solved according to the above formula to obtain the desired angular velocities of the left and right drive motors. The speed setting values ​​of the corresponding motor PID controllers are updated in a timely manner. The weak PWM signal output by STM32 is transmitted to the motor drive module (L298N). The drive module amplifies the weak signal into a strong signal adapted to the motor. By adjusting the PWM duty cycle, the speed of the DC geared motor is controlled, and the direction of the motor is controlled by switching the GPIO level. The DC geared motor with a gearbox outputs mechanical rotation to directly drive the track to operate, thus meeting the robot's load requirements.

[0148] During motor operation, the AB-phase incremental encoder converts the motor's mechanical rotation into electrical pulse signals. The STM32 uses timers (TIM2 / TIM3) to collect the number of pulses within a fixed time interval (10ms). Combining this with the encoder line count and reduction ratio, the actual motor speed is calculated, completing the speed acquisition and feeding the actual speed back to the PID controller. The PID controller then calculates the error between the target speed and the actual speed, and uses the Kp (proportional), Ki (integral), and Kd (derivative) parameters to calculate the corrected PWM output value. The STM32 then transmits the new PWM signal to the drive module to adjust the motor speed to eliminate the error. This cycle executes every 10ms, continuously correcting the motor speed deviation, ultimately stabilizing the motor at the target speed and achieving precise motion control for the tracked robot.

[0149] Robot path planning based on the improved A* algorithm:

[0150] First, the robot needs to collect raw environmental data through its onboard sensors (LiDAR, vision camera, ultrasonic sensor, etc.). This data includes information such as the position, outline, and distance of various objects in the environment. However, it also contains a lot of redundant data and noise. To avoid this data interfering with path planning calculations and consuming hardware resources, the raw data needs to be filtered and cleaned: invalid noise data is removed, duplicate information is merged, and core path planning-related data such as obstacles and feasible areas are retained.

[0151] After data purification, the final result contains only the key state information required for path planning, namely the robot's starting position, target position, obstacle distribution area, and coordinate boundaries and topological relationships of the feasible passage area. This provides a clear digital foundation for subsequent grid map construction and improved A* algorithm calculations.

[0152] A grid map divides the preprocessed problem state space into several uniformly sized, regularly arranged square (or rectangular) grid cells according to preset accuracy requirements. Each grid cell corresponds to a fixed area in the physical environment, forming a "digital grid map." Each grid cell is assigned unique two-dimensional coordinates, corresponding one-to-one with its position in the physical environment. The algorithm can locate the robot's position, obstacle positions, and path nodes using these grid coordinates.

[0153] During the grid division process, the grid size (i.e., map precision) needs to be set based on the actual application scenario: the smaller the grid size, the more grids a single map contains, and the more detailed the environmental depiction; the larger the grid size, the fewer grids, and the coarser the environmental depiction. After division, the grids need to be "assigned a cost": grids with obstacles in the corresponding physical environment are marked as "infinite cost" and marked with a shadow (or a specific color) on the visualization map, representing that the area is impassable; grids with accessible areas without obstacles are assigned a fixed base cost (e.g., cost of 1), representing that the area is passable.

[0154] The A* algorithm is a representative algorithm in Generalized Programming (GP). Its total cost function consists of two parts, specifically:

[0155] Where f(n) is the total cost of the current node n; g(n) is the actual cost from the initial preset point to the current node n; and h(n) is the estimated cost from the current node to the final preset point, also known as the heuristic function. The distance function between the actual cost and the estimated cost is generally the Manhattan distance formula, expressed as the sum of the horizontal and vertical distances. Since only vertical and horizontal distances exist and there are no other road surface constraints, the horizontal and vertical movement costs of each cell on the map are set to 1. For ease of calculation, the diagonal cost of each cell is set to 1.4, and the distance function is expressed as follows: The A* algorithm requires two lists: an openlist and a closelist. The openlist stores the surrounding nodes reachable from the current state (in an 8-direction map, this means the surrounding eight directions: up, down, left, right, upper left, lower left, lower right, and upper right; obstacle areas are inaccessible). The closelist stores the surrounding nodes that the current node cannot reach and the nodes that have already been judged.

[0156] The A* algorithm is quick to respond to the environment and direct in its calculations. After processing the map into layers, it can effectively expand the scale of the map that can be processed. It also combines the ideas of depth-first and breadth-first search, and is highly heuristic, but its calculations are too rigid and it cannot adaptively adjust the heuristic weights.

[0157] To address the low search efficiency of the A* algorithm, Chebyshev distance is used as the cost distance criterion, and a dynamic decay relationship is introduced by combining it with a normal distribution. This leads to a reconstructed cost function with adaptively adjustable heuristic weights. The directional effect is enhanced around the initial node, reducing the computation of some unnecessary nodes, thereby shortening the path search time and improving search efficiency.

[0158] First, add the target point and its sequentially ascending parent nodes into the total node set Q, and mark the starting point as... The remaining nodes are sequentially labeled as ,in The target point. Starting point and path planning node set ( Draw straight lines in sequence and determine the straight lines. Whether it collides with an obstacle, if it's a straight line If a node collides with an obstacle, then... These are essential nodes on the path, and must be key turning points. Establish a set of key turning points O and first... Move it into it; if the line If no collision occurs with the obstacle, it is considered... Redundancy. Then... Reconnect the remaining nodes in Q sequentially, starting from the next node, until... The filtering process ends. The nodes in set O are used as intermediate guiding points for the fusion algorithm. The key node extraction and path reconstruction steps are illustrated below. Figure 8 As shown, the improved dynamic window algorithm with added safety distance factor instructs the tracked robot to perform local path planning in segments, transforming turning paths into motion paths sampled by velocity, thereby improving the smoothness and safety of the planned path and making the planned path more in line with robot dynamics.

[0159] Jetson Nano first completes environmental modeling of the work area, providing the basic computational basis for improving the A* algorithm, and then initiates iterative calculations of the improved A* algorithm to generate continuous optimal paths:

[0160] 1. Initialize the open and closed lists: The open list stores the raster nodes to be evaluated, initially containing only the starting node; the closed list stores the nodes that have been evaluated, initially empty;

[0161] 2. Node Traversal and Cost Calculation: Select the node with the smallest f(n) value from the open list as the current node, and traverse its adjacent grid nodes in the top, bottom, left, right, and diagonal directions; if the adjacent node is an impassable grid or is already in the closed list, skip it directly; if the adjacent node is not in the open list, calculate its g(n) (current node g(n) + adjacent node movement cost) and h(n), update f(n), add it to the open list, and record the parent node (for backtracking); if the adjacent node is already in the open list, compare the newly calculated g(n) with the original value, and if it is smaller, update g(n), f(n), and the parent node;

[0162] 2. Termination Condition and Path Backtracking: The algorithm terminates when the target node is added to the closed list; starting from the target node, backtracking along the parent nodes to the starting node yields the original path consisting of a series of grid coordinates;

[0163] 3. Path smoothing optimization: Post-process the original path to remove redundant inflection points (such as continuous small-angle turns) and transform the discrete grid path into a continuous polyline path to adapt to the motion characteristics of the tracked robot.

[0164] Jetson Nano transforms the smoothed path into standardized motion instructions executable by STM32, breaking down the geometric path into the robot's motion parameters.

[0165] Specifically, step S4 includes the following process:

[0166] Mechanical structure design and control of the vertical moving injection system:

[0167] The mechanical structure of the vertical spraying system consists of a motor-driven lead screw module, a 360-degree automatic opening and closing circular sprayer, a liquid storage device, and supporting connecting components, working together to complete the whitewashing operation within a specified area of ​​the tree trunk. The components are assembled using a combination of rigid connections and flexible piping, ensuring structural stability while meeting the requirements for automatic opening, closing, lifting, and spraying. The 360-degree automatic opening and closing circular sprayer is rigidly connected to the motor-driven lead screw module, and the liquid storage device supplies the sprayer with liquid through a highly flexible, corrosion-resistant hose, achieving synchronous adaptation between action and liquid supply.

[0168] Motor-driven lead screw module: The module adopts a high-precision ball screw and AC servo motor integrated drive. The lead screw has a lead of 10mm, and the stroke can cover the whitening height requirements of different tree species such as trees and shrubs. The AC servo motor, together with the closed-loop feedback system, can achieve 0.1mm level displacement control, so that the sprayer lifting and resetting process is uniform and stable. From the mechanical structure level, it avoids uneven whitening thickness, coating drips and resetting deviations caused by speed fluctuations.

[0169] The guiding mechanism adopts a symmetrical arrangement of double linear guide rails, with the guide rail slider rigidly connected to the sprayer mounting base. This effectively bears the weight of the sprayer and operational vibration loads, suppressing horizontal deviation and radial swaying during the sprayer's lifting and lowering process. This ensures the spray trajectory remains parallel to the tree trunk axis, improving circumferential spray uniformity. Limit switches and buffer devices are installed at the ends of both the upper and lower strokes of the module, forming a mechanical safety protection. When the sprayer moves to its stroke limit position, the limit switch is immediately triggered and cuts off the motor power, while the buffer device absorbs inertial impact, preventing damage to the mechanical structure due to overtravel and enhancing the system's operational safety and reliability.

[0170] 360-degree automatic opening and closing ring sprayer: The sprayer adopts a program-controlled automatic opening and closing ring structure. The inner diameter of the ring is optimized according to the common trunk diameter range. Equipped with an electric hinged opening and closing mechanism, it can automatically open and close under the control command, accurately adapting to trunks with different diameters at breast height. After closing, it forms an embracing posture to ensure that there are no dead angles in the spraying.

[0171] Eight to twelve high-pressure atomizing nozzles are evenly arranged circumferentially along the inner side of the ring. These nozzles are made of corrosion-resistant stainless steel, with an orifice diameter of 0.3mm and a spray angle of 60°. They atomize the whitewash into uniform particles, achieving full coverage of the tree trunk surface and preventing missed areas, accumulation, or dripping. The sprayer is fixed to the lead screw module slider via a dedicated connector. The connector features a bolt-type angle fine-tuning mechanism, allowing adjustment of the sprayer's pitch and yaw angles to maintain the optimal spray distance between the nozzles and the tree trunk, further improving the uniformity of the whitewash.

[0172] Liquid storage device and connecting pipeline: The liquid storage device is used to store whitewash, and its volume meets the needs of continuous operation on a single large tree or multiple small trees; the top of the device is equipped with a sealed feeding port and an air pressure balance hole. The feeding port is equipped with a sealed cover to prevent leakage during transportation and operation, and the air pressure balance hole is used to balance the internal and external air pressure to ensure stable output of whitewash.

[0173] like Figure 9 As shown, the liquid storage device and the 360° automatic opening and closing annular sprayer are connected by a highly flexible, corrosion-resistant, and pressure-resistant hose. The hose length is designed with sufficient leeway to ensure that the sprayer operates without pulling, interference, or blockage during its entire lifting and lowering process. A small electric pump and flow regulating valve are installed on the pipeline to adjust the whitewash spray flow rate according to the trunk diameter and coating thickness requirements, achieving on-demand supply.

[0174] Design of vertical moving injection control system:

[0175] The robot's relative distance to the trees is controlled using distance detection sensors.

[0176] After the robot navigates to the target tree work area using the improved A* algorithm path planning, it completes dual calibration through distance detection and visual recognition to ensure that the working distance and relative posture between the robot and the tree trunk meet the whitening requirements.

[0177] The distance detection unit uses a laser rangefinder sensor, installed at the front of the robot and at the same height as the spraying ring, to detect the horizontal distance between the robot and the tree trunk in real time. The target working distance is set to 0.5-0.8m. The sensor uploads the distance signal to the STM32 main control unit, which compares the measured distance with the target distance. When the deviation is greater than 5cm, the main control unit drives the track motor through PID closed-loop control to make fine adjustments to the position, allowing the robot to quickly enter the optimal spraying position.

[0178] Meanwhile, the robot's vision acquisition module acquires tree trunk images in real time, and completes tree trunk outline recognition through an improved YOLOv5 algorithm. The STM32 performs secondary alignment calibration based on the tree trunk width ratio in the image to ensure that the robot body and the tree trunk remain vertically aligned, avoiding uneven spraying or missed spraying due to positional deviation.

[0179] Whitening height control: The whitening height is controlled by a closed-loop system consisting of a lifting mechanism and a height feedback sensor, enabling precise positioning and stable maintenance of the spray ring at a working height of 1.2m. The spray ring is vertically moved by a ball screw slide driven by a two-phase four-wire stepper motor, with a linear potentiometer mounted on the side of the slide as a height feedback element.

[0180] The STM32 microcontroller acquires the potentiometer output voltage via an ADC and converts it into the actual height value. Using a target height of 1.2m as the setpoint and real-time detected height as the feedback value, a position-based PID algorithm (sampling period T=10ms) is employed for adjustment. ;

[0181] In the formula , This is the correction amount for the output pulse frequency.

[0182] The stepper motor pulse frequency and pulse number are adjusted in real time according to the height error, driving the slide to rise and fall and accurately positioning the spray ring to the target height range, ensuring consistent white coating height and neat coating boundary.

[0183] The system employs a closed-loop PID control algorithm to precisely regulate the supply of whitewash agent. The actual flow rate is collected in real time by a flow sensor and compared with the target flow rate set by the host computer to obtain the flow deviation. After PID calculation, a control quantity is output to adjust the opening of the flow regulating valve, thereby achieving dynamic flow stability.

[0184] This system employs a pump-valve collaborative optimization PID strategy, decomposing the total control quantity into pump frequency increments and valve opening increments. It prioritizes efficient fluid supply by adjusting the pump frequency, supplemented by fine-tuning the valve opening to stabilize pressure and flow. This approach reduces energy consumption and pipeline resistance losses while ensuring control accuracy. The PID parameters can be corrected online in real time through fuzzy inference, enhancing the system's adaptability under different operating conditions.

[0185] Based on the controller parameter correction amount obtained by defuzzification operation It can update PID parameters in real time. The specific formula is as follows: ; ; ;

[0186] In the formula: For each coefficient The initialization results are given. From this, the total control quantity U(t) of the system can be calculated, and the specific calculation formula is as follows: ;

[0187] The total control input is the core signal output by the PID controller, serving as a comprehensive adjustment command for the pump and valves. The following are the PID values ​​obtained after the experiment:

[0188] Control Scenario 1: Track motor speed control, proportional coefficient K p The integral coefficient K is 0.8. i The differential coefficient K is 0.12. d It is 0.05;

[0189] Control Scenario 2: Injector Height and Position Control, Proportional Coefficient K p The integral coefficient K is 1.2. i The differential coefficient K is 0.08. d It is 0.03;

[0190] Control Scenario 3: Whitewash Flow Control, Proportional Coefficient K p The integral coefficient K is 0.6. i The differential coefficient K is 0.15. d It is 0.02.

[0191] Compared with conventional PID control, the control strategy of this invention can improve liquid supply efficiency, optimize dynamic response speed, and achieve energy-saving operation while ensuring the accuracy of flow and pressure control.

[0192] Specifically, step S5 includes the following process:

[0193] 360° spray ring adaptive whitening: The opening and closing size of the two-lobed ring is controlled by a micro stepper motor.

[0194] The spray ring adopts a two-lobed, split-open structure, initially in its fully open position. After the robot arrives at the work location, the spray ring wraps around the tree trunk, and 2-4 infrared distance sensors evenly arranged on its inner side collect real-time distance data from the inner wall to the tree trunk surface. The STM32 microcontroller performs mean filtering on the multi-channel ranging signals, calculates the actual diameter of the tree trunk, compares it with a preset diameter threshold, matches the target opening and closing angle and the corresponding number of motor pulses from the parameter table, and controls the micro stepper motor to drive the spray ring to close to the appropriate size.

[0195] After the spray ring is positioned at a height of 1.2m, the STM32 starts the spray pump, simultaneously driving the lifting mechanism to lower the spray ring at a constant speed of 5cm / s to a height of 0.3m. During the descent, the nozzles continuously atomize the spray, and combined with the ring-shaped structure and vertical uniform motion, the entire circumference of the tree trunk is covered without any blind spots in one go. For thick tree trunks with a diameter greater than 30cm, the system controls the spray ring to spray back and forth once within the range of 1.2m to 0.3m to ensure a uniform coating thickness.

[0196] After the spraying is completed, the spray ring automatically opens to its maximum position, waiting for the next operation instruction.

[0197] In addition, the data acquisition and processing module in this invention collects sensor information such as distance, height, flow rate, and trunk diameter in real time, and uploads it to the host computer for display, recording and storage after filtering, calibration and normalization.

[0198] The system possesses comprehensive fault detection and alarm functions, capable of real-time monitoring of sensor anomalies, motor overload, pipeline blockages, and low whitewash levels. Upon fault occurrence, the system immediately triggers an audible and visual alarm, the host computer synchronously displays the fault type and location, and automatically stops operation to prevent escalation and improve system safety and reliability. The communication module utilizes the USART serial protocol for data exchange between the host and host computers, with a baud rate of 115200bps, 8 data bits, 1 stop bit, no parity bit, and a data transmission latency of less than 10ms. The system also supports WiFi wireless communication as a backup method, allowing for flexible switching based on the operating environment, enhancing communication stability and adaptability.

[0199] The communication module uses the USART serial communication protocol to transmit information between the lower-level and upper-level computers. The communication baud rate is set to 115200bps, with 8 data bits, 1 stop bit, and no parity bit, ensuring the stability and reliability of data transmission, and controlling the transmission delay to within 10ms. Simultaneously, the system is equipped with a backup communication module, which can switch to WiFi communication according to the needs of the operating environment, improving communication flexibility.

[0200] System collaborative workflow: The mobile robot autonomously navigates to the location of the tree to be whitewashed using the optimal path planned by the improved A* algorithm. The system uses an RS485 industrial bus to build a multi-sensor acquisition network, acquiring real-time information on the tree trunk shape and surrounding environment through laser rangefinders and infrared diameter sensors. The STM32 main control unit uses an external RS485 level converter chip to convert TTL and differential communication levels, and completes data interaction between multiple sensor nodes based on the Modbus RTU protocol to obtain multi-point distance measurement information and longitudinal contour data of the tree trunk cross-section.

[0201] After preprocessing such as median filtering and outlier removal, the raw data is filtered to remove environmental noise and interference from the tree trunk surface. The system uses least squares circular fitting and longitudinal contour linear fitting algorithms to calculate the trunk diameter at breast height (DBH), taper, and effective whitewash height. Combined with preset whitewash thickness (1.2-1.8 mm), nozzle atomization flow coefficient, and other process parameters, the system generates three sets of core operating parameters in real time, adapted to the current tree trunk shape: spray flow rate, lifting speed, and spray ring opening and closing diameter, and sends them to the STM32 motion control unit.

[0202] After receiving the operation parameters, the STM32 motion control unit drives the micro stepper motor to open the two-lobed split-ring sprayer to the initial position, and then drives the servo motor to the preset position via the motion control card. After the robot completes positioning and alignment calibration, the ring sprayer automatically closes and wraps around the tree trunk; then the lifting mechanism drives the spray ring to rise at a constant speed, and at the same time the electric diaphragm pump starts, and the whitewash is pressurized, filtered and delivered to the nozzle through a pressure-resistant hose, forming a uniform atomized field with a droplet size of 50-80μm and sprayed onto the surface of the tree trunk.

[0203] During the operation, a flow sensor collects the spray flow rate in real time and dynamically adjusts the opening of the flow regulating valve through a PID control algorithm to ensure a stable spray flow rate. A trunk diameter sensor monitors changes in trunk diameter in real time, and the system adaptively adjusts the spray flow rate and lifting speed to ensure uniform whitewash thickness for trunks with different diameters. When the spray ring reaches the preset upper limit of the whitewash height, a limit switch is triggered, and the system controls the spray ring to stop rising and switch to the lowering stroke, continuing spraying until the full height whitewash is completed.

[0204] After the operation is completed, the spraying and drive mechanism automatically stops, the spraying ring opens and resets, the system generates an operation record and uploads it to the host computer for storage, completing the fully automated whitewashing process for a single tree.

[0205] This invention designs a tracked robot for whitewashing trees. It captures images through a vision acquisition device, identifies unpainted trees using the YOLOv5 system, obtains location information, generates a movement path based on the A* algorithm, navigates to the target tree by avoiding obstacles, and then precisely controls the spray volume through a PID algorithm to operate a 360-degree automatic opening and closing circular sprayer to spray the tree trunk at a height of 1.2 meters.

[0206] This invention mainly enhances the robot's whitening capabilities by combining a tree identification and positioning system with a vertical movement spray control system, adapting to tree trunks of different diameters and improving work efficiency and effectiveness.

[0207] The above description is merely a detailed explanation of preferred embodiments and principles of the present invention. For those skilled in the art, there may be changes in specific implementation methods based on the ideas provided by the present invention, and these changes should also be considered within the scope of protection of the present invention.

Claims

1. An adaptive method for identifying and spraying whitewashed trees, characterized in that, Includes the following steps: Step S1, Target Identification and Localization: Environmental images are acquired using a depth camera, and the improved YOLOv5 model is used to detect the unpainted tree trunks, outputting bounding boxes and categories. Combined with depth information, the target center coordinates in the image coordinate system are transformed to the world coordinate system to obtain the three-dimensional position information of the target tree. Step S2, Route Planning and Navigation: Based on a grid map, an improved A* algorithm is used to plan a global path from the current location to the target tree, generating a path point sequence; the mobile robot navigates to the target tree according to the path point sequence. Step S3, Adaptive opening and closing and alignment: After the robot arrives, it controls the 360-degree automatic opening and closing ring sprayer to open; it measures the trunk diameter, matches the opening and closing angle according to the diameter, and drives the sprayer to close and hug the trunk. Step S4, Lifting and Spraying with Flow Control: The drive sprayer rises from the initial height to the target height, and spraying is started simultaneously, spraying whitewash onto the tree trunk through nozzles arranged in a ring; during the spraying process, the supply of whitewash is dynamically adjusted. Step S5, reciprocating spraying and resetting: Once the sprayer reaches its upper limit, it automatically switches to a descent stroke and continues spraying to achieve full height coverage; after spraying is completed, the sprayer opens and resets.

2. The adaptive tree whitewashing identification and spraying method according to claim 1, characterized in that, In step S1, depth information Calculated using structured light triangulation: ; Where B is the camera baseline length, f is the focal length, and d is the pixel offset value; Image coordinates (u,v) to world coordinates (u,v) , , The conversion includes the following process: First, the intrinsic parameter matrix K is converted into camera coordinates. The formula is as follows: , ; Among them, f x f y These are the focal lengths of the camera in the x and y directions, respectively. , The coordinates of the camera's principal point; Then, the external parameter rotation matrix R and translation matrix T are used to convert the coordinates to world coordinates: ; Where R is a 3×3 rotation matrix and T is a 3×1 translation matrix, both obtained through camera calibration.

3. The adaptive tree whitewashing identification and spraying method according to claim 2, characterized in that, In step S1, the improved YOLOv5 model specifically includes: The original feature fusion network is replaced with an AGFD module, and the SimAm attention mechanism is embedded in the AGFD module. The neck network's ordinary convolutions are replaced with lightweight convolutions using GSConv, and the C3 module is replaced by a Res-GS module built based on Res2Net. The Inner-IoU loss function is used instead of the CIoU loss function. The formula for calculating the Inner-IoU loss function is as follows: ; ; ; in, , These represent the left and right x-coordinates of the ground truth bounding box, respectively. , These represent the y-coordinates of the upper and lower boundaries of the ground truth bounding box, respectively. ; The Inner-IoU loss function value, which is the internal intersection-union ratio between the predicted bounding box and the ground truth bounding box, is used as a loss term for model training. for: ; in, and Represents the height and width of the ground truth bounding box; u represents the area where the ground truth bounding box and the predicted bounding box are joined; i represents the area where the ground truth bounding box and the predicted bounding box intersect. Among them, h, w, (x c ,y c ) represent the height, width, and center coordinates of the predicted bounding box, respectively; r is the scaling factor; b l b r These represent the x-coordinates of the left and right boundaries of the predicted bounding box, respectively; b t b b These represent the y-coordinates of the upper and lower boundaries of the prediction box, respectively.

4. The adaptive tree whitewashing identification and spraying method according to claim 3, characterized in that, In step S1, when the improved YOLOv5 model fails to detect tree targets on its first detection, a secondary detection mechanism is initiated, as follows: Adjust the image enhancement parameters and re-detect the target in the same frame. If no valid target is detected after the second detection, control the robot to rotate 20° clockwise around its own geometric center, pause for 0.3 seconds after rotation, then re-acquire the image and start a new round of detection. If no target is detected, repeat the 20° clockwise rotation, 0.3-second pause, re-acquire the image and start detection until the cumulative rotation angle reaches 360°. If no unpainted trees are detected after the cumulative rotation angle reaches 360°, sound an alarm and control the robot to stop searching and wait in place. The image enhancement parameters include contrast.

5. The adaptive tree whitewashing identification and spraying method according to claim 4, characterized in that, In step S2, the improved A* algorithm uses Chebyshev distance as the heuristic function and introduces a dynamic decay factor to adaptively adjust the weights of the heuristic function. After path generation, redundant nodes are removed using a key node extraction method, as follows: Starting from the initial point P1, connect the subsequent nodes P in sequence. i If the line P1P i If it collides with an obstacle, then P i-1 As key turning points, store them in the key point set O, and use P as the key point set O. i For a new starting point, repeat the operation of connecting the subsequent nodes sequentially from the current starting point and judging collisions until the target point is reached; use the extracted key nodes as intermediate guide points of the dynamic window method to generate a smooth velocity sampling motion path.

6. The adaptive tree whitewashing identification and spraying method according to claim 5, characterized in that, In step S2, the mobile robot adopts a differential drive method, and the corresponding kinematic model satisfies the following formula: ; J is the kinematic Jacobian matrix of the differential-driven robot, i.e.: ; Where k is the linear velocity of the robot. Angular velocity, Let d be the radius of the drive wheel and d be the distance between the two wheels. , These are the angular velocities of the left and right wheels, respectively. During navigation, the speed of the left and right track motors is adjusted by a PID speed controller. The PID controller executes once every 10ms, and the control quantity is the pulse width modulation (PWM) duty cycle correction value.

7. The adaptive tree whitewashing identification and spraying method according to claim 6, characterized in that, In step S4, the height control of the lifting spraying adopts a position-based PID algorithm, and the specific formula is as follows: ; in, , where is the altitude error value at time k; This represents the altitude error value at time k-1. Let be the height error value at time i; Target spraying height This is the actual spraying height; This is the amount of correction for the output pulse frequency; The sampling period.

8. The adaptive tree whitewashing identification and spraying method according to claim 7, characterized in that, In step S4, the adjustment of the whitewash supply adopts a pump-valve coordinated optimization PID control strategy, as follows: The total control quantity U(t) is decomposed into the pump frequency increment and the valve opening increment. The pump frequency is adjusted first, followed by valve fine-tuning. The controller parameters are corrected online through fuzzy inference, and the specific formula is as follows: ; ; ; ; in, This refers to the online correction scaling factor that varies over time. For online correction of integral coefficients that vary over time, This is the correction amount for the integral coefficient; For online correction of differential coefficients that vary with time, This is the correction amount for the differential coefficients; Let t be the error value of the whitewash supply at time t, that is, the difference between the target supply and the actual supply. Let be the error variable during the integration process; , , These are the proportionality coefficients. Integral coefficient Differential coefficients The initialization result; This is the adjustment amount for the controller parameters.

9. The adaptive tree whitewashing identification and spraying method according to claim 8, characterized in that, In step S5, for thick tree trunks with a diameter greater than 30cm, the sprayer is controlled to spray once repeatedly within a height range of 1.2m to 0.3m.

10. An adaptive tree whitewashing identification and spraying system, used to implement the adaptive tree whitewashing identification and spraying method according to any one of claims 1-9, characterized in that, The adaptive tree whitewashing recognition and spraying system includes: The mobile tracked chassis uses differential drive, with the left and right tracks driven by a motor and an encoder, respectively. The main control unit is used to receive motion commands sent by the path planning module, adjust the speed of the track motor through PID speed closed-loop control, and control the opening, closing, lifting and spraying actions of the sprayer. The environment perception module, including a depth camera and a ranging sensor, is used to run an improved YOLOv5 model; The path planning and navigation module is used to execute the improved A* algorithm, generate a smooth path, and send motion commands to the main control unit. A 360-degree automatic opening and closing annular injector, wherein the injector has a two-lobed opening structure and is driven to open and close by a micro stepper motor. 8-12 high-pressure atomizing nozzles are evenly arranged circumferentially on the inner side of the injector, with a nozzle orifice diameter of 0.3mm and a spray angle of 60°. The lifting actuator is used to drive the injector to rise and fall. The liquid supply and flow control unit, including a liquid storage tank, pump, flow regulating valve and flow sensor, is used to supply whitening agent to the injector; The host computer monitoring module communicates with the main control unit to display operation parameters and fault alarm information in real time.