Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 """Prints the serialized bytese of a nav_msgs.Odometry message in hex.
00018
00019 This can be modified slightly to print the serialized bytes in hex for
00020 arbitrary ROS messages and is useful for generating test cases for rosjava
00021 message serialization.
00022 """
00023
00024 __author__ = 'damonkohler@google.com (Damon Kohler)'
00025
00026 import StringIO
00027
00028 import roslib; roslib.load_manifest('rosjava_test')
00029 import rospy
00030
00031 import nav_msgs.msg as nav_msgs
00032
00033 message = nav_msgs.Odometry()
00034 buf = StringIO.StringIO()
00035 message.serialize(buf)
00036 print ''.join('0x%02x,' % ord(c) for c in buf.getvalue())[:-1]
00037