ivogeorg / FCND-Motion-Planning

Udacity FCND Project 2 - Planning in complex urban environment using udacidrone API
1 stars 0 forks source link

Zig-zag trajectory is a straight line #11

Closed ivogeorg closed 1 year ago

ivogeorg commented 1 year ago

When run fromivogeorg/FCND-Motion-Plannning/ the script motion_planning.py shows a straight line instead of the zig-zag trajectory when run from original repo or copy of original file. Numeric comparison of waypoints shows that simulator points correspond to the reported waypoints.

So, how are the straight-line waypoints generated?

ivogeorg commented 1 year ago

How are the points generated? The intermediate points between start (at altitude) and end are not actually explicitly generated. Since start is at [0, 0] and end is at [10, 10], the trajectory on a grid, without any diagonal motions, is Manhattan distance. So, the trajectory is zig-zag. With diagonal motions, it becomes a straight line.

TODO: Check by commenting the diagonal motions.

ivogeorg commented 1 year ago

Indeed, the diagonal motions cause the zig-zag to straighten out. This also means they work!