Is it possible to install additional lua libraries?

Typically: "How do I... ", "How can I... " questions
Post Reply
e2718
Posts: 33
Joined: 15 Nov 2015, 05:39

Is it possible to install additional lua libraries?

Post 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

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

Re: Is it possible to install additional lua libraries?

Post 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

e2718
Posts: 33
Joined: 15 Nov 2015, 05:39

Re: Is it possible to install additional lua libraries?

Post 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)

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

Re: Is it possible to install additional lua libraries?

Post 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

Post Reply