I'm having trouble using sim.setStringSignal in combination with sim.packFloatTable in a custom child script for the fastHokuyo sensor. Here's a simplified version of my code:
Code: Select all
sim.setStringSignal('hokuyo_range_data', sim.packFloatTable(dists))
sim.setStringSignal('hokuyo_angle_data', sim.packFloatTable(angles))
If I replace the packed data with a simple dummy string, the signal is sent and received correctly. However, when I use packFloatTable, I get the following error in the terminal:
Code: Select all
[Connectivity >> ZMQ remote API server@addOnScript:error] [string "Connectivity >> ZMQ remote API server@addOnSc..."]:488: [string "Connectivity >> ZMQ remote API server@addOnSc..."]:442: ...10_0_rev0_Win/luarocks/share/lua/5.3/org\conman\cbor.lua:395: TEXT: not UTF-8 text
{ret = {{data = [long string (2736 bytes)], }}, }
stack traceback:
[C]: in function 'error'
[string "Connectivity >> ZMQ remote API server@addOnSc..."]:442: in field 'send'
[string "Connectivity >> ZMQ remote API server@addOnSc..."]:560: in function 'coroutineMain'
stack traceback:
[C]: in function 'error'
[string "Connectivity >> ZMQ remote API server@addOnSc..."]:543: in field 'resumeCoroutine'
[string "Connectivity >> ZMQ remote API server@addOnSc..."]:488: in field 'handleQueue'
[string "Connectivity >> ZMQ remote API server@addOnSc..."]:714: in function 'sysCall_actuation'
Has anyone encountered this before or found a workaround? Is there a recommended way to transmit binary data (like packed float arrays) through string signals when using the remote API?
Thanks in advance for any help!