Skip to content

Commit 0ca64c2

Browse files
Felix ExnerVinDp
authored andcommitted
Add program directory at correct location also when no model is provided
1 parent 97af030 commit 0ca64c2

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

scripts/start_ursim.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ help()
4343
See https://hub.docker.com/r/universalrobots/ursim_e-series/tags
4444
for available versions. Defaults to 'latest'"
4545
echo " -p <folder> Location from which programs are read / to which programs are written.
46-
If not specified, will fallback to ${PERSISTENT_BASE}/${ROBOT_SERIES}/programs"
46+
If not specified, will fallback to ${PERSISTENT_BASE}/${ROBOT_SERIES}/${ROBOT_MODEL}/programs"
4747
echo " -u <folder> Location from which URCaps are read / to which URCaps are written.
4848
If not specified, will fallback to ${PERSISTENT_BASE}/${ROBOT_SERIES}/urcaps"
4949
echo " -d Detached mode - start in backgound"
5050
echo " -h Print this Help."
5151
echo
5252
}
5353

54-
ROBOT_MODEL=UR5
54+
ROBOT_MODEL=ur5e
5555
ROBOT_SERIES=e-series
5656
URSIM_VERSION=latest
5757
DETACHED=false
@@ -138,16 +138,15 @@ while getopts ":hm:v:p:u:d" option; do
138138
exit;;
139139
m) # robot model
140140
ROBOT_MODEL=${OPTARG}
141-
validate_model
142141
;;
143142
v) # ursim_version
144143
URSIM_VERSION=${OPTARG}
145144
;;
146145
p) # program_folder
147-
PROGRAM_STORAGE=${OPTARG}
146+
PROGRAM_STORAGE_ARG=${OPTARG}
148147
;;
149148
u) # urcaps_folder
150-
URCAP_STORAGE=${OPTARG}
149+
URCAP_STORAGE_ARG=${OPTARG}
151150
;;
152151
d) # detached mode
153152
DETACHED=true
@@ -158,8 +157,16 @@ while getopts ":hm:v:p:u:d" option; do
158157
exit;;
159158
esac
160159
done
160+
validate_model
161161
validate_ursim_version
162162

163+
if [ -n "$PROGRAM_STORAGE_ARG" ]; then
164+
PROGRAM_STORAGE="$PROGRAM_STORAGE_ARG"
165+
fi
166+
if [ -n "$URCAP_STORAGE_ARG" ]; then
167+
URCAP_STORAGE="$URCAP_STORAGE_ARG"
168+
fi
169+
163170
# Create local storage for programs and URCaps
164171
mkdir -p "${URCAP_STORAGE}"
165172
mkdir -p "${PROGRAM_STORAGE}"

0 commit comments

Comments
 (0)