Error using callScriptFunction

Report crashes, strange behaviour, or apparent bugs
Post Reply
adamg
Posts: 20
Joined: 21 Feb 2022, 13:09

Error using callScriptFunction

Post 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?
Last edited by adamg on 04 Apr 2022, 11:30, edited 2 times in total.

coppelia
Site Admin
Posts: 10558
Joined: 14 Dec 2012, 00:25

Re: Error using callScriptFunction

Post 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

adamg
Posts: 20
Joined: 21 Feb 2022, 13:09

Re: Error using callScriptFunction

Post 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

coppelia
Site Admin
Posts: 10558
Joined: 14 Dec 2012, 00:25

Re: Error using callScriptFunction

Post by coppelia »

First, check if the script has executed the init, but not yet the cleanup phase. e.g. simply add a print

Cheers

adamg
Posts: 20
Joined: 21 Feb 2022, 13:09

Re: Error using callScriptFunction

Post by adamg »

The full child script is as such



and the initial comments are executed in the init phase
Last edited by adamg on 04 Apr 2022, 11:31, edited 1 time in total.

coppelia
Site Admin
Posts: 10558
Joined: 14 Dec 2012, 00:25

Re: Error using callScriptFunction

Post 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

adamg
Posts: 20
Joined: 21 Feb 2022, 13:09

Re: Error using callScriptFunction

Post 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

coppelia
Site Admin
Posts: 10558
Joined: 14 Dec 2012, 00:25

Re: Error using callScriptFunction

Post 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

adamg
Posts: 20
Joined: 21 Feb 2022, 13:09

Re: Error using callScriptFunction

Post by adamg »

Got it thanks a million for your help !

Post Reply