Skip to content

Avis-Drone-Labs/FGCS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

be9ae0a · Mar 8, 2025
Mar 2, 2025
Feb 28, 2025
Feb 28, 2025
Mar 8, 2025
Feb 28, 2025
Feb 28, 2025
Feb 28, 2025
Feb 28, 2025
Nov 18, 2023
Jun 3, 2024
Sep 20, 2023
Feb 28, 2025
Feb 28, 2025
Feb 28, 2025
Jul 23, 2024

Repository files navigation

FGCS

Falcon Ground Control Station.

Learn more on our website!

UI Screenshot


How to run

Windows - Installation
  1. Go to releases and download the most recent versions .exe file
  2. Run the downloaded file, you may have to click "more" then "run anyway" if windows defender blocks it
  3. Once installed it should be accessible via the start menu as "FGCS"
Windows - Manually

Prerequisites

  1. Ensure npm is installed, to do so follow this guide. Note: node version must be >= v20.10.0
  2. Ensure yarn is installed, to do so run npm install --global yarn or follow this guide
  3. Install python 3.11.9 (this can be found here) then create a virtual environment for it (see Creating a virtual environment for help)

Creating a virtual environment

Create a new Python virtual environment using python -m venv venv. This can then be activated using ./venv/scripts/activate.

NOTE: To enter the virtual environment you will need to run venv/Scripts/activate on windows, to learn more please read: how to make venv for linux and windows or what is a virtual environment?

Running with bat file
  1. If this is your first time running, please create a venv (see Creating a virtual environment) and then run ./run.bat /path/to/venv update
  2. After this you can run ./run.bat /path/to/venv (without the word update after)
Running independently

Frontend

  1. cd gcs
  2. yarn (to install dependencies)
  3. Create a .env file and add these two entries or rename .env_sample and populate the values:
  4. yarn dev

Backend

  1. cd radio
  2. Make sure you're in a virtual environment (see Creating a virtual environment)
  3. Install requirements pip install -r requirements.txt
  4. python app.py

Mac/Linux

We currently don't have instructions or releases for mac or linux, we will in future releases. It does run on ubuntu and mac as members of the team use it, but we want to test the instructions before releasing them. However, you can still run both the frontend and backend individually by following the windows version with slight alterations to the commands.


Development Info

Stack
  • GUI
    • Electron + Vite + React (JavaScript)
  • Backend
    • Flask + Pymavlink (Python)
Running tests

Backend

For running Python tests, first make sure you're in the radio directory. By default the tests will attempt to connect to the simulator running within Docker. To run the tests simply run pytest. To use a physical device connected to your computer, you can use pytest --fc -s and a prompt will display to select the correct COM port for the device.

SITL with Docker

To run the SITL simulator within Docker, first pull the docker image with docker pull kushmakkapati/ardupilot_sitl. Once pulled, you can start the container with docker run -it --rm -p 5760:5760 kushmakkapati/ardupilot_sitl. This will expose port 5760 for you to connect to over TCP on 127.0.0.1 (the connection string is tcp:127.0.0.1:5760). You can also open up port 5763 for running other scripts on the simulator whilst a GCS is connected.

By default the vehicle type will be ArduCopter, however you can tell the SITL to use a custom vehicle by providing it as a named argument at the end of the run command, e.g. docker run -it --rm -p 5760:5760 kushmakkapati/ardupilot_sitl VEHICLE=ArduPlane. You can also set the starting LAT, LON, ALT and DIR using the named arguments.

If you want to upload a custom parameter file or custom mission waypoint to the simulator then you must have a custom_params.parm or mission.txt file in your current working directory. These can then be uploaded to the simulator on run by specifying a bind mount with -v .:/sitl_setup/custom (note that the destination path must be sitl_setup/custom). E.g. docker run -it --rm -p 5760:5760 -p 5763:5763 -v .:/sitl_setup/custom ardupilot_sitl VEHICLE=ArduPlane.

Note: Steps to push an updated image to docker hub:

docker build . -t ardupilot_sitl
docker tag ardupilot_sitl:latest kushmakkapati/ardupilot_sitl:latest
docker push kushmakkapati/ardupilot_sitl:latest
Python

Version

We are going to be using python 3.11.x so please install that on your computer from Python's website. Please try to use a virtual environment when programming, if you don't know how to do this please message me (Julian)! Name the folder either "env" or "venv" so its in the .gitignore as we don't want to be uploading that to github.

Code Style

We will be using ruff as the code style for python, please look at the documentation found here. When pushing code we have an action to check if it is in the correct code style, if it is not in the correct style it will fail the run and you will need to fix it by running python -m ruff format . in your virtual environment (or something ruff format . works on different systems); this should automatically reformat everything so you can push it again!

Pre-Commit

When cloning the repo for the first time, please install pre-commit. This can be done with a simple pip install pre-commit and then pre-commit install. Our pre-commit hooks will run every time you try to push something, if any of the checks fail then you will not be able to push that commit and receive an error message, often the files will be fixed but not staged, so make sure to re-stage and retry the with pushing commit.

Packaging

Backend

From within the radio folder run pyinstaller --paths .\venv\Lib\site-packages\ --add-data=".\venv\Lib\site-packages\pymavlink\message_definitions\:message_definitions" --add-data=".\venv\Lib\site-packages\pymavlink\:pymavlink" --hidden-import pymavlink --hidden-import engineio.async_drivers.threading .\app.py -n fgcs_backend. This will create an exe and folder within the dist/fgcs_backend/ folder.

On Mac: From within the radio folder run pyinstaller --paths ./venv/lib/python3.11/site-packages/ --add-data="./venv/lib/python*/site-packages/pymavlink/message_definitions:message_definitions" --add-data="./venv/lib/python*/site-packages/pymavlink:pymavlink" --hidden-import pymavlink --hidden-import engineio.async_drivers.threading --windowed --name fgcs_backend ./app.py. This will create the dist/fgcs_backend.app/ folder.

Frontend

After compiling the backend, place the contents of radio/dist/fgcs_backend into a folder in gcs/extras. Then from within the gcs folder run yarn build.

On Mac: After compiling the backend, copy the radio/dist/fgcs_backend.app directory and move it to gcs/extras. Then from within the gcs folder run yarn build. Install from the .dmg file.

Configuration

Changing Ports

We have an .env file located in gcs/.env. To change the host and port for the backend, please edit VITE_BACKEND_URL.

Note: The default host and port is http://127.0.0.1:4237.


Need Help?

Feel free to ask questions in the discussion area.