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