This project is built as a workspace Zephyr application, with some additional requirements due to source generation.
- Install the required dependencies as desribed in the Zephyr Getting Started#Install Dependencies.
- Clone the efc repository into an empty directory (e.g.
~/eurus/efc/). Container directory (~/eurus/workspace) will contain Zephyr and additional modules.
Note: Clone the repository with --recurse-submodules flag to recursively update git submodules.
- Create a new Python virtual environment in the workspace, install west and configure zephyr-related dependencies.
cd ~/eurus
python3 -m venv install .venv
source .venv/bin/activate
pip install west
west init -l efc
west update
west zephyr-export
west packages pip --install
west sdk install
deactivate- Create a efc-specific virtual environment and install the required packages:
cd ~/eurus/efc
python -m venv python_venv
source python_venv/bin/activate
pip install -r requirements.txt
deactivateNote: Sourcing the efc virtual environment will not be necessary after the first time as CMake will use the virtual environment python binary.
Use west or CMake to build for one of the supported boards:
cd ~/eurus
source .venv/bin/activate
cd efc
west build -b eurus_nexus_v1_1 appSITL (Software In The Loop) for the EFC autopilot runs the EFC flight control software on a host machine (PC) while interfacing with a flight simulator that models vehicle dynamics and the environment. The simulator provides synthetic sensor data to EFC, and EFC computes and returns actuator commands, forming a closed control loop. This setup enables realistic testing and validation of the EFC autopilot without physical hardware.
EFC SITL is designed for the EFC autopilot to interact with jMAVSim simulator.
EFC SITL depends on libuv; therefore, libuv must be installed on the host system.
On Debian-based systems, libuv can be installed using:
apt-get install libuv1-dev- Create a efc-specific virtual environment and install the required packages (if it hasn't already been created):
cd ~/eurus/efc
python -m venv python_venv
source python_venv/bin/activate
pip install -r requirements.txt
deactivateNote: Sourcing the efc virtual environment will not be necessary after the first time as CMake will use the virtual environment python binary.
- Use CMake to build EFC SITL
cd ~/eurus/efc
cmake -B build -S sitl
cmake --build build The efc project uses code formatting rules described in .clang-format.
To ensure automatic code formatting, use pre-commit and install hooks:
pre-commit installWhen creating variables that represent physical units, unit suffixes must be added to their names (e.g. pulse_duration_us, temp_degc, gyro_x_radps).