Abstract
Monocular vision is increasingly used in micro air vehicles for navigation. In particular, optical flow, inspired by flying insects, is used to perceive vehicle movement with respect to the surroundings or sense changes in the environment. However, optical flow does not directly provide us the distance to an object or velocity, but the ratio of them. Thus, using optical flow in control involves nonlinearity problems which add complexity to the controller. To deal with that, we propose an algorithm that estimates distance and velocity of the vehicle based on optical flow measured from a monocular camera and the knowledge of control inputs. This algorithm applies an extended Kalman filter to state estimation and uses the estimates for landing control. We implement and test our algorithm in computer simulation and on board a Parrot AR.Drone 2.0 to demonstrate its feasibility for micro air vehicles landings. Results of the simulation and multiple flight tests show that the algorithm is able to estimate height and velocity of the micro air vehicles accurately, and achieves smooth landings with these estimates, even in windy outdoor environments.
Introduction
Micro air vehicles (MAVs) have gained in popularity in recent years. Due to their small size, they are easier and safer to use than large unmanned aerial vehicles. However, the size and weight constraints make the MAVs more challenging to be deployed for autonomous missions. To deal with the problems, it requires reducing the amount of payload or sensors and developing more intelligent and efficient algorithms.
Optical flow, which can be extracted from a monocular camera, provides a very promising solution for miniaturization. Optical flow refers to the apparent visual motion of objects in a scene relative to an observer. 1 This information tells us not only how fast the camera moves, but also how close it is relative to the things it sees. Flying insects use it as the main visual cue for sensing their own movements and surrounding objects while flying. They can perform complex tasks, such as landing, by only relying on this visual input and using limited neural resources. For instance, honeybees heavily use optical flow to perceive the environment and avoid dangerous objects while flying.2,3
To accomplish vertical landings, honeybees use a divergent pattern of optical flow or the so-called flow divergence. By keeping the flow divergence constant, honeybees can perform smooth landings. This strategy leads to exponential decay of both height and velocity to zero at touchdown, and it is ideal for MAVs landings.4–7 Often, a straightforward proportional or proportional integral feedback controller is used for MAVs to perform constant flow divergence landing.
However, in our previous studies, we found that fixed-gain controls used in constant flow divergence can lead to instability of the landing.8,9 This is because the critical control gain is directly proportional to the height. 8 Most of the current approaches to solving this problem are to use a gain-scheduling technique which is actually designed according to the knowledge of an initial height.10,11 However, if no additional sensor is installed, the height is unknown. Besides, if the initial height deviates too much from the one which is used to design the gain-scheduling structure, this method will not work properly. Thus, the knowledge of the height is important for optical flow control.
In fact, optical flow does not give us the absolute distance to a surface or velocity of the camera directly. There are four known methods to estimate distances from optical flow. First, one can add sensors that directly or indirectly measure distance, velocity, or accelerations. The right type of filtering and fusion can then give distance estimates. For instance, some studies include an inertial measurement unit (IMU), a camera sensor, and a pressure sensor, and use a Kalman-based sensor fusion technique to estimate distances.12,13
Second, when performing a perfect constant flow divergence landing, the control input (the thrust) or so-called efference copy follows a specific monotonously decreasing function over time, which can be used to estimate distances. 14 They demonstrated this approach by moving a camera along a track toward an image scene to first estimate an initial distance. Since the constant flow divergence control will result in an exponential decay of distances, they simplified the estimation problem to an exponential propagation of distances after obtaining the initial value.
Third, a stability approach that detects self-induced oscillation caused by high controller gains and uses these gains to estimate distances was introduced. 8 He showed analytically that there exists a directly proportional relationship between the critical control gain, i.e., the gain which causes instability, and the height. Based on this relationship, the MAV detects self-induced oscillation and uses these gains to estimate the height.
Fourth, by knowing the effect of the control inputs, one can “scale” the optical flow to obtain the distance and velocity. An early study on the dynamic effects in visual servoing showed that the control gain is a function of the distance. 15 It was used in an adaptive control scheme for visual servoing. 16 The relationship also implies that the closed-loop response depends on the distance which opens up the possibility of estimating the distance to a target from closed-loop dynamics.
In this paper, we build upon the principle presented in the fourth method to estimate the height (distance to the ground) and vertical velocity of an MAV. An extended Kalman filter (EKF) is used to estimate the height and vertical velocity of an MAV using the knowledge of the control input in combination with the flow divergence observed from a monocular camera. This algorithm uses the efference copy to predict the effects of an action and the observed flow divergence to correct the prediction. The significant advantage of this method is that we simplify the nonlinear control of the constant flow divergence to a linear control that uses height and velocity estimates. Thus, this provides the possibility of using some optimization techniques with vision output from a monocular camera to improve the performance of the control.
The remainder of the paper is set up as follows: In the first section, we provide some knowledge about the flow divergence and the constant flow divergence guidance and control strategy. The following section describes the proposed EKF-based height and velocity estimation using the flow divergence and the control inputs, the nonlinear observability analysis of the system, and vision algorithms used to estimate flow divergence with a monocular camera. Then, the next section shows the results of estimation in computer simulation while in the succeeding section we also show the results of multiple landings of an MAV. Finally, a conclusion with future work is drawn.
Background
Flow divergence
For vertical landing of an MAV, flow divergence (D) or visual looming as shown in Figure 1 can be computed as the ratio of its vertical velocity VZ to the height from the ground Z
Divergence of optical flow vectors (flow divergence) when the observer is approaching a surface.
When the MAV is approaching the ground, we measure positive Z, negative VZ, and thus D < 0 according to the coordinate systems shown in Figure 2. The camera coordinate system is assumed to coincide with the body coordinate system.
MAV body (xb, yb, zb) and world (xw, yw, zw) coordinate systems. MAV: micro air vehicle.
Constant flow divergence guidance and control
Constant flow divergence approach has been used for vertical landing of the MAVs. This approach controls the vertical dynamics of the MAVs by tracking a constant flow divergence. When |D| equals a positive constant c, we can derive from equation (1) the height
A proportional feedback controller is used to track the desired flow divergence
A double integrator system is used to model the dynamics of an MAV toward the ground in one-dimensional space. The continuous state space model can be written as
It is clear that the model dynamics in equation (3) are linear but the observation in equation (4) is nonlinear. Figure 3 shows a time response of the system when tracking a constant flow divergence. In this figure, we can see that the MAV accelerates in the first 2.5 s and then decelerates to zero velocity to touch the ground. Both height and velocity of the MAV decrease exponentially to zero in the end.
Height Z, velocity VZ, and flow divergence D of an MAV during landing using constant flow divergence strategy (
EKF-based height and velocity estimation using flow divergence and control input
An overview of the methodology is presented in Figure 4. Images captured by a camera are served as the inputs to the software while the control input commands the actuator to control the MAV. In this section, we describe (1) an EKF algorithm using the flow divergence and efference copies to estimate the height and velocity of an MAV during landing, (2) a nonlinear observability analysis of the system, and (3) a vision method to compute the flow divergence.
An overview of the methodology.
EKF
In practice, the flow divergence is computed using an on-board processor. Therefore, we used a discrete-time EKF to estimate the height and vertical velocity of the MAV. The system model and observation model are shown in equations (5) and (6), respectively
Several computational steps taken in EKF when the update of flow divergence is obtained are shown below:
One-step ahead prediction
Covariance matrix of the state prediction error vector
Kalman gain
Measurement update
Covariance matrix of state estimation error vector
where
where
Nonlinear observability of the estimation
In this subsection, we show that with the flow divergence and the efference copy/control input the system is observable, i.e., any distinct states are distinguishable by applying a bounded measurable input (e.g., a piecewise constant input). To check the observability of the nonlinear system, the observability rank condition can be used. 17
We first construct the observability algebra which consists of repeated Lie derivatives of the observation model in equation (4),
Next, we analyze
Features-based flow divergence estimation
In computer simulation, we used equation (1) to compute flow divergence, while in flight tests, we estimated flow divergence based on equation (15) (Proof can be found in Ho et al.
9
). For each image captured by an on-board camera, corners were detected using the FAST algorithm18,19 and tracked in the next image using the Lucas–Kanade tracker.
20
Then, the image distances between every two corners at one image,
Computer simulation
Before performing flight tests, we simulated the proposed algorithm presented in the previous section in MATLAB to show the feasibility of the algorithm.
Landing simulation with simulated control inputs
In the simulation, we generated the height and velocity with a timestamp of 0.05 s using a set of control inputs, μ as shown in Figure 5(e). These data served as ground truth for validation. The flow divergence measurement was generated using equation (1) with a measurement noise standard deviation of 0.001 s−1 as illustrated in Figure 5(d).
EKF-based height and vertical velocity estimation from flow divergence for landing control. (a) Height, (b) velocity, (c) innovation, (d) flow divergence, and (e) control input. EKF: extended Kalman filter.
By using the control input, μ and the flow divergence measurement, D, we estimated the height, Z and the velocity, VZ with the proposed EKF algorithm. Figure 5 shows estimated states (Z and VZ) and their ground truth, innovation of the EKF, flow divergence measurement, and the control inputs. In this simulation, we can observe that the estimated height and velocity converge and follow the ground truth after a few seconds, even with different initial conditions (Z0 and
Experiments results and discussion
We implemented the EKF algorithm and vision algorithms in Paparazzi Autopilot, an open source autopilot software. 21 A Parrot AR.Drone 2.0 equipped with a downward-looking camera was used as a testing platform, and all algorithms were running on board the MAV. We used an OptiTrack system to track the position of the MAV in order to provide the ground truth of its height and velocity only for validation purposes, and these measurements were not used in the estimation. In this section, we show the feasibility of the algorithm by performing three different control strategies for MAVs landings.
Before executing the algorithm in real-world experiments, we need to check the relationship between the control input μ (which is assumed to be the acceleration in the model) and the resulting acceleration aZ imposed on our platform, e.g., Mapping of the control input μ to the vertical acceleration aZ using a linear function (
Landing using constant flow divergence with fixed-gain control
The first strategy we used in the flight tests is the constant flow divergence. A flow divergence set point was tracked for the entire landing. During the landing, the EKF algorithm was running in real time to estimate the height and velocity of the MAV.
Figure 7 shows the estimation results of the landing with a constant divergence of Landing with constant flow divergence (
From the landing results, we can observe that this strategy exponentially decreases both height and velocity to nearly zero by only tracking a constant flow divergence. In fact, the drawback of vision algorithms is that when the image is too dark, the algorithms will not work properly. For instance, when the camera is too close to the ground, the flow divergence estimate becomes incorrect. To deal with that, we constantly decrease the trim throttle when the MAV is very close to the ground (
To show the reliability of the proposed algorithm, we performed multiple landings with different flow divergence set points ( Multiple landings with different flow divergence set points (
The height and velocity estimated from EKF can then be adapted to tune the controller gain in real time for the constant divergence landing. This will be discussed in the coming section. By doing that, oscillations due to improperly chosen gain can be reduced, and thus a smooth landing can be achieved by only using a monocular camera.
Landing using constant flow divergence with height-adapted control
Experiments presented in the previous subsection were performed using a manually tuned control gain in order to achieve stable landings. In fact, the critical control gain, i.e., the control gain which causes instability, is directly proportional to the height. 8 This means that if a fixed gain is used in constant flow divergence landing, oscillation will occur at a certain height. When the height is known from the proposed algorithm, it can be used to automatically adjust the control gain in such a way that the oscillation is eliminated. 9 This second strategy is used to keep the advantages of using constant flow divergence landing, i.e., achieving an exponential landing profile by just tracking a desired flow divergence set point and avoid the instability due to a fixed-gain control.
By letting
This controller simplifies the problem to a linear control problem. To find k, we can first solve this linear control problem using the pole-zero analysis. From equation (3), the model dynamics becomes
To achieve stable conditions, all the poles should lie in the left half of the s-plane. The poles of the system are obtained as shown below
Therefore, for a stable system,
Three flight tests were performed at different flow divergence set points ( Height-adapted control for constant flow divergence landings with different flow divergence set points (
Landing using height and velocity from EKF
The third strategy we used for landing is tracking a height profile using the estimates from EKF. To this end, the landing begins by (1) giving an initial excitation to the MAV, or (2) using constant divergence strategy, for the first few seconds. This can ensure that the EKF converges and the controller tracks the right height estimate.
This first initialization was performed in an indoor flight test by giving a block input as the excitation as shown in Figure 10(e) to the MAV for the first 0.5 s. This allowed the MAV to go down or move in order to “observe” flow divergence and initialize the EKF algorithm. After that, the controller used the estimates from the EKF to track a desired profile or set points for landing.
Landing with a linear controller using estimates from EKF (indoor flight). (a) Height, (b) velocity, (c) innovation, (d) flow divergence, and (e) control input. EKF: extended Kalman filter.
Figure 10 shows the height and velocity estimates from EKF compared with their ground truth, the innovation of EKF, the flow divergence from the vision algorithms and the ground truth, and the control input. After giving the initial excitation, the MAV started to track a height profile represented by the black dash-dot line. This profile was generated using
The second initialization was conducted in an outdoor flight by tracking a desired divergence for the first few seconds as shown in Figure 11. Since the OptiTrack system is not available for outdoor flight, we can only use the onboard sensor, such as sonar, to provide the true height and velocity (dZ/dt) for accuracy comparison.
Landing with a linear controller using estimates from EKF (outdoor flight). (a) Height, (b) velocity, (c) innovation, (d) flow divergence, and (e) control input. EKF: extended Kalman filter.
The landing started at 5 m, and the desired divergence of
In this paper, we presented three landing strategies using (1) constant flow divergence with fixed-gain control, (2) constant flow divergence with height-adapted control, and (3) height and velocity estimates. All these strategies can provide a smooth landing solution for MAVs. The first strategy, however, requires a perfectly tuned control gain to avoid instability. The second strategy solves this manual tuning problem by adapting height estimate from EKF to the control gain. This allows stable landings without affecting the tracking performance. Due to fast convergence of height, we only observe a slight oscillation at the start of the landings. Lastly, the third strategy uses the height and velocity from EKF directly for landing. Although it requires an initial excitation for observing optical flow, this strategy lands the MAV by following a desired landing profile and allows further performance improvement using gain optimization techniques.
Discussion on wind effect and rejection
In principle, external disturbance, such as the wind, has no problem in control as it can be rejected easily. For instance, when using a proportional feedback control with height estimates, the steady-state error due to wind can occur, but it can be eliminated using the analysis of final value theorem on our model with the wind. From this analysis, we found that in order to reject for instance a constant wind, the proportional control gain should be
However, for state estimation, the wind as the external force is not accounted for in our model at the moment. The practical experiment performed in a windy outdoor environment shows that this factor might not be problematic. However, a more thorough investigation and a solution for this problem might be necessary. For instance, we can augment the state vector in equation (3) with the wind disturbance as an additional state, i.e.,
Conclusion
In conclusion, we proposed an algorithm to use an EKF to estimate the height and vertical velocity of an MAV from the flow divergence and the knowledge of the control input while approaching a surface and use these estimates for landing control. This algorithm was tested in computer simulation as well as in multiple flight tests in indoor and windy outdoor environments. The results show that the proposed EKF approach managed to estimate the height and velocity of the MAV accurately compared to the ground truth provided by the external cameras. In addition, the estimates were used in the controller to smoothly land the MAV. The proposed approach avoids the complexity of having nonlinearity in the constant flow divergence-based landing by “splitting” the flow divergence into the height and velocity which allows the use of a linear controller. For future work, an augmented state Kalman filter can be used to improve the estimation when strong external disturbances are involved. Also, the algorithm opens up the possibilities to use gain optimization techniques to improve the control performance.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.
