alpaqa
pi-pico
Nonconvex constrained optimization
|
The alpaqa solvers can be used in embedded systems. This guide covers how to build the alpaqa examples for the Raspberry Pi Pico microcontroller, which is based on a dual-core ARM Cortex-M0+.
The only required dependency is the Eigen linear algebra library. It can be installed using the included install-eigen.sh
script. Eigen is installed into the staging
directory.
You'll also need to install the Pico SDK and a suitable compiler:
A CMake toolchain file is included in cmake/toolchain/pico.cmake
, it selects the correct options (disabling unsupported features such as loading of shared libraries), and loads the Pico SDK with the right compiler.
Connect the Pico over USB while pressing the BOOTSEL button to enter programming mode. Then copy the UF2 file to the storage device that appears.
You should see the solver progress and the solution printed.
When using the CMake Tools extension in VSCode, you can select the RPi Pico ─ tttapa/arm-pico-eabi
kit to compile for the Pico. You can edit the .vscode/cmake-kits.json
file to set the paths to the compiler and the Pico SDK.