J E Gomez-Balderas

G Flores
email: gfloresc@hds.utc.fr

L R García Carrillo

R Lozano
email: rlozano@hds.utc.fr

Tracking a ground moving target with a quadrotor using switching control

An UAV stabilization strategy based on computer vision and switching controllers is proposed. The main goal of this system is to perform tracking of a moving target on ground. The architecture implemented consists of a quadrotor equipped with an embedded camera which provides images to a computer vision algorithm where images are processed. A vision-based estimator is proposed, which makes use of 2-dimensional images in order to compute the relative 3-dimensional position and translational velocity of the UAV with respect to the target. The proposed estimator provides the required measurements to a micro-controller for stabilizing the vehicle during flight. The control strategy consists of switching controllers, which allows making decisions when the target is lost temporarily or when it is out of the camera's field of view. Real time experiments are presented to demonstrate the performance of the target-tracking system proposed.

I. INTRODUCTION

Tracking moving targets (m.t.) using unmanned aerial vehicles (UAV) allows performing important tasks like surveillance, reconnaissance and intelligence missions. UAV hovering over a desired position requires information coming from varied sensors, more precisely, it requires data coming from UAV environment. A sensor capable to obtain abundant information of UAV environment is a vision system. Many results related to this topic have been presented in the last few years. Most of them are related to identification and classification of multiple targets [1], [2], [3][4], [5] and [6]. A circular pattern navigation algorithm for autonomous target tracking has been studied in [7] and [8] showing a good performance supported by numerical simulations.

particle filters for moving cameras without stabilization [START_REF] Lee | Strategies of path-planning for a uav to track a ground vehicle[END_REF] and the Joint Probabilistic Data Association Filter (JPDAF) for tracking multiple targets with unreliable target identification [START_REF] Bar-Shalom | Tracking and Data Association[END_REF]. If a model for the object's motion is known, an observer can be used to estimate the object's velocity [START_REF] Ghosh | A realization theory for perspective systems with application to parameter estimation problems in machine vision[END_REF]. In [START_REF] Hashimoto | Observer-based control for visual servoing[END_REF], an observer for estimating the object velocity was utilized; however, a description of the object's kinematics must be known. In [START_REF] Koivo | Real-time vision feed-back for servoing robotic manipulator with self-tuning controller[END_REF] an autoregressive discrete time model is used to predict the location of features of a moving object. In [START_REF] Allen | Trajectory filtering and prediction for automated tracking and grasping of a moving object[END_REF], trajectory filtering and prediction techniques are utilized to track a moving object. In [START_REF] Shariat | Motion estimation with more than two frames[END_REF], object-centered models are utilized to estimate the translation and the center of rotation of the object. Several interesting works have been presented concerning visual tracking of targets using UAVs. In [START_REF] Teuliere | Chasing a moving target from a flying uav[END_REF] a color based tracker is proposed to estimate the target position, while in [START_REF] Heintz | From images to traffic behavior -a uav tracking and monitoring application[END_REF] thermal images are correlated with a geographical information system (GIS) towards the same goal. In [START_REF] Gomez-Balderas | Vision based autonomous hover of a mini-rotorcraft[END_REF] a visionbased control algorithm for stabilizing a UAV equipped with two cameras is presented. The same system has been used in [START_REF] Gomez-Balderas | Vision based tracking for a quadrotor using vanishing points[END_REF] to track a line painted in a wall, using a vanishing points technique. Some methods for designing UAV trajectories that increase the amount of information available are presented in [START_REF] Ponda | Trajectory optimization for target localization using small unmanned aerial vehicles[END_REF].

In this paper we describe the use of a vision system to observe a visual target over a ground vehicle and to track it by using an UAV platform of quadrotor type (X-4). The main challenge involved in target localization include maintaining the target inside the camera's field of view. In order to achieve this requirement, we propose a control schema that develops a X-4 tracking, such the target localization estimation error is minimized. To successfully perform this task, we have developed a control strategy consisting of three principals objectives. First, the hovering UAV tracks the target over a desired position, this stage is known as take-off mode (TO). In case of a temporary lose of sight of the target, we use a second control schema named target localization (TL), which consists on increasing the UAV altitude to obtain a better view of the scene. Once the vision system has located the target, our third control schema called loss of moving target (LOMT) that moves the UAV until it reaches a desired position with respect to the target. All this control strategies switch at every time during the test. The input of the image processing algorithm is a set of images taken during real flight, the output of our algorithm is the 3D target position and its displacement velocity. However, one missing part, as far as our interest is concerned, is that there are no physical obstacles which hinder UAVs from tracking a target. This paper focuses on the UAV implementation strategies of tracking a target over a ground vehicle using vision.

This paper is organized as follows: computer vision algorithm for position measurement and velocity estimation using optical flow are described in section II. In section III, the control design is presented. The experimental platform used to validate theoretical results is described in section IV. Experimental results are presented in section V. Section VI presents conclusions and future work.

II. IMAGE PROCESSING

Estimation of position and velocity of the quadrotor relative to the moving target is needed.

The quadrotor's computer needs to be able to chase the on ground m.t. using the information given by the camera, i.e., position and relative velocity. Regarding this, it is needed the estimation of x -y position, altitude and relative velocity to the moving target of the quadrotor. An on board camera is used and the schema is shown in Figure 1. At this respect, we use some processing methods: edge detection, target detection and optical flow measurement which will be further discussed in this section.

A. Edge Detection

In the present approach a red square object must be tracked using a camera. For this reason, an edge detector to find the edges of the target in the image plane is proposed. We use a Canny edge detection algorithm [START_REF] Canny | A computational approach to edge detection[END_REF] which is known to have the following characteristics: good detection, good localization and only one response to a single edge. The Canny edge detection algorithm uses the good detection criterion: there should be a low probability of failing to mark real edge points, and low probability of falsely marking non edge points. This criterion corresponds to maximize signal-to-noise ratio. In the good localization criterion the points marked as edge points by the operator should be as close as possible to the center of the true edge. That corresponds to maximize the position interval, passing by zero and correspond to the inverse of the expected value between the true edge point and the maximum output of the operator. The last criterion to only obtain one response to a single edge is implicitly captured in the first criterion, since when there are two responses to the same edge, one of them must be considered false. This is necessary to limit the number of peaks in the response so that there will be a low probability of declaring more than one edge.

Our vision based position estimation algorithm uses a red colored square target, for this reason we propose to use an edge detector to find the edges of the square target in the image plane. The Canny edge detection algorithm, locates the edges of the target in the image and produces thin fragments of image contours that can be controlled by a single smoothing parameter known as σ. The image is first smoothed with a Gaussian filter of spread σ, then, gradient magnitude and direction are computed at each pixel of the smoothed image. Gradient direction is used to thin edges by suppressing any pixel response that is not higher than the two neighboring pixels on either side of it along the direction of the gradient, this is called non-maximum suppression. A good operation to use with any edge operator when thin boundaries are wanted. The two 8-neighbors of a pixel [x, y] that are to be compared are found by rounding off the computed gradient direction to yield one neighbor on each side of the center pixel. Once the gradient magnitudes are thinned, high magnitude contours are tracked. In the final aggregation phase, continuous contour segments are sequentially followed. Contour following is initiated only on edge pixels where the gradient magnitude meets a high threshold; however, once started, a contour may be followed through pixels whose gradient magnitude meet a lower threshold, usually about half of the higher starting threshold. Image regions can sometimes be detected when boundary segments close on themselves. In our case the boundary of a rectangular building might result

B. Target Detection

Once we have four rays which intersect in four points it is required to verify that the rays form a square. To verify this, the angle in each corner of the intersection of vertices are computed. By applying the triangulation of polygons, we can obtain two similar triangles in one square, given the triangle ∆ with edges A, B and C, the angle β between the two edges B and C can be obtained by the following formula:

β = arccos |B| 2 + |C| 2 -|A| 2 2 • |B| • |C| (1)
where |A|, |B| and |C|, denotes the lengths of the edges A, B, and C respectively. Applying this formula at each one of the square vertices, we obtain the four angles in the polygon if this edges are perpendiculars. Figure 2 shown the result of target detection algorithm using four vertices, the 4 edges are painted in blue color.

C. Optical Flow measurement

In this paper, we use the optical flow from image sequences to estimate the translational speed of the X-4. The estimate of the horizontal speed will be used to perform autonomous hover flights without lateral displacement. There exist many different methods for computing the optical flow [START_REF] Beauchemin | The computation of optical flow[END_REF]. There exist intensity-based differential methods, frequency-based filtering methods or correlation-based methods. In this paper we implement the Lucas-Kanade pyramidal method, which is an intensity-based differential method [START_REF] Bouguet | Pyramidal implementation of the lucas kanade feature tracker description of the algorithm[END_REF].

Consider two discrete functions I 1 , I 2 ∈ R mu×nv representing two gray scale images at different time instants, and let G pi be the gray scale value of a particular pixel p = (u i , v i ) T . Then, the gray values for p i which appear in two consecutive images are defined respectively as

G p1 = I 1 (u 1 , v 1 ) G p2 = I 2 (u 2 , v 2 ) (2)
where u i and v i are the row and column pixel coordinates respectively. Given a specific image point p 1 ∈ I 1 , the aim of the approach is to find another image point p 2 ∈ I 2 such that G p1 ≈ G p2 . Moreover, the relationship between matched pixels p 1 and p 2 is given by

p 2 = p 1 + r = [ u 1 + r u v 1 + r v ] T (3)
where r = [ r u r v ] T defines the image displacement or optical flow and minimizes the following residual function

ǫ(r) = up 1 +wu up=up 1 -wu vp 2 +wv vp=vp 2 -wv (I 1 (p 1 )-I 2 (p 1 +r)) 2 (4)
where w u and w v are two integers that define the size of the integration window. The Lucas-Kanade optical flow algorithm has an adaptive integration window, it is capable of handling large pixel motions and acts as a low pass filter. See [START_REF] Bouguet | Pyramidal implementation of the lucas kanade feature tracker description of the algorithm[END_REF] for a complete description of the algorithm. Optical flow can be generated by two kinds of observer motion: translational motion (F t ) and rotational motion (F r ). Let us assume that the camera is moving with translational velocity v and angular velocity ω while viewing an object at distance d and offset β from the direction of travel, as depicted in Figure 1. The optical flow (OF) can be mathematically expressed as follows:

