In our lab we mostly use v-rep for developing plugins and one feature that we are missing a lot, is possibility to launch v-rep and automatically load a scene. E.g. something like this:
Code: Select all
./vrep -f myscene.ttt
Code: Select all
./vrep -f myscene.ttt
Code: Select all
15,24c15
< if [ -f $1 ]
< then
< if [ -f "$PWD/$1" ]
< then
< SCENE="$PWD/$1 "
< shift
< fi
< fi
<
< LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$dirname
---
> LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$dirname"
26c17,19
< "$dirname/$appname" ${SCENE}${1+"$@"}
---
> "$dirname/$appname" "$@"
>
>
Code: Select all
#!/bin/sh
thisscript="$0"
while [ -L "$thisscript" ]; do
thisscript="`readlink "$thisscript"`"
done
dirname=`dirname "$thisscript"`
if [ $dirname = "." ]; then
dirname="$PWD"
fi
appname="`basename "$thisscript" | sed 's,\.sh$,,'`"
if [ -f $1 ]
then
if [ -f "$PWD/$1" ]
then
SCENE="$PWD/$1 "
shift
fi
fi
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$dirname
export LD_LIBRARY_PATH
"$dirname/$appname" ${SCENE}${1+"$@"}
Code: Select all
#!/bin/bash
thisscript="$0"
while [ -L "$thisscript" ]; do
thisscript="`readlink "$thisscript"`"
done
dirname=`dirname "$thisscript"`
if [ $dirname = "." ]; then
dirname="$PWD"
fi
appname="`basename "$thisscript" | sed 's,\.sh$,,'`"
PARAMETERS=( ${@} )
FILE_PATTERN='*ttt'
for i in `seq 0 $(( ${#PARAMETERS[@]} -1 ))`
do
if [ -f "${PARAMETERS[$i]}" ] && [[ "${PARAMETERS[$i]}" == $FILE_PATTERN ]]
then
if [ -f "$PWD/${PARAMETERS[$i]}" ]
then
PARAMETERS[$i]="$PWD/${PARAMETERS[$i]}"
fi
fi
done
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$dirname
export LD_LIBRARY_PATH
"$dirname/$appname" "${PARAMETERS[@]}"