@@ -40,7 +40,8 @@ TEST_RUN=false
4040# The PolyScopeX URSim containers follow the SDK versioning scheme. This maps those to marketing
4141# versions
4242declare -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" )
4445
4546help ()
4647{
4950 echo
5051 echo " Syntax: ` basename " $0 " ` [-m|s|h]"
5152 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."
5354 echo " -v <version> URSim version that should be used.
5455 See https://hub.docker.com/r/universalrobots/ursim_e-series/tags
5556 for available versions. Defaults to 'latest'"
@@ -89,10 +90,10 @@ get_series_from_model()
8990 ur3|ur5|ur10)
9091 ROBOT_SERIES=cb3
9192 ;;
92- ur3e|ur5e|ur10e|ur16e)
93+ ur3e|ur5e|ur7e| ur10e|ur12e |ur16e)
9394 ROBOT_SERIES=e-series
9495 ;;
95- ur20|ur30)
96+ ur15| ur20|ur30)
9697 ROBOT_SERIES=e-series
9798 ;;
9899 * )
@@ -131,9 +132,15 @@ strip_robot_model()
131132 ROBOT_MODEL=${robot_model^^}
132133 else
133134 ROBOT_MODEL=${robot_model^^}
134- # UR20 and UR30 need no further adjustment
135+ # UR15, UR20 and UR30 need no further adjustment
135136 if [[ " $robot_model " = @ (ur3e| ur5e| ur10e| ur16e) ]]; then
136137 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
137144 fi
138145 fi
139146}
@@ -144,19 +151,31 @@ strip_robot_model()
144151# - ROBOT_SERIES
145152validate_parameters ()
146153{
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
156154 local MIN_CB3=" 3.14.3"
157155 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"
158159 local MIN_UR20=" 5.14.0"
159160 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
160179
161180 local MIN_VERSION=" 0.0"
162181
@@ -166,37 +185,45 @@ validate_parameters()
166185 if [[ $ROBOT_MODEL != @ (ur3| ur5| ur10) ]]; then
167186 echo " $ROBOT_MODEL is no valid CB3 model!" && exit 1
168187 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
171190 ;;
172191 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
174193 echo " $ROBOT_MODEL is no valid e-series model!" && exit 1
175194 fi
176- if [[ $ROBOT_MODEL == " ur20" ]]; then
195+ if [[ $ROBOT_MODEL == " ur15" ]]; then
196+ MIN_VERSION=$MIN_UR15
197+ elif [[ $ROBOT_MODEL == " ur20" ]]; then
177198 MIN_VERSION=$MIN_UR20
178199 elif [[ $ROBOT_MODEL == " ur30" ]]; then
179200 MIN_VERSION=$MIN_UR30
201+ elif [[ $ROBOT_MODEL == " ur7e" || $ROBOT_MODEL == " ur12e" ]]; then
202+ MIN_VERSION=$MIN_UR7e
180203 else
181204 MIN_VERSION=$MIN_E_SERIES
182205 fi
183206 ;;
184207 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"
187210 exit 1
188211 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
190213 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
191218 else
192- return 0
219+ MIN_VERSION= $MIN_POLYSCOPE_X
193220 fi
194221 ;;
195222 esac
196223
197- verlte " $MIN_VERSION " " $URSIM_VERSION " && return 0
224+ verlte " $MIN_VERSION " " $URSIM_VERSION_CHECK " && return 0
198225
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 ."
200227 exit 1
201228}
202229
@@ -348,6 +375,18 @@ fill_information() {
348375 fi
349376}
350377
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+
351390test_input_handling () {
352391 parse_arguments " $@ "
353392 fill_information
@@ -357,6 +396,7 @@ test_input_handling() {
357396 echo " ROBOT_SERIES: $ROBOT_SERIES "
358397 echo " URSIM_VERSION: $URSIM_VERSION "
359398
399+ TEST_RUN=true
360400 validate_parameters
361401}
362402
@@ -365,6 +405,7 @@ main() {
365405
366406
367407 fill_information
408+ get_version_from_latest
368409
369410 echo " ROBOT_MODEL: $ROBOT_MODEL "
370411 echo " ROBOT_SERIES: $ROBOT_SERIES "
@@ -409,10 +450,14 @@ main() {
409450 mkdir -p " ${PROGRAM_STORAGE} "
410451 PROGRAM_STORAGE=$( realpath " $PROGRAM_STORAGE " )
411452
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+
412456 docker_cmd=" docker run --rm -d \
413457 --net ursim_net --ip $IP_ADDRESS \
414458 -v ${PROGRAM_STORAGE} :/ur/bin/backend/applications \
415459 -e ROBOT_TYPE=${ROBOT_MODEL} \
460+ $ROBOT_MODEL_CONTROLLER_FLAG \
416461 $PORT_FORWARDING \
417462 $DOCKER_ARGS \
418463 --name $CONTAINER_NAME \
0 commit comments