OF = v d sin β -ω (5)
The maximal optical flow is obviously generated when the plane that contains the features is perpendicular to translational motion direction (β = 90 • ) [START_REF] Beauchemin | The computation of optical flow[END_REF]. The velocity can be estimated of (5) as follows

v = (OF + ω) sin β d (6)
Notice that singularities in the above equation appear when β = 0 • . Nevertheless in our case the roll and pitch angles are very close to zero which implies that β = 90 • ±3 • as a maximal interval when the mini-helicopter is appropriately stabilized at hover. The measurement of the angular speed ω is obtained by using the gyro information on each axis. An altitude stabilization algorithm in closed loop is used to keep the distance d constant and equal to some desired value.

D. Solving the problem

Translational velocity was obtained using the optic flow algorithm described in the last section. To obtain X-4 position, we use a target detection with a red color segmentation algorithm to obtain only the red channel image. After this, we apply the Canny algorithm for edge detection, attaining the interior and exterior boundaries in this region. The exterior boundaries are formed by a finite collection of n line segments of the following way

e 0 = v 0 v 1 , e 1 = v 1 v 2 , ..., e i = v i v i+1 , ..., e n-1 = v n-1 v 0 , connected by n image points v 0 , v 1 , v 2 , ..., v n-1
where v i = (x i , y i ). Using this points we can obtain four vertices with four edges, the next step is to verify the right angle in each corner of the quadrilateral, using [START_REF] Schmitt | Cooperative probabilistic state estimation for vision-based autonomous mobile robots[END_REF]. With the area of the square founded and using the pinhole camera model with the intrinsic parameters values, we use similar triangles properties to obtain the distance Z W (altitude) between the camera and the target, also other information such as the central point of the square, that is equal to the point where the two diagonals of the square intersect, called (x ci , y ci ) in the image plane, using this information we can obtain the 3D coordinates of this point:

X W = f x ci Z W (7)
Y W = f y ci Z W ( 8
)
where f is the focal length of the camera. Knowing the four coordinates of target v 0 , v 1 , v 2 and v 3 vertex of the target and the center image coordinates (x ci , y ci ), we construct a line l 1 from the vertex v 0 to the central point p ci = (x ci , y ci ), l 1 = v 0 + α 1 (p i ). In case of horizontal displacement of the target we need to know the target direction to indicate to UAV an change in yaw angle, to do that we use a reference coordinate located in the image corner p 0 = (0, 0) we construct a line from p 0 to p ci , l 2 = p 0 + α 2 (p ci ), using l 1 and l 2 we obtained the yaw angle reference of the UAV using dot product equation: ψ = arccos(l 1 • l 2 ). To calculate X-4 velocity estimation we use a Lucas-Kanade based optical flow algorithm to obtain the translational velocity of the camera placed under X-4 structure. It should be noticed that optical flow gives the velocity in the image plane, which in this case corresponds to the velocity of the X-4 displacements when using the floor as reference. The proposed position algorithm obtain (X W , Y W , Z W , ψ) that is the three dimensional position of X-4 and target orientation with respect to the X-4 camera, using optical flow algorithm we acquire ( ẋ, ẏ) which is X-4 velocity estimation corresponding respectively to ( ẋ ci , ẏ ci ) in world coordinates. The flowchart in Figure 4 explains the image processing algorithms used to obtain position, orientation and velocity data. Once we obtain this 6-tuple, we send this to the X-4 by means of a wireless modem with a baud rate equal to 38400. Our X-4 vehicle is equipped with a reception modem connected to the serial port of a Rabbit microprocessor, embedded in the X-4. The output our methods in real flight are shown in Figures 7 and8.

III. CONTROL

A common mathematical model for the quad-rotor is implemented aiming at developing the navigation control strategy [START_REF] Carrillo | Stabilization and trajectory tracking of a quad rotor using vision[END_REF]:

ẍ = -u 1 (cos φ sin θ cos ψ + sin φ sin ψ) ÿ = -u 1 (cos φ sin θ sin ψ -sin φ cos ψ) z = 1 -u 1 (cos φ cos θ) θ = u 2 φ = u 3 ψ = u 4 (9)
The quad-rotor model, presented in equation ( 9), can be written in a state-space form by introducing Ẋ = (x 1 , ..., x 6 ) T ∈ ℜ 6 , Ż = (z 1 , ..., z 6 ) T ∈ ℜ 6 , with states defined by

x 1 = x z 1 = θ x 2 = ẋ z 2 = θ x 3 = y z 3 = φ x 4 = ẏ z 4 = φ x 5 = z z 5 = ψ x 6 = ż z 6 = ψ (10)
Using the linear representation of the model in equation ( 9) and the notation from equation [START_REF] Bar-Shalom | Tracking and Data Association[END_REF], one has

ẋ1 = x 2 ż1 = z 2 ẋ2 = -z 1 u 1 ż2 = u 2 ẋ3 = x 4 ż3 = z 4 ẋ4 = z 3 u 1 ż4 = u 3 ẋ5 = x 6 ż5 = z 6 ẋ6 = 1 -u 1 ż6 = u 4 (11)
Due to the fact that, in general, the vehicle never works in areas where |θ| ≥ π/2 and |φ| ≥ π/2, the linear model is chosen for being implemented instead of its nonlinear version. Such working domains are satisfied even in research works where the nonlinear model is used together with a feedback control [START_REF] Bouabdallah | Backstepping andd slidingmode techniques applied to an indoor micro quadrotor[END_REF].

A. Operating modes of the moving target mission

The navigation mission has been divided into different sub-missions or stages:

• Take-off (TO): the objective is to achieve the desired altitude z d and it will be supposed that the • Target localization (TL): in this mode, the vehicle has achieved the desired altitude. The task to be accomplished here is to align the vehicle's center of gravity (CG) w.r.t the moving target.

• Loss of moving target (LOMT): the vehicle is required to change its altitude in order to find the moving target, i.e. until the moving target is inside of the camera's field of view. Once the mini-UAV has found the moving target, the vehicle should go back to the desired altitude and pursue the moving target. The navigation control is structured in different controllers for each sub-mission as illustrated in Figure 5.

B. Control Laws in each Operating Mode

The control strategy proposed in all different modes is based on the idea that the global system, presented in equation [START_REF] Ghosh | A realization theory for perspective systems with application to parameter estimation problems in machine vision[END_REF], is constituted of two subsystems, the attitude dynamics and the position dynamics, existing a time-scale separation between them [START_REF] Kokotović | Singular Perturbation Methods in Control: Analysis and Design[END_REF]. From this fact, it is possible to propose a hierarchical control scheme, where the positioning controller provides the reference attitude angles (θ d , φ d and ψ d ), which are the angles that must be tracked by the orientation controllers. For the complete system analysis, the error dynamics of the model in equation [START_REF] Ghosh | A realization theory for perspective systems with application to parameter estimation problems in machine vision[END_REF] are represented by the errors xi = x i -x i d and zi = z i -z i d , with i ∈ {1, ..., 6}.

1) Attitude Control: For the present studies, attitude dynamics have the same controller among all operating modes. An integral sliding mode control (ISMC), is proposed and implemented on the platform, which is explained next.

For the pitch dynamics case, the error equation is defined as z1 = z 1 -z 1 d . As shown in [START_REF] Slotine | Applied Nonlinear Control[END_REF], lets select the switching function s(z, t) = ż1 + 2λz 1 + λ 2 t 0 z1 (τ ) dτ [START_REF] Hashimoto | Observer-based control for visual servoing[END_REF] which depends on the pitch dynamics states. The λ parameter in equation ( 12) is the slope of the sliding line and should be greater than zero to ensure the asymptotic stability of the sliding mode. Computing the time derivative of equation ( 12) one has

ṡ = z 1 u 1 + 2λz 2 + λ 2 z1 (13)
Considering the sliding mode condition ṡ = 0, and using equation ( 13) one finds the equivalent control

z 1eq = -2λz 2 -λ 2 z1 (14)
With the purpose of obtaining a control law such that the state vector z1 remains on the sliding surface s(z, t) = 0, ∀t > 0, let's use the Lyapunov function candidate

v(s) = 1 2 s 2 (15)
An efficient condition for the stability of the pitch subsystem can be satisfied if one can ensure that the reached condition

v(s) = 1 2 d dt s 2 ≤ η|s|, η ≥ 0 (16)
holds. Then, the system remains on the sliding surface and the states go to the origin. Thus s ṡ ≤ -η|s| and the controller must be chosen such that

z 1 = z 1eq -Ksign(s) ( 17
)
where K is a positive real number. Following a similar approach, it is possible to obtain the yaw and roll angles controllers.

C. Position Control

For each sub-mission or stage, the position control have well defined objectives, previously explained.

Motion in the x -y plane is accomplished by orientating the vehicle's thrust vector in the direction of the displacement desired. As a consequence, the angles θ d and φ d act as virtual controllers for the position dynamics. The control laws proposed for the x an y positions, respectively, are expressed as

θ d = k vx (x 2 -x 2 d ) + k px (x 1 -x 1 d ) u 1 ( 18
)
φ d = - k vy (x 4 -x 4 d ) + k py (x 3 -x 3 d ) u 1 ( 19
)
with k vx , k px , k vy and k py being positive real numbers.

1) Altitude Control:

The z-position control is composed by two different controllers, one for the situation when the m.t. is being detected and one for the situation when it is not. When the m.t. is inside of the camera's field of view, the proposed control law is formed by a state feedback taking into account only the states involving the altitude dynamics. On the other hand, when the vehicle looses the image of the target, a switch to a different method for measuring the vehicle's ψ angle occurs, and, at the same time, the z controller changes. In both of them, the control objective is to regulate the x and y states to the origin, i.e. x 1d = x 3d = 0.

There are two possible situations where the m.t. is lost by the mini-UAV. The first one occurs when the camera's field of view is disturbed by some objects behind the m.t. and the UAV. The second one occurs when the m.t. presents one acceleration large enough to disallow the tracking of the target. In this paper we focus only in the second case, considering the camera's field of view is never obstructed by some objects. Thus, we will focus in the second case where is impossible to track the m.t. due to lack of information in the visual system. Then we propose a searching process consisting in change the altitude until the m.t. is found.

