Page 1 of 1

Remote API Connection Timeouts

Posted: 21 Feb 2018, 16:02
by harrisonmg
I am attempting to integrate the V-Rep remote api into a ROS node, but have been experiencing timeout issues.

I am using the remote server that is initiated when V-Rep starts, with the following parameters in the remoteApiConnections.txt file:

Code: Select all

portIndex1_port             = 19997
portIndex1_debug            = false
portIndex1_syncSimTrigger   = true
I am connecting to the remote server from a ROS node written in Python in the following manner, which works reliably (as in I am able to receive a client id of 0):

Code: Select all

import vrep

# configure server connection parameters
remote_server_address = '' # loopback address for V-Rep and ROS run locally
remote_server_port = 19997 # set in vrep/remoteApiConnections.txt
wait_for_connection = True
dont_reconnect_on_disconnect = False
connecting_timeout = 2000 # 2 s timeout
comm_thread_cycle = 5 # 5 ms communication cycle

# attempt connection to the remote server
vrep.simxFinish(-1) # kill any other client connections
self.client_id = -1
while self.client_id == -1:
	self.client_id = vrep.simxStart(remote_server_address, remote_server_port, wait_for_connection,
									dont_reconnect_on_disconnect, connecting_timeout, comm_thread_cycle)
	if self.client_id == -1:
		rospy.logerr('Connection to V-Rep remote server failed. Retrying...')

rospy.logwarn('Connection to V-Rep remote server successful.')
After this, when I run the command simxGetPingTime like so,

Code: Select all

I get a value of 5000 with a return code of 3, suggesting a timeout.

I also get return codes of 3 when attempting to get object handles, and a return code of 1 from the command simxStartSimulation.
This behavior persists if I start the server from a non-threaded child script in a scene, if I disable the synchronous trigger, and if I use a different port.

I am currently runnin V-Rep Pro Edu, Version 3.5.0 (rev. 0) 64bit (serialization version 21) (Qt Version 5.9.0, GCC)

I am confident my computer is powerful enough to run V-Rep at the default simulation step size of 50 ms and a very simple scene. What could perhaps be the issue?

Re: Remote API Connection Timeouts

Posted: 22 Feb 2018, 07:35
by coppelia

referring to my email earlier today, make sure that the simple remote API example run fine on your system. You can find those examples in programming/remoteApiBindings/python/python


Re: Remote API Connection Timeouts

Posted: 22 Feb 2018, 16:37
by harrisonmg

When running, the output is as follows before hanging for an indefinite amount of time.

Code: Select all

Program started
Connected to remote API server
('Remote API function call returned with error code: ', 3)
I have also updated to V-Rep Version 3.5.0 Rev 1.

Thanks for your help,