I am using a W10 operating system and the 3.4.0 VREP version and I am runnig the VREP with a external API (Python, through the PyCharm IDE) in synchronous mode.
The experiment consist of testing an evolutionary algorithm and a neural network using a Poppy robot. I need to run many experiments, changing the scene and restart the robot always in the same start position.
For do that, I load a scene where in each iteration I change the position of an object and reload always the same robot model to start always on the same position.
Here I present the pseudocode:
Code: Select all
At the beginnig of the program: vrep.simxFinish(-1) vrep.simxStart(vrep_host, vrep_port, True, True, 5000, 5) vrep.simxSynchronous(clientID, True) vrep.simxStartSimulation(clientID, vrep.simx_opmode_blocking) Then, in each evaluation step, I do the following: stopSim(clientID) getPingTime(clientID) loadModel(clientID, vrep_model) moveObject(clientID, ovjectHandle, Position to move) startSim(clientID) getPingTime(clientID) getRobotHandlers (do the evolutive process. Libraries used: OpenCV, Pybrain, DEAP) closeModel(clienteID) getPingTime(clientID)
I call "getPingTime" after a stop, start simulation and close model, because if I don't understand bad, it is a blocking function that is executed when the previous commands/orders have been finished and I think taht "stop", "start" and "close" need to be finished before following into the program. Without it, after some iterations, the model appears twice in the scene.
But my problem is the ping time continously increase, iteration by iteration, achieving a time when the program crash for timeout. Furthermore, as there is not high resources consume in RAM memory or Disk on the PC, I am not able to figure where the problem could be. I suppose that it is in the communication between my IDE and the VREP but I don't know how to solve it.
Any idea what could cause this problem and how to solve it?