fp2lm is a command-line tool for converting the output generated by the Flight Planner plugin for QGIS to a Litchi mission.
fp2lm [options] < FlightplannerMission.csv > LitchiMission.csv
-d <distance>: Sets the interval between projection centres (meters 'm' or feet 'ft'). Example:-d 20m-altitude-mode <mode>: Source of altitude data, eitherasl(absolute) oragl(above ground level). Default:agl-pitch <angle>: Gimbal pitch angle (-90 to 0 degrees). Default:-90-max-altitude <meters>: Maximum allowed altitude AGL in meters. Default:120(to comply with regulations)-output <path>: Output file path (if not specified, writes to stdout)
fp2lm reads a stream of waypoints generated by Flight Planner for QGIS and converts them to properly-structured Litchi Mission waypoints. The tool supports both Above Ground Level (AGL) and Above Sea Level (ASL) altitude modes, and provides safeguards to prevent exceeding regulatory altitude limits.
- Go 1.21 or later
git clone https://github.com/pdfinn/flightplan2litchimission.git
cd flightplan2litchimission
make
This will produce a fp2lm binary in the current directory.
make cross-compile
This will create binaries for Linux, macOS (Intel and Apple Silicon), and Windows in the dist/ directory.
make release
This builds binaries for all platforms and packages them into compressed archives (tar.gz for Linux/macOS, zip for Windows).
make check
Pre-compiled binaries for Windows, macOS, and Linux are available from the Releases page. Simply download the appropriate package for your operating system.
- Windows: Download
fp2lm_windows_amd64.zip - macOS (Intel): Download
fp2lm_darwin_amd64.tar.gz - macOS (Apple Silicon): Download
fp2lm_darwin_arm64.tar.gz - Linux (x86_64): Download
fp2lm_linux_amd64.tar.gz - Linux (ARM64): Download
fp2lm_linux_arm64.tar.gz
Alternatively, you can build from source by following the instructions below.
-
Download the appropriate package for your Mac from the Releases page:
- For Intel Macs:
fp2lm_darwin_amd64.tar.gz - For Apple Silicon Macs:
fp2lm_darwin_arm64.tar.gz
- For Intel Macs:
-
Extract the archive:
tar -xzf ~/Downloads/fp2lm_darwin_*.tar.gz -
Make the binary executable and run it directly:
chmod +x ./fp2lm ./fp2lm -d 20m < FlightplannerMission.csv > LitchiMission.csv
Open the Terminal, and copy the commands below. Change any bracketed [] portions to reflect your particular environment.
- Create a folder named
binin your home folder:
mkdir ~/bin
- Move the
fp2lmbinary from the download location to the newly-createdbinfolder:
mv ~/Downloads/fp2lm_darwin_*/fp2lm ~/bin/fp2lm
- Make the
fp2lmprogramme executable:
chmod u+x ~/bin/fp2lm
- Open the Terminal and update your
PATHto include thebinfolder with the following command:
export PATH=/Users/[your home folder]/bin:$PATH
- To make the update to your
PATHpermanent, append the updated path to your user profile:
echo "export PATH=/Users/[your home folder]/bin:$PATH" >> ~/.zshrc
- You may now run
fp2lmfrom the command line as described above at 'Usage:'. For example, assuming you saved your QGIS Flightplanner flight plan asFlightplannerMission.csvon your desktop, and have determined you want twenty-meters between projection centres, you may run the following command:
fp2lm -d 20m < ~/Desktop/FlightplannerMission.csv > ~/Desktop/LitchiMission.csv
-
Download the appropriate package for your system from the Releases page:
- For x86_64 systems:
fp2lm_linux_amd64.tar.gz - For ARM64 systems:
fp2lm_linux_arm64.tar.gz
- For x86_64 systems:
-
Extract the archive:
tar -xzf ~/Downloads/fp2lm_linux_*.tar.gz -
Make the binary executable and run it directly:
chmod +x ./fp2lm ./fp2lm -d 20m < FlightplannerMission.csv > LitchiMission.csv
Open the Terminal, and copy the commands below. Change any bracketed [] portions to reflect your particular environment.
- Create a folder named
binin your home folder:
mkdir ~/bin
- Move the
fp2lmbinary from the download location to the newly-createdbinfolder:
mv ~/Downloads/fp2lm_linux_*/fp2lm ~/bin/fp2lm
- Make the
fp2lmprogramme executable:
chmod u+x ~/bin/fp2lm
- Open the Terminal and update your
PATHto include thebinfolder with the following command:
export PATH=/home/[your home folder]/bin:$PATH
- To make the update to your
PATHpermanent, append the updated path to your user profile:
echo "export PATH=/home/[your home folder]/bin:$PATH" >> ~/.profile
- You may now run
fp2lmfrom the command line as described above at 'Usage:'. For example, assuming you saved your QGIS Flightplanner flight plan asFlightplannerMission.csvon your desktop, and have determined you want twenty-meters between projection centres, you may run the following command:
fp2lm -d 20m < ~/Desktop/FlightplannerMission.csv > ~/Desktop/LitchiMission.csv
-
Grab the latest fp2lm_windows_amd64.zip from
https://github.com/pdfinn/flightplan2litchimission/releases -
Un-zip anywhere (e.g. Desktop)
-
Open PowerShell in that folder and run
.\fp2lm.exe -d 20m < FlightplannerMission.csv > LitchiMission.csv
For more advanced usage, you may want to add the executable to your PATH:
-
Create a Bin Directory
- Open Windows PowerShell.
- Create a folder named
bin(or name of your choice) in your home directory by executing:mkdir $HOME\bin
-
Move the fp2lm Binary
- Move the
fp2lm.exebinary from your download location to the newly-createdbinfolder. Assuming it is in your Downloads folder, use:Move-Item $HOME\Downloads\fp2lm.exe $HOME\bin\fp2lm.exe
- Move the
-
Update the PATH Environment Variable
- Add the
bindirectory to your system's PATH environment variable. This can be done temporarily (just for the current session) by executing:$Env:PATH += ";$HOME\bin"
- For a permanent change, you will need to add
$HOME\binto the PATH environment variable through System Properties or by using the System Environment Variables settings.
- Add the
cmd/fp2lm/main.go- Entry point for the command-line toolcmd/polyorbit/main.go- Experimental polygon flight path utilityfp2lm/- Core conversion logicmissioncsv/- CSV formatting for Litchi missionslenconv/- Length conversion utilitiespolyorbit/- Experimental polygon flight path generationfp2lm/testdata/- Test data filesexamples/- Example input and output files
This guide assumes the reader is already familiar with Litchi, but may need help with the workflow in QGIS.
- Install the flight_planner plugin from QGIS → [Plugins] → [Manage and Install Plugins...] and search for 'Flight Planner'.
- Load the map layer of your choice. To use Google Earth or OpenStreetMap, select 'XYZ Tiles' in your project's browser and add it as a layer to your project by double-clicking or right-clicking and selecting 'Add Layer to Project'.
- Scribe your Area of Interest (AoI) by creating a new shapefile layer from [Layer] → [Create Layer] → [New Shapefile Layer]. Select 'Polygon' as the Geometry type. Select the desired points on the map. ℹ️ Depending on the CRS you are using, you may need to change the CRS of the AoI to work with Flight Planner — which requires measurements in meters.
- Follow the instructions for Flight Planner to plan your flight. ℹ️ If you are using a DJI drone, you will probably need to add your own camera lens. Consult the manufacture's specifications.
- You will need to create latitude and longitude coordinates for use by Litchi. Fortunately, QGIS makes this easy. With the flight plan generated, select the
waypointslayer in the newly-createdflight_designlayer group. Select [Vector] → [Geometry Tools] → [Add Geometry Attributes]. Select your AoI layer, and calculate the latitude and longitude coordinates using an appropriate CRS (for example, EPSG:4326). Add the new layer to your project. ℹ️ The newly-created layer will have two new fields for latitude and longitude calledxcoordandycoord. You may verify the new values by right-clicking on the layer and selecting Open Attribute Table. - Export the new layer with latitude and longitude points added to a CSV file. ℹ️ If the steps were correctly followed, the exported file should have the following header:
️Waypoint Number,X [m],Y [m],Alt. ASL [m],Alt. AGL [m],xcoord,ycoord - Measure the distance between projection centers (in the flight_design layer), you will supply this value to
fp2lmin the final step. - Run
fp2lmagainst the CSV file as described above with the distance between projection centres obtained in the step above set using the-doption.
NOTE: fp2lm expects CSV input in the form of navigation waypoints. The converter automatically inserts a "take photo" action at every waypoint so that images are captured even when the drone is turning, as distance-based intervals alone can miss photos. At the time of this writing, Litchi missions are limited to 99 waypoints. If waypoints are used to trigger additional actions the limit can be quickly consumed, so for this workflow they are primarily reserved for course changes. Photo spacing can still be configured by measuring the distance between projection centres in QGIS, setting that distance in fp2lm with the -d flag, and configuring Litchi to photograph at equal distance intervals. This remains a reliable approach until Litchi supports more waypoints.