simpleTest-nonBlocking.py does not run

Report crashes, strange behaviour, or apparent bugs
Post Reply
Oz@SIT
Posts: 19
Joined: 10 Jul 2014, 10:03

simpleTest-nonBlocking.py does not run

Post by Oz@SIT »

Hi,

I have been trying to run CoppeliaSimEdu\programming\zmqRemoteApi\clients\pythonsimpleTest-nonBlocking.py while CoppeliaSim's empty scene was running, but I got the following exception:

Exception: The client ZeroMQ remote API version does not match CoppeliaSim's version

My environment is:
CoppeliaSim v.4.6.0 rev 2
Windows 11 22H2 / Ubunut 22.04
python 3.9.13 / python 3.10.10
coppeliasim_zmqremoteapi_client (0.1.0)

I was wondering if you could tell me what I am missing.

Thanks,

Oz

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

Re: simpleTest-nonBlocking.py does not run

Post by coppelia »

Hello Oz,

the asyncio version of the ZeroMQ remote API for Python was not updated. But this was done now. You will have to use the newest version from the ZeroMQ remote API repository.

However, since the improvement of the server side responsiveness, differences are really minimal, and my guess is that using the async version would rarely make much sense.

Cheers

Oz@SIT
Posts: 19
Joined: 10 Jul 2014, 10:03

Re: simpleTest-nonBlocking.py does not run

Post by Oz@SIT »

Hello,

Thank you for the reply.
I have not able to build the ZMQ remote api for CoppeliaSim. An error, MSB1009: the project file does not exist, occured at "cmake --build ." So I am still struggling to solve it.

While as you suggest me, I also think the asyncio responsiveness will not make a big difference.
What I would like to do is to run the simulator as fast as possible, but the python file and the ttt file contained in

https://drive.google.com/drive/folders/ ... sp=sharing

runs like the following:

With the above files, I run one simulation and got the following result:
num, ave fps , realtime, stepping, count = 1 356.85 3.77[ms] False False 999 1000 (This means four set/get commands take nealy 4 ms.)
num, ave fps , realtime, stepping, count = 2 181.53 6.24[ms] False False 999 1000 (This means another four set/get commands take 2.5 ms.)
num, ave fps , realtime, stepping, count = 3 126.77 8.25[ms] False False 999 1000(This means another four set/get commands take 2 ms.)
num, ave fps , realtime, stepping, count = 4 95.27 10.88[ms] False False 999 1000(This means another four set/get commands take 2.6 ms.)
num, ave fps , realtime, stepping, count = 5 75.47 13.77[ms] False False 999 1000(This means another four set/get commands take 2.9 ms.)

Windows 11 22H2, Core-i9 9900K@3.60GHz, python 3.9.13

The four set/get commands (three sets, and one get) take around 2-3 ms.
This means one set/get command takes 0.5 - 0.75 ms. Is this normal?

Thank you for your continued help,

Oz

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

Re: simpleTest-nonBlocking.py does not run

Post by coppelia »

Not sure about your error. We will release rev. 4 tomorrow normally. At that time, please try again. But for Python there is no need to rebuild anything: the API is fetched dynamically from CoppeliaSim at first connection. For c++ and Java on the other hand, buildingis required.

The timing you obtain sounds approximately right. It depends on your system, but typically, one API call takes between 0.2 and 0.5 ms on average. Keep in mind that on CoppeliaSim side, there is one thread running the simulation: after each simulation step, remote API commands are handled until no more command is in the queue, or until a time threshold was overshot.

Having a thread that constantly modifies the scene content would be tricky to handle smoothly, but moreover this would possibly lead to strange behaviour, since we have a discreet simulation where a clear sequence between actuation and sensing is highly recommended.

Cheers

Oz@SIT
Posts: 19
Joined: 10 Jul 2014, 10:03

Re: simpleTest-nonBlocking.py does not run

Post by Oz@SIT »

Thank you for your always quick response. It helps us a lot!

About the rebuilding, I see that I do not need to rebuild it for python. Thanks.

The program is just to check how long a set/get command takes. So I will not modify the position of the same object in one step.

Thanks for all your help,

Oz

Post Reply