Commit e369cfaf authored by Pierre Bürki's avatar Pierre Bürki
Browse files

Use xvfb to run without display

parent 54dbd21c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
#!/bin/bash

# install dependencies
apt -y install curl libglfw3{,-dev} libglew-dev libopencv-{core,imgproc,objdetect}-dev libfreeimage-dev libboost-filesystem-dev libpugixml-dev libopenni{,2}-dev
apt -y install curl libglfw3{,-dev} libglew-dev libopencv-{core,imgproc,objdetect}-dev libfreeimage-dev libboost-filesystem-dev libpugixml-dev libopenni{,2}-dev xvfb
# remove automatically installed package -y
apt -y purge openni-utils -y

+7 −23
Original line number Diff line number Diff line
#!/bin/bash

DIR=`dirname $0`
DIR=`dirname "$0"`

MODEL=$($DIR/../realsense-model)
echo "Model : $MODEL"

if [ "$MODEL" = "D435" ]; then
	COMMAND=the-hole-blob-tracker
elif [ "$MODEL" = "D415" ]; then
	COMMAND=the-hole-skeleton-tracker
else
	echo "No RealSense camera detected. Exiting ..."
	exit 1
fi

export LD_LIBRARY_PATH="/usr/local/lib/nuitrack"
while :
do
	$DIR/../$COMMAND
	if [ $? -eq 0 ]
if [ ! -z "$(xrandr --query | grep 'DP-1 disconnected')" ]
then
		echo "Tracker closed. Assuming from the calibrator. Relaunching in 20 seconds"
		sleep 20
	# No active display, running through xvfb
	xvfb-run $DIR/tracker.sh
else
		echo "Tracker crashed. Attempting to relaunch in 1 second"
		sleep 1
	# Screen connected, running directly
	$DIR/tracker.sh
fi
done

scripts/tracker.sh

0 → 100644
+30 −0
Original line number Diff line number Diff line
#!/bin/bash

DIR=`dirname $0`

MODEL=$($DIR/../realsense-model)
echo "Model : $MODEL"

if [ "$MODEL" = "D435" ]; then
	COMMAND=the-hole-blob-tracker
elif [ "$MODEL" = "D415" ]; then
	COMMAND=the-hole-skeleton-tracker
else
	echo "No RealSense camera detected. Exiting ..."
	exit 1
fi

export LD_LIBRARY_PATH="/usr/local/lib/nuitrack"
while :
do
	$DIR/../$COMMAND 2>> $DIR/log

	if [ $? -eq 0 ]
	then
		echo "Tracker closed. Assuming from the calibrator. Relaunching in 20 seconds"
		sleep 20
	else
		echo "Tracker crashed. Attempting to relaunch in 1 second"
		sleep 1
	fi
done