-
Notifications
You must be signed in to change notification settings - Fork 1
/
launchAll.sh
executable file
·32 lines (28 loc) · 985 Bytes
/
launchAll.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
ROBOT=192.168.4.2
launchRobotStuff() {
echo "Issuing remote command!"
sshpass -p "rover" ssh rover@${ROBOT} "./startRobot.sh"
echo "Remote ending..."
}
launchLocalStuff() {
echo "Issuing local commands"
cd ~/school/rp2/streaming
source ~/school/rp2/venv/bin/activate
python ~/school/rp2/streaming/sender.py
deactivate
echo "Local ending..."
}
launchRobotStuff &
# Local stuff is sender; sender waits for trigger frame from receiver to start moving
# Receiver is started after ros; roughly 4.5 seconds to give ros initialization time to go.
launchLocalStuff &
wait $!
echo "Local is finished. "
#echo "Sleeping for up to 10 seconds, allowing remote to handle frame writing."
#sleep 10
#echo "Killing remote!"
#sshpass -p "rover" ssh rover@${ROBOT} "source killRobot.sh"
echo "Waiting for remote to finish..."
echo "If this takes too long, please check remote to see if anything has gone wrong."
echo "/home/rover/killRobot.sh script can fix this, probably."
wait