-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsingularity.def
More file actions
278 lines (219 loc) · 9.16 KB
/
singularity.def
File metadata and controls
278 lines (219 loc) · 9.16 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
Bootstrap: library
From: airl_lab/default/airl_env:base_2.0
%labels
Author maxime.allard@imperial.ac.uk
Version v0.1
%files
./resources/setup.sh /git/sferes2
../resources/hbr_repertoires/hbr_gp_repertoire.zip /git/sferes2
../resources/flat_repertoires/flat_8D_repertoire.zip /git/sferes2
../resources/flat_repertoires/flat_2D_repertoire.zip /git/sferes2
../resources/aprol_repertoires/aprol_repertoire.zip /git/sferes2
%post
export LD_LIBRARY_PATH="/workspace/lib:$LD_LIBRARY_PATH"
##INSTALLING PYTHON
apt-get update
##apt-get upgrade
DEBIAN_FRONTEND=noninteractive apt-get install -y python3-matplotlib python3-numpy python3-tk python3-dev python3-pip gdb -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y python-numpy python2.7-dev
apt-get install -y ffmpeg # For saving videos with robot_dart
apt-get install -y valgrind kcachegrind unzip
pip3 install seaborn pandas python-gitlab plotly -q
## INSTALLING LIMBO
cd /git
git clone https://github.com/resibots/limbo.git
cd limbo
./waf configure --prefix /workspace # general and initial configuration
./waf build
export GIT_SSL_NO_VERIFY=1
## INSTALLING MCTS LIBRARY
cd /git
git clone https://github.com/resibots/chatzilygeroudis_2018_rte.git
cd chatzilygeroudis_2018_rte/mcts
# add lines to the include files in order to prevent compilation error from missing libraries
sed -i "/mcts\/uct.hpp/a #include <random>" src/toy_sim.cpp
sed -i "/define MCTS_DEFAULTS_HPP/a #include <cmath>" include/mcts/defaults.hpp
python2 ./waf configure --prefix /workspace
python2 ./waf
python2 ./waf install
cd /git/sferes2/exp
#mkdir -p ./hte/resources/
mkdir -p ./HTE
cd /git/sferes2/
mkdir -p ./exp/resources/
unzip -o hbr_gp_repertoire.zip -d ./exp/resources/hbr_repertoires
unzip -o flat_8D_repertoire.zip -d ./exp/resources/flat_repertoires
unzip -o flat_2D_repertoire.zip -d ./exp/resources/flat_repertoires
unzip -o aprol_repertoire.zip -d ./exp/resources/aprol_repertoires
#cd ./hte/resources/hbr_repertoires
#unzip -o hbr_gp_repertoire.zip
#cd ../flat_repertoires
#unzip -o flat_8D_repertoire.zip
#unzip -o flat_2D_repertoire.zip
#cd ../aprol_repertoires
#unzip -o aprol_repertoire.zip
#====================================================================================================
exit 0 #NOTFORFINAL - the lines below this "exit" will be executed only when building the final image
#====================================================================================================
git clone --recurse-submodules https://github.com/adaptive-intelligent-robotics/HTE.git ./HTE
cd /git/sferes2/
./setup.sh
%runscript
if [ $# -gt 1 ]; then
echo "Invalid command. Please run 'singularity help <container name>' for help."
exit
fi
CURPATH=$(pwd)
if [ ! -d ./results ]; then
mkdir results
fi
cd /git/limbo/
if [ $# -eq 0 ]; then
./build/exp/HTE/hte_graphic
exit
fi
# running the experiment (the -d option allows to define the directory where the results should be stored
PATHNAME=$(date +%Y-%m-%d_%H_%M_%S)_$$
mkdir $CURPATH/results/$PATHNAME
%apprun low_dim
export HOME=/tmp/home
mkdir $HOME
D=$(/opt/TurboVNC/bin/vncserver 2>&1 | grep "Desktop" | awk '{print $3}' | sed 's/.*://g')
export DISPLAY=':'$D
CURPATH=$(pwd)
cd /git/sferes2/exp/HTE/
git log --decorate --oneline --graph master -n 30 > $CURPATH/git_log.txt
cd $CURPATH
if [ ! -d ./results ]; then
mkdir results
fi
cd /git/sferes2/
# running the experiment (the -d option allows to define the directory where the results should be stored
PATHNAME=$(date +%Y-%m-%d_%H_%M_%S)_$$_$1
ARCHIVE_NR=$1
mkdir $CURPATH/results/$PATHNAME
#cp exp/HTE/python/analysis_hexa_omni.py $CURPATH/results/$PATHNAME
#build/exp/HTE/low_dim_graphic -d $CURPATH/results/$PATHNAME
for i in 0 1 2 3 4 5 6
do
echo $i
mkdir $CURPATH/results/$PATHNAME/$i
build/exp/HTE/low_dim_graphic -d $CURPATH/results/$PATHNAME/$i -l $i -r $ARCHIVE_NR 2>/dev/null
done
%apprun high_dim
export HOME=/tmp/home
mkdir $HOME
D=$(/opt/TurboVNC/bin/vncserver 2>&1 | grep "Desktop" | awk '{print $3}' | sed 's/.*://g')
export DISPLAY=':'$D
CURPATH=$(pwd)
cd /git/sferes2/exp/HTE/
git log --decorate --oneline --graph master -n 30 > $CURPATH/git_log.txt
cd $CURPATH
if [ ! -d ./results ]; then
mkdir results
fi
cd /git/sferes2/
# running the experiment (the -d option allows to define the directory where the results should be stored
PATHNAME=$(date +%Y-%m-%d_%H_%M_%S)_$$_$1
ARCHIVE_NR=$1
mkdir $CURPATH/results/$PATHNAME
#cp exp/HTE/python/analysis_hexa_omni.py $CURPATH/results/$PATHNAME
#build/exp/HTE/high_dim_graphic -d $CURPATH/results/$PATHNAME
for i in 0 1 2 3 4 5 6
do
echo $i
mkdir $CURPATH/results/$PATHNAME/$i
build/exp/HTE/high_dim_graphic -d $CURPATH/results/$PATHNAME/$i -r $ARCHIVE_NR -l $i 2>/dev/null
done
%apprun hbr_simu
export HOME=/tmp/home
mkdir $HOME
D=$(/opt/TurboVNC/bin/vncserver 2>&1 | grep "Desktop" | awk '{print $3}' | sed 's/.*://g')
export DISPLAY=':'$D
CURPATH=$(pwd)
cd /git/sferes2/exp/HTE/
git log --decorate --oneline --graph master -n 30 > $CURPATH/git_log.txt
cd $CURPATH
if [ ! -d ./results ]; then
mkdir results
fi
cd /git/sferes2/
# running the experiment (the -d option allows to define the directory where the results should be stored
PATHNAME=$(date +%Y-%m-%d_%H_%M_%S)_$$_$1
ARCHIVE_NR=$1
mkdir $CURPATH/results/$PATHNAME
#cp exp/HTE/python/analysis_hexa_omni.py $CURPATH/results/$PATHNAME
#build/exp/HTE/hte -d $CURPATH/results/$PATHNAME "$@"
for i in 0 1 2 3 4 5 6
do
echo $i
mkdir $CURPATH/results/$PATHNAME/$i
build/exp/HTE/hte -d $CURPATH/results/$PATHNAME/$i -l $i -r $ARCHIVE_NR 2>/dev/null
done
%apprun aprol
export HOME=/tmp/home
mkdir $HOME
D=$(/opt/TurboVNC/bin/vncserver 2>&1 | grep "Desktop" | awk '{print $3}' | sed 's/.*://g')
export DISPLAY=':'$D
CURPATH=$(pwd)
cd /git/sferes2/exp/HTE/
git log --decorate --oneline --graph master -n 30 > $CURPATH/git_log.txt
cd $CURPATH
if [ ! -d ./results ]; then
mkdir results
fi
cd /git/sferes2/
# running the experiment (the -d option allows to define the directory where the results should be stored
PATHNAME=$(date +%Y-%m-%d_%H_%M_%S)_$$_$1
ARCHIVE_NR=$1
mkdir $CURPATH/results/$PATHNAME
#cp exp/HTE/python/analysis_hexa_omni.py $CURPATH/results/$PATHNAME
#build/exp/HTE/aprol_graphic -d $CURPATH/results/$PATHNAME
for i in 0 1 2 3 4 5 6
do
echo $i
mkdir $CURPATH/results/$PATHNAME/$i
build/exp/HTE/aprol_graphic -d $CURPATH/results/$PATHNAME/$i -r $ARCHIVE_NR -l $i 2>/dev/null
done
%apprun acceleration_gp_legs
export HOME=/tmp/home
mkdir $HOME
D=$(/opt/TurboVNC/bin/vncserver 2>&1 | grep "Desktop" | awk '{print $3}' | sed 's/.*://g')
export DISPLAY=':'$D
CURPATH=$(pwd)
cd /git/sferes2/exp/HTE/
git log --decorate --oneline --graph master -n 30 > $CURPATH/git_log.txt
cd $CURPATH
if [ ! -d ./results ]; then
mkdir results
fi
cd /git/sferes2/
# running the experiment (the -d option allows to define the directory where the results should be stored
PATHNAME=$(date +%Y-%m-%d_%H_%M_%S)_$$
mkdir $CURPATH/results/$PATHNAME
#cp exp/HTE/python/analysis_hexa_omni.py $CURPATH/results/$PATHNAME
build/exp/HTE/acceleration_gp_legs -d $CURPATH/results/$PATHNAME
module load anaconda3/personal
cd $CURPATH/results/$PATHNAME
#python analysis_hexa_omni.py
%apprun gen_job_scripts
echo "Generating job scripts"
python3 /git/sferes2/exp/HTE/submodules/gitlab_notebook/gen_job_script.py "$@"
%apprun analysis
python3 /git/sferes2/exp/HTE/python/analysis.py "$@"
CURPATH=$(pwd)
cd /git/sferes2/exp/HTE/
git log --decorate --oneline --graph master -n 30 > $CURPATH/git_log.txt
python3 ./submodules/gitlab_notebook/gen_report.py $CURPATH
%apprun analysis_damage
python3 /git/sferes2/exp/HTE/python/analysis_damage.py "$@"
CURPATH=$(pwd)
cd /git/sferes2/exp/HTE/
git log --decorate --oneline --graph master -n 30 > $CURPATH/git_log.txt
python3 ./submodules/gitlab_notebook/gen_report.py $CURPATH
%help
This is the development and running environment of the RTE_hexapod.
Run executable image with no arugument and turn on a visualisation server window to see the hexapod in simulation navigating map_2.txt.
The hexapod uses an behavioural repertoire (archive) generated through the MAP-Elites algorithm to obtain behaviorus to move in all directions.
The second part of this algorihtm is when the robot using its learnt behaviours from the repertoire to autonmously navigate the map/environment.
The second part of this algorihtm makes use of the A* path plannign algorithm which guides a Monte Carlo Tree Search (MCTS) to navigate to desired end position.