mscandal
As of now, there isn't an official DepthAI Buildroot package provided by Luxonis (the creators of DepthAI). However, it is possible to integrate DepthAI into a Buildroot-based system by creating a custom Buildroot package. Here’s a general outline (GPTed 🙂)
1. Create a Custom Buildroot Package
You can create a custom Buildroot package for DepthAI. Here’s a step-by-step guide:
Step 1: Set Up Your Buildroot Environment
Step 2: Create a Custom Package Directory
- In the Buildroot directory, create a new directory for your DepthAI package inside
package/
.
mkdir -p package/depthai
Step 3: Write the depthai.mk
File
- Create a
depthai.mk
file inside the depthai
directory with the following content:
# DepthAI Makefile
DEPTHAI_VERSION = 2.15.0.0 # Adjust the version accordingly
DEPTHAI_SITE = https://github.com/luxonis/depthai-core/archive/refs/tags/v$(DEPTHAI_VERSION).tar.gz
DEPTHAI_SITE_METHOD = tarball
DEPTHAI_LICENSE = MIT
DEPTHAI_LICENSE_FILES = LICENSE
# Define dependencies
DEPTHAI_DEPENDENCIES = host-cmake
# Extract and build steps
define DEPTHAI_BUILD_CMDS
(cd $(@D) && mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=$(TARGET_DIR)/usr .. && \
$(MAKE) && $(MAKE) install)
endef
# Install step
define DEPTHAI_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 $(@D)/build/depthai $(TARGET_DIR)/usr/bin/depthai
endef
# Register the package
$(eval $(generic-package))
This Makefile
handles downloading, building, and installing the DepthAI core library.
Step 4: Create a Config.in
File
- Inside the
depthai
directory, create a Config.in
file to allow enabling the package via Buildroot’s menu configuration:
config BR2_PACKAGE_DEPTHAI
bool "DepthAI"
help
DepthAI is the core library for using Luxonis OAK devices.
Step 5: Integrate with Buildroot
- Edit the
package/Config.in
file to include your DepthAI package:
source "package/depthai/Config.in"
Step 6: Configure and Build
- Run
make menuconfig
in the Buildroot directory.
- Navigate to your package and enable it.
- Run
make
to build your system with the DepthAI package included.
make sure you change the build calls with the ones from luxonis/depthai-core
Thanks,
Jaka