We developed a simple V-REP simulation that works pretty well on OS X but not on Linux (Ubuntu 15.04). Lua is employed as the main scripting language.
We attach the following code (with the return values in comments) that unfortunately returns nil on Linux (but converts e[3] to number without problem on OS X):
e[3] -- -0.677782532263
type(e[3]) -- string
type(tonumber(e[3])) -- nil
What is really interesting is the fact that the previous code works as one would expect in Lua 5.2.3 console (both OS X and Linux). However, V-REP can't convert the string to number properly when running on Linux.
We tried both 32b and 64b V-REP versions (today downloaded) with exactly same results - nils. Could you please point out some things we're missing? Neither Lua nor V-REP are utils we use every day.
Edit 1: I Use Ubuntu 15.04. V-REP uses Lua 5.1, My Lua version:
$ apt-cache policy lua5.1
lua5.1:
Installed: 5.1.5-7.1
Candidate: 5.1.5-7.1
Version table:
*** 5.1.5-7.1 0
500 http://cz.archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
100 /var/lib/dpkg/status
In console, I tried the following:
$ lua
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
> e={[3]="-0.677782532263"}; print(e[3], type(e[3]), tonumber(e[3]), type(tonumber(e[3])))
-0.677782532263 string -0.677782532263 number
Packages
Nilprinted out? Or is itnil? You are sure that you are using the same version of lua on both OS X and linux when this happens? And both of the first two lines output the same value on OS X and linux when this happens? - Etan Reisnernil, the version is the same on both platforms, and about the output - the values are dynamically created in python and sent via remote api to vrep (and lua), so they are not the same exact values, but the error doesn't happen on os x at all and happens on linux on all the float numbers that get passed in. - Gyfise[3]if you tryprint(("%q"):format(e[3]))? What distribution of linux is this? What lua package exactly? Can you get that value to work in lua itself (without vrep) if you try it manually? (i.e.e={[3]="-0.677782532263"}; print(e[3], type(e[3]), tonumber(e[3]))?) - Etan Reisner