• Control schema when the m.t. is detected: in this case, the feedback control law proposed is given by

u 1mt = k pz (x 5 -x 5 d ) + k vz (x 6 -x 6 d ) -1 (20)
where k pz and k vz are positive real numbers. Then, using the controllers ( 19) and ( 20), the closed-loop system of the position dynamics (left hand side of ( 11))is given by

ẋ1 = x 2 ẋ2 = -k px x 1 -k vx x 2 ẋ3 = x 4 ẋ4 = -k py x 3 -k vy x 4 ẋ5 = x 6 ẋ6 = -k pz x 5 -k vz x 6 (21)
The equation ( 21) can be represented as Ẋ = A mt X where

A mt =         0 1 0 0 0 0 -k px -k vx 0 0 0 0 0 0 0 1 0 0 0 0 -k py -k vy 0 0 0 0 0 0 0 1 0 0 0 0 -k pz -k vz         (22)
• Control schema when the m.t. is not detected: in this case, the proposed control schema is given by

u 1 mt = k pz (x 5 -x 5 d ) + k vz (x 6 -x 6 d ) -k Zx x 1 -k Zy x 3 -1 (23)
where k Zx and k Zy are positive real numbers. Then, the closed-loop system is represented as

Ẋ = A mt X where A mt =         0 1 0 0 0 0 -k px -k vx -k Zx 0 -k Zy 0 0 0 0 1 0 0 0 0 -k py -k vy 0 0 0 0 0 0 0 1 0 0 0 0 -k pz -k vz         (24)

D. Stability Analysis of the Position Sub-system

This section focuses on the system's stability across switching boundaries, i.e., where altitude dynamics switches between the pair of controllers [START_REF] Ponda | Trajectory optimization for target localization using small unmanned aerial vehicles[END_REF][START_REF] Bouguet | Pyramidal implementation of the lucas kanade feature tracker description of the algorithm[END_REF].

Following a similar approach than the one presented in [START_REF] Liberzon | Switching in Systems and Control[END_REF], it is possible to find a common Lyapunov function for the closed-loop system formed applying the two controllers of the position dynamics. However, working in this way, the same pole locations have to be chosen for both cases, when the m.t. is detected and were it is not detected, which in fact is not the case.

Let's define d x and d y as the distances measured from the vehicle's center of gravity projection to the point where the camera loses the image of the road, see Figure 3. Thus, when the error is bigger than d x for x dynamics or d y for y dynamics, the control law is changed. A change of coordinates can easily be made using the known constants d x and d y . Thus without loss of generality a state dependent switched linear system can be defined, given by the closed-loop system together with the switching conditions

Ẋ = A mt X if |e x | < d x and |e y | < d y A mt X if |e x | ≥ d x or |e y | ≥ d y (25)
It is clear that each individual system in equation ( 25) is stable, since the matrices A mt and A mt are Hurwitz. Suppose that there is a family A p , p ∈ P of functions from ℜ n to ℜ n , with P = 1, 2, ..., m defining the finite index set. For the case of linear systems, this results in a family of systems ẋ = A p x with A p ∈ ℜ n×n . Let's define a piecewise constant function σ : [0, ∞) → P with finite number of discontinuities (switching times) on every bounded time interval. This function takes a constant value on every interval between two consecutive switching times. Then σ gives the index σ(t) ∈ P of the system that is actually active, at each instant of time t.

Theorem 1: Consider vectors t pq , symmetric matrices S p with Ω p ∈ {x : x T S p x ≥ 0}, ∀p ∈ P having nonnegative entries and symmetric matrices P p such that:

A T p P p + P p A p + β p S p < 0, β p ≥ 0 (26) 0 < P p -P q + f pq t T pq + t pq f T pq for some t pq ∈ ℜ n [START_REF] Slotine | Applied Nonlinear Control[END_REF] With the boundary between Ω p and Ω q of the form {x : f T pq = 0}, f pq ∈ ℜ n . Then every continuous, piecewise C 1 trajectory of the system ẋ = A σ x tends to zero exponentially.

Proof: See the Appendix.

IV. EXPERIMENTAL PLATFORM

The total weight of the vehicle is about 500 gr, with a flight endurance of 10 minutes approximately. Theoretical results obtained were incorporated into an autopilot control system using an architecture based on a 29 MHz Rabbit micro controller with 512 Kb Flash and 512Kb RAM. These micro controllers are capable of handling floating point operations and multitasking processing virtually due to the enhancement compiler Dynamic C [START_REF] Shell | Rabbit semiconductors, dynamics c user manual[END_REF]. We have built our own inertial measurement unit (IMU) using accelerometers, gyros and a compass to obtain the roll, pitch and yaw angles and angular rates. The IMU information is sent to the micro controller which also reads reference control inputs from an operator through a serial wireless modem. The micro controller subsequently combines this information to compute the control input and sends the control corrections to the motors through a I2C serial port. Hence, the brushless motor speed controller or booster is handled by the I2C port of the micro controller. Visual sensor is composed of a wifi camera placed over X-4 platform, the camera is putting downwards to process an optical flow algorithm and position algorithm, our vision algorithm processes images coming from two cameras, at a rate of 18 frames/seconds. Each image has a size of 320 width pixels and 240 height pixels. The 3D position and displacement velocity estimation are computed in a PC with Intel Core 2 duo processor 2.10GHz using OpenCV libraries. Figure 6 shows a block diagram of the basic architecture.

V. REAL TIME EXPERIMENTS

To test the proposed algorithms we realize several experiments. In this article we describe an experience in real flight over 180 seconds tracking a car with a translation motion at constant velocity. X-4 position and velocity estimation are obtained by image processing algorithm. In the first 10 seconds we observe the initialization of the algorithms, at this time the target detection Fig. 6. Embedded Control Architecture algorithms detect the target in the field of view of the camera, when the target was detected we obtain the position of the camera next the X-4 try to go over the target. After the initialization the control algorithm uses take-off (TO) navigation method with the desired altitude z d = 90cm at 55 seconds, our target move faster than X-4 and the camera lost the target, with this information X-4 navigation method change to loss of moving target (LOMT) method increasing its altitude over 120cm. At this altitude the X-4 camera localizes the target and target localization mode (TL) try to displace the X-4 toward a desired altitude, we observe in Figure 11 how X-4 moves to desired altitude using a embedded switch control. Figure 9 shown X-4 displacements estimation over its X-axis on 180 seconds of real flight, we can see a initialization steps during the first 10 seconds of flight, after that, we observe the displacement of X-4 center of gravity and how X-4 embedded control try to move it to a desired orientation close to 60 cm over X-4 axis. In Figure 10 we shown X-4 displacements estimation over its Y-axis on 180 seconds of real flight. After 10 seconds of initialization step, X-4 embedded control moves it to a desired orientation over Y-axis, in our case 50 cm. Figure 12 and 13 shown X-4 velocity over X-axis and Y-axis respectively on 180 seconds of flight. Velocity estimation was obtained using optical flow algorithm.

VI. CONCLUSION

In this paper we have presented an UAV tracking a target over a ground vehicle based on a vision system that estimates position, orientation and displacement velocity of an UAV. The navigation mission uses different control algorithms: take-off (TO) trying to achieve to the desired altitude, target localization (TL) has like a goal to align the vehicle's center of gravity (CG) with respect to the moving target and loss of moving target (LOMT) where the vehicle is required to change its altitude in order to find the moving target. The UAV tracking algorithm has been developed and tested using our experimental X-4 platform in real-time flight. The Theorem 2: The system ẋ = f (t, x), f (t, x) ≡ 0, is exponentially stable on the region D = {x ∈ ℜ n | x < r} if there exists a Lyapunov function V (t, x) and some positive constants c 1 , c 2 , c 3 , such that

∀(t, x) ∈ [0, ∞) × D 0 , D 0 = {x ∈ ℜ n | x < r/m} c 1 x 2 ≤ V (t, x) ≤ c 2 x 2 (28) ∂V ∂t + ∂V ∂x ≤ -c 3 x 2 ( 29
)
where m is the overshot from definition of exponential stability.

Proof: See [START_REF] Khalil | Nonlinear Systems[END_REF], pp. 169.

Proof of Theorem 1 :

The proof relies on the Theorem 2, then using the Lyapunov function candidate V (x) = x T P p x and assuming that x(t) is continuous and piecewise C 1 , hence, V (t) has the same characteristics. Premultiplying and postmultiplying the condition (27) by x, the inequality on the left side of (28) is satisfied. In the same way, inequality (29) follows if we premultiply and postmultiply both sides of (26) by x.

Fig. 1 .

 1 Fig. 1. Basic scheme

Fig. 2 .

 2 Fig. 2. Target detection

Fig. 3 .Fig. 4 .

 34 Fig. 3. Camera's view.

Fig. 5 .

 5 Fig. 5. Navigation control system

Fig. 7 .

 7 Fig. 7. X-4 Real time image

Fig. 8 Fig. 10 Fig. 13

 81013 Fig. 8. X-4 Real time displacement

Other work trajectory acquisition from video includes This work was partially supported by the Mexican National Council for Science and Technology (CONACYT), the Institute for Science & Technology of Mexico City (ICyTDF) and the French National Center for Scientific Research (CNRS).


Gerardo Flores

García Carrillo

G Sanahuja

R Lozano

PID Switching Control for a Highway Estimation and Tracking Applied on a Convertible Mini-UAV

This paper reports current work on development and navigation control of an experimental prototype of a new tilt-rotor convertible aircraft (Quad-plane Mini Unmanned Aerial Vehicle). The goal of the work consists of estimating and tracking a road using a vision system, without any previous knowledge of the road, as well as developing an efficient controller for treat with situations when the road is not detected by the vision sensor. For dealing with this situation, we propose a switching control strategy applied in two operational regions: road detected and no road detected. The exponential stability is proved for the subsystem formed by the lateral position taking into account the switching boundaries between the operational regions. The control law is validated in the proposed platform, showing the expected behavior during autonomous navigation.

I. INTRODUCTION

