Command line optional argument and string parameters

Report crashes, strange behaviour, or apparent bugs
Post Reply
mbellaccini
Posts: 6
Joined: 11 Dec 2013, 18:49

Command line optional argument and string parameters

Post by mbellaccini »

Hi v-rep people!
I've just downloaded the new v-rep 3.1.0 and was experimenting the new command-line mode.
I wrote a plugin that gets a parameter through the "-g" flag passed to v-rep as an optional argument. I tried using "simGetStringParameter(sim_stringparam_app_arg1)" as suggested in the documentation, however it didn't work. Instead, if I try with "simGetStringParameter(7)", it correctly reads the first parameter. I can also get the 2nd, 3rd and the other following parameters by using "simGetStringParameter([8,9...])".
Looking at v_repConst.h, I saw that "sim_stringparam_app_arg1" is enumerated as 2 ("sim_stringparam_app_arg2" as 3 and so on...), so it seems there's a parameter index mismatch.
I'm using v-rep pro edu 3.1.0 for Linux 64 bit.

Cheers

Marco Bellaccini

coppelia
Site Admin
Posts: 10364
Joined: 14 Dec 2012, 00:25

Re: Command line optional argument and string parameters

Post by coppelia »

Hello Marco,

you are right, this is a bug. It will be corrected for next release or next revision. Simply try to read the first non-empty sim_stringparam_app_arg (there is a shift that is linked to the position of the -g argument in the command line).

Thanks a lot!

mbellaccini
Posts: 6
Joined: 11 Dec 2013, 18:49

Re: Command line optional argument and string parameters

Post by mbellaccini »

You are welcome. Thanks for the better workaround!

Marco

Post Reply