-
Notifications
You must be signed in to change notification settings - Fork 4
/
rose
executable file
·64 lines (59 loc) · 1.54 KB
/
rose
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
function run {
killall vlc eog &> /dev/null
python3 ./deploy/hephaestus/rose.py
latest_png=$(ls -t ./deploy/hephaestus/logs/*.png | head -n 1)
latest_avi=$(ls -t ./deploy/hephaestus/logs/*.avi | head -n 1)
if [ -n "$latest_png" ]; then
eog "$latest_png" &> /dev/null &
fi
if [ -n "$latest_avi" ]; then
vlc --no-qt-fs-controller "$latest_avi" &> /dev/null &
fi
}
function edit {
case $1 in
gym_conf)
gedit ./deploy/config/config_gym_InvertedPendulumFine-v4.yaml &> /dev/null &
;;
sim_conf)
gedit ./deploy/config/config_deploy_gym.yaml &> /dev/null &
;;
firesim_conf)
gedit ./soc/sim/config/config_runtime_local.yaml &> /dev/null &
;;
pid_sw)
gedit ./soc/sw/baremetal/inverted-pendulum-pid.c &> /dev/null &
;;
*)
echo "Unknown configuration. Please specify one of: gym_conf, sim_conf, firesim_conf, pid_sw"
;;
esac
}
function view_logs {
nautilus ./deploy/hephaestus/logs/ &> /dev/null &
}
function vm_ros {
marshal launch ./soc/sw/rose-images/ros-ubuntu.json
}
case $1 in
run)
run
;;
edit)
edit $2
;;
view)
view_logs
;;
vm)
if [ "$2" = "ros" ]; then
vm_ros
else
echo "Unknown VM command. Please specify one of: ros"
fi
;;
*)
echo "Unknown command. Please specify one of: run, edit, view, vm"
;;
esac