Remote API Connection Timeouts

Report crashes, strange behaviour, or apparent bugs
Post Reply
harrisonmg
Posts: 6
Joined: 16 Feb 2018, 17:53

Remote API Connection Timeouts

Post by harrisonmg » 21 Feb 2018, 16:02

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 = '127.0.0.1' # 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

vrep.simxGetPingTime(self.client_id)
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?

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

Re: Remote API Connection Timeouts

Post by coppelia » 22 Feb 2018, 07:35

Hello,

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

Cheers

harrisonmg
Posts: 6
Joined: 16 Feb 2018, 17:53

Re: Remote API Connection Timeouts

Post by harrisonmg » 22 Feb 2018, 16:37

Hello,

When running simpleTest.py, 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,
Harrison

Post Reply