Skip to content

TCHS-aero/fly

Repository files navigation

TCHS SUAS

Welcome to the TCHS Aero's main drone team repository! This project contains the core code, resources, and documentation for our team’s participation in SUAS (Small Unmanned Aerial Systems) competitions.

Table of contents:

Categories What's shown?
Setup Setup/Installation instructions.
How does SITL work? Explains how the PX4 Software In The Loop Works
Used Packages All packages used in this repo.

Python Scripts

Setting up the individual scripts is simple.

  1. Install git.

    Arch Linux
    1. Install using pacman. Sudo is required.

      sudo pacman -Sy git
    Debian/Ubuntu
    1. Install using the apt package manager. Sudo is required.

      sudo apt install git
    MacOS
    1. Make sure you have brew installed. If not, install it.

      /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    2. Install git.

      brew install git
  2. Clone this repository.

    git clone https://github.com/TCHS-aero/fly/; cd fly
  3. Install mavsdk using pip.

    python -m pip install mavsdk

Caution

When using an operating system such as Arch Linux, install your pip packages through a virtual environment to avoid system-wide python conflicts. While rare, it does happen because Arch uses python for some of it's core scripts. Virtual environments must be initiated to use their installed pip packages.

Simulation

This repository uses PX4 and MAVSDK-python to connect to the drone. In order to use these scripts in a simulation, you must first install the neccessary software. There are multiple simulators we can choose from, but for this project we use JMavSim, a drone simulator built in Java. JMabSim comes with plenty of keyboard bindings for altering things such as the weather conditions, as documented here.

  1. Clone the PX4-Autopilot repository.

    git clone https://github.com/PX4/PX4-Autopilot; cd PX4-Autopilot
  2. Execute the setup script for your operating system. This should automatically install all required dependencies.

    Arch Linux
    1. This script installs applications through pacman, meaning you need sudo privilages.

      bash Tools/setup/arch.sh
    Debain/Ubuntu Linux
    1. This script installs applications through apt, meaning you need sudo privilages.

      bash Tools/setup/ubuntu.sh
    MacOS
    1. The --sim-tools flag must be specified when using the MacOS setup script.

      bash Tools/setup/macos.sh --sim-tools

Important

This script also installs python packages through pip. It will use the system-wide version of python if you do not have a virtual environment enabled. If you have a virtual environment running in the same shell as you run this script, it will use the virtual environment instead. This may be preferred for some arch users.

  1. Make PX4 SITL (Software In The Loop) and JMavSim

    make px4_sitl jmavsim

You may also want to use your simulation alongside an application such as QGroundControl. All you have to do is run it, and it will automatically connect.

PX4 SITL is a way to run the PX4 flight-control software on your computer instead of on a real drone. PX4 runs as a normal program, and the simulator (like Gazebo or jMAVSim) gives physics and sensor readings such as GPS and IMU data. PX4 interprets this, computes any processes or calculations that need to be done, then sends it back to the simulation for the next update. SITL and the simulator talk using MAVLink over UDP, which also allows tools like QGroundControl to connect just like they would to a real drone. This makes it safe and easy to test flight behavior, missions, and code changes without needing any physical hardware or risking a crash, which is definitely something that none of us want to handle ourselves.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages