# Animating a model aircraft along a spline curve

Around a year ago Paul van Dinther shared a cubic spline curve that identified a path through the Grand Canyon.

Colin Hazlehurst (who has created items such as Captain James Cook’s exploration of Australia) was working on software to animate model aircraft in Google Earth and thought it would be an interesting exercise to make his Spirit of St Louis model fly along Paul’s curve.

This KMZ file shows this in action, and illustrates the following (in Colin’s words):

• The model moves in turn to each set of coordinates (longitude, latitude, and altitude) defining the LineString. The duration of each AnimatedUpdate is determined by calculating the distance between points and dividing this by the pre-set speed of the model.
• The roll and tilt of the model are calculated from the changes in heading and altitude respectively between successive pairs of coordinates.
• A Camera ‘follows’ the model with a pre-determined offset, defined in terms of heading, range, and tilt relative to the model. These values identify the location of the Camera, but the Camera also has a tilt setting which varies according to the pitch of the model; if the model is climbing, the camera tilt is reduced; if the model is descending the camera tilt is increased. This has worked fairly well in this instance, but I notice that at one point the Camera bounces off the wall of the canyon. This might happen when you view the kmz, and I would suggest trying different aspect ratios (width to height) of the Google Earth window.

I thought at first it wouldn’t look right to fly a model aircraft along a spline curve; it didn’t seem to be the way that aircraft flew. I realise now that this was because my first experiments drew splines on too large a scale, with many miles between interpolation points. Paul’s curve is on a much smaller scale, making for correspondingly small adjustments to the flightpath.

Views: 814

Comment by mP1 on January 29, 2014 at 10:44pm

Hats off to Captain James Cook, the unquestioned greatest explorer, navigator, map maker in history.

Comment by Gerard Toonstra on January 30, 2014 at 4:05am

Waypoints are a crude and ambiguous method for navigation, stemming from ocean navigation. I worked as a navigation officer on container ships and the assumption is that ships travel along the inside of the angle to switch from one leg to another, essentially following a circle. With some experience you'd know how far ahead of the WP you'd enter the new course in the AP, depending also on the speed.

There is more ambiguity for rapid flight planning. You may want to decide that the vehicle needs to exit the leg "clean" and then figure out how to get back to the next (going through the waypoint), or you may want the vehicle to enter the waypoint at the right heading so it can follow the leg directly (entry). So placing a crude waypoint is an ambiguous method for navigation. It makes a lot more sense to use waypoints to define basic ideas of the path and then tweak the "followable flight path", for example as a spline or bezier (or continue to manipulate the original wp's until you get the results you want). I'm taking the latter approach for my "FPVNav" app (on the left in this video):

For vehicle navigation, wp nav means that curve planning is only done by following the "distance_to_next_wp" setting in the wp, when it switches to the next. That's usually a very short distance of 5 meters, which for many aircraft is too tight a curve, so you get overshoot. If that matters depends on the application, but it's good to take it into account for photogrammetry, because it defines how well the plane tracks at the entry and exit of the survey grid.

For precision navigation in the future, I see these ideas like spline navigation really take shape. There are situations where you may want to land through a 5m gap in the trees, autonomously fly right next to industrial sites for inspection, cases in which navigation through a monocular video lens doesn't allow you to accurately measure the distance, or doesn't allow you to look ahead and sideways at the same time.

Developer
Comment by Rob_Lefebvre on January 30, 2014 at 2:09pm

I'm so excited waiting for spline nav to come on Arducopter! :)

Comment

Join DIY Drones

1

2

3

4

5

6

7

8

9

10

## Groups

784 members

180 members

2838 members

515 members

• ### 3DR SOLO

361 members

Season Two of the Trust Time Trial (T3) Contest
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here