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