def __init__(self): """""" self.clonedRobotHandles = [] # used to store object handles of copy-pasted robots logging.info("Attempting to connect") vrep.simxFinish(-1) # just in case, close all opened connections self.__clientID = vrep.simxStart("127.0.0.1", 19997, True, True, 5000, 5) # Connect to V-REP if self.__clientID == -1: logging.error("Failed connecting to remote API server") raise () logging.info("Connected to remote API server, clientID = %d" % self.__clientID)
def close(self): """Closes the connection with V-REP """ # Now close the connection with V-REP: vrep.simxFinish(self.__clientID) logging.info("Connection closed")