Page 1 of 1

Is it possible to install additional lua libraries?

Posted: 09 Feb 2018, 01:06
by e2718
Was wondering if it was possible to install additional libraries that can be called upon in threaded/non-threaded child scripts in V-REP. In particular, would like to install scilua to do some linear algebra for some calculations. I can install the lua libraries correctly on my computer, but I can not figure out how to get V-REP to recognize them. Does anyone know if this is possible or if there is a reasonable workaround? Thanks

Re: Is it possible to install additional lua libraries?

Posted: 09 Feb 2018, 07:22
by coppelia
Hello,

yes, you can do that. It is normally just a matter of placing a few items correctly in the V-REP folder. The Lua library luaSocket is such an example, and used in V-REP. It uses (on windows (on other platform the placement and naming is different)):
  • lua/ltn12.lua
  • lua/socket.lua
  • lua/socket
  • socket
Cheers

Re: Is it possible to install additional lua libraries?

Posted: 09 Feb 2018, 22:11
by e2718
Thanks, is there a way to install lua libraries when there are no *lua or *so files? I'm trying to install package ffi (it's a dependency for scilua). The package is part of LuaJIT http://luajit.org/ and can not seem to get V-REP to find it. (so far have been putting things in the $VREP_ROOT/lua directory)

Re: Is it possible to install additional lua libraries?

Posted: 12 Feb 2018, 08:04
by coppelia
By default V-REP will not use LuaJIT, but you can enable it via system/usrset.txt: in that file, set useExternalLuaLibrary to true. In that case, all Lua commands are going through a thin wrapper to the LUaJIT library (depending on how v_repLua.dll was compiled). But the LuaJIT is not officially supported yet, since there seem to be problems depending on platform or auxiliary library used (e.g. when using luasocket via luaJIT, there are systematic crashes).

Cheers