Motivated by the theory of switching systems and the need of developing effective Mini UAVs controllers and state estimators, this research work deals not only with the attitude and position stabilization problems, but also with performing a path following mission. The goal is getting the Quadplane [START_REF] Flores | Quad-tilting rotor convertible mav: Modeling and real-time hover flight control[END_REF] to navigate autonomously and to follow the path represented by a highway model (formed not only by lines but also by smooth curves) with the aim of tracking ground vehicles, exploring areas and monitoring roads as well as highways. Once the Quad-plane has achieved its goal, it can proceed to another distant target performing a transition flight, from helicopter mode to airplane mode, and thereby cover vast areas. In this work, we will focus on the hover mode of the Quad-plane.

The road to be tracked is considered unknown, thus the vehicle must estimate the path in real-time. Furthermore, the mission must be performed in presence of external disturbances, which are present in the translational dynamics as well as in the attitude dynamics of the vehicle. Previous research works [START_REF] Carrillo | Stabilization and trajectory tracking of a quad rotor using vision[END_REF] have shown that the PD controllers work efficiently to stabilizing the attitude dynamics of the Quad-rotor. Moreover, the PD controllers have proved to be effective for navigation problems in Quad-rotors [START_REF] Rondon | Vision-based altitude, position and speed regulation of a quad-rotor rotorcraft[END_REF]. The aforementioned works were no dealing with external disturbance problems causing that the vision system losses This work was partially supported by the Institute for Science & Technology of Mexico City (ICyTDF) and the Mexican National Council for Science and Technology (CONACYT).

⋆ are with the Heudiasyc UMR 6599 Laboratory, University of Technology of Compiègne, France. Gerardo Flores (gfloresc@hds.utc.fr), G. Sanahuja (gsanahuj@hds.utc.fr)

† is with the Electrical and Computer Engineering Dept. (ECE) of the University of California, Santa Barbara (UCSB) (lrgc@ece.ucsb.edu)

‡ is with the Heudiasyc UMR 6599 Laboratory, UTC CNRS France and LAFMIA UMI 3175, Cinvestav, México. (rlozano@hds.utc.fr) the artificial landmarks, which provides relative position and velocity of the vehicle. A switching strategy for estimating the states of an airplane equipped with imaging, inertial and air data sensing systems is introduced in [START_REF] Hespanha | Linear parametrically varying systems with brief instabilities: An application to integrated vision/imu navigation[END_REF]. The proposed methodology demonstrates being capable of dealing with instants of time when the visual detection of the landmark fails. A proposed solution to handle the situation when the image is lost, is to implement different controllers, which is appropriate since the use of a PD controller in the position dynamics is not enough for attenuating disturbances (e.g. winds gusts [START_REF] Hoffmann | Quadrotor helicopter flight dynamics and control: Theory and experiment[END_REF]). The analysis and control of a VTOL aircraft at simulation level is shown in [START_REF] Oishi | Switching in nonminimum phase systems: Application to vstol aircraft[END_REF]. Here the authors demonstrate the stability of the complete system divided in three different modes using a common Lyapunov function.

A pointing downwards camera allows to estimate the vehicle's heading angle with respect to the road's longitudinal orientation, as well as the lateral distance that must be corrected in order to navigate exactly over the road. Two operational regions are defined with the purpose of developing a switching control strategy for estimation and tracking: the first one concerns the situation when the road is detected, while the second one deals when it is not. Inside these two regions, it is demonstrated that the system is stable, in addition the system is proved to be stable in the time when the switch between both regions occurs. This control was tested in real-time experiments on the Quad-plane platform, showing the expected behavior during the navigation task. It is important to say, that all the vision and control algorithms are embedded on the Quad-plane.

The body of the papers is as follows. In section II we present the problem statement. Next, in section III the model of the vehicle in hover mode is presented. After that, the methods for estimating the states of the Quad-plane are shown in Section IV. Section V presents a switching control strategy as well as the stability proof. Section VI presents the Quad-plane experimental platform. The behavior of the Quad-plane during real-time experiments is shown in Section VII. Finally, some conclusions and future works are presented in section VIII.

II. PROBLEM STATEMENT

The road following procedure can be detailed as follows. First, the vehicle performs an autonomous take-off, reaching a desired altitude z d over the road. Then, the heading of the vehicle ψ, is controlled to obtain a parallel positioning between the Quad-plane x-axis x h and the longitudinal direction of the highway x r (Fig. 3). The Quad-plane forward velocity ẋ is maintained constant while the distance between x h and x r , expressed by e y , is controlled and maintained to a minimum value, achieving a flight path well aligned and centered w.r.t. the highway at constant forward velocity. Finally the Quad-plane performs a landing in a position near to the end of the highway. All of these actions should be accomplished completely autonomously without the previous knowledge of shape of the highway and the terrain.

During some instants of time, the road that is being tracked will not be detected in the camera's image, due to occlusions or image blurring, but this can also occur when the vehicle experiences external disturbances causing the Quad-plane to lose its stability and the navigation path. In the times when the highway is out of the camera field of view, the Quad-plane heading angle is controlled from the ψ-angle measurement that the IMU provides. In order to deal with situations when the image is lost, a switching strategy is proposed, which allows switching between two different controllers (PD and PI).

III. MODELING

In hover mode, the Quad-plane behaves like a conventional Quad-rotor, then we use the well known mathematical model of the Quad-rotor [START_REF] Carrillo | Stabilization and trajectory tracking of a quad rotor using vision[END_REF]. For the purpose of control we will use the linear model (1) instead of the nonlinear version, since in general the vehicle operates in areas where |θ| ≤ π/2 and |φ| ≤ π/2, these constraints are satisfied even when the nonlinear model is used together with a feedback control [START_REF] Carrillo | Stabilization and trajectory tracking of a quad rotor using vision[END_REF], [START_REF] Bouabdallah | Backstepping and sliding-mode techniques applied to an indoor micro quadrotor[END_REF]. The corresponding coordinate system is represented in (Fig. 2).

ẋ1 = x 2 θ1 = θ 2 ẋ2 = -θu 1 θ2 = u 2 ẏ1 = y 2 φ1 = φ 2 ẏ2 = φu 1 φ2 = u 3 ż1 = z 2 ψ1 = ψ 2 ż2 = 1 -u 1 ψ2 = u 4 (1)

IV. VISION-BASED STATES ESTIMATION

A sufficiently smooth road is represented in the camera's image as a group of lines, (Fig. 3). A straight line in the image can be seen as a segment of infinite length and whose center of gravity belongs to the straight line [START_REF] Chaumette | Image moments: a general and useful set of features for visual servoing[END_REF]. Using the probabilistic Hough transform method available in OpenCV [START_REF] Bradski | Learning OpenCV: Computer Vision with the OpenCV Library[END_REF], a straight line will be represented as ρ = x cos θ+y sin θ. The center of gravity (x g , y g ) of each line detected can be computed as x i g = cos(θ) and y i g = sin(θ). Where the index i is related to the line i. Let's define (x i I , y i I ) as the initial point of the line, located below the image's lower margin, and let (x i F , y i F ) be the line's final point located above the image's upper margin. If the line has a ρ > 0 positive parameter, the coordinates (x i I , y i I ) and (x i F , y i F ) will be computed as

x i I = x g + ξ(-sin(θ)) ; y i I = y 0 + ξ cos(θ) (2) x i F = x g -ξ(-sin(θ)) ; y i F = y 0 -ξ cos(θ) (3)
where ξ is a known constant defining the line's bounds. If ρ < 0, (x i F , y i F ) will be computed as in (2), while (x i I , y i I ) will be computed as in [START_REF] Rondon | Vision-based altitude, position and speed regulation of a quad-rotor rotorcraft[END_REF]. The parallel lines extracted from the road's projection on the image are grouped together with the objective of obtaining a mean line, which will uniquely represent the road in the image with a pair of initial coordinates x I =

x i I i , y I = y i I i and final coordinates x F = x i F i , y F = y i F i .
Where i is the number of lines representing the road, (x I , y I ) stands for the initial road coordinate and (x F , y F ) stands for the final road coordinate.

The angle between the camera's x c axis and the point (x F , y F ) can be computed as ψ r = arctan (y F -y I , x F -x I ), this value is used for obtaining the heading angle ψ d that will align the vehicle's longitudinal x-axis (x h ) with the road's longitudinal axis (x r ), (Fig. 3). Finally we can express ψ d as

ψ d = ψ r + π 2 (4)
the therm π 2 is added to adjust ψ d to zero when ψ r is vertically aligned with x h .

B. Lateral position with respect to the road

Lets consider an image-based distance e c

x along the camera's x c axis, which is defined between the road's center of gravity projection (x g , y g ) and the vehicle's center of gravity projection (x 0 , y 0 ), (Fig. 3). If

x in > x f i , then e c x = xI -xF 2 + x F -cw 2
, where c w represents the image's width in pixels. If x I < x F , x I must be replaced by x F and vice-versa. Using e c

x , the lateral position of the aerial vehicle relative to the road is estimated as

e y = z e c x α x (5)
where z represents the Quad-plane's height and α x is the focal length of the camera, in the x c direction.

C. Translational velocities estimation

By implementing an optical flow algorithm to the camera's image, translational velocities can be estimated. Consider that the arrangement camera-vehicle is moving in a 3-D space w.r.t. a rigid scene. When performing an optical flow computation, the coordinates of the (x i , y i ) features are known, in fact, they all undergo the same movement. A mean value for the optical flow can be expressed by using all the tracked features as Ō F x = VOFx + K x VOFz + ROFx and Ō F y = VOFy + K y VOFz + ROFy . The terms Ō F x and Ō F y are the optical flow means measured in the image coordinate system, the relative depth is expressed as VOFz , and K x , K y are constant scale factors depending on the intrinsic camera parameters. The rotational optical flow terms ROFx and ROFy are compensated and the pseudo-speeds ( VOFx , VOFy , VOFz ) are deduced, by using a similar approach than the one presented in [START_REF] Rondon | Optical flow-based controller for reactive and relative navigation dedicated to a four rotor rotorcraft[END_REF]. This method provides -z VOFx αx = ẋ, -z VOFy αy = ẏ and z VOFz = ż, where we are considering that the camera and Quad-plane arrangement share the same movement, i.e., ( ẋc , ẏc , żc ) = ( ẋ, ẏ, ż).

