In-pipeline unmanned aerial vehicle course sensing method based on TOF technology and related equipment thereof
By installing TOF sensors on the drone in the underground pipeline and using the RANSAC algorithm to fit three-dimensional point cloud data, the problem of drone heading perception in underground pipelines is solved, real-time and accurate heading perception is achieved, and cost is reduced.
Patent Information
- Application Number
- CN202411005523.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-07-25
AI Technical Summary
In underground pipeline environments, traditional GPS heading perception methods are difficult to realize the heading perception function of drones, due to the narrow environment, no natural light source, no GPS signal and the drone volume is limited.
Using the TOF technology-based heading perception method in pipeline drone, by installing TOF sensors on the front end of the drone, collecting pipeline data in real time, performing filtering and data conversion, using RANSAC algorithm to fit three-dimensional point cloud data, and compute the drone The direction of travel deviates from the central axis of the cylinder to realize heading perception.
Real-time heading perception of lightweight small drones in the pipeline is realized, which avoids cumulative errors, improves perception accuracy and reliability, and is low in cost and simple in implementation.
Smart Images

Figure CN118938257A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of unmanned aerial vehicle and control technology, and in particular to a method for sensing the heading of an unmanned aerial vehicle in a pipeline based on TOF technology and related equipment. Background Art
[0002] The heading perception of drones is a very important part of drone control. In the environment of underground pipelines, the control requirements for drones are different from those in conventional environments. The control environment of underground pipelines usually has the following characteristics: 1. The environment is narrow. Usually, the inner diameter of underground pipelines is about 400mm; 2. There is no natural light source. There is no natural light source such as sunlight in underground pipelines; 3. There is no GPS signal. Underground pipelines are closed spaces and cannot receive GPS signals; 4. The size of drones is limited. There is little space in underground pipelines. In order to ensure flight, the size of the drone itself will also be greatly limited, resulting in the drone being unable to carry a large computing platform. Due to the conditions in the above special working environment, the traditional GPS heading perception method is difficult to achieve the heading perception function of drones in pipelines.
[0003] That is, how to provide a new method for sensing the heading of UAVs in pipelines based on 3DTOF technology, which is suitable for lightweight and small UAV equipment, so as to achieve the technical effect of reducing costs and realizing real-time perception of the heading of UAVs in pipelines is a technical problem that urgently needs to be solved in this field. Summary of the invention
[0004] An embodiment of the present invention provides a method for sensing the heading of a UAV in a pipeline based on TOF technology and related equipment thereof to solve at least one of the above-mentioned technical problems.
[0005] In a first aspect, the present application provides a method for sensing the heading of a drone in a pipeline based on TOF technology, which is applied to a drone for inspecting underground pipelines, wherein a TOF sensor is installed at the front end of the drone, and the method comprises:
[0006] Controlling the drone to enter the target pipeline, and after the drone enters the target pipeline, controlling the TOF sensor to collect a TOF data set of the pipeline in front of the drone in real time;
[0007] Performing filtering processing and data conversion processing on the pipeline TOF data set in sequence to obtain a three-dimensional point cloud original data set based on the pipeline TOF data set;
[0008] Performing secondary filtering on the original three-dimensional point cloud data set to obtain a basic point cloud data set;
[0009] Fitting the basic point cloud data set according to the RANSAC algorithm to obtain the optimal fitting cylinder;
[0010] The angle at which the traveling direction of the UAV deviates from the central axis of the best-fit cylinder is calculated based on the best-fit cylinder.
[0011] Preferably, fitting the basic point cloud data set according to the RANSAC algorithm to obtain the optimal fitting cylinder includes:
[0012] Obtaining a pipe radius R of the target pipe;
[0013] Preset RANSAC parameters, including the algorithm's iteration number threshold, inlier distance threshold, exit iteration inlier number ratio, and radius difference threshold;
[0014] According to the pipeline radius R, the RANSAC parameters, and the RANSAC algorithm, the basic point cloud data set is iteratively updated by performing cylinder fitting to obtain the optimal fitting cylinder.
[0015] Preferably, performing cylinder fitting iterative update on the basic point cloud data set according to the pipeline radius R, the RANSAC parameters, and the RANSAC algorithm to obtain the optimal fitting cylinder includes:
[0016] Performing a cylinder fitting calculation operation on the basic point cloud data set according to the RANSAC parameters to obtain a surface equation of a basic fitting cylinder;
[0017] Performing a target interior point calculation operation on the point cloud in the basic point cloud data set according to the surface equation of the basic fitting cylinder to obtain a target interior point ratio;
[0018] Obtaining the current number of iterations corresponding to the target interior point ratio or the surface equation of the basic fitting cylinder currently calculated;
[0019] When the target inner point ratio meets the preset first iteration stop condition, the currently obtained basic fitting cylinder is determined as the optimal fitting cylinder, and the iterative calculation is exited;
[0020] When the target inner point ratio does not meet the preset first iteration stop condition, determine whether the current iteration number meets the preset second iteration stop condition. When the current iteration number meets the preset second iteration stop condition, select the basic fitting cylinder corresponding to the largest target inner point ratio in the historical iteration process as the optimal fitting cylinder, and exit the iterative calculation; when the current iteration number does not meet the preset second iteration stop condition, continue to iterate the cylinder fitting calculation operation and the target inner point calculation operation until the first iteration stop condition or the second iteration stop condition is met, and determine the optimal fitting cylinder according to the first iteration stop condition or the second iteration stop condition.
[0021] Preferably, the first iteration stopping condition is: the target inlier ratio is greater than or equal to the exit iteration inlier ratio;
[0022] The second iteration stopping condition is: the current iteration number reaches the iteration number threshold.
[0023] Preferably, performing a cylinder fitting calculation operation on the basic point cloud data set according to the RANSAC parameters to obtain a surface equation of a basic fitting cylinder includes:
[0024] Randomly select a first group of point clouds from the basic point cloud data set to perform circle fitting calculation, and obtain a first center coordinate C1 and a first radius r1 of a first fitting circle, wherein the first radius r1 satisfies: |r1-R|≤Δr;
[0025] A second group of point clouds is randomly selected from the basic point cloud data set to perform circle fitting calculation, and a second center coordinate C2 and a second radius r2 of a second fitting circle are obtained, wherein the second radius r2 satisfies: |r2-R|≤Δr;
[0026] Perform cylinder fitting calculation on the first fitting circle and the second fitting circle to obtain a surface equation of a basic fitting cylinder;
[0027] Wherein, any point cloud in the first group of point clouds is different from any point cloud in the second group of point clouds.
[0028] Preferably, performing a target interior point calculation operation on the point cloud in the basic point cloud data set according to the surface equation of the basic fitting cylinder to obtain a target interior point ratio includes:
[0029] Calculating the number of point clouds in the basic point cloud data set whose minimum distance to the surface of the basic fitting cylinder is less than the inner point distance threshold based on the surface equation of the basic fitting cylinder, and obtaining the number of target inner points;
[0030] Calculating the ratio of the number of the target internal points to the total number of point clouds in the basic point cloud data set to obtain the target internal point ratio;
[0031] Among them, the target inliers are point clouds in the basic point cloud dataset whose minimum distance to the surface of the basic fitting cylinder is less than the inlier distance threshold; the target inliers ratio is the ratio of the target inliers in the basic point cloud dataset.
[0032] Preferably, the calculating, based on the best-fit cylinder, the angle at which the traveling direction of the UAV deviates from the central axis of the best-fit cylinder comprises:
[0033] Obtaining the central axis direction information of the optimal fitting cylinder;
[0034] Obtaining a moving direction of the drone relative to the TOF sensor;
[0035] The horizontal deviation angle of the moving direction of the UAV from the central axis in the horizontal direction and the vertical deviation angle of the moving direction of the UAV from the central axis in the vertical direction are calculated according to the central axis direction information.
[0036] Preferably, the primary filtering process includes isolated point filtering process, abnormal point filtering process and depth threshold filtering process, and the secondary filtering process includes outlier filtering process.
[0037] In a second aspect, the present application also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor is configured to implement any one of the TOF-based methods for sensing the heading of an in-pipeline UAV in the first aspect when executing the computer program stored in the memory.
[0038] In a third aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the TOF technology-based methods for sensing the heading of an in-pipeline drone in the first aspect.
[0039] The present invention is applied to a drone for inspecting underground pipelines, and a TOF sensor is installed at the front end of the drone. First, the drone is controlled to enter the target pipeline. After the drone enters the target pipeline, the TOF sensor is controlled to collect the pipeline TOF data set in front of the drone in real time, and the pipeline TOF data set is filtered and converted in sequence to obtain a three-dimensional point cloud original data set based on the pipeline TOF data set, and then the three-dimensional point cloud original data set is filtered twice to obtain a basic point cloud data set, and the basic point cloud data set is fitted according to the RANSAC algorithm to obtain the best fitting cylinder, and the angle of the traveling direction of the drone deviating from the central axis of the best fitting cylinder is calculated according to the best fitting cylinder, so as to realize the heading perception of the drone in the pipeline. The method for sensing the heading of the drone in the pipeline based on the TOF technology provided by the present invention is suitable for lightweight small drone equipment, and the real-time perception of the heading in the pipeline is realized by updating the environmental data in real time, avoiding the generation of cumulative errors, and the reliability of the data is increased by filtering the data, while the accuracy of the perception is improved, and the method for sensing the heading in the pipeline of the present application is low in cost, simple in implementation and highly economical. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 A schematic diagram of a flow chart of a method for sensing the heading of a UAV in a pipeline based on TOF technology provided in this application;
[0042] Figure 2 A schematic diagram of the structure of an electronic device provided by this application;
[0043] Figure 3 A schematic diagram of the structure of a computer-readable storage medium provided in this application. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0045] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described here can be implemented in an order other than that illustrated or described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or modules is not necessarily limited to those steps or modules clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products or devices. The naming or numbering of steps in this application does not mean that the steps in the method flow must be executed in the time / logical sequence indicated by the naming or numbering. The process steps that have been named or numbered can change the execution order according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved.
[0046] The division of modules in this application is a logical division. There may be other division methods when it is implemented in actual applications. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection between modules can be electrical or other similar forms, which are not limited in this application. In addition, the modules or submodules described as separate components may or may not be physically separated, may or may not be physical modules, or may be distributed in multiple circuit modules, and some or all of the modules may be selected according to actual needs to achieve the purpose of the present application.
[0047] Next, see Figure 1 , Figure 1 The present invention is a flowchart of a method for sensing the heading of a UAV in a pipeline based on TOF technology in an embodiment of the present invention. The method involved in the present invention is applied to a UAV for inspecting underground pipelines. A TOF sensor is installed at the front end of the UAV. As an embodiment of the method for sensing the heading of a UAV in a pipeline based on TOF technology provided by the present invention, the method for sensing the heading of a UAV in a pipeline based on TOF technology specifically includes the following steps S110 to S150:
[0048] Step S110, controlling the drone to enter the target pipeline, and after the drone enters the target pipeline, controlling the TOF sensor to collect the pipeline TOF data set in front of the drone in real time;
[0049] Among them, underground pipelines include underground horizontal pipes and underground vertical shafts. Underground horizontal pipes refer to underground pipelines laid in a horizontal direction, and underground vertical shafts refer to underground pipelines laid in a vertical direction. The target pipeline involved in this application is the underground horizontal pipe in the underground pipeline.
[0050] Step S120, performing filtering processing and data conversion processing on the pipeline TOF data set in sequence to obtain a three-dimensional point cloud original data set based on the pipeline TOF data set;
[0051] As a feasible method, one-step filtering includes isolated point filtering, abnormal point filtering and depth threshold filtering. One-step filtering increases the reliability of TOF data and prevents unreliable observation data from affecting the accuracy of subsequent steps. Through data conversion processing, the data collected by the TOF sensor is converted into three-dimensional point cloud coordinate data, and the point cloud coordinates are obtained by the coordinate system established with the TOF sensor as the origin.
[0052] Step S130, performing secondary filtering on the original three-dimensional point cloud data set to obtain a basic point cloud data set;
[0053] As an implementable approach, the secondary filtering process includes outlier filtering process to reduce the impact of noise on the accuracy of the method.
[0054] Step S140, fitting the basic point cloud data set according to the RANSAC algorithm to obtain the optimal fitting cylinder;
[0055] As an achievable method, the above step S140 involves fitting the basic point cloud data set according to the RANSAC algorithm to obtain the optimal fitting cylinder, which specifically includes the following sub-steps:
[0056] Get the pipe radius R of the target pipe;
[0057] Preset RANSAC parameters, including the algorithm's iteration number threshold N, the inlier distance threshold d, the number of inliers that exit iteration k, and the radius difference threshold Δr;
[0058] According to the pipeline radius R, RANSAC parameters and RANSAC algorithm, the basic point cloud data set is iteratively updated by cylinder fitting to obtain the optimal fitting cylinder.
[0059] Among them, the pipe radius R of the target pipe involved in this application is mainly obtained in the following two ways: one is to measure it through other measuring equipment, and the measuring equipment can be a measuring equipment installed on a drone; 2. It is obtained through the pipe construction design drawing corresponding to the target pipe. The pipe radius R of the target pipe is the predicted true value of the pipe radius. The calculation process of the RANSAC algorithm is correspondingly limited by the known pipe radius, which can reduce the calculation intensity of the algorithm and improve the calculation speed. The iteration number threshold is the maximum number of iterations for the cylinder fitting calculation of the basic point cloud data set through the RANSAC algorithm, the inner point distance threshold d is the minimum distance threshold of the inner point from the surface of the fitting cylinder, and the radius difference threshold Δr can be preset based on the pipe radius R, which refers to the preset value of the difference between the radius of the fitting circle and the pipe radius R.
[0060] As an achievable method, the sub-steps of the above step S140 include iteratively updating the cylinder fitting of the basic point cloud data set according to the pipeline radius R, RANSAC parameters, and RANSAC algorithm to obtain the optimal fitting cylinder, and specifically include the following sub-steps:
[0061] (1) Perform a cylinder fitting calculation operation on the basic point cloud data set according to the RANSAC parameters to obtain the surface equation of the basic fitting cylinder;
[0062] As an implementable method, the above sub-step (1) involves performing a cylinder fitting calculation operation on the basic point cloud data set according to the RANSAC parameters to obtain the surface equation of the basic fitting cylinder, including:
[0063] A first group of point clouds is randomly selected from the basic point cloud data set to perform circle fitting calculation, and a first center coordinate C1 and a first radius r1 of a first fitting circle are obtained. The first radius r1 satisfies: |r1-R|≤Δr;
[0064] A second group of point clouds is randomly selected from the basic point cloud data set to perform circle fitting calculation, and a second center coordinate C2 and a second radius r2 of the second fitting circle are obtained. The second radius r2 satisfies: |r2-R|≤Δr;
[0065] Perform cylinder fitting calculation on the first fitting circle and the second fitting circle to obtain the surface equation of the basic fitting cylinder;
[0066] Wherein, any point cloud in the first group of point clouds is different from any point cloud in the second group of point clouds. Both the first group of point clouds and the second group of point clouds include at least 3 point clouds.
[0067] Specifically, three point clouds can be randomly selected from the basic point cloud data set for circle fitting. The radius r1 of the first fitting circle should satisfy |r1-R|≤Δr. If the radius r1 does not satisfy |r1-R|≤Δr, that is, when |r1-R|>Δr, three point clouds are taken from the basic point cloud data set for circle fitting again. After the first fitting circle is successfully selected, three point clouds that are different from the point clouds that form the first fitting circle are selected from the basic point cloud data set for fitting to form a second fitting circle. The radius r2 of the second fitting circle should satisfy |r2-R|≤Δr. When |r2-R|>Δr, three point clouds (different from the point clouds that form the first fitting circle) are taken from the basic point cloud data set for circle fitting again.
[0068] Furthermore, assuming that the first circle center coordinates C1 are (x1, y1, z1), and the second circle center coordinates C2 are (x2, y2, z2), the surface equation of the fitting cylinder formed by the first fitting circle and the second fitting circle can be expressed as:
[0069]
[0070] Where A(y,z)=(y c2 -y c1 )(zz c1 )-(z c2 -z c1 )(yy c1 ), B(x,z)=(z c2 -z c1 )(xx c1 )-(x c2 -x c1 )(zz c1 ), C(x,y)=(x c2 -xc1 )(yy c1 )-(y c2 -y c1 )(xx c1 ), A(y,z), B(x,z) and C(x,y) are intermediate parameters.
[0071] (2) Calculate the target internal points on the point cloud in the basic point cloud data set according to the surface equation of the basic fitting cylinder to obtain the target internal point ratio;
[0072] As an achievable method, the above sub-step (2) involves performing a target interior point calculation operation on the point cloud in the basic point cloud data set based on the surface equation of the basic fitting cylinder to obtain the target interior point ratio, which specifically includes the following contents:
[0073] Based on the surface equation of the basic fitting cylinder, the number of point clouds in the basic point cloud dataset whose minimum distance to the surface of the basic fitting cylinder is less than the inner point distance threshold d is calculated to obtain the number of target inner points;
[0074] Calculate the ratio of the number of internal points of the target to the total number of point clouds in the basic point cloud data set to obtain the ratio of internal points of the target;
[0075] Among them, the target inliers are point clouds whose minimum distance to the surface of the basic fitting cylinder in the basic point cloud dataset is less than the inlier distance threshold d; the target inliers ratio is the ratio of the target inliers in the basic point cloud dataset.
[0076] Step S150: Calculate the angle at which the direction of travel of the UAV deviates from the central axis of the best-fit cylinder based on the best-fit cylinder.
[0077] Specifically, let the data coordinates of any point cloud in the basic point cloud dataset be (x i ,y i ,z i ), substitute the point cloud coordinates into the basic fitting cylinder equation, when |f(x i ,y i ,z i )-R|≤d, it means that the point cloud is an internal point of the target. i ,y i ,z i )-R|>d, it means that the point cloud is an outlier. There are several point clouds in the basic point cloud dataset, and the ratio of the number of target inliers to the number of all point clouds is the target inlier ratio.
[0078] (3) obtaining the current iteration number corresponding to the currently calculated target internal point ratio or the surface equation of the basic fitting cylinder;
[0079] Each time the cylinder fitting calculation operation and the target inlier calculation operation are performed, an iteration is completed. During the iteration process, the number of target inliers can be recorded. If the number of target inliers calculated in the current iteration exceeds the maximum value of the previous iteration, the best model and the maximum number of inliers are updated.
[0080] (4) When the target inner point ratio meets the preset first iteration stop condition, the currently obtained basic fitting cylinder is determined as the optimal fitting cylinder, and the iterative calculation is exited;
[0081] The first iteration stopping condition is: the target internal point ratio is greater than or equal to the exit iteration internal point ratio k.
[0082] (5) When the target inner point ratio does not meet the preset first iteration stop condition, determine whether the current iteration number meets the preset second iteration stop condition. When the current iteration number meets the preset second iteration stop condition, select the basic fitting cylinder corresponding to the largest target inner point ratio in the historical iteration process as the optimal fitting cylinder, and exit the iterative calculation; when the current iteration number does not meet the preset second iteration stop condition, continue to iterate and execute the cylinder fitting calculation operation and the target inner point calculation operation until the first iteration stop condition or the second iteration stop condition is met, and determine the optimal fitting cylinder according to the first iteration stop condition or the second iteration stop condition.
[0083] The second iteration stop condition is: the current iteration number reaches the iteration number threshold N (greater than or equal to the iteration number threshold).
[0084] As an achievable manner, the step S150 of calculating the angle of deviation of the direction of travel of the drone from the central axis of the best-fit cylinder based on the best-fit cylinder specifically includes the following sub-steps:
[0085] Obtain the center axis direction information of the best fitting cylinder;
[0086] Get the direction of the drone relative to the TOF sensor;
[0087] The horizontal deviation angle of the UAV's moving direction from the central axis in the horizontal direction and the vertical deviation angle of the UAV's moving direction from the central axis in the vertical direction are calculated based on the central axis direction information.
[0088] Specifically, assuming that the fitting cylinder formed by the first fitting circle and the second fitting circle is the optimal fitting cylinder, the central axis of the optimal fitting cylinder can be expressed as The horizontal and vertical offset angles between the direction of travel of the drone relative to the TOF sensor and the above vector are the heading perception information of the drone.
[0089] The present invention is applied to a drone for inspecting underground pipelines, and a TOF sensor is installed at the front end of the drone. First, the drone is controlled to enter the target pipeline. After the drone enters the target pipeline, the TOF sensor is controlled to collect the pipeline TOF data set in front of the drone in real time, and the pipeline TOF data set is filtered and converted in sequence to obtain a three-dimensional point cloud original data set based on the pipeline TOF data set, and then the three-dimensional point cloud original data set is filtered twice to obtain a basic point cloud data set, and the basic point cloud data set is fitted according to the RANSAC algorithm to obtain the best fitting cylinder, and the angle of the traveling direction of the drone deviating from the central axis of the best fitting cylinder is calculated according to the best fitting cylinder, so as to realize the heading perception of the drone in the pipeline. The method for sensing the heading of the drone in the pipeline based on the TOF technology provided by the present invention is suitable for lightweight small drone equipment, and the real-time perception of the heading in the pipeline is realized by updating the environmental data in real time, avoiding the generation of cumulative errors, and the reliability of the data is increased by filtering the data, while the accuracy of the perception is improved, and the method for sensing the heading in the pipeline of the present application is low in cost, simple in implementation and highly economical.
[0090] An electronic device is also provided in an embodiment of the present invention. Figure 2 , Figure 2 The electronic device of the present invention is a schematic diagram of an embodiment of the electronic device, including:
[0091] A memory 201, a processor 202, and a computer program 203 stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for sensing the heading of a UAV in a pipeline based on TOF technology when executing the computer program 203 stored in the memory.
[0092] For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the part of the embodiment of the present invention on a method for sensing the heading of a drone in a pipeline based on TOF technology. The memory 201 can be used to store a computer program 203, which includes software programs, modules and data. The processor 202 executes the computer program 203 stored in the memory 201 to perform various functional applications and data processing of the electronic device.
[0093] The present invention also provides a computer-readable storage medium. Figure 3 , Figure 3 The present invention is a schematic diagram of an embodiment of a computer-readable storage medium in an embodiment of the present invention, wherein the computer-readable storage medium may store a computer program, which, when executed, includes some or all of the steps of a method for sensing the heading of an unmanned aerial vehicle in a pipeline based on TOF technology as described in the above method embodiment.
[0094] Technicians in the relevant field can clearly understand that, for the convenience and conciseness of description, the specific working process of the above-described device, electronic device and computer-readable storage medium can refer to the corresponding process of a method for sensing the heading of an unmanned aerial vehicle in a pipeline based on TOF technology in the aforementioned method embodiment, and will not be repeated here.
[0095] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.
[0096] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0097] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0098] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or partly contributed to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of a method for sensing the heading of a drone in a pipeline based on TOF technology in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0099] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for sensing the heading of a drone in a pipeline based on TOF technology, which is applied to a drone for inspecting underground pipelines, wherein a TOF sensor is installed at the front end of the drone, and is characterized in that: The method comprises: Controlling the drone to enter the target pipeline, and after the drone enters the target pipeline, controlling the TOF sensor to collect a TOF data set of the pipeline in front of the drone in real time; Performing filtering processing and data conversion processing on the pipeline TOF data set in sequence to obtain a three-dimensional point cloud original data set based on the pipeline TOF data set; Performing secondary filtering on the original three-dimensional point cloud data set to obtain a basic point cloud data set; Fitting the basic point cloud data set according to the RANSAC algorithm to obtain the optimal fitting cylinder; The angle at which the traveling direction of the UAV deviates from the central axis of the best-fit cylinder is calculated based on the best-fit cylinder.
2. The method for sensing the heading of a UAV in a pipeline based on TOF technology according to claim 1 is characterized in that: The step of fitting the basic point cloud data set according to the RANSAC algorithm to obtain the optimal fitting cylinder includes: Obtaining a pipe radius R of the target pipe; Preset RANSAC parameters, including the algorithm's iteration number threshold, inlier distance threshold, exit iteration inlier number ratio, and radius difference threshold; According to the pipeline radius R, the RANSAC parameters, and the RANSAC algorithm, the basic point cloud data set is iteratively updated by performing cylinder fitting to obtain the optimal fitting cylinder.
3. The method for sensing the heading of a UAV in a pipeline based on TOF technology according to claim 2 is characterized in that: According to the pipeline radius R, the RANSAC parameters, and the RANSAC algorithm, the basic point cloud data set is subjected to a cylinder fitting iterative update to obtain an optimal fitting cylinder, including: Performing a cylinder fitting calculation operation on the basic point cloud data set according to the RANSAC parameters to obtain a surface equation of a basic fitting cylinder; Performing a target interior point calculation operation on the point cloud in the basic point cloud data set according to the surface equation of the basic fitting cylinder to obtain a target interior point ratio; Obtaining the current number of iterations corresponding to the target interior point ratio or the surface equation of the basic fitting cylinder currently calculated; When the target inner point ratio meets the preset first iteration stop condition, the currently obtained basic fitting cylinder is determined as the optimal fitting cylinder, and the iterative calculation is exited; When the target inner point ratio does not meet the preset first iteration stop condition, determine whether the current iteration number meets the preset second iteration stop condition. When the current iteration number meets the preset second iteration stop condition, select the basic fitting cylinder corresponding to the largest target inner point ratio in the historical iteration process as the optimal fitting cylinder, and exit the iterative calculation; when the current iteration number does not meet the preset second iteration stop condition, continue to iterate the cylinder fitting calculation operation and the target inner point calculation operation until the first iteration stop condition or the second iteration stop condition is met, and determine the optimal fitting cylinder according to the first iteration stop condition or the second iteration stop condition.
4. The method for sensing the heading of a UAV in a pipeline based on TOF technology according to claim 3 is characterized by: The first iteration stopping condition is: the target inlier ratio is greater than or equal to the exit iteration inlier number ratio k; The second iteration stopping condition is: the current iteration number reaches the iteration number threshold.
5. The method for sensing the heading of a UAV in a pipeline based on TOF technology according to claim 4 is characterized in that: The performing of a cylinder fitting calculation operation on the basic point cloud data set according to the RANSAC parameters to obtain a surface equation of a basic fitting cylinder includes: Randomly select a first group of point clouds from the basic point cloud data set to perform circle fitting calculation, and obtain a first center coordinate C1 and a first radius r1 of a first fitting circle, wherein the first radius r1 satisfies: |r1-R|≤Δr; A second group of point clouds is randomly selected from the basic point cloud data set to perform circle fitting calculation, and a second center coordinate C2 and a second radius r2 of a second fitting circle are obtained, wherein the second radius r2 satisfies: |r2-R|≤Δr; Perform cylinder fitting calculation on the first fitting circle and the second fitting circle to obtain a surface equation of a basic fitting cylinder; Wherein, any point cloud in the first group of point clouds is different from any point cloud in the second group of point clouds.
6. The method for sensing the heading of a UAV in a pipeline based on TOF technology according to claim 5 is characterized in that: The step of performing a target inner point calculation operation on the point cloud in the basic point cloud data set according to the surface equation of the basic fitting cylinder to obtain a target inner point ratio includes: Calculating the number of point clouds in the basic point cloud data set whose minimum distance to the surface of the basic fitting cylinder is less than the inner point distance threshold based on the surface equation of the basic fitting cylinder, and obtaining the number of target inner points; Calculating the ratio of the number of the target internal points to the total number of point clouds in the basic point cloud data set to obtain the target internal point ratio; Among them, the target inliers are point clouds in the basic point cloud dataset whose minimum distance to the surface of the basic fitting cylinder is less than the inlier distance threshold; the target inliers ratio is the ratio of the target inliers in the basic point cloud dataset.
7. The method for sensing the heading of a UAV in a pipeline based on TOF technology according to claim 6 is characterized in that: The step of calculating the angle at which the direction of travel of the UAV deviates from the central axis of the best-fit cylinder according to the best-fit cylinder comprises: Obtaining the central axis direction information of the optimal fitting cylinder; Obtaining a moving direction of the drone relative to the TOF sensor; The horizontal deviation angle of the moving direction of the UAV from the central axis in the horizontal direction and the vertical deviation angle of the moving direction of the UAV from the central axis in the vertical direction are calculated according to the central axis direction information.
8. The method for sensing the heading of a UAV in a pipeline based on TOF technology according to claim 7 is characterized in that: The primary filtering process includes isolated point filtering process, abnormal point filtering process and depth threshold filtering process, and the secondary filtering process includes outlier filtering process.
9. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor is used to implement the method for sensing the heading of a UAV in a pipeline based on TOF technology as described in any one of claims 1 to 8 when executing the computer program stored in the memory.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for sensing the heading of a UAV in a pipeline based on TOF technology according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Pipeline three-dimensional modeling method based on three-dimensional point cloud processing
CN109147038A
Steel member cylinder fitting algorithm
CN111027010A
Pipeline type identification and structure parameter extraction method based on three-dimensional point cloud
CN113822854A
Non-artificial base station antenna working parameter acquisition system and method
CN114531700A
Fitting method of cylinder in point cloud and computer readable storage medium
CN117557719A
