test_ros_to_dict.py
Go to the documentation of this file.
00001 import roslib; roslib.load_manifest('hai_sandbox')
00002 import rospy
00003 from geometry_msgs.msg import PoseStamped
00004 
00005 def ros_to_dict(msg):
00006     d = {}
00007     for f in msg.__slots__:
00008         val = eval('msg.%s' % f)
00009         methods = dir(val)
00010         if 'to_time' in methods:
00011             val = eval('val.to_time()')
00012         elif '__slots__' in methods:
00013             val = ros_to_dict(val)
00014         d[f] = val
00015     return d
00016 
00017 a = PoseStamped()
00018 print ros_to_dict(a)


hai_sandbox
Author(s): Hai Nguyen
autogenerated on Wed Nov 27 2013 11:46:56