Feed in array from command line as -g parameter
Posted: 17 Feb 2021, 18:16
Is there a way to do this? I know you can feed in strings directly
and
Will print the string within V-REP.
and something like
along with
can introduce a float or int value to the sims.
But what about feeding in an array, a 2D one, something like
within V-REP I can say
to make an array, but what is the equivalent of
Please note, in my situation the array is "rectangular" (all the inner elements have the same, and a known, number of elements in them, 2 in this case), but the number of those inner arrays (5 in this exmaple) is variable and I might want to feed in arrays ranging from the likes of:
right up to some holding maybe 50 inner arrays.
Thank you
./vrep.sh -gWORD file.ttt
and
Var=sim.getStringParameter(sim.stringparam_app_arg1 )
print(Var)
Will print the string within V-REP.
and something like
./vrep.sh -g8961.4 file.ttt
along with
VarNum=tonumber(sim.getStringParameter(sim.stringparam_app_arg1))
can introduce a float or int value to the sims.
But what about feeding in an array, a 2D one, something like
{{5,4},{3,28},{16,93},{6,842},{91,0}}
within V-REP I can say
VarArr={{5,4},{3,28},{16,93},{6,842},{91,0}}
to make an array, but what is the equivalent of
tonumber()
when providing this array via a -g
flag from the command line.Please note, in my situation the array is "rectangular" (all the inner elements have the same, and a known, number of elements in them, 2 in this case), but the number of those inner arrays (5 in this exmaple) is variable and I might want to feed in arrays ranging from the likes of:
{{1,9},{2,7}}
right up to some holding maybe 50 inner arrays.
{{85,3},{3,6},...for a further 46...,{92,92},{8,17}}
Thank you