Page 1 of 1

Using LIDAR sensor with remoteAPI

Posted: 05 Feb 2019, 14:33
by jdjdjd

I am trying to use a LIDAR sensor in a python program I write using the remoteAPI.

how can I get the LIDAR data (points cloud / array)?

what do I have to add to the child process of the sensors and how can I read the data in Python.

I have tried using both the Velodyne and SICK sensors.



Re: Using LIDAR sensor with remoteAPI

Posted: 06 Feb 2019, 09:18
by coppelia
Hello Yuval,

you have several ways you can share the LIDAR data with your remote API client. The simplest is probably to set a string signal inside of the child script, that contains the packed data, e.g., in each simulation pass:

Code: Select all

you can then constantly read that signal from your remote API client, with simxGetStringSignal. Make sure to use data streaming mode to read that signal.
Then decode that signal (with simxUnpackFloats) and you have your data.

You have sevral other way of exchanging data. One other way would be to call a specific script function with simxCallScriptFunction.


Re: Using LIDAR sensor with remoteAPI

Posted: 10 Feb 2019, 10:29
by jdjdjd

I have added the lines to the Velodyne's child process but I get the following error when I am running the simulation:

Lua runtime error: [string "CHILD SCRIPT velodyneHDL_64E_S2"]:10: One of the function's argument type is not correct. (sim.packFloatTable)
stack traceback:
[C]: in function 'packFloatTable'
[string "CHILD SCRIPT velodyneHDL_64E_S2"]:10: in function <[string "CHILD SCRIPT velodyneHDL_64E_S2"]:9>

please advice.

Re: Using LIDAR sensor with remoteAPI

Posted: 12 Feb 2019, 09:37
by coppelia
you will still have to adjust the script a little bit, e.g.:

Code: Select all

function sysCall_sensing()