00001 """autogenerated by genpy from pr2_create_object_model/ModelObjectInHandResult.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 ModelObjectInHandResult(genpy.Message):
00011 _md5sum = "351782e2c561b9d4a7b5319ccaaea551"
00012 _type = "pr2_create_object_model/ModelObjectInHandResult"
00013 _has_header = False
00014 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00015
00016 # the resulting object point cloud
00017 sensor_msgs/PointCloud2 cluster
00018
00019 # the resulting collision name, if added to the collision map
00020 string collision_name
00021
00022
00023 ================================================================================
00024 MSG: sensor_msgs/PointCloud2
00025 # This message holds a collection of N-dimensional points, which may
00026 # contain additional information such as normals, intensity, etc. The
00027 # point data is stored as a binary blob, its layout described by the
00028 # contents of the "fields" array.
00029
00030 # The point cloud data may be organized 2d (image-like) or 1d
00031 # (unordered). Point clouds organized as 2d images may be produced by
00032 # camera depth sensors such as stereo or time-of-flight.
00033
00034 # Time of sensor data acquisition, and the coordinate frame ID (for 3d
00035 # points).
00036 Header header
00037
00038 # 2D structure of the point cloud. If the cloud is unordered, height is
00039 # 1 and width is the length of the point cloud.
00040 uint32 height
00041 uint32 width
00042
00043 # Describes the channels and their layout in the binary data blob.
00044 PointField[] fields
00045
00046 bool is_bigendian # Is this data bigendian?
00047 uint32 point_step # Length of a point in bytes
00048 uint32 row_step # Length of a row in bytes
00049 uint8[] data # Actual point data, size is (row_step*height)
00050
00051 bool is_dense # True if there are no invalid points
00052
00053 ================================================================================
00054 MSG: std_msgs/Header
00055 # Standard metadata for higher-level stamped data types.
00056 # This is generally used to communicate timestamped data
00057 # in a particular coordinate frame.
00058 #
00059 # sequence ID: consecutively increasing ID
00060 uint32 seq
00061 #Two-integer timestamp that is expressed as:
00062 # * stamp.secs: seconds (stamp_secs) since epoch
00063 # * stamp.nsecs: nanoseconds since stamp_secs
00064 # time-handling sugar is provided by the client library
00065 time stamp
00066 #Frame this data is associated with
00067 # 0: no frame
00068 # 1: global frame
00069 string frame_id
00070
00071 ================================================================================
00072 MSG: sensor_msgs/PointField
00073 # This message holds the description of one point entry in the
00074 # PointCloud2 message format.
00075 uint8 INT8 = 1
00076 uint8 UINT8 = 2
00077 uint8 INT16 = 3
00078 uint8 UINT16 = 4
00079 uint8 INT32 = 5
00080 uint8 UINT32 = 6
00081 uint8 FLOAT32 = 7
00082 uint8 FLOAT64 = 8
00083
00084 string name # Name of field
00085 uint32 offset # Offset from start of point struct
00086 uint8 datatype # Datatype enumeration, see above
00087 uint32 count # How many elements in the field
00088
00089 """
00090 __slots__ = ['cluster','collision_name']
00091 _slot_types = ['sensor_msgs/PointCloud2','string']
00092
00093 def __init__(self, *args, **kwds):
00094 """
00095 Constructor. Any message fields that are implicitly/explicitly
00096 set to None will be assigned a default value. The recommend
00097 use is keyword arguments as this is more robust to future message
00098 changes. You cannot mix in-order arguments and keyword arguments.
00099
00100 The available fields are:
00101 cluster,collision_name
00102
00103 :param args: complete set of field values, in .msg order
00104 :param kwds: use keyword arguments corresponding to message field names
00105 to set specific fields.
00106 """
00107 if args or kwds:
00108 super(ModelObjectInHandResult, self).__init__(*args, **kwds)
00109
00110 if self.cluster is None:
00111 self.cluster = sensor_msgs.msg.PointCloud2()
00112 if self.collision_name is None:
00113 self.collision_name = ''
00114 else:
00115 self.cluster = sensor_msgs.msg.PointCloud2()
00116 self.collision_name = ''
00117
00118 def _get_types(self):
00119 """
00120 internal API method
00121 """
00122 return self._slot_types
00123
00124 def serialize(self, buff):
00125 """
00126 serialize message into buffer
00127 :param buff: buffer, ``StringIO``
00128 """
00129 try:
00130 _x = self
00131 buff.write(_struct_3I.pack(_x.cluster.header.seq, _x.cluster.header.stamp.secs, _x.cluster.header.stamp.nsecs))
00132 _x = self.cluster.header.frame_id
00133 length = len(_x)
00134 if python3 or type(_x) == unicode:
00135 _x = _x.encode('utf-8')
00136 length = len(_x)
00137 buff.write(struct.pack('<I%ss'%length, length, _x))
00138 _x = self
00139 buff.write(_struct_2I.pack(_x.cluster.height, _x.cluster.width))
00140 length = len(self.cluster.fields)
00141 buff.write(_struct_I.pack(length))
00142 for val1 in self.cluster.fields:
00143 _x = val1.name
00144 length = len(_x)
00145 if python3 or type(_x) == unicode:
00146 _x = _x.encode('utf-8')
00147 length = len(_x)
00148 buff.write(struct.pack('<I%ss'%length, length, _x))
00149 _x = val1
00150 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00151 _x = self
00152 buff.write(_struct_B2I.pack(_x.cluster.is_bigendian, _x.cluster.point_step, _x.cluster.row_step))
00153 _x = self.cluster.data
00154 length = len(_x)
00155
00156 if type(_x) in [list, tuple]:
00157 buff.write(struct.pack('<I%sB'%length, length, *_x))
00158 else:
00159 buff.write(struct.pack('<I%ss'%length, length, _x))
00160 buff.write(_struct_B.pack(self.cluster.is_dense))
00161 _x = self.collision_name
00162 length = len(_x)
00163 if python3 or type(_x) == unicode:
00164 _x = _x.encode('utf-8')
00165 length = len(_x)
00166 buff.write(struct.pack('<I%ss'%length, length, _x))
00167 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00168 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00169
00170 def deserialize(self, str):
00171 """
00172 unpack serialized message in str into this message instance
00173 :param str: byte array of serialized message, ``str``
00174 """
00175 try:
00176 if self.cluster is None:
00177 self.cluster = sensor_msgs.msg.PointCloud2()
00178 end = 0
00179 _x = self
00180 start = end
00181 end += 12
00182 (_x.cluster.header.seq, _x.cluster.header.stamp.secs, _x.cluster.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00183 start = end
00184 end += 4
00185 (length,) = _struct_I.unpack(str[start:end])
00186 start = end
00187 end += length
00188 if python3:
00189 self.cluster.header.frame_id = str[start:end].decode('utf-8')
00190 else:
00191 self.cluster.header.frame_id = str[start:end]
00192 _x = self
00193 start = end
00194 end += 8
00195 (_x.cluster.height, _x.cluster.width,) = _struct_2I.unpack(str[start:end])
00196 start = end
00197 end += 4
00198 (length,) = _struct_I.unpack(str[start:end])
00199 self.cluster.fields = []
00200 for i in range(0, length):
00201 val1 = sensor_msgs.msg.PointField()
00202 start = end
00203 end += 4
00204 (length,) = _struct_I.unpack(str[start:end])
00205 start = end
00206 end += length
00207 if python3:
00208 val1.name = str[start:end].decode('utf-8')
00209 else:
00210 val1.name = str[start:end]
00211 _x = val1
00212 start = end
00213 end += 9
00214 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00215 self.cluster.fields.append(val1)
00216 _x = self
00217 start = end
00218 end += 9
00219 (_x.cluster.is_bigendian, _x.cluster.point_step, _x.cluster.row_step,) = _struct_B2I.unpack(str[start:end])
00220 self.cluster.is_bigendian = bool(self.cluster.is_bigendian)
00221 start = end
00222 end += 4
00223 (length,) = _struct_I.unpack(str[start:end])
00224 start = end
00225 end += length
00226 self.cluster.data = str[start:end]
00227 start = end
00228 end += 1
00229 (self.cluster.is_dense,) = _struct_B.unpack(str[start:end])
00230 self.cluster.is_dense = bool(self.cluster.is_dense)
00231 start = end
00232 end += 4
00233 (length,) = _struct_I.unpack(str[start:end])
00234 start = end
00235 end += length
00236 if python3:
00237 self.collision_name = str[start:end].decode('utf-8')
00238 else:
00239 self.collision_name = str[start:end]
00240 return self
00241 except struct.error as e:
00242 raise genpy.DeserializationError(e)
00243
00244
00245 def serialize_numpy(self, buff, numpy):
00246 """
00247 serialize message with numpy array types into buffer
00248 :param buff: buffer, ``StringIO``
00249 :param numpy: numpy python module
00250 """
00251 try:
00252 _x = self
00253 buff.write(_struct_3I.pack(_x.cluster.header.seq, _x.cluster.header.stamp.secs, _x.cluster.header.stamp.nsecs))
00254 _x = self.cluster.header.frame_id
00255 length = len(_x)
00256 if python3 or type(_x) == unicode:
00257 _x = _x.encode('utf-8')
00258 length = len(_x)
00259 buff.write(struct.pack('<I%ss'%length, length, _x))
00260 _x = self
00261 buff.write(_struct_2I.pack(_x.cluster.height, _x.cluster.width))
00262 length = len(self.cluster.fields)
00263 buff.write(_struct_I.pack(length))
00264 for val1 in self.cluster.fields:
00265 _x = val1.name
00266 length = len(_x)
00267 if python3 or type(_x) == unicode:
00268 _x = _x.encode('utf-8')
00269 length = len(_x)
00270 buff.write(struct.pack('<I%ss'%length, length, _x))
00271 _x = val1
00272 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00273 _x = self
00274 buff.write(_struct_B2I.pack(_x.cluster.is_bigendian, _x.cluster.point_step, _x.cluster.row_step))
00275 _x = self.cluster.data
00276 length = len(_x)
00277
00278 if type(_x) in [list, tuple]:
00279 buff.write(struct.pack('<I%sB'%length, length, *_x))
00280 else:
00281 buff.write(struct.pack('<I%ss'%length, length, _x))
00282 buff.write(_struct_B.pack(self.cluster.is_dense))
00283 _x = self.collision_name
00284 length = len(_x)
00285 if python3 or type(_x) == unicode:
00286 _x = _x.encode('utf-8')
00287 length = len(_x)
00288 buff.write(struct.pack('<I%ss'%length, length, _x))
00289 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00290 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00291
00292 def deserialize_numpy(self, str, numpy):
00293 """
00294 unpack serialized message in str into this message instance using numpy for array types
00295 :param str: byte array of serialized message, ``str``
00296 :param numpy: numpy python module
00297 """
00298 try:
00299 if self.cluster is None:
00300 self.cluster = sensor_msgs.msg.PointCloud2()
00301 end = 0
00302 _x = self
00303 start = end
00304 end += 12
00305 (_x.cluster.header.seq, _x.cluster.header.stamp.secs, _x.cluster.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00306 start = end
00307 end += 4
00308 (length,) = _struct_I.unpack(str[start:end])
00309 start = end
00310 end += length
00311 if python3:
00312 self.cluster.header.frame_id = str[start:end].decode('utf-8')
00313 else:
00314 self.cluster.header.frame_id = str[start:end]
00315 _x = self
00316 start = end
00317 end += 8
00318 (_x.cluster.height, _x.cluster.width,) = _struct_2I.unpack(str[start:end])
00319 start = end
00320 end += 4
00321 (length,) = _struct_I.unpack(str[start:end])
00322 self.cluster.fields = []
00323 for i in range(0, length):
00324 val1 = sensor_msgs.msg.PointField()
00325 start = end
00326 end += 4
00327 (length,) = _struct_I.unpack(str[start:end])
00328 start = end
00329 end += length
00330 if python3:
00331 val1.name = str[start:end].decode('utf-8')
00332 else:
00333 val1.name = str[start:end]
00334 _x = val1
00335 start = end
00336 end += 9
00337 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00338 self.cluster.fields.append(val1)
00339 _x = self
00340 start = end
00341 end += 9
00342 (_x.cluster.is_bigendian, _x.cluster.point_step, _x.cluster.row_step,) = _struct_B2I.unpack(str[start:end])
00343 self.cluster.is_bigendian = bool(self.cluster.is_bigendian)
00344 start = end
00345 end += 4
00346 (length,) = _struct_I.unpack(str[start:end])
00347 start = end
00348 end += length
00349 self.cluster.data = str[start:end]
00350 start = end
00351 end += 1
00352 (self.cluster.is_dense,) = _struct_B.unpack(str[start:end])
00353 self.cluster.is_dense = bool(self.cluster.is_dense)
00354 start = end
00355 end += 4
00356 (length,) = _struct_I.unpack(str[start:end])
00357 start = end
00358 end += length
00359 if python3:
00360 self.collision_name = str[start:end].decode('utf-8')
00361 else:
00362 self.collision_name = str[start:end]
00363 return self
00364 except struct.error as e:
00365 raise genpy.DeserializationError(e)
00366
00367 _struct_I = genpy.struct_I
00368 _struct_IBI = struct.Struct("<IBI")
00369 _struct_3I = struct.Struct("<3I")
00370 _struct_B = struct.Struct("<B")
00371 _struct_2I = struct.Struct("<2I")
00372 _struct_B2I = struct.Struct("<B2I")