Skip to content

Commit

Permalink
Add program directory at correct location also when no model is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
fmauch authored and VinDp committed Jun 3, 2024
1 parent 97af030 commit 0ca64c2
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions scripts/start_ursim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ help()
See https://hub.docker.com/r/universalrobots/ursim_e-series/tags
for available versions. Defaults to 'latest'"
echo " -p <folder> Location from which programs are read / to which programs are written.
If not specified, will fallback to ${PERSISTENT_BASE}/${ROBOT_SERIES}/programs"
If not specified, will fallback to ${PERSISTENT_BASE}/${ROBOT_SERIES}/${ROBOT_MODEL}/programs"
echo " -u <folder> Location from which URCaps are read / to which URCaps are written.
If not specified, will fallback to ${PERSISTENT_BASE}/${ROBOT_SERIES}/urcaps"
echo " -d Detached mode - start in backgound"
echo " -h Print this Help."
echo
}

ROBOT_MODEL=UR5
ROBOT_MODEL=ur5e
ROBOT_SERIES=e-series
URSIM_VERSION=latest
DETACHED=false
Expand Down Expand Up @@ -138,16 +138,15 @@ while getopts ":hm:v:p:u:d" option; do
exit;;
m) # robot model
ROBOT_MODEL=${OPTARG}
validate_model
;;
v) # ursim_version
URSIM_VERSION=${OPTARG}
;;
p) # program_folder
PROGRAM_STORAGE=${OPTARG}
PROGRAM_STORAGE_ARG=${OPTARG}
;;
u) # urcaps_folder
URCAP_STORAGE=${OPTARG}
URCAP_STORAGE_ARG=${OPTARG}
;;
d) # detached mode
DETACHED=true
Expand All @@ -158,8 +157,16 @@ while getopts ":hm:v:p:u:d" option; do
exit;;
esac
done
validate_model
validate_ursim_version

if [ -n "$PROGRAM_STORAGE_ARG" ]; then
PROGRAM_STORAGE="$PROGRAM_STORAGE_ARG"
fi
if [ -n "$URCAP_STORAGE_ARG" ]; then
URCAP_STORAGE="$URCAP_STORAGE_ARG"
fi

# Create local storage for programs and URCaps
mkdir -p "${URCAP_STORAGE}"
mkdir -p "${PROGRAM_STORAGE}"
Expand Down

0 comments on commit 0ca64c2

Please sign in to comment.