@@ -40,7 +40,8 @@ TEST_RUN=false
40
40
# The PolyScopeX URSim containers follow the SDK versioning scheme. This maps those to marketing
41
41
# versions
42
42
declare -Ag POLYSCOPE_X_MAP=( [" 10.7.0" ]=" 0.12.159"
43
- [" 10.8.0" ]=" 0.13.124" )
43
+ [" 10.8.0" ]=" 0.13.124"
44
+ [" 10.9.0" ]=" 0.14.47" )
44
45
45
46
help ()
46
47
{
49
50
echo
50
51
echo " Syntax: ` basename " $0 " ` [-m|s|h]"
51
52
echo " options:"
52
- echo " -m <model> Robot model. One of [ur3, ur3e, ur5, ur5e, ur10 , ur10e, ur16e, ur20, ur30]. Defaults to ur5e."
53
+ echo " -m <model> Robot model. One of [ur3, ur3e, ur5, ur5e, ur7e , ur10e, ur12e, ur16e, ur15 , ur20, ur30]. Defaults to ur5e."
53
54
echo " -v <version> URSim version that should be used.
54
55
See https://hub.docker.com/r/universalrobots/ursim_e-series/tags
55
56
for available versions. Defaults to 'latest'"
@@ -89,10 +90,10 @@ get_series_from_model()
89
90
ur3|ur5|ur10)
90
91
ROBOT_SERIES=cb3
91
92
;;
92
- ur3e|ur5e|ur10e|ur16e)
93
+ ur3e|ur5e|ur7e| ur10e|ur12e |ur16e)
93
94
ROBOT_SERIES=e-series
94
95
;;
95
- ur20|ur30)
96
+ ur15| ur20|ur30)
96
97
ROBOT_SERIES=e-series
97
98
;;
98
99
* )
@@ -131,9 +132,15 @@ strip_robot_model()
131
132
ROBOT_MODEL=${robot_model^^}
132
133
else
133
134
ROBOT_MODEL=${robot_model^^}
134
- # UR20 and UR30 need no further adjustment
135
+ # UR15, UR20 and UR30 need no further adjustment
135
136
if [[ " $robot_model " = @ (ur3e| ur5e| ur10e| ur16e) ]]; then
136
137
ROBOT_MODEL=$( echo " ${ROBOT_MODEL: 0: $((${# ROBOT_MODEL} -1))} " )
138
+ elif [[ " $robot_model " = @ (ur7e| ur12e) ]]; then
139
+ if [[ " $robot_series " == " polyscopex" ]]; then
140
+ ROBOT_MODEL=$( echo " ${ROBOT_MODEL: 0: $((${# ROBOT_MODEL} -1))} " )
141
+ else
142
+ ROBOT_MODEL=$( echo " ${ROBOT_MODEL: 0: $((${# ROBOT_MODEL} -1))} e" )
143
+ fi
137
144
fi
138
145
fi
139
146
}
@@ -144,19 +151,31 @@ strip_robot_model()
144
151
# - ROBOT_SERIES
145
152
validate_parameters ()
146
153
{
147
- local IMAGE_URSIM_VERSION
148
- # Inspect the image's URSim version if the image is locally available. This is especially
149
- # important when we use the "latest" tag, as we don't know the version hiding behind this and it
150
- # could be potentially older.
151
- IMAGE_URSIM_VERSION=$( docker image inspect universalrobots/ursim_" ${ROBOT_SERIES} " :" $URSIM_VERSION " 2> /dev/null | grep -Po ' "build_version": "URSim Version: \K[^"]*' ) || true
152
- if [ -z " $IMAGE_URSIM_VERSION " ]; then
153
- IMAGE_URSIM_VERSION=" $URSIM_VERSION "
154
- fi
155
- [ " $IMAGE_URSIM_VERSION " == " latest" ] && return 0
156
154
local MIN_CB3=" 3.14.3"
157
155
local MIN_E_SERIES=" 5.9.4"
156
+ local MIN_UR15=" 5.22.0"
157
+ local MIN_UR15_X=" 10.8.0"
158
+ local MIN_POLYSCOPE_X=" 10.7.0"
158
159
local MIN_UR20=" 5.14.0"
159
160
local MIN_UR30=" 5.15.0"
161
+ local MIN_UR7e=" 5.22.0" # and UR12e
162
+ local MIN_UR7e_X=" 10.9.0" # and UR12e
163
+
164
+ local URSIM_VERSION_CHECK=" $URSIM_VERSION "
165
+ if [[ " $URSIM_VERSION " == " latest" ]]; then
166
+ if [[ " $ROBOT_SERIES " == " cb3" ]]; then
167
+ URSIM_VERSION_CHECK=" $MIN_CB3 "
168
+ elif [[ " $ROBOT_SERIES " == " e-series" ]]; then
169
+ URSIM_VERSION_CHECK=" $MIN_UR15 "
170
+ elif [[ " $ROBOT_SERIES " == " polyscopex" ]]; then
171
+ URSIM_VERSION_CHECK=" MIN_UR15_X"
172
+ fi
173
+ fi
174
+
175
+ if ! [[ " $URSIM_VERSION_CHECK " =~ [0-9]+\. [0-9]+\. [0-9]+ ]]; then
176
+ echo " Invalid URSim version given. Must be in the format X.Y.Z. Given: $URSIM_VERSION_CHECK "
177
+ exit 1
178
+ fi
160
179
161
180
local MIN_VERSION=" 0.0"
162
181
@@ -166,37 +185,45 @@ validate_parameters()
166
185
if [[ $ROBOT_MODEL != @ (ur3| ur5| ur10) ]]; then
167
186
echo " $ROBOT_MODEL is no valid CB3 model!" && exit 1
168
187
fi
169
- verlte " 4.0.0" " $IMAGE_URSIM_VERSION " && echo " $IMAGE_URSIM_VERSION is no valid CB3 version!" && exit 1
170
- verlte " $MIN_CB3 " " $IMAGE_URSIM_VERSION " && return 0
188
+ verlte " 4.0.0" " $URSIM_VERSION_CHECK " && echo " $URSIM_VERSION_CHECK is no valid CB3 version!" && exit 1
189
+ verlte " $MIN_CB3 " " $URSIM_VERSION_CHECK " && return 0
171
190
;;
172
191
e-series)
173
- if [[ $ROBOT_MODEL != @ (ur3e| ur5e| ur10e| ur16e| ur20| ur30) ]]; then
192
+ if [[ $ROBOT_MODEL != @ (ur3e| ur5e| ur7e | ur10e| ur12e | ur16e| ur15 | ur20| ur30) ]]; then
174
193
echo " $ROBOT_MODEL is no valid e-series model!" && exit 1
175
194
fi
176
- if [[ $ROBOT_MODEL == " ur20" ]]; then
195
+ if [[ $ROBOT_MODEL == " ur15" ]]; then
196
+ MIN_VERSION=$MIN_UR15
197
+ elif [[ $ROBOT_MODEL == " ur20" ]]; then
177
198
MIN_VERSION=$MIN_UR20
178
199
elif [[ $ROBOT_MODEL == " ur30" ]]; then
179
200
MIN_VERSION=$MIN_UR30
201
+ elif [[ $ROBOT_MODEL == " ur7e" || $ROBOT_MODEL == " ur12e" ]]; then
202
+ MIN_VERSION=$MIN_UR7e
180
203
else
181
204
MIN_VERSION=$MIN_E_SERIES
182
205
fi
183
206
;;
184
207
polyscopex)
185
- if [[ ! " ${POLYSCOPE_X_MAP[${URSIM_VERSION }]+_} " ]]; then
186
- echo " URSim version $URSIM_VERSION is unfortunately not supported"
208
+ if [[ ! " ${POLYSCOPE_X_MAP[${URSIM_VERSION_CHECK }]+_} " ]]; then
209
+ echo " URSim version $URSIM_VERSION_CHECK is unfortunately not supported"
187
210
exit 1
188
211
fi
189
- if [[ $ROBOT_MODEL != @ (ur3e| ur5e| ur10e| ur16e| ur20| ur30) ]]; then
212
+ if [[ $ROBOT_MODEL != @ (ur3e| ur5e| ur7e | ur10e| ur12e | ur16e| ur15 | ur20| ur30) ]]; then
190
213
echo " $ROBOT_MODEL is no valid PolyscopeX model!" && exit 1
214
+ elif [[ $ROBOT_MODEL == " ur7e" || $ROBOT_MODEL == " ur12e" ]]; then
215
+ MIN_VERSION=$MIN_UR7e_X
216
+ elif [[ $ROBOT_MODEL == " ur15" ]]; then
217
+ MIN_VERSION=$MIN_UR15_X
191
218
else
192
- return 0
219
+ MIN_VERSION= $MIN_POLYSCOPE_X
193
220
fi
194
221
;;
195
222
esac
196
223
197
- verlte " $MIN_VERSION " " $URSIM_VERSION " && return 0
224
+ verlte " $MIN_VERSION " " $URSIM_VERSION_CHECK " && return 0
198
225
199
- echo " Illegal version given. For $ROBOT_SERIES $ROBOT_MODEL the software version must be greater or equal to $MIN_VERSION . Given version: $IMAGE_URSIM_VERSION ."
226
+ echo " Illegal version given. For $ROBOT_SERIES $ROBOT_MODEL the software version must be greater or equal to $MIN_VERSION . Given version: $URSIM_VERSION ."
200
227
exit 1
201
228
}
202
229
@@ -348,6 +375,18 @@ fill_information() {
348
375
fi
349
376
}
350
377
378
+ get_version_from_latest ()
379
+ {
380
+ local IMAGE_URSIM_VERSION
381
+ # Inspect the image's URSim version if the image is locally available. This is especially
382
+ # important when we use the "latest" tag, as we don't know the version hiding behind this and it
383
+ # could be potentially older.
384
+ IMAGE_URSIM_VERSION=$( docker image inspect universalrobots/ursim_" ${ROBOT_SERIES} " :" $URSIM_VERSION " 2> /dev/null | grep -Po ' "build_version": "URSim Version: \K[^"]*' ) || true
385
+ if [ -n " $IMAGE_URSIM_VERSION " ]; then
386
+ URSIM_VERSION=" $IMAGE_URSIM_VERSION "
387
+ fi
388
+ }
389
+
351
390
test_input_handling () {
352
391
parse_arguments " $@ "
353
392
fill_information
@@ -357,6 +396,7 @@ test_input_handling() {
357
396
echo " ROBOT_SERIES: $ROBOT_SERIES "
358
397
echo " URSIM_VERSION: $URSIM_VERSION "
359
398
399
+ TEST_RUN=true
360
400
validate_parameters
361
401
}
362
402
@@ -365,6 +405,7 @@ main() {
365
405
366
406
367
407
fill_information
408
+ get_version_from_latest
368
409
369
410
echo " ROBOT_MODEL: $ROBOT_MODEL "
370
411
echo " ROBOT_SERIES: $ROBOT_SERIES "
@@ -409,10 +450,14 @@ main() {
409
450
mkdir -p " ${PROGRAM_STORAGE} "
410
451
PROGRAM_STORAGE=$( realpath " $PROGRAM_STORAGE " )
411
452
453
+ ROBOT_MODEL_CONTROLLER_FLAG=" "
454
+ verlte " ${POLYSCOPE_X_MAP[10.7.0]} " " $URSIM_VERSION " && verlte " $URSIM_VERSION " " ${POLYSCOPE_X_MAP[10.8.0]} " && ROBOT_MODEL_CONTROLLER_FLAG=" -e ROBOT_TYPE_CONTROLLER=${ROBOT_MODEL} "
455
+
412
456
docker_cmd=" docker run --rm -d \
413
457
--net ursim_net --ip $IP_ADDRESS \
414
458
-v ${PROGRAM_STORAGE} :/ur/bin/backend/applications \
415
459
-e ROBOT_TYPE=${ROBOT_MODEL} \
460
+ $ROBOT_MODEL_CONTROLLER_FLAG \
416
461
$PORT_FORWARDING \
417
462
$DOCKER_ARGS \
418
463
--name $CONTAINER_NAME \
0 commit comments