To build the firmware for the tinympc controller on Crazyflie using WSL on Windows, follow these organized steps:
- Open Command Prompt as Administrator.
- Run:
wsl --install
- Download and install Python 3.7 or higher from Python.org.
- Check the option to add Python to PATH during installation.
- Open PowerShell or Command Prompt and run:
pip install cfclient
- Update the package list:
sudo apt update && sudo apt upgrade -y
- Install necessary build tools and dependencies:
sudo apt install -y build-essential cmake git python3 python3-dev
- In WSL, navigate to your desired directory and clone the repository:
GIT_CLONE_PROTECTION_ACTIVE=false git clone --recursive git@github.com:A2R-Lab/tinympc-crazyflie.git cd tinympc-crazyflie
- Run the configuration menu:
make menuconfig
- Navigate to:
- App Layer Configuration: Enable "App entry point."
- Controllers and Estimators: Enable "Out of tree."
- Save the configuration as
.config
.
- Compile the firmware using all available CPU cores:
make -j$(nproc)
-
Homebrew: Ensure you have Homebrew installed on your macOS.
-
SWIG: Use Homebrew to install SWIG.
brew install swig
-
Clean the Build: This will erase the current configuration.
make clean
-
Manually Remove Files (Optional):
-
Remove the
build
directory:rm -rf build
-
Navigate to the
src
directory and remove object files:cd src rm *.o
-
-
Generate Configuration: Use
make nconfig
to configure the project.make nconfig
-
Configuration Settings:
-
Navigate to App layer config:
- Set Entry point to on.
-
Navigate to Controllers:
- Set Out of tree controller to on.
-
-
Run the following command to build the project:
make
-
Run the client with command: cfclient
-
Run the following with the CrazyRadio plugged in, and a CrazyFlie turned on and near you:
CLOAD_CMDS="-w radio://0/80/2M/E7E7E7E7E7" make cload
-
Manual option - put CrazyFlie in bootloader mode by holding down power button (3 seconds)
-
Full instructions here.
To use the docker container, clone the repo and run the following commands from the root -
-
-
docker build -t crazyflie-build .
-
docker run -it --rm -v "$(pwd):/workspace" crazyflie-build