-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
130 lines (109 loc) · 3.92 KB
/
setup.sh
File metadata and controls
130 lines (109 loc) · 3.92 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/bash
# script flags
basic=false
cyclone_perf=false
zed=false
unitree=false
docker_install=false
install_sys_deps_docker=false
config_groups=false
install_sys_deps=false
source_ros=false
obk_aliases=false
mujoco=false
for arg in "$@"; do
case $arg in
--dev-setup)
obk_aliases=true
cyclone_perf=true
docker_install=true
install_sys_deps_docker=true
basic=true
shift # Setup for development of Obelisk.
;;
--downstream-setup)
obk_aliases=true
cyclone_perf=true
basic=true
install_sys_deps=true
shift # Setup for downstream use of Obelisk - suggested to build this in a docker container.
;;
# Simulation options
--mujoco)
mujoco=true
shift # Enables Mujoco support
;;
# Hardware options
--zed)
zed=true
shift # Enables ZED SDK
;;
--unitree)
unitree=true
shift
;;
# help
--help)
echo "Usage: source setup.sh [OPTIONS]
Options:
--dev-setup Setup for development of Obelisk.
--downstream-setup Setup for downstream use of Obelisk - suggested to build this in a docker container.
Hardware options:
--zed Enables ZED SDK
--unitree Enables the unitree interfaces
Simulation options:
--mujoco Enables Mujoco simulation. For now, without this flag there will be no simulation of any type.
Other options:
--help Display this help message and exit
"
shift
return
;;
*)
# Unknown option
echo "Unknown option: $arg. Run 'source setup.sh --help' for more information."
return
;;
esac
done
# set OBELISK_ROOT to be the directory containing this script
export OBELISK_ROOT=$(dirname $(readlink -f ${BASH_SOURCE[0]}))
# docker setup
# if you want to use the ZED camera, you always need the local deps
# always set groups in docker for hardware, regardless of whether you're installing the deps
if [ "$install_sys_deps_docker" = true ]; then
source $OBELISK_ROOT/scripts/docker_setup.sh \
$([ "$docker_install" = true ] && echo "--docker-install") \
$([ "$basic" = true ] && echo "--docker-basic") \
$([ "$cyclone_perf" = true ] && echo "--docker-cyclone-perf") \
$([ "$zed" = true ] && echo "--docker-zed --docker-group-zed") \
$([ "$unitree" = true ] && echo "--docker-unitree") \
$([ "$mujoco" = true ] && echo "--docker-mujoco")
else
source $OBELISK_ROOT/scripts/docker_setup.sh \
$([ "$docker_install" = true ] && echo "--docker-install") \
$([ "$cyclone_perf" = true ] && echo "--docker-cyclone-perf") \
$([ "$zed" = true ] && echo "--docker-zed --docker-group-zed") \
$([ "$unitree" = true ] && echo "--docker-unitree") \
$([ "$mujoco" = true ] && echo "--docker-mujoco")
fi
# group configuration on host
if [ "$config_groups" = true ]; then
source $OBELISK_ROOT/scripts/config_groups.sh \
$([ "$zed" = true ] && echo "--zed")
fi
# system-level deps
if [ "$install_sys_deps" = true ]; then
source $OBELISK_ROOT/scripts/install_sys_deps.sh \
$([ "$basic" = true ] && echo "--basic") \
$([ "$cyclone_perf" = true ] && echo "--cyclone-perf") \
$([ "$source_ros" = true ] && echo "--source-ros") \
$([ "$zed" = true ] && echo "--zed") \
$([ "$unitree" = true ] && echo "--unitree")
fi
# run user-specific setup
source $OBELISK_ROOT/scripts/user_setup.sh \
$([ "$pixi" = true ] && echo "--pixi") \
$([ "$zed" = true ] && echo "--zed") \
$([ "$unitree" = true ] && echo "--unitree") \
$([ "$obk_aliases" = true ] && echo "--obk-aliases")