D. States computation when the road is out of the camera's field of view

In a real experimental application, the image of the road can be lost in certain moments. To address this problem, let's define a binary signal s : [0, ∞) → {0, 1} as s(t) := 0 road not detected at time t 1 road detected at time t

which allows to switch between two different strategies for computing the vehicle's states. We define also the time event T s0 as the time when the binary signal switches from 1 to 0, and T s1 the time event when the binary signal switches from 0 to 1. First, consider the desired heading angle computation. The equation ( 6) permits to define

ψ s (t) = s(t)ψ d (t) + (1 -s(t))ψ IMU (T s0 ) (7)
where ψ d (t) is obtained from (4), ψ IMU (T s0 ) is the IMU's heading angle measurement at T s0 , and ψ s (t) is the desired heading angle that will be used in the Quad-plane embedded controller. From this result, (7) allows switching from a ψ s (t) generated by the imaging algorithm, and a ψ s (t) defined by the IMU's heading angle value at the time when the road was not detected on the image. Now, lets consider the vehicle's lateral position estimation when the road is out of the camera's field of view. Equation ( 6) permits to estimate e ys (t) = s(t)e y (t)

+ (1 -s(t)) e y (T s0 ) + Ts1 Ts0 ẏ(t)d(t) (8)
where e y (t) is obtained as in ( 5), e y (T s0 ) is the lateral position estimation at T s0 , and ẏ(t) is the vehicle's lateral velocity obtained from optical flow estimation. From the equation ( 8), it is possible to switch between two different methods for estimating the vehicle's a lateral position w.r.t. the road. In the first method, the lateral position is obtained from the road line detection in the camera's image. The second method uses the road's position at T s0 in combination with the integral of ẏ during the time the road is not being detected by the imaging algorithm, i.e., during a time defined by time events T s0 and T s1 .

V. CONTROL STRATEGY

The proposed control strategy is based on the idea that the global system (1) is constituted of two subsystems, the attitude dynamics and the position dynamics, each one with a time-scale separation between them [START_REF] Kokotović | Singular Perturbation Methods in Control: Analysis and Design[END_REF]. From this fact, it is possible to propose a hierarchical control scheme where the position controller outputs desired attitude angles (θ d , φ d and ψ d ) which are the angles to be tracked by the orientation controllers.

A. Attitude Control

The integral sliding mode control is used for stabilizing the attitude dynamics of the Quad-plane. The approach is explained for the pitch dynamics, but the same procedure must be followed for generating the roll and yaw dynamics. The error equation for the pitch sub-system is defined as θ1 = θ 1 -θ 1 d . Lets choose the switching function defined in [START_REF] Slotine | Applied Nonlinear Control[END_REF] as

ϕ(θ, t) = θ1 + 2λ θ1 + λ 2 t 0 θ1 (τ ) dτ (9)
In ( 9) the parameter λ is the slope of the sliding line, which should accomplished λ > 0 to ensure the asymptotic stability of the sliding mode. The time derivative of ( 9) can be calculated as φ = u 2 + 2λθ 2 + λ 2 θ1 , and from the sliding mode condition φ = 0, we find the equivalent control u 2eq = -2λθ 2 -λ 2 θ1 . For obtaining a control law such that θ1 remains on the sliding surface ϕ(θ, t) = 0, ∀t > 0, we propose the Lyapunov function candidate v(ϕ) = 1 2 ϕ 2 . A condition for the stability of the pitch sub-system is satisfied if we can ensure that the condition v(ϕ) = 1 2 d dt ϕ 2 ≤ η|ϕ| holds for η ≥ 0. Thus, the system remains on the sliding surface and the states go to the origin. Then ϕ φ ≤ -η|ϕ| and the controller must be chosen in a way that θ 1 = u 2eq -Ksign(ϕ) where K > 0.

B. Position Control

The movement in the x -y plane is generated by orientating the vehicle's thrust vector in the direction of the desired displacement. Then, θ d and φ d behaves as virtual controllers for the positioning dynamics. The control proposed for z an x, respectively, are defined by

u 1 = k pz (z 1 -z 1 d ) + k vz (z 2 -z 2 d ) + 1 ( 10
)
θ d = k px (x 1 -x 1 d ) + k vx (x 2 -x 2 d ) u 1 ( 11
)
where k vx , k px , k pz and k vz are positive real numbers.

1) y-Position Control:

