wkentaro
11/11/2015 - 2:04 PM

Performance test for warn_no_remap with rospy

Performance test for warn_no_remap with rospy

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import time
import rospy


rospy.init_node('spam')


print 'rospy.get_name'
s = time.clock()
node_name = rospy.get_name()
print 'elapsed: {0} [s]'.format(time.clock() - s)


print 'rospy.names.resolve_name'
s = time.clock()
names = ['~input', '~input/a', '~output', '~output/a']
resolved_names = [rospy.names.resolve_name(n, node_name) for n in names]
print 'elapsed: {0} [s]'.format(time.clock() - s)
print resolved_names


print 'rospy.names.get_resolved_mappings'
s = time.clock()
mappings = rospy.names.get_resolved_mappings()
print 'elapsed: {0} [s]'.format(time.clock() - s)
print mappings