research: add map-ai.sh extracted from adacam device 2026-03-26

This commit is contained in:
kayos 2026-03-26 12:08:11 -07:00
parent 1f1694f01c
commit 03e02eb361

26
docs/map-ai/map-ai.sh Normal file
View file

@ -0,0 +1,26 @@
#!/bin/bash
COUNT_FILE="/tmp/map-ai-boots"
count=$(cat "$COUNT_FILE" 2>/dev/null || echo 0)
count=$((count + 1))
# write the new count
echo "$count" > "$COUNT_FILE"
systemctl stop depthai_gate
echo "Cleaning up process leftovers..."
sleep 2
# kill old instances and release the memory
pkill -9 -f map-ai.py
# pkill -9 -f gate_fw
# echo "Freeing up caches and CMA..."
# for i in {1..3}; do
# echo 1 > /proc/sys/vm/compact_memory
# sleep 1
# done
echo "Starting DepthAI Gate..."
systemctl restart depthai_gate
sleep 10
echo "Starting Map AI"
python3 -u /opt/map-ai/map-ai.py