The lateral position control is formed by a pair of PID controllers, one for the case where the highway is detected and the other one for the case where it is not. The PID controllers have different gains with the goal of obtaining a behavior like a PD (when the highway is inside of the camera's field of view) and a PI (when the highway is not detected) controller according to the gain values chosen. The PD controller ensures a rapid response for maintaining the vehicle's y coordinate at a minimum value, i. e., y = 0 [START_REF] Hoffmann | Quadrotor helicopter flight dynamics and control: Theory and experiment[END_REF]. The PI controller is used when the vehicle looses the image of the highway, since at this moment a switch to an alternative method for measuring the ψ angle and y position occurs. In both cases the control objective is to regulate the y 1 state to the origin, i.e. y 1d = 0.

The control schema when the line is detected, proposes a feedback control law given by

φ 1 = 1 u 1 (-k L3 y 1 -k L4 y 2 + k LI ξ) (12)
where k L3 , k L4 and k LI are positive real numbers. Here we have introduced the additional state ξ, where ξ dynamics are given by ξ = y 1d -y 1 = -y 1 . Defining a distance named d c as the lateral position existing between the vehicle's center of gravity projection and the point where the camera loses the image of the highway (Fig. 3), a change of coordinates can be made such that y d1 = y 1 + d c and ẏd1 = y d2 = y 2 is its derivative. Thus, using the control ( 12), the closed-loop system of the y dynamics is given by

ẏd1 = y d2 ẏd2 = -k L3 y d1 -k L4 y d2 -k LI ξ ξ = -y d1 (13)
with e y d = (y d1 , y d2 , ξ) T . Then, ( 13) can be represented as ėy d = A L e y d where

A L =   0 1 0 -k L3 -k L4 k LI -1 0 0   (14)
The control schema when the line is not detected proposes the same structure given by ( 12), with the difference of having a set of alternative gains. Thus, the closed-loop system is represented by ėy d = A N L e y d , where

A N L =   0 1 0 -k N L3 -k N L4 k N LI -1 0 0   (15)
here k N L3 , k N L4 and k N LI are positive real numbers.

It is important to mention that in the experimental platform, the gains were chosen experimentally, this resulted in different values for both cases. When the road is detected, the values were selected as K L3 = 1800, K L4 = 650 and K LI = 1. Gains were selected as k N L3 = 1800, k N L4 = 1 and k N LI = 20 for the case where the highway is not detected.

C. y-Position Control Stability Analysis

In this section we prove the stability in each region as well as in switching boundaries, i.e., when the gains of ( 12) switch to alternative values.

It is possible to find a common Lyapunov function for the closed-loop system formed applying the two controllers of the lateral position dynamics [START_REF] Liberzon | Switching in Systems and Control[END_REF]. However, under this approach, same pole locations need to be chosen in the two cases: when the highway is detected and when it is not. For the present application different gain values are being applied. Thus, we can define a state-dependent switched linear system given by the closed-loop system and the switching conditions

ėy d = A L e y d if y d1 < 0 A N L e y d if y d1 ≥ 0 (16)
Note that each individual system in ( 16) is stable, since the matrices A L and A N L are Hurwitz. Now, suppose that there exists a family A p , p ∈ P of functions from ℜ n to ℜ n , with P = 1, 2, ..., m defining the finite index set. For the linear system case, this results in a family of systems ẋ = A p x with A p ∈ ℜ n×n . Now we define a piecewise constant function σ : [0, ∞) → P with finite number of discontinuities, named switching times, defined on every bounded time interval. Then σ gives the index σ(t) ∈ P of the system that is active at each instant of time t. The next theorem proves the stability of the whole system including in the times where the switch occurs:

Theorem 1: Consider vectors t pq , symmetric matrices S p with Ω p ∈ {x : x T S p x ≥ 0}, ∀p ∈ P having non-negative entries and symmetric matrices P p such that:

A T p P p + P p A p + β p S p < 0, β p ≥ 0 (17) 0 < P p -P q + f pq t T pq + t pq f T pq for some t pq ∈ ℜ n (18)

With the boundary between Ω p and Ω q of the form {x : f T pq = 0}, f pq ∈ ℜ n . Then every continuous, piecewise C 1 trajectory of the system ẋ = A σ x tends to zero exponentially.

Before proving Theorem 1, let's use the following theorem.

Theorem 2: The system ẋ = f (t, x), f (t, x) ≡ 0, is exponentially stable on the region D = {x ∈ ℜ n | x < r} if there exists a Lyapunov function V (t, x) and some positive constants

c 1 , c 2 , c 3 , such that ∀(t, x) ∈ [0, ∞) × D 0 , D 0 = {x ∈ ℜ n | x < r/m} c 1 x 2 ≤ V (t, x) ≤ c 2 x 2 (19) ∂V ∂t + ∂V ∂x ≤ -c 3 x 2 ( 20
)
where m is the overshot from definition of exponential stability.

Proof: See [START_REF] Khalil | Nonlinear Systems[END_REF], pp. 169.

Proof: [Proof of Theorem 1 ] The proof relies on the Theorem 2, then using the Lyapunov function candidate V (x) = x T P p x and assuming that x(t) is continuous and piecewise C 1 , hence, V (t) has the same characteristics. Premultiplying and postmultiplying the condition (18) by x, the inequality on the left side of ( 19) is satisfied. In the same way, inequality (20) follows if we premultiply and postmultiply both sides of (17) by x.

VI. EXPERIMENTAL PLATFORM

A. Quad-plane platform

The control algorithm is implemented on the the Gumstix computer that is based on a 720 MHz ARM Cortex-A8 CPU with 512MB Flash memory. It is the heart of the embedded system and constitutes the Flight Control Computer (FCC). The control law is executed in real-time at a 100 Hz frequency. Inertial measurements are provided at 100 Hz by means of a 3DMGX3-25 Inertial Measurement Unit (IMU) from Microstrain R . For more details of the experimental platform see [START_REF] Flores | Quad-tilting rotor convertible mav: Modeling and real-time hover flight control[END_REF].

B. Embedded vision system

The embedded vision system includes a PlayStation R Eye camera, and a Flying Netbook computer, where the vision algorithms are programmed. The camera is capable of providing 120 images per second of a 320 X 240 resolution. The camera is used for observing the scene below the vehicle and record the image and video. The translational velocity in the x -y plane is obtained from an optical flow algorithm, which is based on the pyramidal Lucas-Kanade method.

C. Ground station

The helicopter is communicated wireless to a ground station PC where a graphical user interface (GUI) allows monitoring and controlling the Quad-plane. The user can visualize, in real-time, graphics representing the measurements from the on-board sensors as well as graphics representing the control law computation.

VII. EXPERIMENTAL RESULTS

The strategies for states estimation and control proposed in Section IV and V, were validated in real-time experiments, which can be described as follows. An autonomous take-off is performed, where the goal is to achieve a desired altitude of 0.70 m over the road. Once at this height, the helicopter can detect the road, which allows orientating its heading and stabilizing its lateral position, achieving a flying path well centered over the road. The vehicle is then required to navigate forward at a desired speed of 1 m/s, regulating its heading angle and lateral position w.r.t. the road. Once the vehicle is near to the end of the road segment, the landing is performed autonomously, and the vehicle descends slowly to the ground.

The switching between the two states estimation approaches is illustrated in figure 7. The graphic on the middle represents the time instants where the line is being detected (s = 1) and where the line is not being detected (s = 0). The upper graphic represents the desired heading angle as computed from [START_REF] Bouabdallah | Backstepping and sliding-mode techniques applied to an indoor micro quadrotor[END_REF]. The lower graphic represents the lateral position error as computed from [START_REF] Chaumette | Image moments: a general and useful set of features for visual servoing[END_REF]. As we can see in the figures 4, 5, 6, 7 and 8, the vehicle was perturbed in ψ angle and in the y position. It is important to say that the graphs showed corresponds at the experiment that can be seen at http://www.youtube.com/watch?v=fAQvSXPAG5Q VIII. CONCLUDING REMARKS One limitation that we have seen in the real-time experiment was related to the maximum velocity in which the Quad-Plane can estimate and track the road. Due to the limitation on time of the vision algorithm the vehicle has a limited speed.

The zeno behavior was no studied in the theoretical part of the work, but in practice, this phenomena does not occur in real-time experiments. However, a study related on this phenomena should be treated on future works. Future work will focus on the development of a hybrid control for switching not only controller gains but also control strategies.

Fig. 1 .

 1 Fig. 1. Experimental platform tracking the road.

Fig. 2 .Fig. 3 .

 23 Fig. 2. Coordinate systems: Inertial frame (F i ) and Body-fixed frame (F b )

Fig. 4 .

 4 Fig.[START_REF] Hespanha | Linear parametrically varying systems with brief instabilities: An application to integrated vision/imu navigation[END_REF]. Behavior of the Euler angles during the experiment. The system was disturbed in the ψ angle at t = 34s.

Fig. 5 .

 5 Fig. 5. Position of the vehicle during the experiment. The system was disturbed in the y position at t = 26s and t = 45s.

Fig. 6 .

 6 Fig. 6. Control inputs u 2 , u 3 and u 4 of (1).

Fig. 7 .

 7 Fig. 7. Switching signal s, ψs and eys. At t = 25 and t = 51 the vehicle was disturbed as we can see from the angle measurement ψ d .

Fig. 8 .

 8 Fig.8. xy plane of the navigated path. In this figure we show the switching effect in the lateral position dynamics (see peaks in (x, y) = (2.4, -0.55), (x, y) = (4.6, 2.2) and (x, y) = (5.45, 3.15)) when the system is disturbed and the camera losses the highway image.


Quad-Rotor Switching Control: An Application for the Task of Path Following L.R. García Carrillo † , G. Flores † , G. Sanahuja † , and R. Lozano ⋆ Abstract-The problem of vision-based road following using a quad-rotor is addressed. The objective consists of estimating and tracking a road without a priori knowledge of such path. For this purpose, two operational regions are defined: one for the case when the road is detected, and the other one for when it is not. A switching between imaging and inertial sensors measurements allows estimating the required vehicle's parameters in both regions. Also, for dealing with both aforementioned cases, a switching control strategy which stabilizes the vehicle's lateral position is proposed. The performance of the proposed switching methodologies is tested in real time experiments.

I. INTRODUCTION

This work is motivated by the theory of switching systems and the need of developing effective UAVs controllers and state estimators, not only for attitude and position stabilization, but also for successfully executing a more complex predefined mission. The problem of stabilizing a quad-rotor using visual feedback has been constantly addressed, see for example [START_REF] Altug | Control of a quadrotor helicopter using visual feedback[END_REF], [START_REF] Zingg | Mav navigation through indoor corridors using optical flow[END_REF], [START_REF] Cabecinhas | Vision-based quadrotor stabilization using a pan and tilt camera[END_REF]. It has been previously shown that PD controllers work efficiently for stabilizing the UAV's attitude dynamics [START_REF] García-Carrillo | Stabilization and trajectory tracking of a quad rotor using vision[END_REF]. Also, PD controllers have proved to be robust enough for similar applications than the one being addressed in the present research [START_REF] Rondon | Vision-based altitude, position and speed regulation of a quad-rotor rotorcraft[END_REF]. In both previous approaches, the imaging system was used for estimating the vehicle's translational dynamics. However, those strategies are not robust solutions for dealing with external disturbances causing that the imaging system losses temporarily the artificial landmarks used for obtaining the vehicle's states. In [START_REF] Hespanha | Linear parametrically varying systems with brief instabilities: An application to integrated vision/imu navigation[END_REF], the authors propose a switching strategy for estimating the states of a UAV equipped with imaging, inertial and air data sensing systems, capable of dealing with instants of time when the visual detection of the landmark fails. Following a similar reasoning, the implementation of different controllers (and therefore different gains) is required by the fact that, the use of a PD controller in the position dynamics is not enough for attenuating the disturbances caused by, for example, winds gusts [START_REF] Hoffmann | Quadrotor helicopter flight dynamics and control: Theory and experiment[END_REF]. The switching system approach has been previously implemented to solve UAVs related problems. In [START_REF] Oishi | Switching in nonminimum phase systems: Application to vstol aircraft[END_REF], the authors present the analysis and control of a VTOL aircraft at simulation level. † are with the Heudiasyc UMR 6599 Laboratory, University of Technology of Compiègne, France. L.R. García Carrillo (email: lgarciac@hds.utc.fr), G. Flores (email: gfloresc@hds.utc.fr), G. Sanahuja (email: gsanahuj@hds.utc.fr)

⋆ is with the Heudiasyc UMR 6599 Laboratory, UTC CNRS France and LAFMIA UMI 3175, Cinvestav, México. (email: rlozano@hds.utc.fr) By using a common Lypunov function, the stability of the complete system, divided in three modes, is proved.

This paper addresses the problem of autonomously perform a road following mission using a quad-rotor UAV, over a road having smooth curves. Estimating and controlling the vehicle's relative position, orientation and velocity with respect to (w.r.t.) the road, are the subjects of interest. A camera allows estimating the vehicle's heading angle w.r.t. the road's longitudinal orientation, as well as the lateral distance that the vehicle must correct in order to navigate exactly over the road. A switching control strategy for estimation and tracking between two operational regions is defined: one for the situation when the road is in the camera field of view (FOV), and the other for the situation when it is not. The system's stability is proved not only in the two regions, but also in the switching boundaries between them. The performance of the switching control is tested in real time experiments, demonstrating the effectiveness of the proposed approach.

The paper is organized as follows. Section II presents the problem statement. The methods proposed to estimate the vehicle's states are shown in Section III. The switching control strategy and the stability proof are presented in Section IV. Section V presents the quad-rotor experimental platform. The performance of the UAV during real-time experiments is shown in Section VI. Finally, Section VII presents some conclusions.

II. PROBLEM STATEMENT

The vehicle considered is equipped with inertial sensors, an ultrasonic range finder and a calibrated camera. The inertial system provides the vehicle's angular dynamics, allowing the development of a control strategy for attitude stabilization. The ultrasonic range finder points downwards, directly measuring the altitude of the aerial vehicle during flight. The camera is installed on-board pointing downwards, in a manner that the plane formed by the helicopter's (x h , y h ) plane and the camera's (y c , x c ) image plane are parallel and have the same orientation. The camera and the aerial vehicle move together as a rigid body, therefore, using the image provided by the camera, vision-based strategies could be implemented to estimate the vehicle's states required for the navigation mission.

The road-following task can be detailed as follows. First the vehicle performs an autonomous take-off, reaching a desired altitude z d over the road. At this point, the heading of the vehicle, expressed by ψ, is driven to yield a parallel positioning between the helicopter x-axis (represented by x h ) and the longitudinal direction of the road (expressed by x r ). The helicopter's forward speed, expressed by ẋ, is kept to a constant value while the distance between x h and x r , expressed by e y , is regulated and kept to a minimum value, achieving a flight path well aligned and centered w.r.t. the road. Finally, the quad-rotor is required to land autonomously in a position near the end of the road.

The main goal is to design a road following strategy based on computer vision and switching control, with the purpose of stabilizing the vehicle's altitude, heading angle and lateral position (z, ψ and y states respectively) w.r.t. the road, while traveling at constant forward speed ( ẋ = c) in presence of external disturbances.

III. STATES ESTIMATION USING VISION

Consider that the vehicle is flying over a road having smooth curves, which is represented in the camera's image as a group of straight and parallel lines, see Fig. 1. A straight line in the image can be seen as a segment of infinite length and whose center of gravity belongs to the straight line [START_REF] Chaumette | Image moments: a general and useful set of features for visual servoing[END_REF]. Based on the Hough transform method for line detection, a straight line is represented as ρ = x cos θ + y sin θ. The center of gravity (x g , y g ) of each straight line detected can be computed as x i g = cos(θ)ρ and y i g = sin(θ)ρ, where the super-index i stands for the line i. It is possible to assign initial and final bounds to the line. Let's define (x i I , y i I ) as the initial point of the line, located in a place below the image's lower margin, and let (x i F , y i F ) be the final point of the line, located in a place above the image's upper margin. If the line has a parameter ρ > 0, the coordinates (x i I , y i I ) and (x i F , y i F ) will be defined as

x i I = x g + Γ(-sin(θ)) ; y i I = y g + Γ cos(θ) (1) x i F = x g -Γ(-sin(θ)) ; y i F = y g -Γ cos(θ) (2)
where Γ is a known constant defining the line's bounds. When ρ < 0, the point (x i F , y i F ) will be computed as in equation ( 1) while the point (x i I , y i I ) will be computed as in equation ( 2). The set of parallel lines extracted from the road's projection on the image are grouped yielding just a single average line. This average line will uniquely represent the road in the image with a simple pair of initial and final coordinates

x I = x i I i , y I = y i I i ; x F = x i F i , y F = y i F i ( 3
)
where i is the number of lines grouped together, (x I , y I ) represents the initial (lowermost) road coordinate and (x F , y F ) represents the final (uppermost) road coordinate.

A. Computing the heading angle

The angle ψ r between the camera's x c axis and the point given by (x F , y F ) can be computed using (x I , y I ) and (x F , y F ) in the two argument function atan2 as ψ r = atan2(y Fy I , x Fx I ). The angle ψ r is used for obtaining the desired heading angle ψ d that will align the vehicle's xaxis (x h ) with the road's longitudinal axis (x r ), see Fig. 1. ψ d will finally be expressed as

ψ d = ψ r + π 2 ,
where the therm π 2 is added to adjust ψ d to a value of zero when ψ r is aligned vertically with x h .

B. Computing the relative lateral position

Consider an image-based distance e c x along the camera's x c axis. e c

x is defined between the road's center of gravity projection (x g , y g ) and the vehicle's center of gravity projection (x 0 , y 0 ), see Fig. 1. In the case when x I > x F , one has

e c x = x I -x F 2 + x F - c w 2 (4)
where c w represents the width of the image in pixels. In the case when x I < x F , x I must be replaced by x F and viceversa. The lateral position of the aerial vehicle w.r.t. the road can be estimated from e c x as

e y = z e c x α x ( 5
)
where z represents the distance existing between the helicopter and the road (altitude), and α x represents the camera's focal length in terms of pixel dimensions in the x c direction.

C. Translational velocities

Consider a camera-vehicle arrangement moving in a 3dimensional space with respect to a rigid scene. The optical flow coming from an image point (x i , y i ) is composed of a translational part T OF and a rotational part R OF , see [START_REF] Rondon | Vision-based altitude, position and speed regulation of a quad-rotor rotorcraft[END_REF] for details. When computing optical flow, all the (x i , y i ) image coordinates are known, furthermore, they all share the same movement. By using all the tracked features, a mean value for the optical flow can be expressed as

Ō F x = VOFx + K x VOFz + ROFx (6) Ō F y = VOFy + K y VOFz + ROFy (7)
where Ō F x and Ō F y are the means of the optical flow sensed in the image coordinate system, VOFz represents the relative depth and K x and K y are known scale factors depending on intrinsic parameters of the camera. Following a similar approach approach than the one presented in

D. Computing heading and lateral position when the road is not detected

The computation of the vehicle's desired heading angle and lateral position are compromised by the sensitivity of the Hough transform method for lines detection. Furthermore, it is not possible to estimate such parameters when the the vehicle is flying over a region where the road is out of the camera's FOV. Therefore, the results presented in Section III must be extended to deal with such situations. Let's define a binary signal s : [0, ∞) → {0, 1} as s(t) := 0 no line detection at time t 1 camera detects line at time t [START_REF] Oishi | Switching in nonminimum phase systems: Application to vstol aircraft[END_REF] allowing to switch between two different methods for computing the vehicle's states. Lets define the time event T s0 as the time when the binary signal changes from 1 to 0, and T s1 the time event when the binary signal changes from 0 to 1.

Consider the desired heading angle ψ d . Equation ( 8) allows us to define

ψ s (t) = s(t)ψ d (t) + (1 -s(t))ψ IMU (T s0 ) (9)
where ψ d (t) is obtained from the imaging system, ψ IMU (T s0 ) is the IMU's heading angle measurement at the time event T s0 , and ψ s (t) represents the desired heading angle that will be used in the helicopter controller. Equation ( 9) allows switching from a ψ s (t) obtained from the imaging algorithm and a ψ s (t) defined by the IMU's heading angle measurement at the time event when the road was not detected in the image. Consider now the vehicle's lateral position computation when the road is out of sight. Equation ( 8) allows to compute e ys (t) = s(t)e y (t) + (1s(t)) (e y (T s0 ) + Σ s )

with Σ s = Ts1 Ts0 ẏ(t)d(t). Here e y (t) is given by equation ( 5), e y (T s0 ) is the lateral position measurement at the time event T s0 , and ẏ(t) represents the vehicle's lateral velocity obtained from optical flow. Equation [START_REF] García-Carrillo | Combining stereo vision and inertial navigation system for a quad-rotor uav[END_REF], allows switching between two different approaches for estimating the vehicle's a lateral position w.r.t. the road. In the first approach, lateral position is directly obtained from the detection of the road line in the camera's image (equation ( 5)). The second approach makes use of the road's position at time event T s0 in combination with the integral of the translational velocity ẏ during the time the road is not being detected by the vision algorithm, i.e., during a time bounded by time events T s0 and T s1 .

IV. CONTROL

A normalized mathematical model for the quad-rotor is implemented [START_REF] García-Carrillo | Combining stereo vision and inertial navigation system for a quad-rotor uav[END_REF]:

ẍ = -u 1 (cos φ sin θ cos ψ + sin φ sin ψ) ÿ = -u 1 (cos φ sin θ sin ψ -sin φ cos ψ) z = 1 -u 1 (cos φ cos θ) θ = u 2 φ = u 3 ψ = u 4 (11)
such model can be written in a state-space form by introducing Ẋ = (x 1 , ..., x 6 ) T = (x, ẋ, y, ẏ, z, ż) T and Ż = (z 1 , ..., z 6 ) T = (θ, θ, φ, φ, ψ, ψ) T . Using this notation on the linear representation of the model in equation [START_REF] Kokotović | Singular Perturbation Methods in Control: Analysis and Design[END_REF] one has

ẋ1 = x 2 ż1 = z 2 ẋ2 = -z 1 u 1 ż2 = u 2 ẋ3 = x 4 ż3 = z 4 ẋ4 = z 3 u 1 ż4 = u 3 ẋ5 = x 6 ż5 = z 6 ẋ6 = 1 -u 1 ż6 = u 4 (12)
A. Operating modes of the road following mission

The road following mission is divided in five stages. Stage 1 -Take-off mode: the objective is to achieve the desired altitude z d . Stage 2 -ψ-alignment mode (ψ AL): once at the desired altitude, the task to be accomplished is to align the vehicle's heading angle w.r.t. the road direction. Stage 3y-alignment mode (y AL): the vehicle is required to maintain a flying path well aligned w.r.t. the center of the road. Stage 4 -Navigation mode: the vehicle's forward displacement is stabilized in order to navigate at constant velocity. Stage 5 -Landing mode: the altitude is controlled in order to perform an autonomous landing.

B. Control Laws in each Operating Mode

The control strategy proposed in all different modes is based on the idea that the system in equation ( 12) is constituted of two subsystems, the attitude dynamics and the position dynamics, existing a time-scale separation between them [START_REF] Kokotović | Singular Perturbation Methods in Control: Analysis and Design[END_REF]. From this fact, it is possible to propose a hierarchical control scheme, where the positioning controller provides the reference attitude angles (θ d , φ d and ψ d ), which are the angles that must be tracked by the orientation controllers. Error dynamics of the model in equation ( 12) are represented by xi = x ix i d and zi = z iz i d , with i ∈ {1, ..., 6}.

1) Attitude Control: An integral sliding mode control is proposed, which was chosen due to its insensitivity to model errors, parametric uncertainties and other disturbances [START_REF] Xu | Sliding mode control of a class of underactuated systems[END_REF]. For the pitch dynamics case, the error equation is defined as z1 = z 1z 1 d . As shown in [START_REF] Slotine | Applied Nonlinear Control[END_REF], lets select the switching function

