00001 """autogenerated by genpy from hrl_haptic_manipulation_in_clutter_msgs/ContactTable.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 std_msgs.msg
00008
00009 class ContactTable(genpy.Message):
00010 _md5sum = "b1c160c81c51fc9c816360c15ebf3875"
00011 _type = "hrl_haptic_manipulation_in_clutter_msgs/ContactTable"
00012 _has_header = True
00013 _full_text = """Header header
00014
00015 std_msgs/Int32MultiArray id
00016 std_msgs/Int32MultiArray contact
00017
00018
00019
00020
00021 ================================================================================
00022 MSG: std_msgs/Header
00023 # Standard metadata for higher-level stamped data types.
00024 # This is generally used to communicate timestamped data
00025 # in a particular coordinate frame.
00026 #
00027 # sequence ID: consecutively increasing ID
00028 uint32 seq
00029 #Two-integer timestamp that is expressed as:
00030 # * stamp.secs: seconds (stamp_secs) since epoch
00031 # * stamp.nsecs: nanoseconds since stamp_secs
00032 # time-handling sugar is provided by the client library
00033 time stamp
00034 #Frame this data is associated with
00035 # 0: no frame
00036 # 1: global frame
00037 string frame_id
00038
00039 ================================================================================
00040 MSG: std_msgs/Int32MultiArray
00041 # Please look at the MultiArrayLayout message definition for
00042 # documentation on all multiarrays.
00043
00044 MultiArrayLayout layout # specification of data layout
00045 int32[] data # array of data
00046
00047
00048 ================================================================================
00049 MSG: std_msgs/MultiArrayLayout
00050 # The multiarray declares a generic multi-dimensional array of a
00051 # particular data type. Dimensions are ordered from outer most
00052 # to inner most.
00053
00054 MultiArrayDimension[] dim # Array of dimension properties
00055 uint32 data_offset # padding bytes at front of data
00056
00057 # Accessors should ALWAYS be written in terms of dimension stride
00058 # and specified outer-most dimension first.
00059 #
00060 # multiarray(i,j,k) = data[data_offset + dim_stride[1]*i + dim_stride[2]*j + k]
00061 #
00062 # A standard, 3-channel 640x480 image with interleaved color channels
00063 # would be specified as:
00064 #
00065 # dim[0].label = "height"
00066 # dim[0].size = 480
00067 # dim[0].stride = 3*640*480 = 921600 (note dim[0] stride is just size of image)
00068 # dim[1].label = "width"
00069 # dim[1].size = 640
00070 # dim[1].stride = 3*640 = 1920
00071 # dim[2].label = "channel"
00072 # dim[2].size = 3
00073 # dim[2].stride = 3
00074 #
00075 # multiarray(i,j,k) refers to the ith row, jth column, and kth channel.
00076 ================================================================================
00077 MSG: std_msgs/MultiArrayDimension
00078 string label # label of given dimension
00079 uint32 size # size of given dimension (in type units)
00080 uint32 stride # stride of given dimension
00081 """
00082 __slots__ = ['header','id','contact']
00083 _slot_types = ['std_msgs/Header','std_msgs/Int32MultiArray','std_msgs/Int32MultiArray']
00084
00085 def __init__(self, *args, **kwds):
00086 """
00087 Constructor. Any message fields that are implicitly/explicitly
00088 set to None will be assigned a default value. The recommend
00089 use is keyword arguments as this is more robust to future message
00090 changes. You cannot mix in-order arguments and keyword arguments.
00091
00092 The available fields are:
00093 header,id,contact
00094
00095 :param args: complete set of field values, in .msg order
00096 :param kwds: use keyword arguments corresponding to message field names
00097 to set specific fields.
00098 """
00099 if args or kwds:
00100 super(ContactTable, self).__init__(*args, **kwds)
00101
00102 if self.header is None:
00103 self.header = std_msgs.msg.Header()
00104 if self.id is None:
00105 self.id = std_msgs.msg.Int32MultiArray()
00106 if self.contact is None:
00107 self.contact = std_msgs.msg.Int32MultiArray()
00108 else:
00109 self.header = std_msgs.msg.Header()
00110 self.id = std_msgs.msg.Int32MultiArray()
00111 self.contact = std_msgs.msg.Int32MultiArray()
00112
00113 def _get_types(self):
00114 """
00115 internal API method
00116 """
00117 return self._slot_types
00118
00119 def serialize(self, buff):
00120 """
00121 serialize message into buffer
00122 :param buff: buffer, ``StringIO``
00123 """
00124 try:
00125 _x = self
00126 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00127 _x = self.header.frame_id
00128 length = len(_x)
00129 if python3 or type(_x) == unicode:
00130 _x = _x.encode('utf-8')
00131 length = len(_x)
00132 buff.write(struct.pack('<I%ss'%length, length, _x))
00133 length = len(self.id.layout.dim)
00134 buff.write(_struct_I.pack(length))
00135 for val1 in self.id.layout.dim:
00136 _x = val1.label
00137 length = len(_x)
00138 if python3 or type(_x) == unicode:
00139 _x = _x.encode('utf-8')
00140 length = len(_x)
00141 buff.write(struct.pack('<I%ss'%length, length, _x))
00142 _x = val1
00143 buff.write(_struct_2I.pack(_x.size, _x.stride))
00144 buff.write(_struct_I.pack(self.id.layout.data_offset))
00145 length = len(self.id.data)
00146 buff.write(_struct_I.pack(length))
00147 pattern = '<%si'%length
00148 buff.write(struct.pack(pattern, *self.id.data))
00149 length = len(self.contact.layout.dim)
00150 buff.write(_struct_I.pack(length))
00151 for val1 in self.contact.layout.dim:
00152 _x = val1.label
00153 length = len(_x)
00154 if python3 or type(_x) == unicode:
00155 _x = _x.encode('utf-8')
00156 length = len(_x)
00157 buff.write(struct.pack('<I%ss'%length, length, _x))
00158 _x = val1
00159 buff.write(_struct_2I.pack(_x.size, _x.stride))
00160 buff.write(_struct_I.pack(self.contact.layout.data_offset))
00161 length = len(self.contact.data)
00162 buff.write(_struct_I.pack(length))
00163 pattern = '<%si'%length
00164 buff.write(struct.pack(pattern, *self.contact.data))
00165 except struct.error as se: self._check_types(se)
00166 except TypeError as te: self._check_types(te)
00167
00168 def deserialize(self, str):
00169 """
00170 unpack serialized message in str into this message instance
00171 :param str: byte array of serialized message, ``str``
00172 """
00173 try:
00174 if self.header is None:
00175 self.header = std_msgs.msg.Header()
00176 if self.id is None:
00177 self.id = std_msgs.msg.Int32MultiArray()
00178 if self.contact is None:
00179 self.contact = std_msgs.msg.Int32MultiArray()
00180 end = 0
00181 _x = self
00182 start = end
00183 end += 12
00184 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00185 start = end
00186 end += 4
00187 (length,) = _struct_I.unpack(str[start:end])
00188 start = end
00189 end += length
00190 if python3:
00191 self.header.frame_id = str[start:end].decode('utf-8')
00192 else:
00193 self.header.frame_id = str[start:end]
00194 start = end
00195 end += 4
00196 (length,) = _struct_I.unpack(str[start:end])
00197 self.id.layout.dim = []
00198 for i in range(0, length):
00199 val1 = std_msgs.msg.MultiArrayDimension()
00200 start = end
00201 end += 4
00202 (length,) = _struct_I.unpack(str[start:end])
00203 start = end
00204 end += length
00205 if python3:
00206 val1.label = str[start:end].decode('utf-8')
00207 else:
00208 val1.label = str[start:end]
00209 _x = val1
00210 start = end
00211 end += 8
00212 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end])
00213 self.id.layout.dim.append(val1)
00214 start = end
00215 end += 4
00216 (self.id.layout.data_offset,) = _struct_I.unpack(str[start:end])
00217 start = end
00218 end += 4
00219 (length,) = _struct_I.unpack(str[start:end])
00220 pattern = '<%si'%length
00221 start = end
00222 end += struct.calcsize(pattern)
00223 self.id.data = struct.unpack(pattern, str[start:end])
00224 start = end
00225 end += 4
00226 (length,) = _struct_I.unpack(str[start:end])
00227 self.contact.layout.dim = []
00228 for i in range(0, length):
00229 val1 = std_msgs.msg.MultiArrayDimension()
00230 start = end
00231 end += 4
00232 (length,) = _struct_I.unpack(str[start:end])
00233 start = end
00234 end += length
00235 if python3:
00236 val1.label = str[start:end].decode('utf-8')
00237 else:
00238 val1.label = str[start:end]
00239 _x = val1
00240 start = end
00241 end += 8
00242 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end])
00243 self.contact.layout.dim.append(val1)
00244 start = end
00245 end += 4
00246 (self.contact.layout.data_offset,) = _struct_I.unpack(str[start:end])
00247 start = end
00248 end += 4
00249 (length,) = _struct_I.unpack(str[start:end])
00250 pattern = '<%si'%length
00251 start = end
00252 end += struct.calcsize(pattern)
00253 self.contact.data = struct.unpack(pattern, str[start:end])
00254 return self
00255 except struct.error as e:
00256 raise genpy.DeserializationError(e)
00257
00258
00259 def serialize_numpy(self, buff, numpy):
00260 """
00261 serialize message with numpy array types into buffer
00262 :param buff: buffer, ``StringIO``
00263 :param numpy: numpy python module
00264 """
00265 try:
00266 _x = self
00267 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00268 _x = self.header.frame_id
00269 length = len(_x)
00270 if python3 or type(_x) == unicode:
00271 _x = _x.encode('utf-8')
00272 length = len(_x)
00273 buff.write(struct.pack('<I%ss'%length, length, _x))
00274 length = len(self.id.layout.dim)
00275 buff.write(_struct_I.pack(length))
00276 for val1 in self.id.layout.dim:
00277 _x = val1.label
00278 length = len(_x)
00279 if python3 or type(_x) == unicode:
00280 _x = _x.encode('utf-8')
00281 length = len(_x)
00282 buff.write(struct.pack('<I%ss'%length, length, _x))
00283 _x = val1
00284 buff.write(_struct_2I.pack(_x.size, _x.stride))
00285 buff.write(_struct_I.pack(self.id.layout.data_offset))
00286 length = len(self.id.data)
00287 buff.write(_struct_I.pack(length))
00288 pattern = '<%si'%length
00289 buff.write(self.id.data.tostring())
00290 length = len(self.contact.layout.dim)
00291 buff.write(_struct_I.pack(length))
00292 for val1 in self.contact.layout.dim:
00293 _x = val1.label
00294 length = len(_x)
00295 if python3 or type(_x) == unicode:
00296 _x = _x.encode('utf-8')
00297 length = len(_x)
00298 buff.write(struct.pack('<I%ss'%length, length, _x))
00299 _x = val1
00300 buff.write(_struct_2I.pack(_x.size, _x.stride))
00301 buff.write(_struct_I.pack(self.contact.layout.data_offset))
00302 length = len(self.contact.data)
00303 buff.write(_struct_I.pack(length))
00304 pattern = '<%si'%length
00305 buff.write(self.contact.data.tostring())
00306 except struct.error as se: self._check_types(se)
00307 except TypeError as te: self._check_types(te)
00308
00309 def deserialize_numpy(self, str, numpy):
00310 """
00311 unpack serialized message in str into this message instance using numpy for array types
00312 :param str: byte array of serialized message, ``str``
00313 :param numpy: numpy python module
00314 """
00315 try:
00316 if self.header is None:
00317 self.header = std_msgs.msg.Header()
00318 if self.id is None:
00319 self.id = std_msgs.msg.Int32MultiArray()
00320 if self.contact is None:
00321 self.contact = std_msgs.msg.Int32MultiArray()
00322 end = 0
00323 _x = self
00324 start = end
00325 end += 12
00326 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00327 start = end
00328 end += 4
00329 (length,) = _struct_I.unpack(str[start:end])
00330 start = end
00331 end += length
00332 if python3:
00333 self.header.frame_id = str[start:end].decode('utf-8')
00334 else:
00335 self.header.frame_id = str[start:end]
00336 start = end
00337 end += 4
00338 (length,) = _struct_I.unpack(str[start:end])
00339 self.id.layout.dim = []
00340 for i in range(0, length):
00341 val1 = std_msgs.msg.MultiArrayDimension()
00342 start = end
00343 end += 4
00344 (length,) = _struct_I.unpack(str[start:end])
00345 start = end
00346 end += length
00347 if python3:
00348 val1.label = str[start:end].decode('utf-8')
00349 else:
00350 val1.label = str[start:end]
00351 _x = val1
00352 start = end
00353 end += 8
00354 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end])
00355 self.id.layout.dim.append(val1)
00356 start = end
00357 end += 4
00358 (self.id.layout.data_offset,) = _struct_I.unpack(str[start:end])
00359 start = end
00360 end += 4
00361 (length,) = _struct_I.unpack(str[start:end])
00362 pattern = '<%si'%length
00363 start = end
00364 end += struct.calcsize(pattern)
00365 self.id.data = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00366 start = end
00367 end += 4
00368 (length,) = _struct_I.unpack(str[start:end])
00369 self.contact.layout.dim = []
00370 for i in range(0, length):
00371 val1 = std_msgs.msg.MultiArrayDimension()
00372 start = end
00373 end += 4
00374 (length,) = _struct_I.unpack(str[start:end])
00375 start = end
00376 end += length
00377 if python3:
00378 val1.label = str[start:end].decode('utf-8')
00379 else:
00380 val1.label = str[start:end]
00381 _x = val1
00382 start = end
00383 end += 8
00384 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end])
00385 self.contact.layout.dim.append(val1)
00386 start = end
00387 end += 4
00388 (self.contact.layout.data_offset,) = _struct_I.unpack(str[start:end])
00389 start = end
00390 end += 4
00391 (length,) = _struct_I.unpack(str[start:end])
00392 pattern = '<%si'%length
00393 start = end
00394 end += struct.calcsize(pattern)
00395 self.contact.data = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00396 return self
00397 except struct.error as e:
00398 raise genpy.DeserializationError(e)
00399
00400 _struct_I = genpy.struct_I
00401 _struct_3I = struct.Struct("<3I")
00402 _struct_2I = struct.Struct("<2I")