00001 """autogenerated by genpy from iri_sift/DescriptorsFromImageRequest.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 import sensor_msgs.msg
00009
00010 class DescriptorsFromImageRequest(genpy.Message):
00011 _md5sum = "b13d2865c5af2a64e6e30ab1b56e1dd5"
00012 _type = "iri_sift/DescriptorsFromImageRequest"
00013 _has_header = False
00014 _full_text = """
00015 sensor_msgs/Image image
00016
00017 ================================================================================
00018 MSG: sensor_msgs/Image
00019 # This message contains an uncompressed image
00020 # (0, 0) is at top-left corner of image
00021 #
00022
00023 Header header # Header timestamp should be acquisition time of image
00024 # Header frame_id should be optical frame of camera
00025 # origin of frame should be optical center of cameara
00026 # +x should point to the right in the image
00027 # +y should point down in the image
00028 # +z should point into to plane of the image
00029 # If the frame_id here and the frame_id of the CameraInfo
00030 # message associated with the image conflict
00031 # the behavior is undefined
00032
00033 uint32 height # image height, that is, number of rows
00034 uint32 width # image width, that is, number of columns
00035
00036 # The legal values for encoding are in file src/image_encodings.cpp
00037 # If you want to standardize a new string format, join
00038 # ros-users@lists.sourceforge.net and send an email proposing a new encoding.
00039
00040 string encoding # Encoding of pixels -- channel meaning, ordering, size
00041 # taken from the list of strings in src/image_encodings.cpp
00042
00043 uint8 is_bigendian # is this data bigendian?
00044 uint32 step # Full row length in bytes
00045 uint8[] data # actual matrix data, size is (step * rows)
00046
00047 ================================================================================
00048 MSG: std_msgs/Header
00049 # Standard metadata for higher-level stamped data types.
00050 # This is generally used to communicate timestamped data
00051 # in a particular coordinate frame.
00052 #
00053 # sequence ID: consecutively increasing ID
00054 uint32 seq
00055 #Two-integer timestamp that is expressed as:
00056 # * stamp.secs: seconds (stamp_secs) since epoch
00057 # * stamp.nsecs: nanoseconds since stamp_secs
00058 # time-handling sugar is provided by the client library
00059 time stamp
00060 #Frame this data is associated with
00061 # 0: no frame
00062 # 1: global frame
00063 string frame_id
00064
00065 """
00066 __slots__ = ['image']
00067 _slot_types = ['sensor_msgs/Image']
00068
00069 def __init__(self, *args, **kwds):
00070 """
00071 Constructor. Any message fields that are implicitly/explicitly
00072 set to None will be assigned a default value. The recommend
00073 use is keyword arguments as this is more robust to future message
00074 changes. You cannot mix in-order arguments and keyword arguments.
00075
00076 The available fields are:
00077 image
00078
00079 :param args: complete set of field values, in .msg order
00080 :param kwds: use keyword arguments corresponding to message field names
00081 to set specific fields.
00082 """
00083 if args or kwds:
00084 super(DescriptorsFromImageRequest, self).__init__(*args, **kwds)
00085
00086 if self.image is None:
00087 self.image = sensor_msgs.msg.Image()
00088 else:
00089 self.image = sensor_msgs.msg.Image()
00090
00091 def _get_types(self):
00092 """
00093 internal API method
00094 """
00095 return self._slot_types
00096
00097 def serialize(self, buff):
00098 """
00099 serialize message into buffer
00100 :param buff: buffer, ``StringIO``
00101 """
00102 try:
00103 _x = self
00104 buff.write(_struct_3I.pack(_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs))
00105 _x = self.image.header.frame_id
00106 length = len(_x)
00107 if python3 or type(_x) == unicode:
00108 _x = _x.encode('utf-8')
00109 length = len(_x)
00110 buff.write(struct.pack('<I%ss'%length, length, _x))
00111 _x = self
00112 buff.write(_struct_2I.pack(_x.image.height, _x.image.width))
00113 _x = self.image.encoding
00114 length = len(_x)
00115 if python3 or type(_x) == unicode:
00116 _x = _x.encode('utf-8')
00117 length = len(_x)
00118 buff.write(struct.pack('<I%ss'%length, length, _x))
00119 _x = self
00120 buff.write(_struct_BI.pack(_x.image.is_bigendian, _x.image.step))
00121 _x = self.image.data
00122 length = len(_x)
00123
00124 if type(_x) in [list, tuple]:
00125 buff.write(struct.pack('<I%sB'%length, length, *_x))
00126 else:
00127 buff.write(struct.pack('<I%ss'%length, length, _x))
00128 except struct.error as se: self._check_types(se)
00129 except TypeError as te: self._check_types(te)
00130
00131 def deserialize(self, str):
00132 """
00133 unpack serialized message in str into this message instance
00134 :param str: byte array of serialized message, ``str``
00135 """
00136 try:
00137 if self.image is None:
00138 self.image = sensor_msgs.msg.Image()
00139 end = 0
00140 _x = self
00141 start = end
00142 end += 12
00143 (_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00144 start = end
00145 end += 4
00146 (length,) = _struct_I.unpack(str[start:end])
00147 start = end
00148 end += length
00149 if python3:
00150 self.image.header.frame_id = str[start:end].decode('utf-8')
00151 else:
00152 self.image.header.frame_id = str[start:end]
00153 _x = self
00154 start = end
00155 end += 8
00156 (_x.image.height, _x.image.width,) = _struct_2I.unpack(str[start:end])
00157 start = end
00158 end += 4
00159 (length,) = _struct_I.unpack(str[start:end])
00160 start = end
00161 end += length
00162 if python3:
00163 self.image.encoding = str[start:end].decode('utf-8')
00164 else:
00165 self.image.encoding = str[start:end]
00166 _x = self
00167 start = end
00168 end += 5
00169 (_x.image.is_bigendian, _x.image.step,) = _struct_BI.unpack(str[start:end])
00170 start = end
00171 end += 4
00172 (length,) = _struct_I.unpack(str[start:end])
00173 start = end
00174 end += length
00175 if python3:
00176 self.image.data = str[start:end].decode('utf-8')
00177 else:
00178 self.image.data = str[start:end]
00179 return self
00180 except struct.error as e:
00181 raise genpy.DeserializationError(e)
00182
00183
00184 def serialize_numpy(self, buff, numpy):
00185 """
00186 serialize message with numpy array types into buffer
00187 :param buff: buffer, ``StringIO``
00188 :param numpy: numpy python module
00189 """
00190 try:
00191 _x = self
00192 buff.write(_struct_3I.pack(_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs))
00193 _x = self.image.header.frame_id
00194 length = len(_x)
00195 if python3 or type(_x) == unicode:
00196 _x = _x.encode('utf-8')
00197 length = len(_x)
00198 buff.write(struct.pack('<I%ss'%length, length, _x))
00199 _x = self
00200 buff.write(_struct_2I.pack(_x.image.height, _x.image.width))
00201 _x = self.image.encoding
00202 length = len(_x)
00203 if python3 or type(_x) == unicode:
00204 _x = _x.encode('utf-8')
00205 length = len(_x)
00206 buff.write(struct.pack('<I%ss'%length, length, _x))
00207 _x = self
00208 buff.write(_struct_BI.pack(_x.image.is_bigendian, _x.image.step))
00209 _x = self.image.data
00210 length = len(_x)
00211
00212 if type(_x) in [list, tuple]:
00213 buff.write(struct.pack('<I%sB'%length, length, *_x))
00214 else:
00215 buff.write(struct.pack('<I%ss'%length, length, _x))
00216 except struct.error as se: self._check_types(se)
00217 except TypeError as te: self._check_types(te)
00218
00219 def deserialize_numpy(self, str, numpy):
00220 """
00221 unpack serialized message in str into this message instance using numpy for array types
00222 :param str: byte array of serialized message, ``str``
00223 :param numpy: numpy python module
00224 """
00225 try:
00226 if self.image is None:
00227 self.image = sensor_msgs.msg.Image()
00228 end = 0
00229 _x = self
00230 start = end
00231 end += 12
00232 (_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00233 start = end
00234 end += 4
00235 (length,) = _struct_I.unpack(str[start:end])
00236 start = end
00237 end += length
00238 if python3:
00239 self.image.header.frame_id = str[start:end].decode('utf-8')
00240 else:
00241 self.image.header.frame_id = str[start:end]
00242 _x = self
00243 start = end
00244 end += 8
00245 (_x.image.height, _x.image.width,) = _struct_2I.unpack(str[start:end])
00246 start = end
00247 end += 4
00248 (length,) = _struct_I.unpack(str[start:end])
00249 start = end
00250 end += length
00251 if python3:
00252 self.image.encoding = str[start:end].decode('utf-8')
00253 else:
00254 self.image.encoding = str[start:end]
00255 _x = self
00256 start = end
00257 end += 5
00258 (_x.image.is_bigendian, _x.image.step,) = _struct_BI.unpack(str[start:end])
00259 start = end
00260 end += 4
00261 (length,) = _struct_I.unpack(str[start:end])
00262 start = end
00263 end += length
00264 if python3:
00265 self.image.data = str[start:end].decode('utf-8')
00266 else:
00267 self.image.data = str[start:end]
00268 return self
00269 except struct.error as e:
00270 raise genpy.DeserializationError(e)
00271
00272 _struct_I = genpy.struct_I
00273 _struct_3I = struct.Struct("<3I")
00274 _struct_2I = struct.Struct("<2I")
00275 _struct_BI = struct.Struct("<BI")
00276 """autogenerated by genpy from iri_sift/DescriptorsFromImageResponse.msg. Do not edit."""
00277 import sys
00278 python3 = True if sys.hexversion > 0x03000000 else False
00279 import genpy
00280 import struct
00281
00282 import geometry_msgs.msg
00283 import iri_perception_msgs.msg
00284 import std_msgs.msg
00285
00286 class DescriptorsFromImageResponse(genpy.Message):
00287 _md5sum = "db5e12e66d3b02ca867728f150b58d69"
00288 _type = "iri_sift/DescriptorsFromImageResponse"
00289 _has_header = False
00290 _full_text = """
00291 iri_perception_msgs/DescriptorSet descriptor_set
00292
00293
00294 ================================================================================
00295 MSG: iri_perception_msgs/DescriptorSet
00296 Header header
00297 int32 num_orient_bins
00298 int32 num_spa_bins
00299 int32 num
00300 int32 len
00301 int32 width
00302 int32 height
00303 iri_perception_msgs/Descriptor[] descriptors
00304
00305 ================================================================================
00306 MSG: std_msgs/Header
00307 # Standard metadata for higher-level stamped data types.
00308 # This is generally used to communicate timestamped data
00309 # in a particular coordinate frame.
00310 #
00311 # sequence ID: consecutively increasing ID
00312 uint32 seq
00313 #Two-integer timestamp that is expressed as:
00314 # * stamp.secs: seconds (stamp_secs) since epoch
00315 # * stamp.nsecs: nanoseconds since stamp_secs
00316 # time-handling sugar is provided by the client library
00317 time stamp
00318 #Frame this data is associated with
00319 # 0: no frame
00320 # 1: global frame
00321 string frame_id
00322
00323 ================================================================================
00324 MSG: iri_perception_msgs/Descriptor
00325 float32[] descriptor
00326 geometry_msgs/Vector3 point3d
00327 int32 u
00328 int32 v
00329 float32 orientation
00330
00331 ================================================================================
00332 MSG: geometry_msgs/Vector3
00333 # This represents a vector in free space.
00334
00335 float64 x
00336 float64 y
00337 float64 z
00338 """
00339 __slots__ = ['descriptor_set']
00340 _slot_types = ['iri_perception_msgs/DescriptorSet']
00341
00342 def __init__(self, *args, **kwds):
00343 """
00344 Constructor. Any message fields that are implicitly/explicitly
00345 set to None will be assigned a default value. The recommend
00346 use is keyword arguments as this is more robust to future message
00347 changes. You cannot mix in-order arguments and keyword arguments.
00348
00349 The available fields are:
00350 descriptor_set
00351
00352 :param args: complete set of field values, in .msg order
00353 :param kwds: use keyword arguments corresponding to message field names
00354 to set specific fields.
00355 """
00356 if args or kwds:
00357 super(DescriptorsFromImageResponse, self).__init__(*args, **kwds)
00358
00359 if self.descriptor_set is None:
00360 self.descriptor_set = iri_perception_msgs.msg.DescriptorSet()
00361 else:
00362 self.descriptor_set = iri_perception_msgs.msg.DescriptorSet()
00363
00364 def _get_types(self):
00365 """
00366 internal API method
00367 """
00368 return self._slot_types
00369
00370 def serialize(self, buff):
00371 """
00372 serialize message into buffer
00373 :param buff: buffer, ``StringIO``
00374 """
00375 try:
00376 _x = self
00377 buff.write(_struct_3I.pack(_x.descriptor_set.header.seq, _x.descriptor_set.header.stamp.secs, _x.descriptor_set.header.stamp.nsecs))
00378 _x = self.descriptor_set.header.frame_id
00379 length = len(_x)
00380 if python3 or type(_x) == unicode:
00381 _x = _x.encode('utf-8')
00382 length = len(_x)
00383 buff.write(struct.pack('<I%ss'%length, length, _x))
00384 _x = self
00385 buff.write(_struct_6i.pack(_x.descriptor_set.num_orient_bins, _x.descriptor_set.num_spa_bins, _x.descriptor_set.num, _x.descriptor_set.len, _x.descriptor_set.width, _x.descriptor_set.height))
00386 length = len(self.descriptor_set.descriptors)
00387 buff.write(_struct_I.pack(length))
00388 for val1 in self.descriptor_set.descriptors:
00389 length = len(val1.descriptor)
00390 buff.write(_struct_I.pack(length))
00391 pattern = '<%sf'%length
00392 buff.write(struct.pack(pattern, *val1.descriptor))
00393 _v1 = val1.point3d
00394 _x = _v1
00395 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00396 _x = val1
00397 buff.write(_struct_2if.pack(_x.u, _x.v, _x.orientation))
00398 except struct.error as se: self._check_types(se)
00399 except TypeError as te: self._check_types(te)
00400
00401 def deserialize(self, str):
00402 """
00403 unpack serialized message in str into this message instance
00404 :param str: byte array of serialized message, ``str``
00405 """
00406 try:
00407 if self.descriptor_set is None:
00408 self.descriptor_set = iri_perception_msgs.msg.DescriptorSet()
00409 end = 0
00410 _x = self
00411 start = end
00412 end += 12
00413 (_x.descriptor_set.header.seq, _x.descriptor_set.header.stamp.secs, _x.descriptor_set.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00414 start = end
00415 end += 4
00416 (length,) = _struct_I.unpack(str[start:end])
00417 start = end
00418 end += length
00419 if python3:
00420 self.descriptor_set.header.frame_id = str[start:end].decode('utf-8')
00421 else:
00422 self.descriptor_set.header.frame_id = str[start:end]
00423 _x = self
00424 start = end
00425 end += 24
00426 (_x.descriptor_set.num_orient_bins, _x.descriptor_set.num_spa_bins, _x.descriptor_set.num, _x.descriptor_set.len, _x.descriptor_set.width, _x.descriptor_set.height,) = _struct_6i.unpack(str[start:end])
00427 start = end
00428 end += 4
00429 (length,) = _struct_I.unpack(str[start:end])
00430 self.descriptor_set.descriptors = []
00431 for i in range(0, length):
00432 val1 = iri_perception_msgs.msg.Descriptor()
00433 start = end
00434 end += 4
00435 (length,) = _struct_I.unpack(str[start:end])
00436 pattern = '<%sf'%length
00437 start = end
00438 end += struct.calcsize(pattern)
00439 val1.descriptor = struct.unpack(pattern, str[start:end])
00440 _v2 = val1.point3d
00441 _x = _v2
00442 start = end
00443 end += 24
00444 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00445 _x = val1
00446 start = end
00447 end += 12
00448 (_x.u, _x.v, _x.orientation,) = _struct_2if.unpack(str[start:end])
00449 self.descriptor_set.descriptors.append(val1)
00450 return self
00451 except struct.error as e:
00452 raise genpy.DeserializationError(e)
00453
00454
00455 def serialize_numpy(self, buff, numpy):
00456 """
00457 serialize message with numpy array types into buffer
00458 :param buff: buffer, ``StringIO``
00459 :param numpy: numpy python module
00460 """
00461 try:
00462 _x = self
00463 buff.write(_struct_3I.pack(_x.descriptor_set.header.seq, _x.descriptor_set.header.stamp.secs, _x.descriptor_set.header.stamp.nsecs))
00464 _x = self.descriptor_set.header.frame_id
00465 length = len(_x)
00466 if python3 or type(_x) == unicode:
00467 _x = _x.encode('utf-8')
00468 length = len(_x)
00469 buff.write(struct.pack('<I%ss'%length, length, _x))
00470 _x = self
00471 buff.write(_struct_6i.pack(_x.descriptor_set.num_orient_bins, _x.descriptor_set.num_spa_bins, _x.descriptor_set.num, _x.descriptor_set.len, _x.descriptor_set.width, _x.descriptor_set.height))
00472 length = len(self.descriptor_set.descriptors)
00473 buff.write(_struct_I.pack(length))
00474 for val1 in self.descriptor_set.descriptors:
00475 length = len(val1.descriptor)
00476 buff.write(_struct_I.pack(length))
00477 pattern = '<%sf'%length
00478 buff.write(val1.descriptor.tostring())
00479 _v3 = val1.point3d
00480 _x = _v3
00481 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00482 _x = val1
00483 buff.write(_struct_2if.pack(_x.u, _x.v, _x.orientation))
00484 except struct.error as se: self._check_types(se)
00485 except TypeError as te: self._check_types(te)
00486
00487 def deserialize_numpy(self, str, numpy):
00488 """
00489 unpack serialized message in str into this message instance using numpy for array types
00490 :param str: byte array of serialized message, ``str``
00491 :param numpy: numpy python module
00492 """
00493 try:
00494 if self.descriptor_set is None:
00495 self.descriptor_set = iri_perception_msgs.msg.DescriptorSet()
00496 end = 0
00497 _x = self
00498 start = end
00499 end += 12
00500 (_x.descriptor_set.header.seq, _x.descriptor_set.header.stamp.secs, _x.descriptor_set.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00501 start = end
00502 end += 4
00503 (length,) = _struct_I.unpack(str[start:end])
00504 start = end
00505 end += length
00506 if python3:
00507 self.descriptor_set.header.frame_id = str[start:end].decode('utf-8')
00508 else:
00509 self.descriptor_set.header.frame_id = str[start:end]
00510 _x = self
00511 start = end
00512 end += 24
00513 (_x.descriptor_set.num_orient_bins, _x.descriptor_set.num_spa_bins, _x.descriptor_set.num, _x.descriptor_set.len, _x.descriptor_set.width, _x.descriptor_set.height,) = _struct_6i.unpack(str[start:end])
00514 start = end
00515 end += 4
00516 (length,) = _struct_I.unpack(str[start:end])
00517 self.descriptor_set.descriptors = []
00518 for i in range(0, length):
00519 val1 = iri_perception_msgs.msg.Descriptor()
00520 start = end
00521 end += 4
00522 (length,) = _struct_I.unpack(str[start:end])
00523 pattern = '<%sf'%length
00524 start = end
00525 end += struct.calcsize(pattern)
00526 val1.descriptor = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00527 _v4 = val1.point3d
00528 _x = _v4
00529 start = end
00530 end += 24
00531 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00532 _x = val1
00533 start = end
00534 end += 12
00535 (_x.u, _x.v, _x.orientation,) = _struct_2if.unpack(str[start:end])
00536 self.descriptor_set.descriptors.append(val1)
00537 return self
00538 except struct.error as e:
00539 raise genpy.DeserializationError(e)
00540
00541 _struct_I = genpy.struct_I
00542 _struct_2if = struct.Struct("<2if")
00543 _struct_6i = struct.Struct("<6i")
00544 _struct_3I = struct.Struct("<3I")
00545 _struct_3d = struct.Struct("<3d")
00546 class DescriptorsFromImage(object):
00547 _type = 'iri_sift/DescriptorsFromImage'
00548 _md5sum = '3f84e2bbe8799c8c0db43a5ff96da0c4'
00549 _request_class = DescriptorsFromImageRequest
00550 _response_class = DescriptorsFromImageResponse