00001 """autogenerated by genpy from telekyb_msgs/MKValues.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import genpy
00008 import telekyb_msgs.msg
00009 import std_msgs.msg
00010
00011 class MKValues(genpy.Message):
00012 _md5sum = "afaef65507ef259ceac9248f30bd2d9f"
00013 _type = "telekyb_msgs/MKValues"
00014 _has_header = True
00015 _full_text = """#
00016 # Copyright 2011 Antonio Franchi and Martin Riedel
00017 #
00018 # This file is part of TeleKyb.
00019 #
00020 # TeleKyb is free software: you can redistribute it and/or modify
00021 # it under the terms of the GNU General Public License as published by
00022 # the Free Software Foundation, either version 3 of the License, or
00023 # (at your option) any later version.
00024 #
00025 # TeleKyb is distributed in the hope that it will be useful,
00026 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00027 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00028 # GNU General Public License for more details.
00029 #
00030 # You should have received a copy of the GNU General Public License
00031 # along with TeleKyb. If not, see <http://www.gnu.org/licenses/>.
00032
00033 Header header
00034 telekyb_msgs/MKValue[] values
00035
00036 #
00037 #
00038 ================================================================================
00039 MSG: std_msgs/Header
00040 # Standard metadata for higher-level stamped data types.
00041 # This is generally used to communicate timestamped data
00042 # in a particular coordinate frame.
00043 #
00044 # sequence ID: consecutively increasing ID
00045 uint32 seq
00046 #Two-integer timestamp that is expressed as:
00047 # * stamp.secs: seconds (stamp_secs) since epoch
00048 # * stamp.nsecs: nanoseconds since stamp_secs
00049 # time-handling sugar is provided by the client library
00050 time stamp
00051 #Frame this data is associated with
00052 # 0: no frame
00053 # 1: global frame
00054 string frame_id
00055
00056 ================================================================================
00057 MSG: telekyb_msgs/MKValue
00058 #
00059 # Copyright 2011 Antonio Franchi and Martin Riedel
00060 #
00061 # This file is part of TeleKyb.
00062 #
00063 # TeleKyb is free software: you can redistribute it and/or modify
00064 # it under the terms of the GNU General Public License as published by
00065 # the Free Software Foundation, either version 3 of the License, or
00066 # (at your option) any later version.
00067 #
00068 # TeleKyb is distributed in the hope that it will be useful,
00069 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00070 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00071 # GNU General Public License for more details.
00072 #
00073 # You should have received a copy of the GNU General Public License
00074 # along with TeleKyb. If not, see <http://www.gnu.org/licenses/>.
00075
00076 string name
00077 time stamp
00078 int16 id
00079 int16 value
00080
00081 #
00082 #
00083 """
00084 __slots__ = ['header','values']
00085 _slot_types = ['std_msgs/Header','telekyb_msgs/MKValue[]']
00086
00087 def __init__(self, *args, **kwds):
00088 """
00089 Constructor. Any message fields that are implicitly/explicitly
00090 set to None will be assigned a default value. The recommend
00091 use is keyword arguments as this is more robust to future message
00092 changes. You cannot mix in-order arguments and keyword arguments.
00093
00094 The available fields are:
00095 header,values
00096
00097 :param args: complete set of field values, in .msg order
00098 :param kwds: use keyword arguments corresponding to message field names
00099 to set specific fields.
00100 """
00101 if args or kwds:
00102 super(MKValues, self).__init__(*args, **kwds)
00103
00104 if self.header is None:
00105 self.header = std_msgs.msg.Header()
00106 if self.values is None:
00107 self.values = []
00108 else:
00109 self.header = std_msgs.msg.Header()
00110 self.values = []
00111
00112 def _get_types(self):
00113 """
00114 internal API method
00115 """
00116 return self._slot_types
00117
00118 def serialize(self, buff):
00119 """
00120 serialize message into buffer
00121 :param buff: buffer, ``StringIO``
00122 """
00123 try:
00124 _x = self
00125 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00126 _x = self.header.frame_id
00127 length = len(_x)
00128 if python3 or type(_x) == unicode:
00129 _x = _x.encode('utf-8')
00130 length = len(_x)
00131 buff.write(struct.pack('<I%ss'%length, length, _x))
00132 length = len(self.values)
00133 buff.write(_struct_I.pack(length))
00134 for val1 in self.values:
00135 _x = val1.name
00136 length = len(_x)
00137 if python3 or type(_x) == unicode:
00138 _x = _x.encode('utf-8')
00139 length = len(_x)
00140 buff.write(struct.pack('<I%ss'%length, length, _x))
00141 _v1 = val1.stamp
00142 _x = _v1
00143 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00144 _x = val1
00145 buff.write(_struct_2h.pack(_x.id, _x.value))
00146 except struct.error as se: self._check_types(se)
00147 except TypeError as te: self._check_types(te)
00148
00149 def deserialize(self, str):
00150 """
00151 unpack serialized message in str into this message instance
00152 :param str: byte array of serialized message, ``str``
00153 """
00154 try:
00155 if self.header is None:
00156 self.header = std_msgs.msg.Header()
00157 if self.values is None:
00158 self.values = None
00159 end = 0
00160 _x = self
00161 start = end
00162 end += 12
00163 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00164 start = end
00165 end += 4
00166 (length,) = _struct_I.unpack(str[start:end])
00167 start = end
00168 end += length
00169 if python3:
00170 self.header.frame_id = str[start:end].decode('utf-8')
00171 else:
00172 self.header.frame_id = str[start:end]
00173 start = end
00174 end += 4
00175 (length,) = _struct_I.unpack(str[start:end])
00176 self.values = []
00177 for i in range(0, length):
00178 val1 = telekyb_msgs.msg.MKValue()
00179 start = end
00180 end += 4
00181 (length,) = _struct_I.unpack(str[start:end])
00182 start = end
00183 end += length
00184 if python3:
00185 val1.name = str[start:end].decode('utf-8')
00186 else:
00187 val1.name = str[start:end]
00188 _v2 = val1.stamp
00189 _x = _v2
00190 start = end
00191 end += 8
00192 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00193 _x = val1
00194 start = end
00195 end += 4
00196 (_x.id, _x.value,) = _struct_2h.unpack(str[start:end])
00197 self.values.append(val1)
00198 return self
00199 except struct.error as e:
00200 raise genpy.DeserializationError(e)
00201
00202
00203 def serialize_numpy(self, buff, numpy):
00204 """
00205 serialize message with numpy array types into buffer
00206 :param buff: buffer, ``StringIO``
00207 :param numpy: numpy python module
00208 """
00209 try:
00210 _x = self
00211 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00212 _x = self.header.frame_id
00213 length = len(_x)
00214 if python3 or type(_x) == unicode:
00215 _x = _x.encode('utf-8')
00216 length = len(_x)
00217 buff.write(struct.pack('<I%ss'%length, length, _x))
00218 length = len(self.values)
00219 buff.write(_struct_I.pack(length))
00220 for val1 in self.values:
00221 _x = val1.name
00222 length = len(_x)
00223 if python3 or type(_x) == unicode:
00224 _x = _x.encode('utf-8')
00225 length = len(_x)
00226 buff.write(struct.pack('<I%ss'%length, length, _x))
00227 _v3 = val1.stamp
00228 _x = _v3
00229 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00230 _x = val1
00231 buff.write(_struct_2h.pack(_x.id, _x.value))
00232 except struct.error as se: self._check_types(se)
00233 except TypeError as te: self._check_types(te)
00234
00235 def deserialize_numpy(self, str, numpy):
00236 """
00237 unpack serialized message in str into this message instance using numpy for array types
00238 :param str: byte array of serialized message, ``str``
00239 :param numpy: numpy python module
00240 """
00241 try:
00242 if self.header is None:
00243 self.header = std_msgs.msg.Header()
00244 if self.values is None:
00245 self.values = None
00246 end = 0
00247 _x = self
00248 start = end
00249 end += 12
00250 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00251 start = end
00252 end += 4
00253 (length,) = _struct_I.unpack(str[start:end])
00254 start = end
00255 end += length
00256 if python3:
00257 self.header.frame_id = str[start:end].decode('utf-8')
00258 else:
00259 self.header.frame_id = str[start:end]
00260 start = end
00261 end += 4
00262 (length,) = _struct_I.unpack(str[start:end])
00263 self.values = []
00264 for i in range(0, length):
00265 val1 = telekyb_msgs.msg.MKValue()
00266 start = end
00267 end += 4
00268 (length,) = _struct_I.unpack(str[start:end])
00269 start = end
00270 end += length
00271 if python3:
00272 val1.name = str[start:end].decode('utf-8')
00273 else:
00274 val1.name = str[start:end]
00275 _v4 = val1.stamp
00276 _x = _v4
00277 start = end
00278 end += 8
00279 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00280 _x = val1
00281 start = end
00282 end += 4
00283 (_x.id, _x.value,) = _struct_2h.unpack(str[start:end])
00284 self.values.append(val1)
00285 return self
00286 except struct.error as e:
00287 raise genpy.DeserializationError(e)
00288
00289 _struct_I = genpy.struct_I
00290 _struct_3I = struct.Struct("<3I")
00291 _struct_2h = struct.Struct("<2h")
00292 _struct_2I = struct.Struct("<2I")