# Generate a Trajectory from GPS coordinates

How would I generate a trajectory (e.g. minimum snap/jerk/acceleration) for a quad rotor between GPS coordinates? In all the examples that I have seen, they assume that the x,y positions are in meters relative to a starting point (0,0). Is it as simple as calculating the distance of a straight line between the 2 points and dividing that up into segments to create a continuous path?

By the way I'm ignoring the z/altitude value as that value will be a constant value throughout in my case.

A sample trajectory for reference that I have seen when applying boundary conditions to a quin-tic polynomial to generate velocity and acceleration polynomials.

time,   x,                  y
0.0,    0.0,                0.0
0.1,    0.00350070021007,   0.00350070021007
0.2,    0.0105021006302,    0.0105021006302
0.3,    0.0210042012604,    0.0210042012604
0.4,    0.0350070021007,    0.0350070021007
0.5,    0.0525105031511,    0.0525105031511
0.6,    0.0735147044115,    0.0735147044115
0.7,    0.098019605882,     0.098019605882
0.8,    0.126025207563,     0.126025207563
0.9,    0.157531509453,     0.157531509453
1.0,    0.231046213865,     0.231046213865
1.1,    0.273054616385,     0.273054616385
1.2,    0.318563719116,     0.318563719116
1.3,    0.367573522057,     0.367573522057
1.4,    0.420084025208,     0.420084025208
1.5,    0.47609522857,      0.47609522857
1.6,    0.535607132141,     0.535607132141
1.7,    0.598619735922,     0.598619735922
1.8,    0.665133039913,     0.665133039913
1.9,    0.735147044115,     0.735147044115
2.0,    0.808661748526,     0.808661748526


As reported for example in https://robotics.stackexchange.com/a/21571/6941, a minimum-jerk trajectory in one dimension is coded with respect to time $$t$$ as: $$x(t) = x_i + (x_f-x_i) \cdot \left( 10\left(\frac{t}{t_f}\right)^3 -15\left(\frac{t}{t_f}\right)^4 +6\left(\frac{t}{t_f}\right)^5\right),$$ where $$t_f$$ is the final time ($$2\, \text{s}$$ in your case), $$t \in \left[0, t_f\right]$$, and $$x_i$$ and $$x_f$$ are the initial and final position, respectively.
• Given your GPS locations in a convenient 2D representation, you ought to apply the above formula that is responsible for generating a trajectory linking the start to the end point with the desired timing. So, you'll have $[x_i, x_f]$ as well as $[y_i, y_f]$. – Ugo Pattacini Jan 11 at 18:54