Page 1 of 1

Error using callScriptFunction

Posted: 23 Feb 2022, 16:20
by adamg
Hi I am using Python code

using the function importFinger_function and getting an error message in CoppeliaSim "External call to simCallScriptFunction failed (importFinger_function@CodeDummy): Failed calling script function."

How might I alleviate this error?

Re: Error using callScriptFunction

Posted: 23 Feb 2022, 16:27
by coppelia
Hello,

which version of CoppeliaSim are you using? With V4.2+ and Python, we highly recommend to use the ZeroMQ remote API, which makes everything much easier.

In your case, make sure that the script is initialized at the time you call it.
Please also show us your child script code.

Cheers

Re: Error using callScriptFunction

Posted: 24 Feb 2022, 13:02
by adamg
Hi,

Thanks for your response.
I am currently using version 4.2.
How can I ensure that the script is initialised at the time that I call it ?

Thanks

Re: Error using callScriptFunction

Posted: 24 Feb 2022, 13:06
by coppelia
First, check if the script has executed the init, but not yet the cleanup phase. e.g. simply add a print

Cheers

Re: Error using callScriptFunction

Posted: 24 Feb 2022, 14:12
by adamg
The full child script is as such



and the initial comments are executed in the init phase

Re: Error using callScriptFunction

Posted: 24 Feb 2022, 14:38
by coppelia
Are you sure there was no error in that script, and that sysCall_cleanup wasn't called yet? Is the script a child script or customization script?
I can't explain the error (but don't have all the infos here neither). Can you try with the ZeroMQ remote API?

cheers

Re: Error using callScriptFunction

Posted: 24 Feb 2022, 14:50
by adamg
There is no error showing up in the script when I run it, when i added a comment to check if sysCall_cleanup was called the message never printed.

The script is a child script.

I will try with the ZeroMQ remote API, currently using legacy remote API client as from this page https://www.coppeliarobotics.com/helpFi ... erview.htm

Re: Error using callScriptFunction

Posted: 24 Feb 2022, 15:00
by coppelia
could it be that at the moment of calling, the script is not yet initialized? Try to wait one second after simulation started before calling that function, then we will know maybe..

Cheers

Re: Error using callScriptFunction

Posted: 24 Feb 2022, 16:01
by adamg
Got it thanks a million for your help !