If these assumptions does not hold one should rewrite eq. (3.33) using the rotation matrix, eq. (3.3), by including the roll and pitch angles, which are both available as measurements. In the next section we will derive the bank angle.
3.4 Bank angle
Figure 3.6: An aircraft executing a coordinated, level turn (Leven et al., 2009).
As mentioned earlier, the Piccolo autopilot supports bank angle given as control action. The bank angle is defined in Leven et al. (2009) as the following:
Definition 3.4.1 (Bank angle)
The bank angle is the angle between the horizontal plane and the right wing in the lateral plane, positive when the wing points down.
Loosely speaking, the bank angle can be seen as the calculated roll angle which gives a yaw rate r. By considering figure 3.6 we can use Newton’s first law to express lateral equilibrium of the acting forces. FL denotes the lift force, FC the centrifugal force, v the measured flight speed,
m is the vehicle’s mass, ˙Ψ is the heading turn rate and g the gravity acceleration perpendicular to the earth’s surface. The yaw rate r can be expressed as a function of heading turn rate ˙Ψ and roll angle ψ by
Chapter 3. UAV dynamics 23
FC = FLsin (φ) ⇓
m ˙Ψv = mg tan (φ) .
(3.35)
One should note that the minus sign is related to the use of the body and ENU frames. A positive roll angle will result in a negative yaw rate. By combining eq. (3.35) and (3.34) we get the following simple relationship between the roll angle (φ) and the yaw rate (r),
φ =− arcsin
v
gr
. (3.36)
Hence, the bank angle could be calculated using the measured flight speed and the yaw rate. However, the object tracking system will be using way-point control instead of bank angle control. This is because the Piccolo is able to compensate for measured wind forces. By using bank angles as control action, we loose some of the functionality embedded in the Piccolo which compensates for wind and noise disturbances. Hence, in the present thesis way-points will be used as control action to control the UAV’s path. In the next chapter we will look into a camera image’s projection from the UAV down on earth.
Chapter 4
Field of View
The object tracking system includes a thermal camera, FLIR Tau 2 (see appendix C.3), which is embedded in a gimbal and used to find and track objects of interest. In this chapter we will look into and define the relations between the UAV’s coordinates and the corner coordinates of the projected camera image frame relative the earth. In section 4.1 we look at the ground field of view (GFV), which is the camera image projected down on the earth’s surface. The resulting camera image constrains are defined in section 4.2. As in the previous chapter we assume all coordinates and calculated variables to be continuous time dependent and omit the notation {(t)} due to increase readability.
4.1 The projected camera image
The projected camera image’s corners need to be defined by coordinates relative the earth. The corner coordinates are dependent on the UAV’s attitude (roll, pitch and yaw) and position, the gimbal’s rotations (pan and tilt) and the spread of the camera lens. The camera’s body frame relative the gimbal and the UAV, which was denoted in the previous chapter as {c,b}, is shown below in figure 4.1.
Figure 4.1: The camera frame {c,b} in zero position, i.e. {c,b} equals {c,e}.
26 4.1. The projected camera image
As can be seen, the camera’s body frame coincides with the gimbal’s body frame. Using the definition of the camera’s orientation we can define a pyramid that illustrates the camera’s projected view. This is shown i figure 4.2 where figure 4.2b shows a rotated camera view. The red lines define the camera’s center and the blue lines define the pyramid of the camera view.
(a) Before rotation (b) Rotated.
Figure 4.2: Rotation of the camera image’s projected pyramid.
The pyramid of the camera view is known as the ideal pinhole camera model (Wilison and Shafer, 1993, p. 154). This is an ideal model since it is completely undisturbed and without any distortions. Ganapathy (1984) creates an image plane which is offset from the image sensor by the focal length and rotated about the image sensor’s center1. In this report we extend the pyramid’s center line beyond the focal length. The length of the center line is chosen arbitrarily. The ideal pinhole camera model is still offset by the focal length, eq. (3.13), from the image sensor, and the extended center vector is only used to calculate the corners of the GFV. The model is chosen to keep the calculations simple, but if there is a need for increased accuracy distortions might have to be considered.
To calculate the camera view’s projected corners we assume the camera lens’ center is placed in the origin of the camera frame {c,b}, rc,borigin= [0, 0, 0]⊤, and all angles equal zero (α = β = φ = θ = ψ = 0). This means that {c,b} = {c,e}. Then we define a vector relative the camera frame’s origin given by
Cprojc,b = 0, 0,−1 2z ⊤ , (4.1)
which is half of the UAV’s altitude, to describe the center of the projected image plane shown in figure 4.2. The camera lens’ parameters of spread in height and width are given respectively as H and W . For the FLIR camera in appendix C.3 the values are H = 26◦ and W = 32◦.
This results in a total angle of view of 52◦ vertical, and 64◦ horizontal, which are given by the
image format, i.e the size of the image sensor and the focal length (Douglas A. Kerr, 2006). If one were to use a different lens than the 19mm lens mounted on the FLIR camera, or another camera with a different image sensor, the angle of view would change. Moreover, if a zoom lens
1
Chapter 4. Field of View 27
is used the system would need real-time information from the camera as zooming changes the focal length and thereby the angle of view.
With the angles H and W given above we can calculate the pyramid’s corner coordinates (F ront/Rear/Starboard/P ort) relative the camera frame’s origin by
F Sprojc,b = C c,b proj tan (W ) , C c,b proj tan (H) , − C c,b proj F Pprojc,b = − C c,b proj tan (W ) , C c,b proj tan (H) , − C c,b proj RSprojc,b = C c,b proj tan (W ) , − C c,b proj tan (H) , − C c,b proj RPprojc,b = − C c,b proj tan (W ) , − C c,b proj tan (H) , − C c,b proj , (4.2) where C c,b proj
is the positive distance between the {c,b} frame’s origin and the projected image
center. In order to calculate the image corners’ coordinates projected down on earth we need to rotate the coordinates relative the gimbal’s and UAV’s rotations. We define the transformation matrix from zero rotations to the camera’s rotation relative the gimbal’s and UAV’s rotations as
M, M (α, β, φ, θ, ψ) = Rx(θ)Ry(φ)Rz(ψ)Rxg(α)Rzg(β), (4.3)
where Rx, Ry, Rz were defined in section 3.1 and Rxg, Rzg in 3.1.3. By this, the projected
pyramid’s corners and center can be related to an earth fixed ENU frame by first rotating the projected pyramid relative the UAV’s and gimbal’s rotations. Then we relate the corners and the center to the earth by using the camera’s coordinates relative earth. This can be done by
Cproj = M· (Cprojc,b ) + rc F Sproj = M· (F Sprojc,b ) + rc F Pproj = M· (F Pprojc,b ) + rc RSproj = M· (RSprojc,b ) + rc RPproj = M· (RPprojc,b ) + rc, (4.4)
where the camera coordinates relative earth, rc, was defined in eq. (3.14). The coordinate transformations are shown in figure 4.2b. The projected image corners, where the projected pyramid intersects the earth’s surface, can be found by calculating the vectors from the camera’s position through the projected corners and down on earth. The line through the center of the projected pyramid can be calculated by first finding the slopes in each axis,
∆(Cproj)x= (Cproj)x− xc ∆(Cproj)y = (Cproj)y− yc ∆(Cproj)z = (Cproj)z− zc.
28 4.1. The projected camera image
The center line starting in the camera’s center can now be calculated as
C(t) = rct(t) = xc+ ∆(Cproj)x· t yc+ ∆(Cproj)y· t zc+ ∆(Cproj)z· t . (4.6)
Further, we want to find the coordinates to the pyramid’s center where it intersects the earth’s surface. This is the case where the center line’s z coordinate, zct, equals zero. From this we can calculate the variable t as
t = −zc ∆(Cproj)z
. (4.7)
Thus, the center coordinates of the ground field of view (GFV) can be stated as
rct= xc+−z∆(Cc∆(Cprojproj)z)x yc+−z∆(Cc∆(Cprojproj)z)y 0 . (4.8)
Similarly, we can calculate the projected corners in the GFV denoted by rF S, rF P, rRS and
rRP. Figures 4.3 and 4.4 illustrates how the GFV would be affected by the UAV’s pitch and roll angles.
Figure 4.3: Projection of the camera image with a pitch angle of 30◦.
The green area in figure 4.3 and 4.4 represents the GFV, while the blue plane represents a cross-section of the camera view’s pyramid. The UAV’s position is [−100m, 300m, 100m]⊤
relative a local ENU frame, while the gimbal is located at a distance [0m, 0.5m,−0.1m]⊤ from
Chapter 4. Field of View 29
Figure 4.4: Projection of the camera image with a roll angle of 30◦.
[0m, 1cm,−1cm]⊤ from the gimbal’s center given in the camera frame {c,b}.
When the projected camera image corner’s coordinates are calculated, we are able to use the corner coordinates to determine whether an object tracked by the object tracking system is within the GFV or not. This would be discussed in the next section.