Files
Jetson/scripts/install_deps.sh
T
AngePierreandClaude Opus 5 23b30ac1e8 Add the MKV recorder so a node can Record, not only preview
The recorder was the gap: it is FTF's own customised SDK example (a 1139-line
K4A MKV writer), not a stock sample, and it lived only in one machine's build
tree. Bring its source into the repo and build it as part of install.

It writes K4A-format MKV — the format the rest of Ithaca reads — so it stays,
and gets its libk4a from the Orbbec K4A wrapper rather than Microsoft's Azure
Kinect SDK, which is set aside. build_k4a_wrapper.sh builds that wrapper;
build_sdk.sh injects the recorder into the SDK examples tree and builds it there
against the wrapper (it depends on the SDK's own cmake targets). Found by rpath
at runtime, so no LD_LIBRARY_PATH.

install.sh now builds wrapper -> SDK+recorder -> preview server, each reusing an
existing build so the Nano is untouched. If the wrapper is unavailable the
install still completes preview-only and says so.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 16:21:44 +02:00

36 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Installs the build- and run-time packages the node needs. Idempotent: apt is a
# no-op for what is already there.
#
# The set is the same across Jetson generations — only the distro release behind
# it changes (18.04 -> 22.04), and apt resolves the right versions itself. No
# GStreamer: the direct preview route encodes no video.
set -euo pipefail
here=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
eval "$("$here/detect_platform.sh")"
echo ">> Dependances pour JetPack ${JETPACK} (L4T ${L4T}, ${SOC})"
# python3 is present on every JetPack image; websockets is the only bridge dep and
# is pure Python, so it works identically everywhere. Prefer apt's package, fall
# back to pip when the distro is too old to carry it.
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
build-essential cmake pkg-config git \
libusb-1.0-0-dev libudev-dev liblz4-dev libjpeg-turbo8-dev \
libopencv-dev \
python3 python3-pip
# libopencv-dev: the MKV recorder links OpenCV (image handling). liblz4/libjpeg:
# the preview server. libusb/libudev: the SDK and the K4A wrapper.
if ! python3 -c 'import websockets' 2>/dev/null; then
echo ">> websockets absent — installation via pip"
# 8.1 is what the Nano runs and what bridge.py was written against; anything
# >=8 keeps the same asyncio API surface the bridge uses.
python3 -m pip install --user "websockets>=8,<13" || \
sudo apt-get install -y python3-websockets
fi
echo ">> Dependances OK"