Hi!
I am currently using the ZeroMQ remote API to access and control a Coppelia scene through a Python application.
I was wondering if it would be possible to access functions that are defined within customization and child scripts contained in the scene.
I am using Coppelia v4.6.0.
Thank you!
Accessing Coppelia script functions via ZeroMQ
Re: Accessing Coppelia script functions via ZeroMQ
Yes, via sim.callScriptFunction you can call a function defined in a child or customization script. (in case of child script, the simulation must be running)
Re: Accessing Coppelia script functions via ZeroMQ
Thanks for the answer.
Specifically, we are trying to access a function that is stored within a threaded child script.
The problem is, we are trying to unit test each of these functions. For that purpose, the simulation must start (so that the child script is initialized).
What we are doing is starting the simulation from the Python application and then calling the function contained in our threaded child script, but that doesn't seem to work since the simulation halts and the function does not return anything.
Thank you in advance!
Specifically, we are trying to access a function that is stored within a threaded child script.
The problem is, we are trying to unit test each of these functions. For that purpose, the simulation must start (so that the child script is initialized).
What we are doing is starting the simulation from the Python application and then calling the function contained in our threaded child script, but that doesn't seem to work since the simulation halts and the function does not return anything.
Thank you in advance!
Re: Accessing Coppelia script functions via ZeroMQ
When the simulation stops, child scripts are destroyed.
You have to keep simulation running if you wish to call functions of a threaded child script.
You have to keep simulation running if you wish to call functions of a threaded child script.
Re: Accessing Coppelia script functions via ZeroMQ
Maybe try using a threaded customization script instead? Those won't stop when simulation stops.
Cheers
Cheers
Re: Accessing Coppelia script functions via ZeroMQ
I didn't manage to access the functions within the childscripts so we found a workaround to test those functions separately. i will keep you updated if we find a better solution.
Thanks for the support!
Thanks for the support!