s(z, t) = ż1 + 2λz 1 + λ 2 t 0 z1 (τ ) dτ (13)
which depends on the pitch dynamics states. The λ parameter in equation ( 13) is the slope of the sliding line and should be greater than zero to ensure the asymptotic stability of the sliding mode. Computing the time derivative of equation ( 13) one has ṡ = z 1 u 2 + 2λz 2 + λ 2 z1 . Considering the sliding mode condition ṡ = 0, one finds the equivalent control z 1eq = -2λz 2λ 2 z1 . With the purpose of obtaining a control law such that the state vector z1 remains on the sliding surface s(z, t) = 0, ∀t > 0, let's use the Lyapunov function candidate v(s) = 1 2 s 2 . An efficient condition for the stability of the pitch sub-system can be satisfied if one can ensure that the reached condition v(s) = 1 system remains on the sliding surface and the states go to the origin. Thus s ṡ ≤ -η|s| and the controller must be chosen such that z 1 = z 1eq -Ksign(s), where K is a positive real number. Following a similar approach, it is possible to obtain the yaw and roll angles controllers.

2) Position Control: Motion in the x-y plane is accomplished by orientating the vehicle's thrust vector in the direction of the displacement desired. Therefore, the angles θ d and φ d act as virtual controllers for the position dynamics. The control laws proposed for the z an x positions, respectively, are expressed as

u 1 = k pz (x 5 -x 5 d ) + k vz (x 6 -x 6 d ) -1 (14)
θ d = k vx (x 2 -x 2 d ) + k px (x 1 -x 1 d ) u 1 ( 15
)
with k vx , k px , k pz and k vz being positive real numbers. The y-position control is composed by two PID controllers, one for the situation when the road is being detected and one for the situation when it is not. Although both PID controllers are similar, they have different gains. When the road is inside of the camera's FOV, the gains of the controller are tuned to behave like a PD controller, due to the necessity of having a rapid response for maintaining the vehicle's y coordinate at a minimum value, i. e., y = 0 [START_REF] Hoffmann | Quadrotor helicopter flight dynamics and control: Theory and experiment[END_REF]. On the other hand, when the vehicle looses the image of the line, a switch to a different method for measuring the vehicle's ψ angle and y position occur, and, at the same time, the positioning controller's gains switch to alternative values simulating a PI controller. In both of them, the control objective is to regulate the x 3 state to the origin, i.e. x 3d = 0.

