Has anyone received Lua runtime error in simROS.Publish during ROS1 tutorial
Posted: 16 Mar 2020, 20:48
Hi there,
I managed to compile the RosInterface on windows.
I was working through the ROS1 Tutorial: https://www.coppeliarobotics.com/helpFi ... torial.htm
Everything worked fine until I tried to:
In an empty CoppeliaSim scene, select an object, then attach a non-threaded child script to it with [Menu bar --> Add --> Associated child script --> non threaded]. Open the script editor for that script and replace the content with following: I added the 52 lines of code to the XYZCameraProxy.
Ran simulation...Lua errors...
inside the Lua script:
line31: if rosInterfacePresent then
line32: publisher=simROS.advertise('/simulationTime','std_msgs/Float32')
line33: subscriber=simROS.subscribe('/simulationTime','std_msgs/Float32','subscriber_callback')
line34: end
...
line39: if rosInterfacePresent then
line40: simROS.publish(publisher,{data=sim.getSimulationTime()})
line41: simROS.sendTransform(getTransformStamped(objectHandle,objectName,-1,'world'))
line42: -- To send several transforms at once, use simROS.sendTransforms instead
line43: end
The RosInterface compiled ok, so I am not sure what to fix before building again.
Has anyone seen this before? Any ideas?
Thanks in advance.
Simulation started.
Lua runtime error: [string "CHILD SCRIPT XYZCameraProxy"]:32: unsupported message type. please edit and recompile ROS plugin (simROS.advertise @ 'RosInterface' plugin)
stack traceback:
: in function 'advertise'
[string "CHILD SCRIPT XYZCameraProxy"]:32: in function
Lua runtime error: [string "CHILD SCRIPT XYZCameraProxy"]:40: read in arg 1 (publisherHandle): expected int (simROS.publish @ 'RosInterface' plugin)
stack traceback:
[C]: in function 'publish'
[string "CHILD SCRIPT XYZCameraProxy"]:40: in function
Lua runtime error: [string "CHILD SCRIPT XYZCameraProxy"]:40: read in arg 1 (publisherHandle): expected int (simROS.publish @ 'RosInterface' plugin)
stack traceback:
[C]: in function 'publish'
[string "CHILD SCRIPT XYZCameraProxy"]:40: in function
Lua runtime error: [string "CHILD SCRIPT XYZCameraProxy"]:40: read in arg 1 (publisherHandle): expected int (simROS.publish @ 'RosInterface' plugin)
stack traceback:
I managed to compile the RosInterface on windows.
I was working through the ROS1 Tutorial: https://www.coppeliarobotics.com/helpFi ... torial.htm
Everything worked fine until I tried to:
In an empty CoppeliaSim scene, select an object, then attach a non-threaded child script to it with [Menu bar --> Add --> Associated child script --> non threaded]. Open the script editor for that script and replace the content with following: I added the 52 lines of code to the XYZCameraProxy.
Ran simulation...Lua errors...
inside the Lua script:
line31: if rosInterfacePresent then
line32: publisher=simROS.advertise('/simulationTime','std_msgs/Float32')
line33: subscriber=simROS.subscribe('/simulationTime','std_msgs/Float32','subscriber_callback')
line34: end
...
line39: if rosInterfacePresent then
line40: simROS.publish(publisher,{data=sim.getSimulationTime()})
line41: simROS.sendTransform(getTransformStamped(objectHandle,objectName,-1,'world'))
line42: -- To send several transforms at once, use simROS.sendTransforms instead
line43: end
The RosInterface compiled ok, so I am not sure what to fix before building again.
Has anyone seen this before? Any ideas?
Thanks in advance.
Simulation started.
Lua runtime error: [string "CHILD SCRIPT XYZCameraProxy"]:32: unsupported message type. please edit and recompile ROS plugin (simROS.advertise @ 'RosInterface' plugin)
stack traceback:
: in function 'advertise'
[string "CHILD SCRIPT XYZCameraProxy"]:32: in function
Lua runtime error: [string "CHILD SCRIPT XYZCameraProxy"]:40: read in arg 1 (publisherHandle): expected int (simROS.publish @ 'RosInterface' plugin)
stack traceback:
[C]: in function 'publish'
[string "CHILD SCRIPT XYZCameraProxy"]:40: in function
Lua runtime error: [string "CHILD SCRIPT XYZCameraProxy"]:40: read in arg 1 (publisherHandle): expected int (simROS.publish @ 'RosInterface' plugin)
stack traceback:
[C]: in function 'publish'
[string "CHILD SCRIPT XYZCameraProxy"]:40: in function
Lua runtime error: [string "CHILD SCRIPT XYZCameraProxy"]:40: read in arg 1 (publisherHandle): expected int (simROS.publish @ 'RosInterface' plugin)
stack traceback: