To build the firmware or the simulator, you need to clone the repository using git:
git clone https://github.com/okalachev/flix.git
cd flix
The latest version of Ubuntu supported by Gazebo 11 simulator is 20.04. If you have a newer version, consider using a virtual machine.
-
Install Arduino CLI:
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=~/.local/bin sh
-
Install Gazebo 11:
curl -sSL http://get.gazebosim.org | sh
Set up your Gazebo environment variables:
echo "source /usr/share/gazebo/setup.sh" >> ~/.bashrc source ~/.bashrc
-
Install SDL2 and other dependencies:
sudo apt-get update && sudo apt-get install build-essential libsdl2-dev
-
Add your user to the
input
group to enable joystick support (you need to re-login after this command):sudo usermod -a -G input $USER
-
Run the simulation:
make simulator
-
Install Homebrew package manager, if you don't have it installed:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Install Arduino CLI, Gazebo 11 and SDL2:
brew tap osrf/simulation brew install arduino-cli brew install gazebo11 brew install sdl2
Set up your Gazebo environment variables:
echo "source /opt/homebrew/share/gazebo/setup.sh" >> ~/.zshrc source ~/.zshrc
-
Run the simulation:
make simulator
- Install QGroundControl mobile app on your smartphone. For iOS, use QGroundControl build from TAJISOFT.
- Connect your smartphone to the same Wi-Fi network as the machine running the simulator.
- If you're using a virtual machine, make sure that its network is set to the bridged mode with Wi-Fi adapter selected.
- Run the simulation.
- Open QGroundControl app. It should connect and begin showing the virtual drone's telemetry automatically.
- Go to the settings and enable Virtual Joystick. Auto-Center Throttle setting should be disabled.
- Use the virtual joystick to fly the drone!
- Connect your USB remote control to the machine running the simulator.
- Run the simulation.
- Calibrate the RC using
cr
command in the command line interface. - Run the simulation again.
- Use the USB remote control to fly the drone!
- Install Arduino IDE (version 2 is recommended).
- Windows users might need to install USB to UART bridge driver from Silicon Labs.
- Install ESP32 core, version 3.1.0 (version 2.x is not supported). See the official Espressif's instructions on installing ESP32 Core in Arduino IDE.
- Install the following libraries using Library Manager:
FlixPeriph
, the latest version.MAVLink
, version 2.0.12.
- Clone the project using git or download the source code as a ZIP archive.
- Open the downloaded Arduino sketch
flix/flix.ino
in Arduino IDE. - Connect your ESP32 board to the computer and choose correct board type in Arduino IDE (WEMOS D1 MINI ESP32 for ESP32 Mini) and the port.
- Build and upload the firmware using Arduino IDE.
-
On Linux, use:
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=~/.local/bin sh
-
Windows users might need to install USB to UART bridge driver from Silicon Labs.
-
Compile the firmware using
make
. Arduino dependencies will be installed automatically:make
You can flash the firmware to the board using command:
make upload
You can also compile the firmware, upload it and start serial port monitoring using command:
make upload monitor
See other available Make commands in the Makefile.
Tip
You can test the firmware on a bare ESP32 board without connecting IMU and other peripherals. The Wi-Fi network flix
should appear and all the basic functionality including CLI and QGroundControl connection should work.
Before flight you need to calibrate the accelerometer:
- Open Serial Monitor in Arduino IDE (or use
make monitor
command in the command line). - Type
ca
command there and follow the instructions.
- Install QGroundControl mobile app on your smartphone.
- Power the drone using the battery.
- Connect your smartphone to the appeared
flix
Wi-Fi network. - Open QGroundControl app. It should connect and begin showing the drone's telemetry automatically.
- Go to the settings and enable Virtual Joystick. Auto-Center Throttle setting should be disabled.
- Use the virtual joystick to fly the drone!
Before flight using remote control, you need to calibrate it:
- Open Serial Monitor in Arduino IDE (or use
make monitor
command in the command line). - Type
cr
command there and follow the instructions. - Use the remote control to fly the drone!
If your drone doesn't have RC receiver installed, you can use USB remote control and QGroundControl app to fly it.
- Install QGroundControl app on your computer.
- Connect your USB remote control to the computer.
- Power up the drone.
- Connect your computer to the appeared
flix
Wi-Fi network. - Launch QGroundControl app. It should connect and begin showing the drone's telemetry automatically.
- Go the the QGroundControl menu ⇒ Vehicle Setup ⇒ Joystick. Calibrate you USB remote control there.
- Use the USB remote control to fly the drone!
You can adjust some of the drone's parameters (include PID coefficients) in QGroundControl app. In order to do that, go to the QGroundControl menu ⇒ Vehicle Setup ⇒ Parameters.
In addition to accessing the drone's command line interface (CLI) using the serial port, you can also access it with QGroundControl using Wi-Fi connection. To do that, go to the QGroundControl menu ⇒ Vehicle Setup ⇒ Analyze Tools ⇒ MAVLink Console.
Note
If something goes wrong, go to the Troubleshooting article.
See firmware overview for more details.