I'm using the ZMQ python API and a simple Lua script that only opens up the API port.
I've run into an issue: whenever i try to sim.saveImage, this gets logged into the Coppelia console and the python program hangs:
Code: Select all
[Connectivity >> ZMQ remote API server@addOnScript:error] [string "Connectivity >> ZMQ remote API server@addOnSc..."]:439: [string "Connectivity >> ZMQ remote API server@addOnSc..."]:393: ...ktop/Coppelia/luarocks/share/lua/5.3/org/conman/cbor.lua:301: attempt to get length of a number value (local 'value')
{'ret' = {{'data' = 1, }}, }
stack traceback:
[C]: in function 'error'
[string "Connectivity >> ZMQ remote API server@addOnSc..."]:393: in field 'send'
[string "Connectivity >> ZMQ remote API server@addOnSc..."]:511: in function 'coroutineMain'
stack traceback:
[C]: in function 'error'
[string "Connectivity >> ZMQ remote API server@addOnSc..."]:494: in field 'resumeCoroutine'
[string "Connectivity >> ZMQ remote API server@addOnSc..."]:439: in field 'handleQueue'
[string "Connectivity >> ZMQ remote API server@addOnSc..."]:660: in function 'sysCall_actuation'
Code: Select all
def getImage():
m, sim = setup()
cam = sim.getObject('./kinect/rgb')
data, res = sim.getVisionSensorImg(cam)
a = sim.saveImage(data, res, 0, "a.png", 10)
I've tried to add "sim.handleVisionSensor" but it logs into the python console that the sensor is not tagged for explicit handling and that sim.handleVisionSensor is therefore not required.
Could anyone help me? Thank you very much. If you need the scene file or the entire code i'll be happy to hand it over.
This issue appears on both Windows and Ubuntu systems.