For the case when the line is detected, the feedback control law proposed is given by

z 3 = 1 u 1 (-k L3 x 3 -k L4 x 4 + k LI ξ) (16)
where k L3 , k L4 and k LI are positive real numbers. It has been introduced the additional state ξ, whose dynamics are given by ξ = x 3dx 3 = -x 3 . Using the control in equation ( 16), the closed-loop system of the lateral dynamics is given as

ẋ3 = x 4 ẋ4 = -k L3 x 3 -k L4 x 4 -k LI ξ ξ = -x 3 (17)
Equation ( 17) can be represented as ėy = A L e y , where e y = (x 3 , x 4 , ξ) T and

A L =   0 1 0 -k L3 -k L4 k LI -1 0 0   (18)
For the case when the line is not detected, the control schema proposed is the same as was given by equation ( 16), with the only difference of having a set of different gains. Then, the closed-loop system is represented as ėy = A N L e y , where

A N L =   0 1 0 -k N L3 -k N L4 k N LI -1 0 0   ( 19
)
whit k N L3 , k N L4 and k N LI being positive real numbers. Remark 1: On the experimental platform, the gains were tuned experimentally, resulting in different values for both cases.

In the first approach (road detected), they were selected as K L3 = 1000, K L4 = 850 and K LI = 0.1, while in the second one (no road detected) as k N L3 = 1000, k N L4 = 1 and k N LI = 9.5. In this way, the system presents a switchedsystem characteristic.

C. Stability Analysis of the Lateral Position Control

This section focuses on the system's stability across switching boundaries, i.e., where the control gains of equation ( 16) switch to different values. Following a similar approach than the one presented in [START_REF] Liberzon | Switching in Systems and Control[END_REF], it is possible to find a common Lyapunov function for the closed-loop system formed from applying the two controllers of the lateral position dynamics. However, working in this way, the same pole locations have to be chosen for both cases, which in fact is not the case (different gain values are being applied).

Let's define d c as the distance measured from the vehicle's center of gravity projection to the point where the camera loses the image of the road, see Fig. 1. Thus, a change of coordinates can be made such that y d1 = x 3 + d c and ẏd1 = y d2 = x 4 is its derivative. From equation (17

) one has ẏd1 = y d2 , ẏd2 = -k L3 y d1 -k L4 y d2 -k LI ξ, ξ = -y d1
, with e y d = (y d1 , y d2 , ξ) T . It can be defined a state-dependent switched linear system, given by the closed-loop system together with the switching conditions

ėy d = A L e y d if |y d1 | < 0 A N L e y d if |y d1 | ≥ 0 (20)
It is clear that each individual system in equation ( 20) is stable, since the matrices A L and A N L are Hurwitz. Suppose that there is a family A p , p ∈ P of functions from ℜ n to ℜ n , with P = 1, 2, ..., m defining the finite index set. For the case of linear systems, this results in a family of systems ẋ = A p x with A p ∈ ℜ n×n . Let's define a piecewise constant function σ : [0, ∞) → P with finite number of discontinuities (switching times) on every bounded time interval. This function takes a constant value on every interval between two consecutive switching times. Then σ gives the index σ(t) ∈ P of the system that is actually active, at each instant of time t. Theorem 1: Consider vectors t pq , symmetric matrices S p with Ω p ∈ {x : x T S p x ≥ 0}, ∀p ∈ P having non-negative entries and symmetric matrices P p such that:

A T p P p + P p A p + β p S p < 0, β p ≥ 0 (21) 0 < P p -P q + f pq t T pq + t pq f T pq for some t pq ∈ ℜ n (22)
With the boundary between Ω p and Ω q of the form {x : f T pq = 0}, f pq ∈ ℜ n . Then every continuous, piecewise C 1 trajectory of the system ẋ = A σ x tends to zero exponentially.

Proof: See the Appendix.

V. EXPERIMENTAL PLATFORM

The quad-rotor has a dimension of 40 cm between same axis rotors, a weight of 1.1 kg. and an autonomy of 15 min. Control electronics is based on a IGEPv2 card equipped with a TI R DM3730 System On Chip where the control law is executed at a 100 Hz. A Microstrain R IMU provides measurements at 100 Hz while an SRF10 ultrasonic sensor measures the altitude between 0 and 2 m. Images are provided at 120 Hz by a PlayStation R Eye camera pointing downwards. The Harris affine region detector is implemented to perform characteristic features detection. The optical flow algorithm implemented is based on the pyramidal Lucas-Kanade method. The computation of the vehicle's heading angle and lateral position are based on a Hough transform technique for detecting lines. The imaging algorithms are based on openCV functions [START_REF] Bradski | Learning OpenCV[END_REF] and are executed in the onboard DSP at 100 Hz. The quad-rotor is wirelessly linked to a ground station PC where a graphical user interface allows monitoring and controlling the vehicle. The quad-rotor can be controlled manually by means of a PlayStation R 3 joystick, which is linked with BlueTooth TM to the ground station.

VI. REAL TIME EXPERIMENTS

The road following mission in presence of external disturbances was performed autonomously by the quad-rotor over a road model having two smooth curves. The experiment procedure is just as explained in Section II. An external disturbance is applied during navigation which makes the imaging system unable to detect the road, this has the purpose of demonstrating the effectiveness of the estimators and controllers during switching times. A video of the road following experiment can be seen at http://youtu.be/IV75kaMt_gg

The quad-rotor translational dynamics are shown in Fig. 2. From the upper graphic, x = 10 meters represents the longitudinal distance flown by the quad-rotor, obtained by integrating the optical flow sensed in the x direction. The y parameter represents the lateral position of the quad-rotor w.r.t. the road. It can be seen an external perturbation induced in the y direction at t = 26 seconds. The lower graphic represents the vehicle's altitude. Translational velocities are shown in Fig. 3. Notice that the forward speed ẋ is maintained at 1 m/s, while ẏ and ż are kept near zero.

The switching between the estimation approaches is shown in Fig. 4. The middle graphic represents the time instants where the line is being detected (s = 1) and where it is not (s = 0). The upper graphic represents the desired heading angle that will align the vehicle heading with the road direction, which is computed from equation [START_REF] Chaumette | Image moments: a general and useful set of features for visual servoing[END_REF]. The lower graphic represents the lateral position error as computed from equation [START_REF] García-Carrillo | Combining stereo vision and inertial navigation system for a quad-rotor uav[END_REF]. A zoom of the region where the switch occurs (t = 26s) is shown in Fig. 5.

The helicopter's Euler angles, as obtained directly from the embedded IMU are shown in Fig. 6. Angles θ and φ are always kept small while performing the mission. The lower graphic shows the heading angle described by the vehicle in order to handle the two road's curves. This heading angle is represented w.r.t. the inertial reference frame whose origin is at the quadrotor initial position.

VII. CONCLUSION

The problem of vision-based road following using a quadrotor was addressed. The goal of this research consisted on estimating and tracking a road without a priori knowledge of the path to be tracked, as well as of deriving efficient controllers for dealing with situations when the road is not detected in the camera's image. Two operational regions were defined: one for the case when the road is detected and the other one for when it is not. A switching between imaging and inertial sensors measurements was used for estimating the vehicle's parameters in both regions. For dealing with both aforementioned cases a switching control strategy which stabilizes the vehicle's lateral position was proposed. The system's stability was proved not only in the two regions, but also in the switching boundaries between them. The performance of the switching control was tested in real time experiments, demonstrating the effectiveness of the proposed approach for performing the task of road following in the presence of external disturbances. Future work will consider a hybrid scheme for switching not only different gains but also different control strategies. APPENDIX Before proving Theorem 1, let's use the following theorem. Theorem 2: The system ẋ = f (t, x), f (t, x) ≡ 0, is exponentially stable on the region D = {x ∈ ℜ n | x < r} if there exists a Lyapunov function V (t, x) and some positive constants c 1 , c 2 , c 3 , such that ∀(t, x) ∈ [0, ∞) × D 0 ,

D 0 = {x ∈ ℜ n | x < r/m} c 1 x 2 ≤ V (t, x) ≤ c 2 x 2 (23) ∂V ∂t + ∂V ∂x ≤ -c 3 x 2 (24)
where m is the overshot from definition of exponential stability.

Proof: See [START_REF] Khalil | Nonlinear Systems[END_REF], pp. 169.

Proof of Theorem 1 : The proof relies on Theorem 2, then using the Lyapunov function candidate V (x) = x T P p x and assuming that x(t) is continuous and piecewise C 1 , hence, V (t) has the same characteristics. Premultiplying and postmultiplying condition (22) by x, the inequality on the left side of (23) is satisfied. Similarly, inequality (24) follows if we premultiply and postmultiply both sides of (21) by x.

Fig. 1 .

 1 Fig. 1. The camera's view: projection of a road with longitudinal axis xr.

  [START_REF] Rondon | Vision-based altitude, position and speed regulation of a quad-rotor rotorcraft[END_REF], the rotational optical flow terms ROFx and ROFy are compensated and the pseudo-speeds ( VOFx , VOFy , VOFz ) are deduced, finally yielding -z VOFx αx = ẋ, -z VOFy αy = ẏ and z VOFz = ż.

Fig. 2 .

 2 Fig. 2. (x, y, z) states. Perturbation in y position is shown at t = 26s.

Fig. 3 .

 3 Fig. 3. Translational velocities during the experiment.

Fig. 4 .

 4 Fig. 4. Switching signals: ψ d , switch signal s, eys.

Fig. 5 .

 5 Fig. 5. Zoom of signal s affecting the lateral position measurement method.

Fig. 6 .

 6 Fig. 6. The helicopter Euler angles during flight.

  This work was partially supported by the Mexican National Council for Science and Technology (CONACYT) and the Institute for Science & Technology of Mexico City (ICyTDF)

d dt s 2 ≤ η|s|, with η ≥ 0 holds. Then, the