Hi everyone,
I would like to control a robot from MULTIPLE Python scripts via remoteAPI. Hence, I attached a child script to the related robot that includes a
simExtRemoteApiStart(newPortNb)
If I start just one script, the application works fine and the remote server offers an access to all elements of the robot. But a parallel execution of a second script addressing the same port does not generate a correct connection. I tested this behavior with the tutorial scripts. Do I have to start more than one remote Server? Which components are addressed by the function call "simExtRemoteApiStart"? Are all elements included that are in the component tree of the child script? Is it possible to select them and to provide an access to dedicated sensors seperatly?
Thanks for your effort
Poseidonius
How does the Remote Control Server work?
Re: How does the Remote Control Server work?
Hi,
Each remote API client require a separate remote API server running on V-REP. This also means that a separate port is required. Each server running gives the client access to all objects in a scene.
Now, not sure about this 100%, but it could be that if you start the remote API on python, that the remote API library that is loaded is always the same (this depends on how you launch your scripts too I guess). If this is the case, then from Python you will only be able to execute one connection to V-REP. This should be improved in next release or so.
Cheers
Each remote API client require a separate remote API server running on V-REP. This also means that a separate port is required. Each server running gives the client access to all objects in a scene.
Now, not sure about this 100%, but it could be that if you start the remote API on python, that the remote API library that is loaded is always the same (this depends on how you launch your scripts too I guess). If this is the case, then from Python you will only be able to execute one connection to V-REP. This should be improved in next release or so.
Cheers
-
- Posts: 7
- Joined: 22 Feb 2013, 12:22
Re: How does the Remote Control Server work?
Dear Eric,
thanks for your fast reply! I followed your advice and included a second RemoteApiStart in the child script:
newPortNb=19999
simExtRemoteApiStart(newPortNb)
newPortNb=20000
simExtRemoteApiStart(newPortNb)
Now 2 Python scripts can connect to the server, but just the first one gets an access to the components. All requests producing a error state. If I stop the first one, the second script works immediately. Any ideas?
Poseidonius
thanks for your fast reply! I followed your advice and included a second RemoteApiStart in the child script:
newPortNb=19999
simExtRemoteApiStart(newPortNb)
newPortNb=20000
simExtRemoteApiStart(newPortNb)
Now 2 Python scripts can connect to the server, but just the first one gets an access to the components. All requests producing a error state. If I stop the first one, the second script works immediately. Any ideas?
Poseidonius
Re: How does the Remote Control Server work?
Hello,
well, it seems that Python will always refer to the same library loaded in memory. As a quick fix, you might try to copy the file "remoteApi.dll", rename it to "remoteApi2d.dll", then do the same with vrep.py (i.e. from "vrep.py" to "vrep2.py"). Then in vrep2.py, adjust the referencings correctly. This way you will be able to make 2 distinct connections from Python, by using vrep.py and vrep2.py
The remote API client will become multi-instance capable in future
well, it seems that Python will always refer to the same library loaded in memory. As a quick fix, you might try to copy the file "remoteApi.dll", rename it to "remoteApi2d.dll", then do the same with vrep.py (i.e. from "vrep.py" to "vrep2.py"). Then in vrep2.py, adjust the referencings correctly. This way you will be able to make 2 distinct connections from Python, by using vrep.py and vrep2.py
The remote API client will become multi-instance capable in future
-
- Posts: 7
- Joined: 22 Feb 2013, 12:22
Re: How does the Remote Control Server work?
Hi Eric,
thanks for your advice. I dont like this solution :-( Probably I will test the ROS interface.
Enjoy the weekend
Poseidonius
thanks for your advice. I dont like this solution :-( Probably I will test the ROS interface.
Enjoy the weekend
Poseidonius
Re: How does the Remote Control Server work?
Hello Poseidonius,
If you can get Python to load a new instance of the remote API library, then you should not have any problem. Maybe you just need to restart a new Pyrthon interpreter at each time.
And as Eric said, there will soon be a new version of the remote API capable of handling several connections in parallel from a same client.
Cheers
If you can get Python to load a new instance of the remote API library, then you should not have any problem. Maybe you just need to restart a new Pyrthon interpreter at each time.
And as Eric said, there will soon be a new version of the remote API capable of handling several connections in parallel from a same client.
Cheers
-
- Posts: 7
- Joined: 22 Feb 2013, 12:22
Re: How does the Remote Control Server work?
Great news! Thanks for this information ... is month of the submission allready known?
Best wishes
Poseidonius
Best wishes
Poseidonius
Re: How does the Remote Control Server work?
We will do our best for the next release... but I cannot guarantee it. But it has a high priority compared to other things!
Cheers
Cheers
Re: How does the Remote Control Server work?
Hello Poseidonius,
The "multiple connections from a same remote API client" feature has been implemented and will be available in next release (V3.0.3), that should be out within 2-4 weeks. If you contact us via the website, you can get the source code already now.
Cheers
The "multiple connections from a same remote API client" feature has been implemented and will be available in next release (V3.0.3), that should be out within 2-4 weeks. If you contact us via the website, you can get the source code already now.
Cheers