00001 """autogenerated by genmsg_py from TestWithHeader.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import std_msgs.msg
00006
00007 class TestWithHeader(roslib.message.Message):
00008 _md5sum = "d7be0bb39af8fb9129d5a76e6b63a290"
00009 _type = "test_roscpp/TestWithHeader"
00010 _has_header = True
00011 _full_text = """Header header
00012
00013 ================================================================================
00014 MSG: std_msgs/Header
00015 # Standard metadata for higher-level stamped data types.
00016 # This is generally used to communicate timestamped data
00017 # in a particular coordinate frame.
00018 #
00019 # sequence ID: consecutively increasing ID
00020 uint32 seq
00021 #Two-integer timestamp that is expressed as:
00022 # * stamp.secs: seconds (stamp_secs) since epoch
00023 # * stamp.nsecs: nanoseconds since stamp_secs
00024 # time-handling sugar is provided by the client library
00025 time stamp
00026 #Frame this data is associated with
00027 # 0: no frame
00028 # 1: global frame
00029 string frame_id
00030
00031 """
00032 __slots__ = ['header']
00033 _slot_types = ['Header']
00034
00035 def __init__(self, *args, **kwds):
00036 """
00037 Constructor. Any message fields that are implicitly/explicitly
00038 set to None will be assigned a default value. The recommend
00039 use is keyword arguments as this is more robust to future message
00040 changes. You cannot mix in-order arguments and keyword arguments.
00041
00042 The available fields are:
00043 header
00044
00045 @param args: complete set of field values, in .msg order
00046 @param kwds: use keyword arguments corresponding to message field names
00047 to set specific fields.
00048 """
00049 if args or kwds:
00050 super(TestWithHeader, self).__init__(*args, **kwds)
00051
00052 if self.header is None:
00053 self.header = std_msgs.msg._Header.Header()
00054 else:
00055 self.header = std_msgs.msg._Header.Header()
00056
00057 def _get_types(self):
00058 """
00059 internal API method
00060 """
00061 return self._slot_types
00062
00063 def serialize(self, buff):
00064 """
00065 serialize message into buffer
00066 @param buff: buffer
00067 @type buff: StringIO
00068 """
00069 try:
00070 _x = self
00071 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00072 _x = self.header.frame_id
00073 length = len(_x)
00074 buff.write(struct.pack('<I%ss'%length, length, _x))
00075 except struct.error, se: self._check_types(se)
00076 except TypeError, te: self._check_types(te)
00077
00078 def deserialize(self, str):
00079 """
00080 unpack serialized message in str into this message instance
00081 @param str: byte array of serialized message
00082 @type str: str
00083 """
00084 try:
00085 if self.header is None:
00086 self.header = std_msgs.msg._Header.Header()
00087 end = 0
00088 _x = self
00089 start = end
00090 end += 12
00091 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00092 start = end
00093 end += 4
00094 (length,) = _struct_I.unpack(str[start:end])
00095 start = end
00096 end += length
00097 self.header.frame_id = str[start:end]
00098 return self
00099 except struct.error, e:
00100 raise roslib.message.DeserializationError(e)
00101
00102
00103 def serialize_numpy(self, buff, numpy):
00104 """
00105 serialize message with numpy array types into buffer
00106 @param buff: buffer
00107 @type buff: StringIO
00108 @param numpy: numpy python module
00109 @type numpy module
00110 """
00111 try:
00112 _x = self
00113 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00114 _x = self.header.frame_id
00115 length = len(_x)
00116 buff.write(struct.pack('<I%ss'%length, length, _x))
00117 except struct.error, se: self._check_types(se)
00118 except TypeError, te: self._check_types(te)
00119
00120 def deserialize_numpy(self, str, numpy):
00121 """
00122 unpack serialized message in str into this message instance using numpy for array types
00123 @param str: byte array of serialized message
00124 @type str: str
00125 @param numpy: numpy python module
00126 @type numpy: module
00127 """
00128 try:
00129 if self.header is None:
00130 self.header = std_msgs.msg._Header.Header()
00131 end = 0
00132 _x = self
00133 start = end
00134 end += 12
00135 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00136 start = end
00137 end += 4
00138 (length,) = _struct_I.unpack(str[start:end])
00139 start = end
00140 end += length
00141 self.header.frame_id = str[start:end]
00142 return self
00143 except struct.error, e:
00144 raise roslib.message.DeserializationError(e)
00145
00146 _struct_I = roslib.message.struct_I
00147 _struct_3I = struct.Struct("<3I")