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