00001 """autogenerated by genpy from srs_object_database_msgs/surf.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 geometry_msgs.msg
00008 import std_msgs.msg
00009 import sensor_msgs.msg
00010
00011 class surf(genpy.Message):
00012 _md5sum = "0faab423389dc07fa3f21ffd5950aa25"
00013 _type = "srs_object_database_msgs/surf"
00014 _has_header = False
00015 _full_text = """int32 objectId
00016 sensor_msgs/PointCloud2 surf
00017 sensor_msgs/PointCloud2 bounding_box
00018 geometry_msgs/Pose coord_frame
00019
00020 ================================================================================
00021 MSG: sensor_msgs/PointCloud2
00022 # This message holds a collection of N-dimensional points, which may
00023 # contain additional information such as normals, intensity, etc. The
00024 # point data is stored as a binary blob, its layout described by the
00025 # contents of the "fields" array.
00026
00027 # The point cloud data may be organized 2d (image-like) or 1d
00028 # (unordered). Point clouds organized as 2d images may be produced by
00029 # camera depth sensors such as stereo or time-of-flight.
00030
00031 # Time of sensor data acquisition, and the coordinate frame ID (for 3d
00032 # points).
00033 Header header
00034
00035 # 2D structure of the point cloud. If the cloud is unordered, height is
00036 # 1 and width is the length of the point cloud.
00037 uint32 height
00038 uint32 width
00039
00040 # Describes the channels and their layout in the binary data blob.
00041 PointField[] fields
00042
00043 bool is_bigendian # Is this data bigendian?
00044 uint32 point_step # Length of a point in bytes
00045 uint32 row_step # Length of a row in bytes
00046 uint8[] data # Actual point data, size is (row_step*height)
00047
00048 bool is_dense # True if there are no invalid points
00049
00050 ================================================================================
00051 MSG: std_msgs/Header
00052 # Standard metadata for higher-level stamped data types.
00053 # This is generally used to communicate timestamped data
00054 # in a particular coordinate frame.
00055 #
00056 # sequence ID: consecutively increasing ID
00057 uint32 seq
00058 #Two-integer timestamp that is expressed as:
00059 # * stamp.secs: seconds (stamp_secs) since epoch
00060 # * stamp.nsecs: nanoseconds since stamp_secs
00061 # time-handling sugar is provided by the client library
00062 time stamp
00063 #Frame this data is associated with
00064 # 0: no frame
00065 # 1: global frame
00066 string frame_id
00067
00068 ================================================================================
00069 MSG: sensor_msgs/PointField
00070 # This message holds the description of one point entry in the
00071 # PointCloud2 message format.
00072 uint8 INT8 = 1
00073 uint8 UINT8 = 2
00074 uint8 INT16 = 3
00075 uint8 UINT16 = 4
00076 uint8 INT32 = 5
00077 uint8 UINT32 = 6
00078 uint8 FLOAT32 = 7
00079 uint8 FLOAT64 = 8
00080
00081 string name # Name of field
00082 uint32 offset # Offset from start of point struct
00083 uint8 datatype # Datatype enumeration, see above
00084 uint32 count # How many elements in the field
00085
00086 ================================================================================
00087 MSG: geometry_msgs/Pose
00088 # A representation of pose in free space, composed of postion and orientation.
00089 Point position
00090 Quaternion orientation
00091
00092 ================================================================================
00093 MSG: geometry_msgs/Point
00094 # This contains the position of a point in free space
00095 float64 x
00096 float64 y
00097 float64 z
00098
00099 ================================================================================
00100 MSG: geometry_msgs/Quaternion
00101 # This represents an orientation in free space in quaternion form.
00102
00103 float64 x
00104 float64 y
00105 float64 z
00106 float64 w
00107
00108 """
00109 __slots__ = ['objectId','surf','bounding_box','coord_frame']
00110 _slot_types = ['int32','sensor_msgs/PointCloud2','sensor_msgs/PointCloud2','geometry_msgs/Pose']
00111
00112 def __init__(self, *args, **kwds):
00113 """
00114 Constructor. Any message fields that are implicitly/explicitly
00115 set to None will be assigned a default value. The recommend
00116 use is keyword arguments as this is more robust to future message
00117 changes. You cannot mix in-order arguments and keyword arguments.
00118
00119 The available fields are:
00120 objectId,surf,bounding_box,coord_frame
00121
00122 :param args: complete set of field values, in .msg order
00123 :param kwds: use keyword arguments corresponding to message field names
00124 to set specific fields.
00125 """
00126 if args or kwds:
00127 super(surf, self).__init__(*args, **kwds)
00128
00129 if self.objectId is None:
00130 self.objectId = 0
00131 if self.surf is None:
00132 self.surf = sensor_msgs.msg.PointCloud2()
00133 if self.bounding_box is None:
00134 self.bounding_box = sensor_msgs.msg.PointCloud2()
00135 if self.coord_frame is None:
00136 self.coord_frame = geometry_msgs.msg.Pose()
00137 else:
00138 self.objectId = 0
00139 self.surf = sensor_msgs.msg.PointCloud2()
00140 self.bounding_box = sensor_msgs.msg.PointCloud2()
00141 self.coord_frame = geometry_msgs.msg.Pose()
00142
00143 def _get_types(self):
00144 """
00145 internal API method
00146 """
00147 return self._slot_types
00148
00149 def serialize(self, buff):
00150 """
00151 serialize message into buffer
00152 :param buff: buffer, ``StringIO``
00153 """
00154 try:
00155 _x = self
00156 buff.write(_struct_i3I.pack(_x.objectId, _x.surf.header.seq, _x.surf.header.stamp.secs, _x.surf.header.stamp.nsecs))
00157 _x = self.surf.header.frame_id
00158 length = len(_x)
00159 if python3 or type(_x) == unicode:
00160 _x = _x.encode('utf-8')
00161 length = len(_x)
00162 buff.write(struct.pack('<I%ss'%length, length, _x))
00163 _x = self
00164 buff.write(_struct_2I.pack(_x.surf.height, _x.surf.width))
00165 length = len(self.surf.fields)
00166 buff.write(_struct_I.pack(length))
00167 for val1 in self.surf.fields:
00168 _x = val1.name
00169 length = len(_x)
00170 if python3 or type(_x) == unicode:
00171 _x = _x.encode('utf-8')
00172 length = len(_x)
00173 buff.write(struct.pack('<I%ss'%length, length, _x))
00174 _x = val1
00175 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00176 _x = self
00177 buff.write(_struct_B2I.pack(_x.surf.is_bigendian, _x.surf.point_step, _x.surf.row_step))
00178 _x = self.surf.data
00179 length = len(_x)
00180
00181 if type(_x) in [list, tuple]:
00182 buff.write(struct.pack('<I%sB'%length, length, *_x))
00183 else:
00184 buff.write(struct.pack('<I%ss'%length, length, _x))
00185 _x = self
00186 buff.write(_struct_B3I.pack(_x.surf.is_dense, _x.bounding_box.header.seq, _x.bounding_box.header.stamp.secs, _x.bounding_box.header.stamp.nsecs))
00187 _x = self.bounding_box.header.frame_id
00188 length = len(_x)
00189 if python3 or type(_x) == unicode:
00190 _x = _x.encode('utf-8')
00191 length = len(_x)
00192 buff.write(struct.pack('<I%ss'%length, length, _x))
00193 _x = self
00194 buff.write(_struct_2I.pack(_x.bounding_box.height, _x.bounding_box.width))
00195 length = len(self.bounding_box.fields)
00196 buff.write(_struct_I.pack(length))
00197 for val1 in self.bounding_box.fields:
00198 _x = val1.name
00199 length = len(_x)
00200 if python3 or type(_x) == unicode:
00201 _x = _x.encode('utf-8')
00202 length = len(_x)
00203 buff.write(struct.pack('<I%ss'%length, length, _x))
00204 _x = val1
00205 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00206 _x = self
00207 buff.write(_struct_B2I.pack(_x.bounding_box.is_bigendian, _x.bounding_box.point_step, _x.bounding_box.row_step))
00208 _x = self.bounding_box.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 _x = self
00216 buff.write(_struct_B7d.pack(_x.bounding_box.is_dense, _x.coord_frame.position.x, _x.coord_frame.position.y, _x.coord_frame.position.z, _x.coord_frame.orientation.x, _x.coord_frame.orientation.y, _x.coord_frame.orientation.z, _x.coord_frame.orientation.w))
00217 except struct.error as se: self._check_types(se)
00218 except TypeError as te: self._check_types(te)
00219
00220 def deserialize(self, str):
00221 """
00222 unpack serialized message in str into this message instance
00223 :param str: byte array of serialized message, ``str``
00224 """
00225 try:
00226 if self.surf is None:
00227 self.surf = sensor_msgs.msg.PointCloud2()
00228 if self.bounding_box is None:
00229 self.bounding_box = sensor_msgs.msg.PointCloud2()
00230 if self.coord_frame is None:
00231 self.coord_frame = geometry_msgs.msg.Pose()
00232 end = 0
00233 _x = self
00234 start = end
00235 end += 16
00236 (_x.objectId, _x.surf.header.seq, _x.surf.header.stamp.secs, _x.surf.header.stamp.nsecs,) = _struct_i3I.unpack(str[start:end])
00237 start = end
00238 end += 4
00239 (length,) = _struct_I.unpack(str[start:end])
00240 start = end
00241 end += length
00242 if python3:
00243 self.surf.header.frame_id = str[start:end].decode('utf-8')
00244 else:
00245 self.surf.header.frame_id = str[start:end]
00246 _x = self
00247 start = end
00248 end += 8
00249 (_x.surf.height, _x.surf.width,) = _struct_2I.unpack(str[start:end])
00250 start = end
00251 end += 4
00252 (length,) = _struct_I.unpack(str[start:end])
00253 self.surf.fields = []
00254 for i in range(0, length):
00255 val1 = sensor_msgs.msg.PointField()
00256 start = end
00257 end += 4
00258 (length,) = _struct_I.unpack(str[start:end])
00259 start = end
00260 end += length
00261 if python3:
00262 val1.name = str[start:end].decode('utf-8')
00263 else:
00264 val1.name = str[start:end]
00265 _x = val1
00266 start = end
00267 end += 9
00268 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00269 self.surf.fields.append(val1)
00270 _x = self
00271 start = end
00272 end += 9
00273 (_x.surf.is_bigendian, _x.surf.point_step, _x.surf.row_step,) = _struct_B2I.unpack(str[start:end])
00274 self.surf.is_bigendian = bool(self.surf.is_bigendian)
00275 start = end
00276 end += 4
00277 (length,) = _struct_I.unpack(str[start:end])
00278 start = end
00279 end += length
00280 if python3:
00281 self.surf.data = str[start:end].decode('utf-8')
00282 else:
00283 self.surf.data = str[start:end]
00284 _x = self
00285 start = end
00286 end += 13
00287 (_x.surf.is_dense, _x.bounding_box.header.seq, _x.bounding_box.header.stamp.secs, _x.bounding_box.header.stamp.nsecs,) = _struct_B3I.unpack(str[start:end])
00288 self.surf.is_dense = bool(self.surf.is_dense)
00289 start = end
00290 end += 4
00291 (length,) = _struct_I.unpack(str[start:end])
00292 start = end
00293 end += length
00294 if python3:
00295 self.bounding_box.header.frame_id = str[start:end].decode('utf-8')
00296 else:
00297 self.bounding_box.header.frame_id = str[start:end]
00298 _x = self
00299 start = end
00300 end += 8
00301 (_x.bounding_box.height, _x.bounding_box.width,) = _struct_2I.unpack(str[start:end])
00302 start = end
00303 end += 4
00304 (length,) = _struct_I.unpack(str[start:end])
00305 self.bounding_box.fields = []
00306 for i in range(0, length):
00307 val1 = sensor_msgs.msg.PointField()
00308 start = end
00309 end += 4
00310 (length,) = _struct_I.unpack(str[start:end])
00311 start = end
00312 end += length
00313 if python3:
00314 val1.name = str[start:end].decode('utf-8')
00315 else:
00316 val1.name = str[start:end]
00317 _x = val1
00318 start = end
00319 end += 9
00320 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00321 self.bounding_box.fields.append(val1)
00322 _x = self
00323 start = end
00324 end += 9
00325 (_x.bounding_box.is_bigendian, _x.bounding_box.point_step, _x.bounding_box.row_step,) = _struct_B2I.unpack(str[start:end])
00326 self.bounding_box.is_bigendian = bool(self.bounding_box.is_bigendian)
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.bounding_box.data = str[start:end].decode('utf-8')
00334 else:
00335 self.bounding_box.data = str[start:end]
00336 _x = self
00337 start = end
00338 end += 57
00339 (_x.bounding_box.is_dense, _x.coord_frame.position.x, _x.coord_frame.position.y, _x.coord_frame.position.z, _x.coord_frame.orientation.x, _x.coord_frame.orientation.y, _x.coord_frame.orientation.z, _x.coord_frame.orientation.w,) = _struct_B7d.unpack(str[start:end])
00340 self.bounding_box.is_dense = bool(self.bounding_box.is_dense)
00341 return self
00342 except struct.error as e:
00343 raise genpy.DeserializationError(e)
00344
00345
00346 def serialize_numpy(self, buff, numpy):
00347 """
00348 serialize message with numpy array types into buffer
00349 :param buff: buffer, ``StringIO``
00350 :param numpy: numpy python module
00351 """
00352 try:
00353 _x = self
00354 buff.write(_struct_i3I.pack(_x.objectId, _x.surf.header.seq, _x.surf.header.stamp.secs, _x.surf.header.stamp.nsecs))
00355 _x = self.surf.header.frame_id
00356 length = len(_x)
00357 if python3 or type(_x) == unicode:
00358 _x = _x.encode('utf-8')
00359 length = len(_x)
00360 buff.write(struct.pack('<I%ss'%length, length, _x))
00361 _x = self
00362 buff.write(_struct_2I.pack(_x.surf.height, _x.surf.width))
00363 length = len(self.surf.fields)
00364 buff.write(_struct_I.pack(length))
00365 for val1 in self.surf.fields:
00366 _x = val1.name
00367 length = len(_x)
00368 if python3 or type(_x) == unicode:
00369 _x = _x.encode('utf-8')
00370 length = len(_x)
00371 buff.write(struct.pack('<I%ss'%length, length, _x))
00372 _x = val1
00373 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00374 _x = self
00375 buff.write(_struct_B2I.pack(_x.surf.is_bigendian, _x.surf.point_step, _x.surf.row_step))
00376 _x = self.surf.data
00377 length = len(_x)
00378
00379 if type(_x) in [list, tuple]:
00380 buff.write(struct.pack('<I%sB'%length, length, *_x))
00381 else:
00382 buff.write(struct.pack('<I%ss'%length, length, _x))
00383 _x = self
00384 buff.write(_struct_B3I.pack(_x.surf.is_dense, _x.bounding_box.header.seq, _x.bounding_box.header.stamp.secs, _x.bounding_box.header.stamp.nsecs))
00385 _x = self.bounding_box.header.frame_id
00386 length = len(_x)
00387 if python3 or type(_x) == unicode:
00388 _x = _x.encode('utf-8')
00389 length = len(_x)
00390 buff.write(struct.pack('<I%ss'%length, length, _x))
00391 _x = self
00392 buff.write(_struct_2I.pack(_x.bounding_box.height, _x.bounding_box.width))
00393 length = len(self.bounding_box.fields)
00394 buff.write(_struct_I.pack(length))
00395 for val1 in self.bounding_box.fields:
00396 _x = val1.name
00397 length = len(_x)
00398 if python3 or type(_x) == unicode:
00399 _x = _x.encode('utf-8')
00400 length = len(_x)
00401 buff.write(struct.pack('<I%ss'%length, length, _x))
00402 _x = val1
00403 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00404 _x = self
00405 buff.write(_struct_B2I.pack(_x.bounding_box.is_bigendian, _x.bounding_box.point_step, _x.bounding_box.row_step))
00406 _x = self.bounding_box.data
00407 length = len(_x)
00408
00409 if type(_x) in [list, tuple]:
00410 buff.write(struct.pack('<I%sB'%length, length, *_x))
00411 else:
00412 buff.write(struct.pack('<I%ss'%length, length, _x))
00413 _x = self
00414 buff.write(_struct_B7d.pack(_x.bounding_box.is_dense, _x.coord_frame.position.x, _x.coord_frame.position.y, _x.coord_frame.position.z, _x.coord_frame.orientation.x, _x.coord_frame.orientation.y, _x.coord_frame.orientation.z, _x.coord_frame.orientation.w))
00415 except struct.error as se: self._check_types(se)
00416 except TypeError as te: self._check_types(te)
00417
00418 def deserialize_numpy(self, str, numpy):
00419 """
00420 unpack serialized message in str into this message instance using numpy for array types
00421 :param str: byte array of serialized message, ``str``
00422 :param numpy: numpy python module
00423 """
00424 try:
00425 if self.surf is None:
00426 self.surf = sensor_msgs.msg.PointCloud2()
00427 if self.bounding_box is None:
00428 self.bounding_box = sensor_msgs.msg.PointCloud2()
00429 if self.coord_frame is None:
00430 self.coord_frame = geometry_msgs.msg.Pose()
00431 end = 0
00432 _x = self
00433 start = end
00434 end += 16
00435 (_x.objectId, _x.surf.header.seq, _x.surf.header.stamp.secs, _x.surf.header.stamp.nsecs,) = _struct_i3I.unpack(str[start:end])
00436 start = end
00437 end += 4
00438 (length,) = _struct_I.unpack(str[start:end])
00439 start = end
00440 end += length
00441 if python3:
00442 self.surf.header.frame_id = str[start:end].decode('utf-8')
00443 else:
00444 self.surf.header.frame_id = str[start:end]
00445 _x = self
00446 start = end
00447 end += 8
00448 (_x.surf.height, _x.surf.width,) = _struct_2I.unpack(str[start:end])
00449 start = end
00450 end += 4
00451 (length,) = _struct_I.unpack(str[start:end])
00452 self.surf.fields = []
00453 for i in range(0, length):
00454 val1 = sensor_msgs.msg.PointField()
00455 start = end
00456 end += 4
00457 (length,) = _struct_I.unpack(str[start:end])
00458 start = end
00459 end += length
00460 if python3:
00461 val1.name = str[start:end].decode('utf-8')
00462 else:
00463 val1.name = str[start:end]
00464 _x = val1
00465 start = end
00466 end += 9
00467 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00468 self.surf.fields.append(val1)
00469 _x = self
00470 start = end
00471 end += 9
00472 (_x.surf.is_bigendian, _x.surf.point_step, _x.surf.row_step,) = _struct_B2I.unpack(str[start:end])
00473 self.surf.is_bigendian = bool(self.surf.is_bigendian)
00474 start = end
00475 end += 4
00476 (length,) = _struct_I.unpack(str[start:end])
00477 start = end
00478 end += length
00479 if python3:
00480 self.surf.data = str[start:end].decode('utf-8')
00481 else:
00482 self.surf.data = str[start:end]
00483 _x = self
00484 start = end
00485 end += 13
00486 (_x.surf.is_dense, _x.bounding_box.header.seq, _x.bounding_box.header.stamp.secs, _x.bounding_box.header.stamp.nsecs,) = _struct_B3I.unpack(str[start:end])
00487 self.surf.is_dense = bool(self.surf.is_dense)
00488 start = end
00489 end += 4
00490 (length,) = _struct_I.unpack(str[start:end])
00491 start = end
00492 end += length
00493 if python3:
00494 self.bounding_box.header.frame_id = str[start:end].decode('utf-8')
00495 else:
00496 self.bounding_box.header.frame_id = str[start:end]
00497 _x = self
00498 start = end
00499 end += 8
00500 (_x.bounding_box.height, _x.bounding_box.width,) = _struct_2I.unpack(str[start:end])
00501 start = end
00502 end += 4
00503 (length,) = _struct_I.unpack(str[start:end])
00504 self.bounding_box.fields = []
00505 for i in range(0, length):
00506 val1 = sensor_msgs.msg.PointField()
00507 start = end
00508 end += 4
00509 (length,) = _struct_I.unpack(str[start:end])
00510 start = end
00511 end += length
00512 if python3:
00513 val1.name = str[start:end].decode('utf-8')
00514 else:
00515 val1.name = str[start:end]
00516 _x = val1
00517 start = end
00518 end += 9
00519 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00520 self.bounding_box.fields.append(val1)
00521 _x = self
00522 start = end
00523 end += 9
00524 (_x.bounding_box.is_bigendian, _x.bounding_box.point_step, _x.bounding_box.row_step,) = _struct_B2I.unpack(str[start:end])
00525 self.bounding_box.is_bigendian = bool(self.bounding_box.is_bigendian)
00526 start = end
00527 end += 4
00528 (length,) = _struct_I.unpack(str[start:end])
00529 start = end
00530 end += length
00531 if python3:
00532 self.bounding_box.data = str[start:end].decode('utf-8')
00533 else:
00534 self.bounding_box.data = str[start:end]
00535 _x = self
00536 start = end
00537 end += 57
00538 (_x.bounding_box.is_dense, _x.coord_frame.position.x, _x.coord_frame.position.y, _x.coord_frame.position.z, _x.coord_frame.orientation.x, _x.coord_frame.orientation.y, _x.coord_frame.orientation.z, _x.coord_frame.orientation.w,) = _struct_B7d.unpack(str[start:end])
00539 self.bounding_box.is_dense = bool(self.bounding_box.is_dense)
00540 return self
00541 except struct.error as e:
00542 raise genpy.DeserializationError(e)
00543
00544 _struct_I = genpy.struct_I
00545 _struct_IBI = struct.Struct("<IBI")
00546 _struct_i3I = struct.Struct("<i3I")
00547 _struct_B7d = struct.Struct("<B7d")
00548 _struct_B3I = struct.Struct("<B3I")
00549 _struct_B2I = struct.Struct("<B2I")
00550 _struct_2I = struct.Struct("<2I")