A method for creating multi-view 3D dynamic environment situation map based on nonlinear graph optimization
Through the nonlinear graph optimization method, UAV position and attitude information is shared to generate a three-dimensional situation map, which solves the problem of difficult target identification and matching in complex environments, achieves rapid and accurate summary and fusion of situation maps in the mission area, and improves the mission Precision in execution.
Patent Information
- Application Number
- CN202311542824.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-18
- Publication Date
- 2024-09-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In a complex mission environment, when multiple UAVs perform tasks collaboratively, due to target recognition errors and navigation system errors, there are large errors in target positioning calculations, and each UAV can only see part of the target and cannot obtain global information. Making target matching difficult.
A multi-view three-dimensional dynamic environment situation map creation method based on nonlinear graph optimization is used to share position and attitude information through UAVs, and the reference coordinate system and coordinate adjustment algorithm are used to quickly and accurately summarize and integrate the local information of each UAV. , generate a unified mission area situation map.
It effectively reduces the difficulty of UAV cluster collaboration in complex mission area environments, ensuring that UAV clusters can dynamically generate situation maps to achieve accurate mission completion.
Smart Images

Figure CN117975302B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of situation graph creation, and in particular to a method for creating a multi-view three-dimensional dynamic environment situation graph based on nonlinear graph optimization. Background Art
[0002] The situation map is a prerequisite for completing multi-machine multi-target collaborative detection, which requires accurate perception of the mission area in advance, that is, the real-time dynamic information of multiple targets and drones in the mission area. Only by accurately and in real time grasping the mission environment can the collaborative mission execution effect be maximized.
[0003] The complexity of the mission environment increases the difficulty of fleet coordination, which is mainly reflected in:
[0004] ① Due to complex factors such as smoke, camouflage, and movement of the target, the error in target recognition is large. At the same time, the navigation system errors of each drone accumulate, resulting in large errors in the positioning calculation of the target;
[0005] ② Due to differences in position and posture, multiple drones can only see part of the target and cannot obtain unified global information, making it difficult to match targets between drones;
[0006] The above unfavorable conditions require that multiple UAVs can dynamically generate a situation map of the current mission area according to the evolution of the environment through information sharing and distributed calculation when jointly performing tasks, and integrate the location, importance and other information of various targets to achieve the accuracy of target matching between UAVs and maximize the effect of task execution. In view of this, the present invention proposes a method for creating a multi-perspective three-dimensional dynamic environment situation map based on nonlinear graph optimization. Summary of the invention
[0007] The purpose of the present invention is to provide a method for creating a multi-perspective three-dimensional dynamic environment situation map based on nonlinear graph optimization, so that multiple drones can share their respective positions and postures, as well as their respective discovered targets through data links, and through efficient algorithms, quickly and accurately summarize and fuse the local information generated by each drone, providing a unified mission area situation map for executing the mission.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] The method for creating a multi-perspective three-dimensional dynamic environment situation map based on nonlinear graph optimization is that each UAV uses its own posture, the electronic map provided by the carrier and the identified target information to complete the creation of a multi-perspective three-dimensional dynamic environment situation map through a series of calculation steps, which specifically includes the following contents:
[0010] Step 1, establishing a reference coordinate system and a landform information table: using the data provided by the carrier, the photoelectric detection device and the positioning device to establish a reference coordinate system; extracting important landform data from the electronic map provided by the carrier, storing it in a table, and forming a landform information table;
[0011] Step 2, UAV, target, and terrain coordinate transformation: Combined with the position and posture of each UAV, the image coordinates of the identified target are transformed into the reference coordinate system established in step 1; the coordinate system transformation between the UAV and the target further includes: firstly, the coordinates of the target are transformed from the image coordinate system to the camera coordinate system, then from the camera coordinate system to the UAV body coordinate system, and finally to the reference coordinate system; the terrain coordinate transformation refers to the transformation completed according to the coordinates of the terrain in the original coordinate system of the digital map and the reference coordinate system transformation matrix after the reference coordinate system is determined;
[0012] Step 3, coordinate adjustment: Use the coordinate adjustment algorithm to fuse the local information of the mission area sensed by each drone, obtain the unique coordinates of each target, and correct the error of the drone navigation system;
[0013] Step 4: Create a situation map: Integrate the content obtained in steps 1-3 to obtain the optimized coordinates of each UAV and each target, and generate a unified mission area situation map.
[0014] Preferably, the reference coordinate system in step 1 is a rectangular coordinate system, which provides a unified reference for each drone.
[0015] Preferably, the coordinate transformation between the drone and the target in step 2 specifically includes the following contents:
[0016] The drone body coordinate system O is established at the rotation center of each drone positioning device component m X m Y m Z m , with its Y axis pointing to the direction of the aircraft head, the Z axis pointing vertically upward, and the X axis pointing to the right; the camera coordinate system O is established at the optical center of the camera when the servo frame is at zero position in the photoelectric detection device. c X c Y c Z c , with its optical axis as Z c Axis, the positive direction is the direction pointing to the target, X c The axis is along the image u-axis to the right, Y c The axis is downward along the v-axis of the image;
[0017] Let the image coordinates of the target center be [u,v] T , the coordinates of the target in the camera coordinate system are [x c , y c , zc ] T , then there is the following relationship:
[0018] (1)
[0019] Among them, k x , k y , u0 and v0 are the intrinsic parameters of the camera, which are obtained by calibrating the camera using a chessboard in advance;
[0020] The coordinates in the camera coordinate system are obtained from formula (1):
[0021] (2)
[0022] Since the photoelectric detection device is fixedly connected to the drone body, the transformation matrix between the camera coordinate system and the drone body coordinate system can be calibrated in advance before leaving the factory, and it is set as T c m ; Assume that the yaw angle of the drone given by the navigation unit is ψ, the pitch angle is θ, the roll angle is φ, and its current position is [p x ,p y ,p z ] T , then the coordinate system of the drone body in the reference coordinate system is expressed as:
[0023] (3)
[0024] Among them, s(.) and c(.) represent sin(.) and cos(.) respectively;
[0025] The camera coordinate system is expressed in the reference coordinate system as:
[0026] (4)
[0027] Where R is a 3×3 rotation matrix and p is a 3×1 translation vector;
[0028] Assume that the position of the target in the reference coordinate system is [x r , y r , z r ] T , since the target is on the ground, its z coordinate is set to 0. From equations (1) and (4), we can get:
[0029] (5)
[0030] Let a = x c / z c , b = y c / z c , the above formula is rearranged:
[0031] (6)
[0032] The coordinate x of the target in the reference coordinate system r and r Solve it using the following formula:
[0033] (7)
[0034] At this point, the coordinates of each drone and target in the reference coordinate system [p x ,p y ,p z ] T and [x r , y r , z r ] T All have been obtained.
[0035] Preferably, the purpose of the coordinate adjustment described in step 3 is to send the noisy target coordinates and the noisy camera pose into a nonlinear graph optimizer, wherein the pose of each camera is used as the vertex of the graph, and the transformation matrix between the camera coordinate systems is used as the edge of the graph, and by defining a loss function and through a certain number of iterations, the optimal estimation of the target coordinates and the camera pose is obtained simultaneously. Step 3 specifically includes the following contents:
[0036] Step 3.1, optimize the positioning error of the target and the drone body: First, a drone uses the internal and external parameters of the camera to calculate the image coordinates of the target and obtain the predicted value of the target coordinates; secondly, the target coordinates calculated by other drones are back-projected to the image coordinates of the drone, that is, the observation value of the target coordinates is obtained by using the observation equation; finally, the predicted value is corrected by using the coordinates of the identified target and the posture of each drone, and the posture error of the target and each drone is eliminated in the process of minimizing the cumulative sum of all pixel coordinate errors through least squares iteration;
[0037] Step 3.2, construct the observation equation: First, starting from the camera of a single photoelectric detection device, let the coordinates of a certain target observed by it in the reference coordinate system be p, and the coordinates transformed to the camera coordinate system are:
[0038] P '= R + t =[ X ', Y ', Z '] T (8)
[0039] Among them, R and t are the external parameters of the camera;
[0040] Then, transform P′ to the normalized plane to obtain the normalized coordinates:
[0041] P c =[ u c , v c ,1] T =[ X ' / Z ', Y ' / Z ',1] T (9)
[0042] Dedistort the normalized coordinates to obtain the dedistorted coordinates:
[0043] (10)
[0044] Among them, k1 and k2 are radial distortion coefficients, and r is the distance between the pixel and the center of the image;
[0045] Finally, according to the intrinsic parameter model, the pixel coordinates are calculated:
[0046] (11)
[0047] Among them, f x 、f y 、c x , cy are the intrinsic parameters of the camera.
[0048] Step 3.3, construct the cost function: The observation equation obtained in step 3.2 is abbreviated as:
[0049] z = h(ξ , y) (12)
[0050] Where ξ represents the Lie algebra of the seeker camera pose, the target three-dimensional coordinates are p, and the observation data are pixel coordinates z = [u, v];
[0051] The observation error of the image coordinates of the photoelectric detection device is:
[0052] e = z − h ( ξ , p )(13)
[0053] For the case of multiple drones and multiple targets, let zij be the data generated by observing the target pj at the position ξi of the i-th drone, then the overall cost function is:
[0054] (14)
[0055] Step 3.4, optimize the cost function: Use a nonlinear optimization method to solve the cost function obtained in step 3.3, and use three-dimensional points for projection to find the optimal camera pose, that is, adjust the target coordinates and camera pose simultaneously through least squares iteration to minimize the combined error.
[0056] Compared with the prior art, the present invention provides a method for coordinated attack of multiple aircraft targets under complex combat area conditions, which has the following beneficial effects:
[0057] The present invention proposes a method for creating a multi-view three-dimensional dynamic environment situation map based on nonlinear graph optimization, which utilizes multiple drones to share their respective positions and postures and their respective discovered targets, and quickly and accurately summarizes and integrates the local information generated by each drone through calculation, so as to provide a unified task area situation map for achieving the task. The present invention can effectively reduce the difficulty of drone cluster coordination in a complex task area environment, and ensure that the drone cluster can dynamically generate a situation map of the current task area through information sharing and distributed calculation according to the evolution of the environment when performing the task, so as to achieve accurate completion of the task. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a schematic diagram of the principle of fusing the local perception images of multiple drones into an overall situation image in the present invention;
[0059] Figure 2 A schematic diagram of a common situation diagram mentioned in an embodiment of the present invention;
[0060] Figure 3 A schematic diagram of a situation diagram constructed by the present invention;
[0061] Figure 4 A system diagram for calculating the situation diagram in Embodiment 1 of the present invention;
[0062] Figure 5 A schematic diagram of the process of constructing a situation diagram in Example 1 of the present invention;
[0063] Figure 6 A data flow diagram for calculating the situation diagram in Embodiment 1 of the present invention;
[0064] Figure 7 Schematic diagram of a reference coordinate system established by a carrier aircraft in Embodiment 2 of the present invention;
[0065] Figure 8 Schematic diagram of coordinate system transformation when calculating target coordinates in Example 2 of the present invention;
[0066] Fig. 9 Schematic diagram of positioning error of a UAV in Embodiment 3 of the present invention;
[0067] Fig.10 This is a schematic diagram of the optimization concept in Example 3 of the present invention. DETAILED DESCRIPTION
[0068] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0069] See also Figure 1 In order to establish a situation map, multiple drones in the present invention can share their respective positions and postures, as well as their respective discovered targets, through data links. Through efficient algorithms, the local information generated by each drone is quickly and accurately summarized and integrated to provide a unified mission area situation map (such as Figure 1-2 as shown).
[0070] The present invention mainly solves the following two problems:
[0071] ① Fusion of local maps
[0072] Due to the limitations of the field of view and position of each drone, they only obtain a partial view of the mission area environment. Through the present invention, these partial views can be fused into a complete picture.
[0073] ② Fusion of target coordinates and suppression of coordinate and attitude angle errors of each UAV
[0074] Since there are errors in the calculation of the position and attitude of each drone, there will inevitably be multiple results when they calculate the coordinates of the same target. The present invention uses optimization technology to comprehensively consider the position and attitude of each drone and all the calculation results of the target coordinates, and finally completes the error suppression of the position / attitude of each drone, and fuses the different coordinate calculation results of each target to obtain the unique coordinate after the error is suppressed.
[0075] Among them, item ② is the most important work and the basis of item ①, so the present invention mainly focuses on this item and simulates and verifies the effectiveness of the solution.
[0076] See also Figure 3 ,The situation map constructed by the present invention mainly includes three elements: the information of each UAV, the target information and the terrain information that affects the ,mission.
[0077] ① Information about drones
[0078] Figure 3 The information of each drone is its three-dimensional coordinates and posture.
[0079] The position is the three-dimensional coordinate of each drone, and the attitude is its yaw, pitch, and roll angles, which are all relative to the reference coordinate system uniformly established before the drone is released by the carrier aircraft.
[0080] ②Target information
[0081] The target information is its three-dimensional coordinates, which are relative to the reference coordinate system uniformly established before the UAV is released by the carrier aircraft.
[0082] ③ Geomorphic information
[0083] If an electronic map of the mission area can be obtained in advance, valuable topographic information in the prior map, such as hills, needs to be added to the situation map.
[0084] Based on the above content, the present invention is described in detail below with reference to the accompanying drawings and embodiments.
[0085] Embodiment 1:
[0086] The overall framework of the situation map
[0087] Each UAV uses its own position, identified target information and the electronic map provided by the carrier to complete the creation of the situation map through a series of calculation steps. The system diagram of situation map calculation is as follows: Figure 4 As shown:
[0088] (1) Establishment of reference coordinate system and geomorphic information table
[0089] The reference coordinate system is established using the data provided by the carrier aircraft, and its function is to provide a unified coordinate reference for the situation map; the topographic information table extracts important topographic data from the electronic map provided by the carrier aircraft and stores it in a table.
[0090] (2) Coordinate transformation of drone, target, and terrain
[0091] Combined with the position and attitude of each drone, the image coordinates of the identified target are converted to the reference coordinate system. This involves a series of coordinate system transformations: first, the target coordinates are converted from the image coordinate system to the camera coordinate system, then from the camera coordinate system to the drone body coordinate system, and finally to the reference coordinate system.
[0092] (3) Coordinate adjustment
[0093] Due to the accumulation of errors in the navigation system, there are large errors in the self-positioning coordinates and attitude of the UAV body. At the same time, the coordinates of the same target calculated by each UAV based on its position and attitude are inconsistent. Through coordinate adjustment, the local information of the mission area perceived by each UAV can be fused to obtain the unique coordinates of each target and correct the errors of the navigation system.
[0094] (4) Establishment of situation map
[0095] Through the calculations in the above steps, the optimized coordinates of each UAV and each target are obtained. Combined with the evaluation of other UAVs and targets, the complete information of each element can be obtained, thus generating a unified mission area situation map.
[0096] Figure 5 Each step and input and output information in the situation map calculation process is shown. The three dashed boxes on the left side of the figure are the three information input sources: the carrier, the photoelectric detection device, and the positioning device. They provide the necessary initial information for the situation map calculation (including the positioning device alignment data, the target template, and the terrain, etc.); the five solid boxes in the middle are the construction and calculation steps of the situation map, which are followed by the initialization of the situation map calculation, the coordinate transformation of each element (target, UAV, terrain), the coordinate adjustment, and the final generation of the situation map.
[0097] The data flow diagram for situation diagram calculation is as follows Figure 6 shown, including:
[0098] (1) Input unit
[0099] The input unit includes a bus, a navigation unit and a photoelectric detection device. The bus is a bus that obtains data from the carrier aircraft and provides information such as target templates and reference coordinate systems to the drone; the navigation unit provides the positioning and attitude information of the drone; and the photoelectric detection device provides the frame angle of the photoelectric detection device and the sight angle of the target.
[0100] (2) Situation map calculation unit
[0101] The situation map calculation unit saves the terrain information and calculates the reference coordinate system based on the data provided by the carrier, photoelectric detection device and positioning device, and calculates the position of the target in the reference coordinate system based on this. Then, the coordinate adjustment algorithm is used to fuse the targets in the local field of view of each UAV, while optimizing the position and posture errors of each UAV, evaluating the status of the UAV and the target, and forming a situation map with the above information.
[0102] (3) Output unit
[0103] The generated situation map is finally sent to other modules to complete the target allocation calculation.
[0104] Embodiment 2:
[0105] Reference coordinate system and coordinate transformation
[0106] The premise of establishing a situation map is to establish unified coordinates for each element in the map, such as drones, targets, and landforms. First, a reference coordinate system is established, then coordinates are established for each drone and all targets in this coordinate system, and finally these coordinates are used to establish a situation map.
[0107] (1) Reference coordinate system
[0108] The reference coordinate system is a rectangular coordinate system that provides a unified reference for each drone. Considering the characteristics of the positioning device error accumulation over time, the reference coordinate system cannot use the geographic coordinate system used before takeoff, but should be established before performing the mission.
[0109] like Figure 7 As shown, a rectangular coordinate system O is established at the rotation center of the carrier navigation assembly. b X b Y b Z b , called the carrier coordinate system. The optical system of the carrier is installed on the carrier in a certain way, and the camera coordinate system O is established at the optical center of the camera in its optoelectronic system. c X c Y c Z c , Z c The axis points forward, X c Right, Y c Downward. The transformation relationship matrix between the camera coordinate system of the carrier and the carrier coordinate system has been calibrated before the carrier leaves the factory.
[0110] The carrier aircraft searches for targets during the cruise process. When the attack conditions are met, the aircraft sets the alignment parameters to each UAV and sets the carrier coordinate system O b X b Y b Z b As the reference coordinate system O r X r Y r Z r , which is the coordinate system of the carrier marked by the dotted frame on the left. Through the alignment parameters bound by the carrier, each UAV establishes its unified reference coordinate system.
[0111] Since the reference coordinate system is in the air at this time, the Z coordinates of the ground targets in this coordinate system are all negative values. In order to avoid some possible adverse effects, the carrier coordinate system O during the transfer alignment can be used. b X b Y b Z b A vertical translation is superimposed on the surface so that the reference coordinate system is established on the ground.
[0112] (2) UAV and target coordinate transformation
[0113] After each drone recognizes its own target, the coordinates of each target are uniformly converted to the reference coordinate system through a series of coordinate transformations. This calculation process involves the camera coordinate system of each drone, the drone body coordinate system and the reference coordinate system, such as Figure 8 shown.
[0114] The drone body coordinate system O is established at the rotation center of each drone positioning device component m X m Y m Z m The Y axis points to the direction of the machine head, the Z axis is vertically upward, and the X axis is right. The camera coordinate system O is established at the optical center of the camera when the servo frame is at zero position in the photoelectric detection device. c X c Y c Z c , with its optical axis as Z c Axis, the positive direction is the direction pointing to the target, X c The axis is along the image u-axis to the right, Y c The axis is downward along the image v-axis.
[0115] Let the image coordinates of the target center be [u,v] T , the coordinates of the target in the camera coordinate system are [x c , y c , z c ] T , then the following relationship exists:
[0116] (1)
[0117] Among them, k x , k y , u0 and v0 are the intrinsic parameters of the camera, which can be obtained by calibrating the camera using a chessboard in advance.
[0118] From the above formula, the coordinates in the camera coordinate system are:
[0119] (2)
[0120] Since the photoelectric detection device is fixedly connected to the drone body, the transformation matrix between the camera coordinate system and the drone body coordinate system can be calibrated in advance before leaving the factory, and it is set as T c m ; Assume that the yaw angle of the drone given by the navigation unit is ψ, the pitch angle is θ, the roll angle is φ, and its current position is [p x ,p y ,p z ] T , then the coordinate system of the drone body in the reference coordinate system is expressed as:
[0121] (3)
[0122] Among them, s(.) and c(.) represent sin(.) and cos(.) respectively.
[0123] The camera coordinate system is expressed in the reference coordinate system as:
[0124] (4)
[0125] Among them, R is a 3×3 rotation matrix and p is a 3×1 translation vector.
[0126] Assume that the position of the target in the reference coordinate system is [x r , y r , z r ] T , since the target is on the ground, its z coordinate can be set to 0. From equations (1) and (4), we can get:
[0127] (5)
[0128] Let a = x c / z c , b = y c / z c , after rearrangement, we can get:
[0129] (6)
[0130] The coordinate x of the target in the reference coordinate system r and r The following formula can be used to solve it:
[0131] (7)
[0132] At this point, the coordinates of each UAV and target in the reference coordinate system [p x ,p y ,p z ] T and [x r , y r , z r ] T All have been obtained.
[0133] (3) Geomorphic coordinate transformation
[0134] After the reference coordinate system is determined, the transformation can be completed based on the coordinates of the topography in the original coordinate system of the digital map and the transformation matrix of the reference coordinate system.
[0135] Embodiment 3:
[0136] Coordinate adjustment
[0137] The self-positioning of a drone includes the calculation of both position and attitude, and plays an important role in the entire mission. It not only tells the drone where it is, but also uses it as a basis for calculating the position of the target. However, due to the limitations of specific conditions, the cumulative positioning error of the drone has a great impact on the positioning accuracy, especially when the flight trajectory includes many attitude changes. However, in the case of data link communication between multiple drones, each drone can share the positioning results of the attitude and target, and this information can be fused to reduce the possibility of errors. Fig. 9 As shown, Fig. 9 (a) shows the accumulation of self-positioning errors of the UAV during routine flight when no target is found, where the size of the dotted circle indicates the size of the error; Fig. 9 In (b), the drone can observe different numbers of targets at different locations during flight. If reasonable technology can be used to integrate the calculated coordinates of these targets with the self-positioning results, it can reduce both the self-positioning error and the calculation error of the target coordinates. This fusion method is called optimization technology.
[0138] (1) Optimization model
[0139] For the optoelectronic detection device of a certain drone, its camera recognizes a subset of all targets and calculates the three-dimensional coordinates of these targets. For the same target, the three-dimensional coordinates calculated by different drones are different. This difference comes from the positioning error of each drone and the transformation matrix error between the drone coordinate system, camera coordinate system and other related coordinate systems. The different coordinates calculated by different drones for the same target need to be merged into one coordinate in the end; at the same time, each drone needs to use its position and posture when calculating the target coordinates, which also has errors and needs to be eliminated at the same time as the target coordinate error.
[0140] The purpose of coordinate fusion is to feed the noisy target coordinates and the noisy camera pose into a nonlinear graph optimizer, where the pose of each camera is used as the vertex of the graph and the transformation matrix between the camera coordinate systems is used as the edge of the graph. By defining the loss function and undergoing a certain number of iterations, the optimal estimate of the target coordinates and the camera pose can be obtained simultaneously. Since the camera and the drone body are rigidly connected and the transformation matrix between them can be accurately calibrated in advance, the optimization of the camera pose (i.e., the camera coordinate system) is equivalent to the drone body coordinate system.
[0141] Optimization ideas such as Fig.10As shown in the figure: the image coordinates of the space target (square) in the camera of UAV 1 are [u1, v1], the coordinates calculated by UAV 1 in the reference coordinate system are [x1, y1, z1], and the coordinates calculated by UAV 2 in the reference coordinate system are [x2, y2, z2]. Through reverse projection, the coordinates [x2, y2, z2] are calculated back to the image coordinates of UAV 1 as [u2, v2]. There is an error between this coordinate and the coordinate calculated by UAV 1, which includes the error in the pose calculation of UAV 1 and UAV 2. The image coordinates [u1, v1] are the predicted values of the target coordinates, and [u2, v2] are the observed values of the target coordinates.
[0142] The optimization method for the positioning error of the target and the drone body is to first use the prediction equation for prediction, that is, a drone uses the internal and external parameters of the camera to calculate the image coordinates of the target; secondly, use the observation equation to obtain the observation value, that is, use the target coordinates calculated by other drones, and back-project them to the image coordinates of this drone; finally, use the optimization model to iteratively correct the deviation between the two. The optimization model uses the coordinates of the identified target and the posture of each drone, and uses the observed value of the target coordinates to correct its predicted value. Through the least squares iteration, the posture error of the target and each drone is eliminated in the process of minimizing the cumulative sum of all pixel coordinate errors.
[0143] (2) Observation equation and optimization cost function
[0144] The observation equation is the process of obtaining the observation value. First, starting from the camera of a single photoelectric detection device, let the coordinates of a certain target observed by it in the reference coordinate system be p, and the coordinates transformed to the camera coordinate system are:
[0145] (8)
[0146] Among them, R and t are the external parameters of the camera. Then, P′ is transformed to the normalized plane to obtain the normalized coordinates:
[0147] (9)
[0148] Dedistort the normalized coordinates to obtain the dedistorted coordinates. Here we only consider radial distortion:
[0149] (10)
[0150] Among them, k1 and k2 are radial distortion coefficients, and r is the distance between the pixel and the center of the image.
[0151] Finally, according to the intrinsic parameter model, the pixel coordinates are calculated:
[0152] (11)
[0153] Among them, f x 、f y 、c x , cy are the intrinsic parameters of the camera.
[0154] To facilitate subsequent analysis, the observation equation is abbreviated as:
[0155] z = h(ξ , y) (12)
[0156] Among them, ξ represents the Lie algebra of the camera pose of the photoelectric detection device (i.e., the external parameters R, t), the three-dimensional coordinates of the target are p, and the observation data are the pixel coordinates z = [u, v].
[0157] The observation error of the image coordinates of the photoelectric detection device is:
[0158] e = z − h ( ξ , p )(13)
[0159] For the case of multiple drones and multiple targets, let zij be the data generated by observing the target pj at the position ξi of the i-th drone, then the overall cost function is:
[0160] (14)
[0161] Solving this least squares equation is equivalent to adjusting the camera posture and target point of each drone at the same time.
[0162] In the past, the classic solution method was to use an extended Kalman filter, which performs a first-order approximation on nonlinear problems, performs a first-order Taylor expansion on the equations of motion and observation near a certain point, and then solves the approximate linear system. For a long time, EKF has been dominant in solving nonlinear problems. During this period, researchers have further proposed various filters to address its shortcomings, such as IF (information filter), IEKF (Iterated KF), UKF (Unscented KF), particle filter, SWF (Sliding Window Filter), etc., and also used divide-and-conquer methods to improve the efficiency of EKF. In situations where computing resources are limited or the quantity to be estimated is relatively simple, filter methods such as EKF still have good results. However, in recent years, nonlinear optimization methods have become increasingly more widely used, mainly due to the following reasons:
[0163] First, the filter method assumes Markov properties to a certain extent, that is, the state at the current moment is only related to the previous moment, and has nothing to do with other previous states and observations. Nonlinear optimization methods tend to use all historical data: not only the system state at the adjacent moment, but also the previous state. In this sense, nonlinear optimization methods use more information (and also require more calculations).
[0164] Secondly, the EKF filter only performs linearization once at a certain moment, and then directly calculates the posterior probability based on the result of this linearization. In fact, when we are far away from the working point, the first-order approximation may not be able to achieve a good approximation, which depends on the nonlinearity of the motion model and the observation model. If they have strong nonlinearity, then the linear approximation is only valid in a very small range, and the error becomes larger at a very far distance. This is the nonlinear error of the EKF, and it is also its main problem. Although the nonlinear optimization method also performs first-order (steepest descent) or second-order (Gauss-Newton or Levenberg-Marquardt) approximation, each time the state estimate changes after each iteration, the Taylor expansion will be performed on the new estimated point, instead of only performing a Taylor expansion at a fixed point like the EKF. This results in a wider range of applicability of the optimization method, and it can also be applied when the state changes greatly.
[0165] Finally, from the perspective of program implementation, EKF needs to store the mean and variance of the state quantity (drone body posture, target coordinates, etc.), and maintain and update them. If the target information is also put into the state, the storage volume is considerable, and it grows quadratically with the state quantity (covariance matrix). Therefore, EKF is generally considered not to be applicable to large-scale scenarios.
[0166] In summary, this solution adopts a nonlinear optimization method to solve the problem, and uses three-dimensional points for projection to find the optimal camera pose (rotation matrix and translation matrix), that is, to simultaneously adjust the target coordinates and camera pose through least squares iteration to minimize the comprehensive error.
[0167] (3) Nonlinear optimization solution
[0168] The observation equation h(ξ,p) is not a linear function and needs to be optimized using nonlinear optimization methods. Define the state variable x to contain all the variables to be optimized:
[0169] x = [ ξ 1, ..., ξ m , p 1, ..., p n ](15)
[0170] In this sense, when a small increment is given to the state variable, the cost function is:
[0171] (16)
[0172] Where Fij represents the partial derivative of the entire cost function with respect to the camera pose in the current state, and Eij represents the partial derivative of the function with respect to the target position.
[0173] For ease of calculation, the camera pose variables are put together separately:
[0174] x c = [ ξ 1, ξ 2, ..., ξ m] T ∈ R 6 m (17)
[0175] And put the target coordinates in a variable as well:
[0176] x p = [ p 1, p 2, ..., p n]T∈ R 3n(18)
[0177] In this way, formula (17) can be expressed in blocks as:
[0178] (19)
[0179] Thus, we transform the sum of multiple small quadratic terms into a more integrated form. The partial derivative matrices F and E are the derivatives of the overall objective function with respect to the pose and target, respectively, and are composed of Fij and Eij. On this basis, the overall derivative matrix (i.e., Jacobian matrix) of the cost function can be defined as the combination of two partial derivative blocks:
[0180] J = [ FE ](20)
[0181] The process of nonlinear optimization starts from the initial value, and each iteration calculates the current best descent direction and executes the step length in that direction, and finally converges to the optimal solution. This process is to continuously solve the increment g in the following incremental equation:
[0182] H Δ x = g (twenty one)
[0183] The optimal descent direction (i.e., gradient direction) is given by the Hessian matrix H, and ∆x is the detection step size in this direction.
[0184] For the above formula, the Hessian matrix H can be approximated using the Gauss-Newton method (GN) or the Levenberg-Marquardt method (LM). The main difference between the two is that in the GN method, H=J T J, while in the LM method H=J T J+λI, no matter which method is used, from formula (21)
[0185] (twenty two)
[0186] In the specific solution, the H matrix contains all the information of the camera and the target, so the dimension is very large. When calculating the incremental equation, if H is directly inverted, the complexity is O(n 3 ), which cannot meet the real-time requirements, so we need to reduce the dimension of H first.
[0187] To illustrate this phenomenon, take two cameras and six targets as an example. Camera C1 of drone 1 identifies targets P1 to P4, and camera C2 of drone 2 identifies targets P3 to P6.
[0188] The BA loss function in this case should be:
[0189]
[0190] With e 11 For example, it describes that the camera C1 of UAV 1 sees the target P1, which is independent of the camera poses of other UAVs and other targets. 11 for e 11 The corresponding Jacobian matrix, it is not difficult to see that e 11 The partial derivatives of the camera variable ξ2 and the targets p2,...,p6 are all 0. Substitute all variables with x = (ξ1,ξ2,p1,...,p6) T The order of placement is:
[0191]
[0192] At this time J 11 It appears as the following figure:
[0193]
[0194] Other J ij Similarly, the entire Jacobian matrix and the elements in the H matrix exhibit a blocking pattern.
[0195] The squares in the figure above indicate that the matrix has values at the corresponding matrix blocks, and the rest indicate that the values of the matrix at that location are always 0.
[0196] For the more general multi-drone multi-target situation, the upper left block of the H matrix is smaller, the lower right diagonal block occupies most of it, and the non-diagonal part is scattered with observation data. It can be divided into 4 sub-blocks: the upper left corner is a diagonal block matrix with the same dimension as the number of camera poses; the lower right corner is also a diagonal block matrix with the same dimension as the number of targets. The structure of the non-diagonal block is related to the specific observation data.
[0197] This structural feature indicates that the H matrix is sparse. The sparsity of the H matrix is caused by the Jacobian matrix J. Since the error term eij in the cost function describes that when ξi sees pj, only the i-th camera pose and the j-th target are involved, and the derivatives of the variables of the rest are 0, the Jacobian matrix corresponding to the error term has the following form:
[0198] (twenty three)
[0199] Among them, 02×6 represents a 0 matrix with a dimension of 2×6, and the same is true for 02×3. The dimension of the partial derivative of the error term with respect to the camera attitude ∂eij / ∂ξi is 2×6, and the dimension of the partial derivative with respect to the target coordinates ∂eij / ∂pj is 2×3. The Jacobian matrix of this error term is zero except for these two non-zero blocks.
[0200] Taking advantage of the sparsity of H, Schur elimination can be used to reduce dimensionality, which can further reduce space occupancy and improve computing speed.
[0201] Divide the matrix into 4 blocks: the upper left corner is a diagonal block matrix, the dimension of each diagonal block element is equal to the dimension of the camera pose, and it is a diagonal block matrix. The lower right corner is also a diagonal block matrix, and the dimension of each diagonal block is the dimension of the target. The structure of the non-diagonal block is related to the specific observation data. For the convenience of analysis, these four blocks are called B, E, and C.
[0202] Therefore, the corresponding linear equations can also be transformed from HΔx = g into the following form:
[0203] (twenty four)
[0204] Where B is a diagonal block matrix, the dimension of each diagonal block is the same as the dimension of the camera parameters, and the number of diagonal blocks is the number of camera variables. Since the number of targets is generally greater than the number of camera variables, C is often much larger than B. Each target in three-dimensional space is three-dimensional, so the C matrix is a diagonal block matrix, and each block is a 3×3-dimensional matrix. The difficulty of inverting a diagonal block matrix is much easier than the difficulty of inverting a general matrix, because only those diagonal matrix blocks need to be inverted separately. Taking this feature into account, Gaussian elimination is performed on the linear equations to eliminate the non-diagonal part E in the upper right corner, and we get:
[0205] (25)
[0206] After sorting, we get
[0207] (26)
[0208] After elimination, the first row of equations becomes the sum Δx p Irrelevant terms. Take it out separately and get the incremental equation for the posture part:
[0209] (27)
[0210] The dimension of this linear system of equations is the same as the B matrix. Solve this equation first, and then use the solution Δx c Substitute into the original equation and solve for Δx p This process is called Schur Elimination.
[0211] There is also a serious problem here: in the case of multiple drones and multiple targets, when different drones calculate the coordinates of the same target, their coordinates may be confused with other targets, and there will be mismatches when substituting them into the cost function, resulting in incorrect data for a certain error term. This is reflected in the graph optimization, which means that an edge that should not be added to the graph is added. However, the optimization algorithm cannot distinguish that this is wrong data, and it will treat all data as errors. At this time, the algorithm will see an edge with a large error and a large gradient, which means that adjusting the variables associated with it will cause the objective function to drop more. Therefore, the algorithm will try to adjust the estimated values of the nodes connected to this edge so that they conform to the unreasonable requirements of this edge. Since the error of this edge is generally very large, it often greatly suppresses the influence of other correct edges, causing the optimization algorithm to focus on adjusting an incorrect value.
[0212] The reason for this problem is that when the error is large, the two-norm grows too fast. To solve this problem, we need to use the kernel function technology. The kernel function ensures that the error of each edge is not too large to cover up other edges. The specific method is to replace the original two-norm measurement of the error with a function that does not grow so fast while ensuring its own smoothness (this is required for derivation). Because they make the entire optimization result more robust, they are also called robust kernel functions. Here, the most common Huber kernel is selected:
[0213] (28)
[0214] After the kernel function is introduced, when the error e is greater than a certain threshold, the function growth changes from a quadratic form to a linear form, which is equivalent to limiting the maximum value of the gradient. At the same time, the Huber kernel function is smooth and can be easily differentiated. Equation (28) shows the comparison between the Huber kernel function and the quadratic function. It can be seen that when the error is large, the growth of the Huber kernel function is significantly lower than that of the quadratic function.
[0215] In addition to the Huber kernel, there are also Cauchy and Tukey kernels, which can be selected according to needs.
[0216] Above, we theoretically analyzed the sparsity in BA and used Schur elimination to solve the sparsity problem, and based on this, we realized the construction of a nonlinear optimization model.
[0217] Embodiment 4:
[0218] Situation map generation
[0219] Each UAV completes the generation of the situation map based on the above calculations. For each UAV, the complete operation steps are:
[0220] (1) Complete self-positioning and calculate its three-dimensional coordinates and posture in the reference coordinate system;
[0221] (2) For each identified target, calculate its coordinates in the reference coordinate system;
[0222] (3) Receive the position and coordinates of the targets detected by other drones;
[0223] (4) Perform coordinate adjustment to obtain the optimized coordinates of the UAV, other UAVs, and the target;
[0224] (5) The drone, target information table and terrain information are combined to obtain a complete situation map;
[0225] (6) Send the map feature table to other modules.
[0226] The situation map consists of the UAV information table, target information table, and terrain information table, as shown in Table 1, Table 2, and Table 3:
[0227] Table 1 UAV information table
[0228]
[0229] Table 2 Target information table
[0230]
[0231] Table 3 Geomorphic information table
[0232]
[0233] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for creating a multi-view 3D dynamic environment situation map based on nonlinear graph optimization. It is characterized in that Each UAV uses its own position, the electronic map provided by the carrier and the identified target information to complete the creation of a multi-view three-dimensional dynamic environment situation map through a series of calculation steps, including the following: Step 1, establishing a reference coordinate system and a landform information table: using the data provided by the carrier, the photoelectric detection device and the positioning device to establish a reference coordinate system; extracting important landform data from the electronic map provided by the carrier, storing it in a table, and forming a landform information table; Step 2, UAV, target, and terrain coordinate transformation: Combined with the position and posture of each UAV, the image coordinates of the identified target are transformed into the reference coordinate system established in step 1; the coordinate system transformation between the UAV and the target further includes: firstly, the coordinates of the target are transformed from the image coordinate system to the camera coordinate system, then from the camera coordinate system to the UAV body coordinate system, and finally to the reference coordinate system; the terrain coordinate transformation refers to the transformation completed according to the coordinates of the terrain in the original coordinate system of the digital map and the reference coordinate system transformation matrix after the reference coordinate system is determined; The coordinate transformation between the drone and the target specifically includes the following contents: Establish the drone body coordinate system at the rotation center of each drone positioning device component O m X m Y m Z m , with its Y axis pointing to the direction of the aircraft nose, the Z axis pointing vertically upward, and the X axis pointing to the right; the camera coordinate system is established at the optical center of the camera when the servo frame is at zero position in the photoelectric detection device O c X c Y c Z c , with its optical axis as Z c Axis, the positive direction is the direction pointing to the target, X c The axis is along the image u-axis to the right, Y c The axis is downward along the v-axis of the image; Assume the image coordinates of the target center are [ u , v ] T , then the coordinates of the target in the camera coordinate system are [ x c , y c , z c ] T for: (1) in, k x , k y , u 0 and v 0 is the intrinsic parameter of the camera, which is obtained by calibrating the camera using a chessboard in advance; The coordinates in the camera coordinate system are obtained from formula (1): (2) Since the photoelectric detection device is fixedly connected to the drone body, the transformation matrix between the camera coordinate system and the drone body coordinate system can be calibrated in advance at the factory, and it is set as T c m ; Assume that the yaw angle of the UAV given by the navigation unit is ψ , the pitch angle is θ , the roll angle is φ , whose current position is [ p x , p y , p z ] T , then the coordinate system of the drone body in the reference coordinate system is expressed as: (3) in, s (.)and c (.) respectively represent sin (.)and cos (.); The camera coordinate system is expressed in the reference coordinate system as: (4) in, R is a 3×3 rotation matrix, p is a 3×1 translation vector; Assume the position of the target in the reference coordinate system is [ x r , y r , z r ] T , since the target is on the ground, set its z The coordinate is 0, and from equations (1) and (4) we can get: (5) set up a = x c / z c , b = y c / z c , the above formula is rearranged: (6) Coordinates of the target in the reference coordinate system x r and y r Solve it using the following formula: (7) At this point, the coordinates of each drone and target in the reference coordinate system [ p x , p y , p z ] T and[ x r , y r , z r ] T All have been obtained Step 3, coordinate adjustment: Use the coordinate adjustment algorithm to fuse the local information of the mission area sensed by each drone, obtain the unique coordinates of each target, and correct the error of the drone navigation system; Step 4: Establish situation map: Integrate the contents of steps 1-3 to obtain the optimized coordinates of each UAV and each target. Combined with the evaluation of other UAVs and targets, obtain complete information of each element of the situation map, and then generate a unified mission area situation map.
2. The method for creating a multi-view three-dimensional dynamic environment situation map based on nonlinear graph optimization according to claim 1, It is characterized in that The reference coordinate system described in step 1 is a rectangular coordinate system, which provides a unified reference for each drone.
3. The method for creating a multi-view three-dimensional dynamic environment situation map based on nonlinear graph optimization according to claim 1, It is characterized in that The purpose of the coordinate adjustment described in step 3 is to send noisy target coordinates and noisy camera pose into a nonlinear graph optimizer, wherein the pose of each camera is used as the vertex of the graph, and the transformation matrix between the camera coordinate system is used as the edge of the graph. By defining a loss function and through a certain number of iterations, the optimal estimation of the target coordinates and the camera pose is obtained simultaneously. Step 3 specifically includes the following content: Step 3.1, optimize the positioning error of the target and the drone body: First, a drone uses the internal and external parameters of the camera to calculate the image coordinates of the target and obtain the predicted value of the target coordinates; secondly, the target coordinates calculated by other drones are back-projected to the image coordinates of the drone, that is, the observation value of the target coordinates is obtained by using the observation equation; finally, the predicted value is corrected by using the coordinates of the identified target and the posture of each drone, and the posture error of the target and each drone is eliminated in the process of minimizing the cumulative sum of all pixel coordinate errors through least squares iteration; Step 3.2, construct the observation equation: First, starting from the camera of a single photoelectric detection device, let the coordinates of a certain target observed by it in the reference coordinate system be p, and the coordinates transformed to the camera coordinate system are: (8) in, R’ , t is the camera external parameter; Then, P′ Transform to the normalized plane and get the normalized coordinates: (9) Dedistort the normalized coordinates to obtain the dedistorted coordinates: (10) in, k 1 , k 2 is the radial distortion coefficient, r c is the distance between the pixel and the center of the image; Finally, according to the intrinsic parameter model, the pixel coordinates are calculated: (11) in, f x , f y , c x , c y is the camera internal parameter; Step 3.3, construct the cost function: The observation equation obtained in step 3.2 is abbreviated as: z = h(ξ , p) (12) Among them, ξ represents the Lie algebra of the camera pose of the photoelectric detection device, and the three-dimensional coordinates of the target are p , the observation data is the pixel coordinates z =[ u’ , v’ ]; The observation error of the image coordinates of the photoelectric detection device is: e = z − h ( ξ , p )(13) For the case of multiple UAVs and multiple targets, zij To observe the target at the position ξi of the i-th UAV pj The data generated, the overall cost function is: (14) Step 3.4, optimize the cost function: Use a nonlinear optimization method to solve the cost function obtained in step 3.3, and use three-dimensional points for projection to find the optimal camera pose, that is, adjust the target coordinates and camera pose simultaneously through least squares iteration to minimize the combined error.
4. The method for creating a multi-view three-dimensional dynamic environment situation map based on nonlinear graph optimization according to claim 3, It is characterized in that The nonlinear optimization is to optimize the nonlinear observation equation h ( ξ , p ) is optimized, specifically: Defining state variables x Contains all variables to be optimized: x = [ ξ 1 , ..., ξ m , p 1 , ..., p n ](15) In this sense, when a small increment is given to the state variable, the cost function is: (16) in Fij represents the partial derivative of the entire cost function with respect to the camera pose in the current state, and Eij represents the partial derivative of the function with respect to the target position; Put the camera pose variables alone: x c = [ ξ 1, ξ 2, ..., ξ m] T ∈ R 6 m (17) And put the target coordinates in a variable as well: x p = [ p 1, p 2, ..., p n]T ∈ R 3n(18) Based on equations (17) and (18), equation (16) is expressed in blocks as follows: (19) Partial derivative matrix F and E are the derivatives of the overall objective function with respect to the pose and the target, respectively, which are given by Fij and Eij On this basis, the overall derivative matrix of the cost function is defined as a combination of two partial derivative blocks: J = [ FE ](20) Starting from the initial value, the optimal descent direction is calculated iteratively, and the step length is executed in this direction. Finally, the optimal solution is approached, and the increments in the following incremental equation are continuously solved. g : H D x = g (21) Among them, the best descent direction is given by the Hessian matrix H, and ∆x is the detection step in this direction; Taking advantage of the sparsity of the matrix H, Schur elimination is used to reduce its dimensionality, and equation (21) is transformed into the following form: (22) in B It is a diagonal block matrix. The dimension of each diagonal block is the same as the dimension of the camera parameters. The number of diagonal blocks is the number of camera variables. Further Gaussian elimination is performed on equation (22) to eliminate the non-diagonal part in the upper right corner. E ,have to: (23) After sorting, we get (24) After elimination, the first row of equations becomes the sum Δ x p Irrelevant terms; take it out separately and get the incremental equation for the posture part: (25) Solve equation (25), and then convert the obtained Δ x c Substitute into the original equation and solve for Δ x p ; Based on the kernel function technology, the Huber kernel is introduced to transform the cost function into: (26) After the deformation is completed, the observation equation h ( ξ , p )Nonlinear optimization is completed.
