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