|
1 | 1 | # Drone Flight Plan Generator for FLYLITCHI
|
2 | 2 |
|
3 |
| -Website: https://flylitchi.com/hub <br> |
| 3 | +### Website: https://flylitchi.com/hub <br> |
4 | 4 |
|
5 |
| -<b> Sample source code </b> <br> |
| 5 | +### How to get the coordinates of the field? |
6 | 6 |
|
| 7 | +1) Go to https://flylitchi.com/hub and search for your target location. |
| 8 | + |
| 9 | +  |
| 10 | + |
| 11 | +2) Click the map to generate a point and extract the coordinates from the panel. |
| 12 | + |
| 13 | +   |
| 14 | + |
| 15 | +### Input requirement for the drone flight plan |
| 16 | + |
| 17 | +Four corners of the field (latitude and longitude) |
| 18 | + |
| 19 | + corner 1 = 14.168092, 121.255055 <br> |
| 20 | + corner 2 = 14.168402, 121.255369 <br> |
| 21 | + corner 3 = 14.167741, 121.256036 <br> |
| 22 | + corner 4 = 14.167434, 121.255701 <br> |
| 23 | + |
| 24 | +  |
| 25 | + |
| 26 | + Horizontal partition (x) and vertical partition (y) |
| 27 | + In this example x = 4 and y = 3 |
| 28 | + |
| 29 | +  |
| 30 | + |
| 31 | +<b>NOTE:</b> Create <b>drone</b> folder in your root directory for the output |
| 32 | + |
| 33 | +### Implementation of API |
| 34 | + |
| 35 | +#### Import dplan library |
7 | 36 | from dplan import Flight <br>
|
8 | 37 | from dplan import Order <br>
|
9 | 38 |
|
10 |
| -"""Initiate flight plan"""<br> |
11 |
| -fl = Flight() <br> |
12 |
| -fl.setCorners(corner1=(14.168087,121.255039), corner2=(14.168399,121.255377), corner3=(14.167741,121.256045), corner4=(14.167442,121.255707)) <br> |
13 |
| -fl.setPartition(x=3, y=4) <br> |
| 39 | +#### Initialize flight |
| 40 | +flight = Flight() |
| 41 | + |
| 42 | +#### Set four corners of the field |
| 43 | +flight.setCorners(corner1 = (14.168092, 121.255055), |
| 44 | + corner2 = (14.168402, 121.255369), |
| 45 | + corner3 = (14.167741, 121.256036), |
| 46 | + corner4 = (14.167434, 121.255701)) |
| 47 | + |
| 48 | +#### Set partition of x and y |
| 49 | +flight.setPartition(x=4, y=3) <br> |
14 | 50 | unique_coordinates = fl.calculateDistance()
|
| 51 | + |
| 52 | +### Result |
| 53 | +To view the default flight plan result, import the <b>litchi.csv</b> from the </b>drone</b> folder to https://flylitchi.com/hub |
| 54 | + |
| 55 | +    |
| 56 | + |
| 57 | +### Default flight plan result |
| 58 | + |
| 59 | +  |
| 60 | + |
| 61 | +### Customize flight plan |
| 62 | + |
| 63 | +### Initialize order |
| 64 | +order = Order() |
15 | 65 |
|
16 |
| -"""Initiate order of points"""<br> |
17 |
| -order = Order() <br> |
18 |
| -order.setPointOrder(unique_coordinates, [20,19,17,15,11,13,16,18,14,12,9,7,3,5,8,10,6,4,2,1]) <br> |
| 66 | +#### Select point numbers in which order you prefer |
| 67 | +This a sample order of points <br> |
| 68 | + |
| 69 | +list_order = [14,9,4,1,2,6,11,16,18,13,8,3,5,10,15,19,20,17,12,7] <br> |
| 70 | +order.setPointOrder(unique_coordinates, list_order)<br> |
19 | 71 | order.start() <br>
|
| 72 | + |
| 73 | +### Result |
| 74 | +To view the customized flight plan result, import the <b>litchi_order.csv</b> from the </b>drone</b> folder to https://flylitchi.com/hub |
| 75 | + |
| 76 | +    |
| 77 | + |
| 78 | +  |
| 79 | + |
| 80 | +### View test.py for your reference |
0 commit comments