def _runService(self):
        try:
            rospy.wait_for_service('stringEchoService', timeout=5)
        except rospy.ROSException:
            return [-1.0] * len(SIZES)

        times = []

        serviceFunc = rospy.ServiceProxy('stringEchoService', StringEcho)

        for size in SIZES:
            if size > 10:
                sample = ''.join(random.choice(string.lowercase)
                                 for _ in xrange(10))
                s = sample * int(size / 10) + 'A' * (size % 10)
            else:
                s = ''.join(random.choice(string.lowercase)
                            for _ in xrange(size))

            start = time.time()
            response = serviceFunc(s)
            end = time.time()

            if response.data != s:
                times.append(-1.0)
            else:
                times.append((end - start) * 1000)

        return times
dataset/ETHPy150Open rapyuta/rce/test/Test/src/center.py/TestCenter._runService/original