Method and device for measuring and calculating relative height of canopy of unmanned aerial vehicle in canopy-imitating flight and unmanned aerial vehicle
By integrating data from ultrasonic, laser ranging, and millimeter-wave radar sensors, and utilizing sliding window and dynamic weighting techniques, the problem of inaccurate altitude calculation for UAVs in forest canopy environments was solved, thereby improving flight stability and safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-08
- Publication Date
- 2026-04-07
AI Technical Summary
Existing drones struggle to achieve stable and reliable relative height measurement of the canopy in forest environments, as they are affected by uneven canopy structure and strong dynamic disturbances, resulting in poor flight stability.
By combining the advantages of ultrasonic sensors (short-range sensitivity), laser rangefinders (high precision), and millimeter-wave radar sensors (penetrating capability), and through data correction, setting a sliding window, and dynamic weighting to fuse data from the three types of sensors, accurate measurement of the relative height of the canopy can be achieved.
It improves the flight stability and operational safety of drones in forest canopy environments, adapts to complex working conditions such as uneven canopy and wind-induced swaying, and provides accurate altitude calculation results.
Smart Images

Figure CN121804422A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method, apparatus, and drone for calculating the relative height of the canopy during canopy-inspired flight of an unmanned aerial vehicle (UAV), belonging to the field of unmanned aerial vehicles (UAVs). Background Technology
[0002] With the rapid development of drone technology in forestry, agriculture, and power industries, its application in tasks such as semi-autonomous hoisting, autonomous hoisting, plant protection spraying, and inspection is becoming increasingly widespread. For mission scenarios in complex canopy environments such as forests, drones often need to fly stably within a certain distance above the canopy layer—a process known as canopy-mimicking flight—to perform operations such as material hoisting, canopy data collection, or inspection. These tasks require drones to measure the relative height of the canopy based on its dynamic undulations and environmental changes, and to adjust their own altitude in real time to maintain a stable relative flight attitude and safe operating distance. However, the forest canopy has significantly different spatial structure characteristics compared to other tree species. The branches and leaves at the top of the canopy are either sparse or dense, with a highly uneven spatial distribution. Significant dynamic disturbances exist, such as wind-induced swaying, leaf shading, and changes in light intensity, which poses a severe challenge to drone altitude control and relative height estimation in canopy environments.
[0003] Existing methods for measuring and controlling the altitude of unmanned aerial vehicles (UAVs) mostly rely on a single type of sensor, such as a visual sensor, ultrasonic sensor, laser rangefinder, or millimeter-wave radar sensor. However, these sensors each have their limitations in complex natural environments.
[0004] Among them, visual sensors can estimate height through images or depth information, but they are easily affected by changes in lighting, shadows and repetitive leaf textures in forest scenes, and image processing computation is large and requires high airborne computing resources. Laser rangefinders offer high ranging accuracy and resolution. However, their small spot size makes them prone to overlooking protruding branches; the small spot can even penetrate through gaps in the branches and fall directly onto the ground. This makes it difficult to accurately reflect the overall canopy outline, and the data fluctuates more significantly, causing drones to constantly adjust their position during flight. Furthermore, obtaining a better overall canopy outline typically requires a gimbal, which is costly and power-intensive. Millimeter-wave radar sensors have some penetration capability and can detect structural information under sparse foliage, but in multi-layered canopy conditions, they may penetrate to lower foliage or the ground, leading to lower ranging results. Ultrasonic sensors are simple in structure and low in cost, but their ranging range is limited, their response speed is slow, and they are susceptible to wind disturbance and sound absorption by branches and leaves.
[0005] Due to differences in the sensing mechanisms and anti-interference characteristics of different sensors, it is difficult for a single sensor to achieve stable and reliable height estimation in an environment such as the unevenly distributed and significantly disturbed forest canopy.
[0006] While existing multi-sensor fusion algorithms can alleviate single-source errors to some extent, they mostly employ fixed-weight averaging or Kalman filtering. Due to the limitations of each sensor, applying fixed weights to different sensors makes it difficult to adapt to complex and time-varying environmental characteristics. One of the core assumptions of Kalman filtering is that noise follows a Gaussian distribution with fixed statistical properties. However, sensor noise in the forest canopy is non-uniform and time-varying. Kalman filtering cannot dynamically adjust its adaptability to different sensor noise. When the local density or height of the canopy changes rapidly, the fusion result is easily affected by single-source anomalies, causing lag or oscillation in UAV altitude control.
[0007] In addition, there are many types of existing sensors with different frequencies and characteristics. For example, the frequency of laser rangefinders is generally 0-1000 Hz, with the upper limit being significantly higher than that of other sensors. Therefore, people are still exploring which sensors can be used together to achieve good results.
[0008] Existing methods for calculating the relative height of the bamboo canopy for drones are insufficient to achieve stable and reliable height estimation in environments with uneven distribution and significant disturbances. Due to the varying density and spatial distribution of branches and leaves at the top of the bamboo canopy, it is greatly affected by wind-induced swaying, sunlight, and other factors, resulting in strong dynamic disturbances. This technical deficiency makes drones particularly inadequate when flying above bamboo forests in a canopy-like manner. Drones often struggle to fly at the ideal height expected by people, and there are obvious upper-level oscillations, resulting in poor flight stability and causing inconvenience to canopy-like flight. Summary of the Invention
[0009] To address the aforementioned problems or one of the aforementioned problems, the objective of this invention is to provide a method for calculating the relative height of the canopy during canopy-following flight of unmanned aerial vehicles (UAVs). This method integrates the advantages of ultrasonic sensors for close-range sensitivity, laser rangefinders for high precision, and millimeter-wave radar sensors for penetrating power. It effectively addresses complex working conditions such as uneven forest canopy and strong dynamic disturbances, enabling accurate calculation of the relative height of the UAV canopy and improving the stability and safety of canopy-following flight.
[0010] To address the aforementioned problems or one of the aforementioned problems, the second objective of this invention is to provide a canopy relative height calculation device for UAV canopy-mimicking flight. This device integrates the advantages of ultrasonic sensors for close-range sensitivity, laser rangefinders for high precision, and millimeter-wave radar sensors for penetrating power, effectively addressing complex working conditions such as uneven forest canopy and strong dynamic disturbances, achieving accurate calculation of the UAV canopy relative height, and improving the stability and operational safety of canopy-mimicking flight.
[0011] To address the aforementioned problems or one of the aforementioned problems, the second objective of this invention is to provide a drone that integrates the advantages of ultrasonic sensors for close-range sensitivity, laser rangefinders for high precision, and millimeter-wave radar sensors for penetrating power. This effectively addresses complex working conditions such as uneven forest canopy and strong dynamic disturbances, enabling accurate calculation of the relative height of the canopy and improving the stability and safety of canopy-following flight.
[0012] To achieve one of the above objectives, the first technical solution of the present invention is as follows: A method for calculating the relative height of the canopy during canopy-inspired flight of an unmanned aerial vehicle (UAV) includes the following steps: Acquire raw measurement data from ultrasonic sensors, laser rangefinders, and millimeter-wave radar sensors; By fusing raw measurement data from three types of sensors, the relative height of the UAV canopy is obtained.
[0013] As a preferred technical measure: The method for obtaining the relative height of the UAV canopy by fusing raw measurement data from three types of sensors is as follows: Step 1: Using a pre-established correspondence between the sensor readings and the actual height, correct the three types of raw measurement data to obtain corrected measurement data; Step 2: Set a sliding window based on each type of corrected measurement data; filter the data within the sliding window to obtain the measured data, and simultaneously obtain the fluctuation index of the data within the sliding window; Step 3: Based on the volatility index, assign a corresponding weight to each type of measured data, with the weight decreasing as the volatility increases. Step 4: Weight and fuse the three types of measured data to obtain the relative height of the UAV canopy.
[0014] As a preferred technical measure: Step 1: Using a pre-established correspondence between the sensor readings and the actual height, correct the three types of raw measurement data. The method for obtaining the corrected measurement data is as follows: Step A1: At different actual heights, obtain the detection values of each sensor to obtain multiple sets of corresponding points between actual heights and detection values; Step A2: Construct a fitting curve to fit the corresponding points. This fitting curve represents a relationship containing several undetermined coefficients. Step A3: Using the least squares method, with the goal of minimizing the sum of squared residuals between the predicted height and the actual height corresponding to the fitted curve of the detected value, establish a system of linear equations about the undetermined coefficients. Step A4: Solve the system of linear equations to obtain the undetermined coefficients, and determine the relationship between the actual height and the detected value, i.e., the correspondence; Step A5: Substitute the original measurement data from the sensor into the formula and calculate to obtain the corrected measurement data.
[0015] As a preferred technical measure, the acquisition of raw measurement data from the ultrasonic sensor, laser rangefinder, and millimeter-wave radar sensor includes: Step B1: Collect data from the ultrasonic sensor, laser rangefinder, and millimeter-wave radar sensor; Step B2: Determine the validity of the collected data and replace invalid values with zero; Step B3: Use the remaining valid values and the replaced zeros together as the original measurement data; In step two, setting a sliding window based on each type of corrected measurement data means setting a sliding window containing N data points with the current time as the endpoint, based on each type of corrected measurement data. In step two, filtering the data within the sliding window to obtain the measured data includes: listing zero data within the sliding window as invalid samples and listing non-zero data as valid samples. If there are valid samples within the sliding window, the average of all valid samples is calculated, and the average value is the measured data at the current time. Otherwise, zero is output as the measured data at the current time. In step two, the content of the fluctuation index of the data within the sliding window includes: When there are at least two valid samples within the sliding window, calculate the variance of the valid samples and compare it with the preset minimum variance, taking the larger one as the fluctuation index at the current moment. When there is only one valid sample in the sliding window, the preset maximum variance is used as the fluctuation index at the current moment. When there are no valid samples in the sliding window, output zero as the fluctuation index at the current moment.
[0016] As a preferred technical measure: Step three, based on the volatility index, assigns a corresponding weight to each type of measured data, with the weight decreasing as volatility increases. This includes: Only the measured data at the current moment where the fluctuation index is not zero are assigned the corresponding weight; The weight of the measured data is set as the reciprocal of its fluctuation index; Normalize all weights; Step four, which involves weighted fusion of the three types of measured data to obtain the relative height of the UAV canopy, is as follows: The volatility indicators are filtered out, and the measured data where the volatility indicator is zero at the current moment are removed. The results of multiplying the remaining measured data by their corresponding weights and adding them together give the relative height of the drone's canopy at the current moment.
[0017] Or / and: In step B2, the method for determining the legality of the collected data is as follows: For ultrasonic sensors, data received after a time exceeding the maximum echo wait time is considered invalid. For laser rangefinders, data with extreme values or intensity values lower than a preset value are considered invalid. For millimeter-wave radar sensors, data exceeding the maximum range is considered invalid. Or / and: The value of N is from 5 to 15; Or / and: The amount of data within the sliding window is dynamically adjusted according to the flight conditions.
[0018] As a preferred technical measure: The ultrasonic sensor includes a first ultrasonic sensor and a second ultrasonic sensor that are triggered alternately. The laser ranging sensor and the millimeter-wave radar sensor have the same sampling frequency, and the sampling frequency of the first ultrasonic sensor and the second ultrasonic sensor is half the sampling frequency of the millimeter-wave radar sensor. The triggering frequency of the first ultrasonic sensor and the second ultrasonic sensor is the same as their sampling frequency. The first ultrasonic sensor and the second ultrasonic sensor each have their own reception period after being triggered, and the duration of the reception period is not shorter than the maximum echo waiting time. The upper limit of the triggering frequency is determined based on the maximum effective range and sound velocity of the ultrasonic sensor.
[0019] As a preferred technical measure, interrupt priority configuration is also included. The highest priority is used for triggering the ultrasonic sensor to ensure that the ultrasonic transmission cycle is not interrupted. The second highest priority is allocated to ultrasonic sensor echo acquisition, laser rangefinder data reception, and millimeter-wave radar sensor data reception, respectively. Lower priority is used for data fusion.
[0020] To achieve one of the above objectives, the second technical solution of the present invention is as follows: A canopy relative height calculation device for unmanned aerial vehicle (UAV) canopy-inspired flight includes a shell, a first ultrasonic sensor, a second ultrasonic sensor, a laser rangefinder, a millimeter-wave radar sensor, and a controller; The controller is used to implement the canopy relative height calculation method for UAV canopy-inspired flight described in this invention.
[0021] As a preferred technical measure: the controller, the first ultrasonic sensor, the second ultrasonic sensor, the laser rangefinder, and the millimeter-wave radar sensor are located inside the housing, and the first ultrasonic sensor, the second ultrasonic sensor, the laser rangefinder, and the millimeter-wave radar sensor are exposed on the bottom surface of the housing. The first ultrasonic sensor, the second ultrasonic sensor, and the laser rangefinder are arranged on the side of the millimeter-wave radar sensor, and the laser rangefinder is located between the two ultrasonic sensors. Or / and: The gap between the first ultrasonic sensor and the second ultrasonic sensor is greater than 60 mm; Or / and: The controller is an STM32 microcontroller, which is connected to the laser rangefinder and millimeter-wave radar sensor via a serial port, and to the first ultrasonic sensor and the second ultrasonic sensor via a TTL interface; Or / and: The top of the housing has a mounting structure for mounting on a drone; To achieve one of the above objectives, the third technical solution of the present invention is as follows: A drone is provided with a canopy relative height calculation device for canopy flight as described in this invention on its bottom surface. The bottom surface of the drone is also provided with a pole for hoisting cargo to avoid the cargo affecting the accuracy of the sensor.
[0022] Compared with existing technologies, this invention has the following advantages: it accurately compensates for the limitations of single sensors by utilizing the short-range sensitivity of ultrasonic sensors to fill the blind spots in short-range canopy measurements; it leverages the high precision of laser rangefinders to accurately capture local thorns and small structures on tree branches; and it utilizes the penetrating power of millimeter-wave radar sensors to capture the stable height of the lower canopy when the top branches sway in the wind, avoiding misjudgments by a single sensor and providing a safe distance guarantee for the entire drone; by integrating the advantages of three sensors, this invention effectively addresses complex working conditions with strong dynamic disturbances such as uneven forest canopy, wind-induced swaying, and branch and leaf obstruction, achieving accurate calculation of the relative height of the drone canopy and improving the stability and safety of canopy-following flight.
[0023] Furthermore, this invention corrects the original data by pre-establishing the correspondence between sensor detection values and actual heights, accurately compensating for the inherent errors of each sensor in the forest canopy environment. This provides a highly reliable data foundation for subsequent fusion, avoiding distortion of the fusion results caused by deviations in the original data. A sliding window is set based on the corrected data, which can remove instantaneous noise from the sensors through filtering, ensuring data stability and real-time performance. This avoids the lag or over-smoothing problems of fixed filtering methods under dynamic canopy disturbances. Weighting is based on data fluctuation indices within the sliding window, giving higher weights to sensors with small fluctuations and high stability, automatically avoiding the influence of abnormal data with large fluctuations, resulting in higher reliability. Compared to traditional fixed weights or Kalman filtering, this invention is more suitable for the dynamic characteristics of uneven forest canopy density and wind-induced swaying, significantly improving the robustness of height estimation.
[0024] This invention is particularly suitable for drones to fly in a canopy-like manner over bamboo forests. Attached Figure Description
[0025] Figure 1 This is a timing diagram of the ultrasonic sensor in Example 2; Figure 2 This is an interruption distribution diagram for each sensor in Example 2; Figure 3 This is a flowchart of the workflow for Example 2; Figure 4 This is a schematic diagram of the appearance of Embodiment 3; Figure 5 This is a schematic diagram of the third embodiment viewed from an angle. Explanation of reference numerals in the attached figures: 1. First ultrasonic sensor; 2. Second ultrasonic sensor; 3. Laser rangefinder sensor; 4. Millimeter-wave radar sensor; 5. Housing; 6. Mounting structure. Detailed Implementation
[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application. This invention covers any substitutions, modifications, equivalent methods, and solutions made within the spirit and scope of the invention as defined by the claims.
[0027] Example 1 This embodiment describes a method for calculating the relative height of the canopy during canopy-inspired flight of an unmanned aerial vehicle (UAV), including the following steps: Acquire raw measurement data from ultrasonic sensors, laser rangefinders, and millimeter-wave radar sensors; By fusing raw measurement data from three types of sensors, the relative height of the UAV canopy is obtained.
[0028] To better eliminate invalid data and reduce interference, thus making height calculation more accurate, the acquisition of raw measurement data from the ultrasonic sensor, laser rangefinder, and millimeter-wave radar sensor includes: Step B1: Collect data from the ultrasonic sensor, laser rangefinder, and millimeter-wave radar sensor; Step B2: Determine the validity of the collected data and replace invalid values with zero; Step B3: Use the remaining valid values and the replaced zeros together as the original measurement data; In step B2, the method for determining the legality of the collected data is as follows: For ultrasonic sensors, data received after a time exceeding the maximum echo wait time is considered invalid. For laser rangefinders, data with extreme values or intensity values lower than a preset value are considered invalid. For millimeter-wave radar sensors, data exceeding the maximum range is considered invalid. To more effectively integrate data from the three types of sensors and obtain more accurate altitude calculation results, the method for obtaining the relative altitude of the UAV's canopy by integrating the raw measurement data from the three types of sensors can be as follows: Step 1: Using a pre-established correspondence between the sensor readings and the actual height, correct the three types of raw measurement data to obtain corrected measurement data; Step 2: Set a sliding window based on each type of corrected measurement data; filter the data within the sliding window to obtain the measured data, and simultaneously obtain the fluctuation index of the data within the sliding window; Step 3: Based on the volatility index, assign a corresponding weight to each type of measured data, with the weight decreasing as the volatility increases. Step 4: Weight and fuse the three types of measured data to obtain the relative height of the UAV canopy.
[0029] Specifically, step one: using a pre-established correspondence between the sensor readings and the actual height, the three types of raw measurement data are corrected. The method for obtaining the corrected measurement data is as follows: Step A1: At different actual heights, obtain the detection values of each sensor to obtain multiple sets of corresponding points between actual heights and detection values; Step A2: Construct a fitting curve to fit the corresponding points. This fitting curve represents a relationship containing several undetermined coefficients. Step A3: Using the least squares method, with the goal of minimizing the sum of squared residuals between the predicted height and the actual height corresponding to the fitted curve of the detected value, establish a system of linear equations about the undetermined coefficients. Step A4: Solve the system of linear equations to obtain the undetermined coefficients, and determine the relationship between the actual height and the detected value, i.e., the correspondence; Step A5: Substitute the original measurement data from the sensor into the formula and calculate to obtain the corrected measurement data.
[0030] By correcting the original data through pre-established correspondences, the inherent errors of each sensor in the canopy environment can be accurately compensated, providing a highly reliable foundation for subsequent data fusion, avoiding distortion of fusion results due to deviations in the original data, and ensuring the accuracy of subsequent calculations.
[0031] In step two, setting a sliding window based on each type of corrected measurement data means setting a sliding window containing N data points with the current time as the endpoint, based on each type of corrected measurement data. In step two, filtering the data within the sliding window to obtain the measured data includes: listing zero data within the sliding window as invalid samples and listing non-zero data as valid samples. If there are valid samples within the sliding window, the average of all valid samples is calculated, and the average value is the measured data at the current time. Otherwise, zero is output as the measured data at the current time. This method can remove instantaneous noise from the sensor within the sliding window, reduce data fluctuations by averaging the effective samples, provide stable measured data for subsequent weighted fusion, and improve the reliability of canopy relative height measurement. The value of N can be between 5 and 15; the number of data points within the sliding window can also be dynamically adjusted according to the flight conditions. In step two, the content of the fluctuation index of the data within the sliding window includes: When there are at least two valid samples within the sliding window, calculate the variance of the valid samples and compare it with the preset minimum variance, taking the larger one as the fluctuation index at the current moment. When there is only one valid sample in the sliding window, the preset maximum variance is used as the fluctuation index at the current moment. When there are no valid samples in the sliding window, output zero as the fluctuation index at the current moment.
[0032] The volatility indicator can be variance; Specifically, step three, which assigns a corresponding weight to each type of measured data based on the volatility index, with the weight decreasing as volatility increases, includes: Only the measured data at the current moment where the fluctuation index is not zero are assigned the corresponding weight; The weight of the measured data is set as the reciprocal of its fluctuation index; Normalize all weights; Step four, which involves weighted fusion of the three types of measured data to obtain the relative height of the UAV canopy, is as follows: The volatility indicators are filtered out, and the measured data where the volatility indicator is zero at the current moment are removed. The results of multiplying the remaining measured data by their corresponding weights and adding them together give the relative height of the drone's canopy at the current moment.
[0033] In UAV canopy relative height calculation, inverse variance weighting dynamically allocates weights based on the fluctuation indicators (such as variance) of measured data from three types of sensors. Smaller variance indicates more stable and reliable data, resulting in higher weights; larger variance indicates greater data volatility and lower reliability, resulting in lower weights. During weighting, only measured data with non-zero fluctuation indicators are weighted. The weight can be the reciprocal of the variance and normalized, eliminating invalid data with zero fluctuation indicators. Weighted fusion highlights stable data and suppresses outliers, adapting to dynamic environments with uneven canopy density and wind-induced swaying, thus improving the accuracy and robustness of height calculation.
[0034] To improve the coverage of the ultrasonic sensor, the ultrasonic sensor may include a first ultrasonic sensor and a second ultrasonic sensor that are triggered alternately; the two ultrasonic sensors use an alternating triggering method to measure distance, and they work in staggered time to avoid sound wave crosstalk.
[0035] To ensure that the sampling frequencies of each sensor are aligned and to facilitate data fusion, the following scheme can be adopted; The laser ranging sensor and the millimeter-wave radar sensor have the same sampling frequency, and the sampling frequency of the first ultrasonic sensor and the second ultrasonic sensor is half the sampling frequency of the millimeter-wave radar sensor. The triggering frequency of the first ultrasonic sensor and the second ultrasonic sensor is the same as their sampling frequency. The first ultrasonic sensor and the second ultrasonic sensor each have their own reception period after being triggered, and the duration of the reception period is not shorter than the maximum echo waiting time. The upper limit of the triggering frequency is determined based on the maximum effective range and sound velocity of the ultrasonic sensor.
[0036] A specific solution could be: the trigger cycle of the ultrasonic sensor is controlled by a timer, typically 40 Hz, and the independent trigger frequency of each ultrasonic sensor is 20 Hz. This ensures that the two ultrasonic ranging frequencies are independent and stable.
[0037] The sampling period of the millimeter-wave radar sensor is set according to its internal processing frame rate, with a typical value of 40 Hz. The ranging data is output to the controller via serial port transmission.
[0038] The laser rangefinder samples at a fixed period, typically between 0 and 1000 Hz. In this embodiment, 40 Hz is used, and the output range data is transmitted to the controller via a serial port. It should be noted that, in this UAV canopy-following flight canopy relative height calculation scheme, although the laser rangefinder sensor has a high sampling frequency range of 0-1000Hz, it is specifically adjusted to 40Hz in this embodiment. This choice may seem to deviate from the conventional approach of prioritizing high frequencies to maximize sensor performance, but it actually contains creative design and is deeply adapted to the variance weighting mechanism.
[0039] If high-frequency sampling is used, the laser rangefinder sensor, due to its small spot size, can easily penetrate the gaps in the canopy branches and leaves to collect ground data, resulting in drastic fluctuations in the measurement data and a significant increase in the variance of the effective samples within the corresponding sliding window. Furthermore, in this scheme, weights are inversely proportional to variance; a larger variance results in a lower weight. This would significantly weaken the weight of the high-precision sensor in the weighted fusion process, thus wasting its core advantages.
[0040] When the frequency is reduced to 40Hz, ground-based mis-sampling decreases, data fluctuations are reduced, and the effective sample variance within the sliding window decreases. Sensors can participate in fusion with higher weights, thus leveraging the high accuracy of laser ranging. At the same time, 40Hz can be precisely matched with the 40Hz of millimeter-wave radar and the 20Hz of ultrasonic sensors (half the millimeter-wave frequency), ensuring that multi-sensor data are synchronized in the sliding window filtering and variance calculation stages. This allows the variance weighting mechanism to function more efficiently, fully releasing the accuracy value of the laser ranging sensor, significantly improving the reliability of the fusion results, and providing stable support for UAV altitude control.
[0041] Specifically, this also includes interrupt priority configuration. The highest priority is used for triggering the ultrasonic sensor to ensure that the ultrasonic transmission cycle is not interrupted. The next highest priority is allocated to ultrasonic sensor echo acquisition, laser rangefinder data reception, and millimeter-wave radar sensor data reception to ensure that time-sensitive data is recorded in real time. Lower priority is used for data fusion, and the data fusion frequency can be 30Hz. This ensures that the fusion algorithm executes at a uniform frequency and outputs a relative height estimate. In this embodiment, the characteristics of the three types of sensors are as follows: Two ultrasonic sensors are positioned at a certain horizontal distance on the bottom of the drone, so that their sound beam coverage areas partially overlap but do not completely coincide, thereby obtaining more comprehensive close-range measurement information when the bamboo canopy is sparse or local branches are more prominent.
[0042] Both ultrasonic sensors are pointed vertically downwards towards the ground to measure the height of the bamboo crown at close range (generally within the range of 5 to 350 cm).
[0043] The laser rangefinder is also located at the center of the bottom of the drone. Its beam is vertically downward. Laser rangefinders have the characteristics of high precision and small spot size. They can be used to capture the instantaneous height information of the small structure of bamboo crown and local protrusions. Its rangefinder covers about 1 to 1500 cm, which can supplement the insufficient precision of ultrasonic data.
[0044] The millimeter-wave radar sensor is positioned at the center of the drone's bottom, allowing its beam coverage area to be larger than that of lasers and ultrasound. Millimeter waves have a certain penetrating power, enabling measurements of lower branches and leaves or deeper structures in sparse bamboo canopies, providing stable, overall trend-based altitude data.
[0045] By combining the advantages of the above three types of sensors, more accurate results can be obtained for the relative height of the canopy.
[0046] The specific models of the three types of sensors are as follows: the millimeter-wave radar sensor is the NRA12 millimeter-wave radar, the laser rangefinder sensor is the TFmini Plus laser radar, and the ultrasonic sensor is the HC-SR04 ultrasonic sensor.
[0047] Example 2 This embodiment describes a method for calculating the relative height of the canopy during canopy-inspired flight of an unmanned aerial vehicle (UAV), including the following steps: The first step is to obtain the raw measurements from the ultrasonic sensor, laser rangefinder, and millimeter-wave radar sensor. Quantitative data, specifically including: Collect data from ultrasonic sensors, laser rangefinders, and millimeter-wave radar sensors; The collected data is validated, and invalid values are replaced with zero. The validity standards for data from different sensors are as follows: Laser rangefinder sensor: When the intensity value is <100 or =65535 (extreme value), the distance is considered invalid and the output is 0; Ultrasonic sensor: Outputs 0 if the maximum echo wait time is exceeded; Millimeter-wave radar sensor: Output 0 when the maximum range (20m) is exceeded.
[0048] The remaining valid values and the replaced zeros are used together as the original measurement data.
[0049] The ultrasonic sensor includes a first ultrasonic sensor and a second ultrasonic sensor that are triggered alternately. In bamboo forest environments, ultrasonic ranging is easily affected by multiple reflections from leaves, which may lead to ranging timeouts and misjudgments. The invention addresses the problems of entering the next cycle or abnormal values caused by crosstalk from opposing sensors by employing dual ultrasonic waves, time gating, and redundancy removal mechanisms.
[0050] Therefore, the first step is to introduce a redundancy range limitation, that is, to use two ultrasonic sensors to prevent one of them from failing. Data that is invalid or outdated is removed when it exceeds the maximum range required for the task. Time gating is also used to prevent crosstalk between two ultrasonic waves. like Figure 1 As shown, in order to prevent crosstalk between the two ultrasonic sensors due to the two sensors receiving erroneous echo reflection signals from each other during operation, a time gating method is introduced, and the working time of the two sensors is staggered. The purpose is to ensure that the two sensors only receive echoes within the expected echo window of this transmission.
[0051] Set an expected time window and This is the redundancy coefficient, and its value can be between 0 and 0.5.
[0052] For ultrasonic sensors A and B, then: At the theoretical maximum time difference The additional tolerance time added is used to improve the stability and anti-interference capability of the time consistency between the two ultrasonic sensors. Use a time-domain flag to distinguish between valid and invalid values: in For time domain flags, This is the serial number of the ultrasonic sensor. These are the echo reception time and the transmission time, respectively. The maximum allowable echo latency, where c is the speed of sound. This is the maximum permissible measurement distance.
[0053] After obtaining the above relationship, the distance is equal to: This ensures that data within the allowable range is output normally, and for rejected data, the ultrasonic sensor output is replaced with 0.
[0054] Analyze the frequency of the dual ultrasonic sensors and specify... The system's trigger frequency, The system's trigger period is [value], and the independent trigger frequencies of the two ultrasonic sensors are [value]. Its independent triggering cycle is : As can be seen, in a dual-ultrasound system, to prevent echo crosstalk and aliasing, the first and second ultrasonic sensors need to be triggered alternately and have independent reception periods for independently receiving echo signals; the duration of the reception period can be as described above. ; System trigger frequency With the longest range of a single ultrasound The relationship is closely related because the echo signal generated by the trigger signal of the first ultrasonic sensor needs to be received before the second ultrasonic sensor is triggered (redundancy factor not considered). After that, the first ultrasonic sensor waits for one cycle for the second ultrasonic sensor to receive the signal. The physical constraint relationship can be expressed as follows: Therefore, the upper limit of the system trigger frequency is: Therefore, the total sampling frequency of the dual ultrasonic sensors The relationship between the distance and the distance is: This represents the maximum effective ranging range of the ultrasonic sensor, while the total sampling frequency of the system... This refers to the highest refresh rate at which the dual sensors can provide stable ranging data while avoiding echo crosstalk. It directly determines the height update frequency, the data density of the fusion algorithm, and the system's dynamic response performance. Here, we can take its maximum value. ; Since we want the system to have a stable output, and the dual ultrasonic sensors to avoid exceeding their range and becoming useless, we calculate the transmission and reception time for each transmission and reception based on the maximum range and velocity of the ultrasonic waves. Then, we use this time to calculate the maximum frequency we can achieve, and set the sampling frequency of the entire sensor system based on this frequency.
[0055] The second step involves fusing the raw measurement data from the three types of sensors to obtain the relative height of the UAV's canopy, specifically including: Step 1: Using a pre-established correspondence between the sensor readings and the actual height, correct the three types of raw measurement data to obtain corrected measurement data; Each sensor is affected by the environment, resulting in ranging errors; therefore, calibration of each sensor is necessary. Sensor readings are obtained at different heights above the ground, and the data is corrected using curve fitting. The detected height and actual height of each sensor can be represented as n points on a planar coordinate system. Then calculate a curve By finding the point closest to all test points, we can obtain the relationship between the measured height and the actual height that minimizes the overall error. The least squares method, proposed by Gauss, is often used to solve curve fitting problems because of its simplicity. The formula for the fitted curve can be expressed as: In the above formula It is a combination of unrelated functions. Undetermined coefficients The fitting process is to let and distance The sum of squares is minimized, and the formula is: In order to find , making The minimum value can be obtained by finding the extreme value. ; Therefore, we obtain information about The system of linear equations can be denoted as: ,remember , The above formula can be expressed as: If R has a maximum rank n, i.e. Zhengding, then The least squares estimate is: Thus, the specific relational formula is obtained. By substituting the raw measurement data from each sensor into this formula, the corrected measurement data can be obtained through calculation.
[0056] Step 2: Set a sliding window based on each type of corrected measurement data; filter the data within the sliding window to obtain the measured data, and simultaneously obtain the fluctuation index of the data within the sliding window; Before proceeding with the data fusion, the data from the three sensors needs to be filtered to improve the stability of the fused data. A sliding window is set for each type of sensor. The size of the sliding window and the choice of its size are crucial to the filtering effect.
[0057] Generally, a larger window allows for a wider range of smoothing, but may increase latency; while a smaller window may not effectively remove noise. For the high real-time requirements of drone-based crown-following flight algorithms, the size of the sliding window is usually dynamically adjusted, but the maximum size is usually fixed, such as 5, 10, or 15.
[0058] In the mean filtering process, when a data point is 0, it is considered invalid. This invalid data occupies a position within the sliding window but is not included in the mean calculation. When invalid data appears within the window, the filtering process skips the calculation of that data point and includes it in the sliding window for normal mean calculation when the next valid data point arrives. Finally, the mean within the sliding window is calculated, and the result is the mean for the first valid data point. Each sensor at time The effective ranging samples within the sliding window are defined as the set: The expression for the number of valid samples is as follows: Based on the above effective sample set, the mean filtering result of the sensor at the current moment can be calculated as follows: Among them when Only then did they participate in seeking peace.
[0059] When there are no valid samples in the window The system outputs a default value of 0 to avoid division by zero errors.
[0060] This refers to the obtained measured data; After mean filtering, the measured data from the three sensors are initially smoothed, and are denoted as follows: , and ; Then calculate the variance of the data in each sliding window N, i.e., the volatility index; when At that time, calculate the sample variance (unbiased estimate): like Unable to estimate variance, assume The purpose of σ_max is to reduce the weight of the sensor when there is only one valid sample in the sliding window (the variance cannot be calculated). σ_max is assigned as the preset maximum variance to the sample to reduce its weight and avoid interfering with the fusion result. The value can be taken as 5-10 times the maximum normal variance of the sensor under stable operating conditions.
[0061] like This sensor does not participate in subsequent data fusion; To avoid division by zero or excessively large weights, a lower bound constraint is implemented: in To preset the minimum variance; when the measurement data of a certain sensor is always a fixed value (without fluctuation), if the minimum variance is not set, it will cause the division by 0 error when calculating the weights later.
[0062] The value of the minimum variance needs to be determined in combination with the data type and the actual scenario: For example, when the sensor output data is a constant in the "meter" range (such as a continuous and stable output of 2.5m), the minimum variance can be set to a value two orders of magnitude smaller than the value of the constant (such as 0.001), which avoids division by zero error and will not interfere with the normal weight allocation due to the value being too large.
[0063] Step 3: Based on the volatility index, assign a corresponding weight to each type of measured data, with the weight decreasing as the volatility increases. raw variance of each sensor This represents the current level of data fluctuation; the smaller the variance, the more stable the signal and the higher its reliability. Therefore, its reciprocal is used as the base weight for the fusion weights. Weights of all valid sensors are normalized: Step 4: Weight and fuse the three types of measured data to obtain the relative height of the UAV canopy.
[0064] The relative height of the drone's canopy is the final fused height output, and its specific expression is: in, This represents the set of valid sensors participating in the fusion at the current moment.
[0065] like Figure 2 As shown, the task scheduling and interrupt priority configuration in this embodiment is as follows: To ensure that data acquisition from multiple sensors does not interfere with each other, this invention designs the following interrupt priority and task scheduling strategy: The highest priority is used for ultrasonic triggering tasks to ensure that the ultrasonic emission cycle is not interrupted and to stably control the time window.
[0066] The second highest priority is allocated to ultrasonic echo capture interrupts and laser data reception and millimeter-wave data reception interrupts, respectively, to ensure the timely recording of time-sensitive data.
[0067] Lower priority is used to drive the 30Hz data fusion loop, ensuring that the fusion algorithm executes at a uniform frequency and outputs relative height estimates. In summary, such as Figure 3 As shown, the canopy relative height calculation method for UAV canopy-mimicking flight described in this embodiment uses a uniform sliding window scale throughout. Based on this foundation, the calculations are sequentially completed in three stages: mean filtering, variance evaluation, and weighted fusion. The mean filtering stage provides a smoothing center for the data to reduce random noise; the variance calculation stage characterizes the data volatility within the same window to reflect the stability of each sensor's measurement; and the fusion stage assigns weights based on the results of the first two stages, dynamically adjusting the weights according to the stability of the sensor data to achieve dynamic weighting and adaptive adjustment of reliability for multi-sensor information. When UAVs perform canopy-inspired flight missions, sensor data is often affected by various external factors (such as wind, changes in light intensity, and leaf disturbances). The canopy relative height measurement method described in this embodiment can effectively cope with such dynamic changes and accurately measure altitude.
[0068] The canopy relative height calculation method described in this embodiment was applied to three scenarios: autonomous hoisting flight in a bamboo forest environment, canopy following during plant protection spraying operations, and mountain emergency rescue and narrow forest road flight.
[0069] (1) Autonomous hoisting flight in a bamboo forest environment In the transportation of raw materials from mountainous bamboo forests uphill, midhill, and downhill, drones need to fly at equal intervals along the bamboo canopy to maintain a safe gap between the suspension rope and the bamboo tips, reducing the risk of collision. Traditional methods relying on a single sensor for altitude control often suffer from altitude misjudgment due to uneven bamboo canopy distribution, wind disturbances, and variations in the density of branches and leaves, leading to unstable flight or even collisions with bamboo branches. By applying the method described in this embodiment: a millimeter-wave radar sensor identifies the underlying structure of sparse areas; a laser rangefinder compensates for the penetration error of millimeter waves under dense canopies. Dual ultrasonic sensors provide redundant safety assessments at low altitudes and close ranges; the fusion algorithm adjusts weights in real time to make the fusion height more consistent with the physical height of the bamboo canopy. After the flight path and the offset from the bamboo canopy height are planned in advance at the ground station, the UAV can achieve stable autonomous flight up and down the bamboo forest, significantly improving hoisting efficiency and safety.
[0070] (2) Canopy following in plant protection spraying operations When conducting understory pest and disease control or foliar fertilization in bamboo forests, drones need to fly close to the top of the bamboo canopy at an equal distance to ensure even spraying of the pesticide and reduce pesticide drift. The method described in this embodiment provides continuous and stable relative canopy height estimation, enabling the drone to maintain the target altitude under the following conditions: The bamboo crown has relatively small undulations but prominent local thorns; the branches and leaves sway in the wind, causing instantaneous height changes; the density of the bamboo crown varies greatly among bamboo forests of different ages.
[0071] By applying the method described in this embodiment, the effects of laser ignoring protruding branches and leaves, millimeter wave detection of underlying structures, or ultrasonic response lag can be effectively avoided, thus significantly improving the coverage accuracy of spraying operations.
[0072] (3) Mountain emergency rescue and narrow forest road flight In emergency operations in mountainous forests, such as search and rescue, transporting emergency supplies, and deploying communication relays, drones often need to fly along the edges of forest canopies in complex terrain with limited visibility. The method described in this embodiment can provide altitude assurance in the following scenarios: maintaining safe passage when traversing narrow forest roads and bamboo corridors; maintaining reliable altitude estimation in partially obscured environments; and stably following the canopy profile in strong turbulent wind fields.
[0073] Example 3 like Figure 4 , 5 As shown, this embodiment describes a canopy relative height calculation device for a drone flying in a canopy-like manner, including a housing 5, a first ultrasonic sensor 1, a second ultrasonic sensor 2, a laser rangefinder 3, a millimeter-wave radar sensor 4, and a controller; The controller is used to implement the canopy relative height calculation method for UAV canopy-inspired flight as described in Embodiment 1 or Embodiment 2 of the present invention.
[0074] Specifically, the controller, the first ultrasonic sensor 1, the second ultrasonic sensor 2, the laser rangefinder 3, and the millimeter-wave radar sensor 4 are located inside the housing 5, and the first ultrasonic sensor 1, the second ultrasonic sensor 2, the laser rangefinder 3, and the millimeter-wave radar sensor 4 are exposed on the bottom surface of the housing 5. The first ultrasonic sensor 1, the second ultrasonic sensor 2, and the laser rangefinder 3 are arranged on the side of the millimeter-wave radar sensor 4, and the laser rangefinder 3 is located between the two ultrasonic sensors. Or / and: The gap between the first ultrasonic sensor 1 and the second ultrasonic sensor 2 is greater than 60 mm. This can effectively prevent crosstalk between two ultrasonic sensors; Or / and: The controller is an STM32 microcontroller, which is connected to the laser rangefinder 3 and the millimeter-wave radar sensor 4 via a serial port, and to the first ultrasonic sensor 1 and the second ultrasonic sensor 2 via a TTL interface. Or / and: The top of the housing 5 has a mounting structure 6 for mounting on a drone; the mounting structure 6 may be a protrusion with a through groove; or it may be other mechanical mounting forms in the prior art, such as a snap-fit structure, a fixed connection structure, etc.
[0075] Example 4 This embodiment describes a drone. The drone's bottom surface is equipped with the canopy relative height calculation device for canopy-inspired flight as described in Embodiment 3 of this invention. The bottom surface of the drone also includes a pole for hoisting cargo to prevent the cargo from affecting the sensor's accuracy. The pole can be fixed or telescopic, and its maximum length should be greater than 2 meters to avoid the cargo affecting the sensor's accuracy.
[0076] Example 5 This embodiment describes a method for calculating the relative height of the canopy during canopy-mimicking flight of an unmanned aerial vehicle (UAV). Building upon Embodiment 1 or 2, it further includes dynamically adjusting the amount of data within a sliding window based on flight conditions. Specifically, it includes... The attitude parameters of the UAV are obtained, which may include the roll rate of change, pitch rate of change, and vertical velocity rate of change; the attitude parameters can be obtained from the UAV controller. Obtain the fluctuation indicators of the three types of sensors within the current sliding window; When the drone's attitude parameters exceed the preset value (exceeding the preset value indicates a significant change in the drone's attitude), and at the same time, the fluctuation indicators of at least two types of sensors exceed the preset fluctuation value (exceeding the preset value indicates severe data fluctuation); under normal circumstances, this is the judgment of the drone's transition from stable flight to sudden interference, such as a sudden encounter with strong winds, which causes changes in the drone's attitude and increased fluctuations in the collected data. Calculate the ratio of the sum of the volatility indicators at the current moment to the sum of the volatility indicators at the previous moment; Based on the ratio, the number of data in the sliding window at the next moment is adjusted. The larger the ratio, the more data in the sliding window; the larger the window, the higher the stability, and the more effectively it can cope with such sudden disturbances. The method for determining the number of data in the sliding window at the next moment can be: multiplying the number of data in the sliding window at the current moment by the ratio and rounding it down; and when the rounded value is less than 5, the number of data in the sliding window at the next moment is 5; when the rounded value is greater than 15, the number of data in the sliding window at the next moment is 15.
[0077] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person 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 within the scope of the technology disclosed in the present invention; and these modifications or substitutions will not cause the substance of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any modifications or equivalent substitutions that do not deviate from the spirit and scope of the present invention should be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for calculating the relative height of the canopy during canopy-mimicking flight of an unmanned aerial vehicle (UAV), characterized in that... Includes the following steps: Acquire raw measurement data from ultrasonic sensors, laser rangefinders, and millimeter-wave radar sensors; By fusing raw measurement data from three types of sensors, the relative height of the UAV canopy is obtained.
2. The method for calculating the relative height of the canopy during canopy-mimicking flight of an unmanned aerial vehicle as described in claim 1, characterized in that: The method for obtaining the relative height of the UAV canopy by fusing raw measurement data from three types of sensors is as follows: Step 1: Using a pre-established correspondence between the sensor readings and the actual height, correct the three types of raw measurement data to obtain corrected measurement data; Step 2: Set a sliding window based on each type of corrected measurement data; filter the data within the sliding window to obtain the measured data, and simultaneously obtain the fluctuation index of the data within the sliding window; Step 3: Based on the volatility index, assign a corresponding weight to each type of measured data, with the weight decreasing as the volatility increases. Step 4: Weight and fuse the three types of measured data to obtain the relative height of the UAV canopy.
3. The method for calculating the relative height of the canopy during canopy-mimicking flight of an unmanned aerial vehicle as described in claim 2, characterized in that: Step 1: Using a pre-established correspondence between the sensor readings and the actual height, correct the three types of raw measurement data. The method for obtaining the corrected measurement data is as follows: Step A1: At different actual heights, obtain the detection values of each sensor to obtain multiple sets of corresponding points between actual heights and detection values; Step A2: Construct a fitting curve to fit the corresponding points. This fitting curve represents a relationship containing several undetermined coefficients. Step A3: Using the least squares method, with the goal of minimizing the sum of squared residuals between the predicted height and the actual height corresponding to the fitted curve of the detected value, establish a system of linear equations about the undetermined coefficients. Step A4: Solve the system of linear equations to obtain the undetermined coefficients, and determine the relationship between the actual height and the detected value, i.e., the correspondence; Step A5: Substitute the original measurement data from the sensor into the formula and calculate to obtain the corrected measurement data.
4. The method for calculating the relative height of the canopy during canopy-mimicking flight of an unmanned aerial vehicle as described in claim 2, characterized in that: The acquisition of raw measurement data from the ultrasonic sensor, laser rangefinder, and millimeter-wave radar sensor includes: Step B1: Collect data from the ultrasonic sensor, laser rangefinder, and millimeter-wave radar sensor; Step B2: Determine the validity of the collected data and replace any invalid values with zero; Step B3: Use the remaining valid values and the replaced zeros together as the original measurement data; In step two, setting a sliding window based on each type of corrected measurement data means setting a sliding window containing N data points with the current time as the endpoint, based on each type of corrected measurement data. In step two, filtering the data within the sliding window to obtain the measured data includes: listing zero data within the sliding window as invalid samples and listing non-zero data as valid samples. If there are valid samples within the sliding window, the average of all valid samples is calculated, and the average value is the measured data at the current time. Otherwise, zero is output as the measured data at the current time. In step two, the content of obtaining the fluctuation index of the data within the sliding window includes: When there are at least two valid samples within the sliding window, calculate the variance of the valid samples and compare it with the preset minimum variance, taking the larger one as the fluctuation index at the current moment. When there is only one valid sample in the sliding window, the preset maximum variance is used as the fluctuation index at the current moment; When there are no valid samples in the sliding window, output zero as the fluctuation index at the current moment.
5. The method for calculating the relative height of the canopy during canopy-mimicking flight of an unmanned aerial vehicle as described in claim 4, characterized in that: Step three, based on the volatility index, assigns a corresponding weight to each type of measured data, with the weight decreasing as volatility increases. This includes: Only the measured data at the current moment where the fluctuation index is not zero are assigned the corresponding weight; The weight of the measured data is set as the reciprocal of its fluctuation index; Normalize all weights; Step four, which involves weighted fusion of the three types of measured data to obtain the relative height of the UAV canopy, is as follows: The volatility indicators are filtered out, and the measured data where the volatility indicator is zero at the current moment are removed. The results of multiplying the remaining measured data by their corresponding weights are added together to obtain the relative height of the UAV canopy at the current moment. Or / and: In step B2, the method for determining the legality of the collected data is as follows: For ultrasonic sensors, data received after a time exceeding the maximum echo wait time is considered invalid. For laser rangefinders, data with extreme values or intensity values lower than a preset value are considered invalid. For millimeter-wave radar sensors, data exceeding the maximum range is considered invalid. Or / and: The value of N is from 5 to 15; Or / and: The amount of data within the sliding window is dynamically adjusted according to the flight conditions.
6. The method for calculating the relative height of the canopy during canopy-mimicking flight of an unmanned aerial vehicle as described in any one of claims 1 to 5, characterized in that: The ultrasonic sensor includes a first ultrasonic sensor and a second ultrasonic sensor that are triggered alternately. The laser ranging sensor and the millimeter-wave radar sensor have the same sampling frequency, and the sampling frequency of the first ultrasonic sensor and the second ultrasonic sensor is half the sampling frequency of the millimeter-wave radar sensor. The triggering frequency of the first ultrasonic sensor and the second ultrasonic sensor is the same as their sampling frequency. The first ultrasonic sensor and the second ultrasonic sensor each have their own reception period after being triggered, and the duration of the reception period is not shorter than the maximum echo waiting time. The upper limit of the triggering frequency is determined based on the maximum effective range and sound velocity of the ultrasonic sensor.
7. The method for calculating the relative height of the canopy during canopy-mimicking flight of an unmanned aerial vehicle as described in claim 6, characterized in that: It also includes interrupt priority configuration, with the highest priority used for triggering the ultrasonic sensor to ensure that the ultrasonic transmission cycle is not interrupted; the second highest priority is allocated to ultrasonic sensor echo acquisition, laser rangefinder data reception, and millimeter-wave radar sensor data reception, respectively; and the lower priority is used for data fusion.
8. A device for calculating the relative height of the canopy during canopy-mimicking flight of an unmanned aerial vehicle (UAV), characterized in that... It includes a housing, a first ultrasonic sensor, a second ultrasonic sensor, a laser rangefinder, a millimeter-wave radar sensor, and a controller; The controller is used to implement the method for calculating the relative height of the canopy during canopy-inspired flight of an unmanned aerial vehicle as described in any one of claims 1-7.
9. The canopy relative height calculation device for unmanned aerial vehicle (UAV) canopy-mimicking flight according to claim 8, characterized in that: The controller, the first ultrasonic sensor, the second ultrasonic sensor, the laser rangefinder, and the millimeter-wave radar sensor are located inside the housing, with the first ultrasonic sensor, the second ultrasonic sensor, the laser rangefinder, and the millimeter-wave radar sensor protruding from the bottom surface of the housing. The first ultrasonic sensor, the second ultrasonic sensor, and the laser rangefinder are arranged on the side of the millimeter-wave radar sensor, and the laser rangefinder is located between the two ultrasonic sensors. Or / and: The gap between the first ultrasonic sensor and the second ultrasonic sensor is greater than 60 mm; Or / and: The controller is an STM32 microcontroller, which is connected to the laser rangefinder and millimeter-wave radar sensor via a serial port, and to the first ultrasonic sensor and the second ultrasonic sensor via a TTL interface; Or / and: The top of the housing has a mounting structure for mounting on a drone.
10. An unmanned aerial vehicle (UAV), characterized in that... The drone is equipped with a canopy relative height calculation device for drone canopy flight as described in claim 8 or 9 on its bottom surface. The drone is also equipped with a pole for hoisting cargo on its bottom surface to avoid the cargo affecting the accuracy of the sensor.