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

Update scripts

parent 57372eef
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -3,8 +3,11 @@
# Find the process of the tracker using the camera
PID=`pgrep the-hole`

if [ ! -z $PID ]
then
	# Kill tracker (15 = SIGTERM)
	sudo kill -15 $PID
fi

# Run calibrator
/home/encor/thehole/the-hole-calibrator
+13 −5
Original line number Diff line number Diff line
@@ -8,6 +8,17 @@ Exec=lxterminal -e "/home/encor/thehole/scripts/startup.sh"
Terminal=true
EOF

# set the calibration tool to launch on calib session open
sudo mkdir -p ~calib/.config/autostart
cat << EOF | sudo tee ~calib/.config/autostart/theholecalib.desktop > /dev/null
[Desktop Entry]
Name=The Hole Calibration
Type=Application
Exec=lxterminal -e "/home/encor/thehole/scripts/calibration.sh"
Terminal=true
EOF
sudo chown -R calib:calib ~calib/.config

# Prevent auto-sleep
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

@@ -30,9 +41,6 @@ sudo adduser calib sudo

sudo chown -R encor:thehole ~encor/thehole

# Allow anyone in groupe thehole to kill each other's processes
echo "%thehole localhost=(%thehole) NOPASSWD:/bin/kill" | sudo EDITOR="tee -a" visudo

# install xRDP for remote control
# thanks to https://askubuntu.com/questions/580415/how-to-remote-desktop-from-windows-to-lubuntu
# for the black screen fix
@@ -44,6 +52,6 @@ echo "lxsession -e LDXE -s Lubuntu" | sudo tee ~calib/.xsession > /dev/null

# Add desktop shortcut for calibration
sudo mkdir ~calib/Desktop
sudo cp scripts/Calibration\ tool ~calib/Desktop
sudo cp scripts/calibration.sh ~calib/Desktop
sudo chown -R calib:calib ~calib/Desktop
sudo chmod a+x ~calib/Desktop/Calibration\ tool
sudo chmod a+x ~calib/Desktop/calibration.sh
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ chmod a+x the-hole* realsense-model scripts/*.sh
scripts/install_deps.sh
scripts/configure.sh

echo
echo "You should run nuitrack_license_tool to activate a D415 camera on this computer if you intend to use it."
echo "Setup done. Run ~/thehole/scripts/startup.sh to test the tracker."
echo "Calibrate this station from the Windows PC by connecting to the following address :"
+11 −6
Original line number Diff line number Diff line
@@ -14,11 +14,16 @@ else
	exit 1
fi

# Save PID for interruptions due to calibration
echo $$ > $DIR/pid

export LD_LIBRARY_PATH="/usr/local/lib/nuitrack"
until $DIR/../$COMMAND; do
	echo "Tracker crashed. Relaunching in 1 second"
while :
do
	$DIR/../$COMMAND
	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