00001 """autogenerated by genmsg_py from ModelObjectInHandResult.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import std_msgs.msg
00006 import sensor_msgs.msg
00007
00008 class ModelObjectInHandResult(roslib.message.Message):
00009 _md5sum = "351782e2c561b9d4a7b5319ccaaea551"
00010 _type = "pr2_create_object_model/ModelObjectInHandResult"
00011 _has_header = False
00012 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00013
00014 sensor_msgs/PointCloud2 cluster
00015 string collision_name
00016
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__ = ['cluster','collision_name']
00086 _slot_types = ['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 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(ModelObjectInHandResult, self).__init__(*args, **kwds)
00104
00105 if self.cluster is None:
00106 self.cluster = sensor_msgs.msg.PointCloud2()
00107 if self.collision_name is None:
00108 self.collision_name = ''
00109 else:
00110 self.cluster = sensor_msgs.msg.PointCloud2()
00111 self.collision_name = ''
00112
00113 def _get_types(self):
00114 """
00115 internal API method
00116 """
00117 return self._slot_types
00118
00119 def serialize(self, buff):
00120 """
00121 serialize message into buffer
00122 @param buff: buffer
00123 @type buff: StringIO
00124 """
00125 try:
00126 _x = self
00127 buff.write(_struct_3I.pack(_x.cluster.header.seq, _x.cluster.header.stamp.secs, _x.cluster.header.stamp.nsecs))
00128 _x = self.cluster.header.frame_id
00129 length = len(_x)
00130 buff.write(struct.pack('<I%ss'%length, length, _x))
00131 _x = self
00132 buff.write(_struct_2I.pack(_x.cluster.height, _x.cluster.width))
00133 length = len(self.cluster.fields)
00134 buff.write(_struct_I.pack(length))
00135 for val1 in self.cluster.fields:
00136 _x = val1.name
00137 length = len(_x)
00138 buff.write(struct.pack('<I%ss'%length, length, _x))
00139 _x = val1
00140 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00141 _x = self
00142 buff.write(_struct_B2I.pack(_x.cluster.is_bigendian, _x.cluster.point_step, _x.cluster.row_step))
00143 _x = self.cluster.data
00144 length = len(_x)
00145
00146 if type(_x) in [list, tuple]:
00147 buff.write(struct.pack('<I%sB'%length, length, *_x))
00148 else:
00149 buff.write(struct.pack('<I%ss'%length, length, _x))
00150 buff.write(_struct_B.pack(self.cluster.is_dense))
00151 _x = self.collision_name
00152 length = len(_x)
00153 buff.write(struct.pack('<I%ss'%length, length, _x))
00154 except struct.error, se: self._check_types(se)
00155 except TypeError, te: self._check_types(te)
00156
00157 def deserialize(self, str):
00158 """
00159 unpack serialized message in str into this message instance
00160 @param str: byte array of serialized message
00161 @type str: str
00162 """
00163 try:
00164 if self.cluster is None:
00165 self.cluster = sensor_msgs.msg.PointCloud2()
00166 end = 0
00167 _x = self
00168 start = end
00169 end += 12
00170 (_x.cluster.header.seq, _x.cluster.header.stamp.secs, _x.cluster.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00171 start = end
00172 end += 4
00173 (length,) = _struct_I.unpack(str[start:end])
00174 start = end
00175 end += length
00176 self.cluster.header.frame_id = str[start:end]
00177 _x = self
00178 start = end
00179 end += 8
00180 (_x.cluster.height, _x.cluster.width,) = _struct_2I.unpack(str[start:end])
00181 start = end
00182 end += 4
00183 (length,) = _struct_I.unpack(str[start:end])
00184 self.cluster.fields = []
00185 for i in xrange(0, length):
00186 val1 = sensor_msgs.msg.PointField()
00187 start = end
00188 end += 4
00189 (length,) = _struct_I.unpack(str[start:end])
00190 start = end
00191 end += length
00192 val1.name = str[start:end]
00193 _x = val1
00194 start = end
00195 end += 9
00196 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00197 self.cluster.fields.append(val1)
00198 _x = self
00199 start = end
00200 end += 9
00201 (_x.cluster.is_bigendian, _x.cluster.point_step, _x.cluster.row_step,) = _struct_B2I.unpack(str[start:end])
00202 self.cluster.is_bigendian = bool(self.cluster.is_bigendian)
00203 start = end
00204 end += 4
00205 (length,) = _struct_I.unpack(str[start:end])
00206 start = end
00207 end += length
00208 self.cluster.data = str[start:end]
00209 start = end
00210 end += 1
00211 (self.cluster.is_dense,) = _struct_B.unpack(str[start:end])
00212 self.cluster.is_dense = bool(self.cluster.is_dense)
00213 start = end
00214 end += 4
00215 (length,) = _struct_I.unpack(str[start:end])
00216 start = end
00217 end += length
00218 self.collision_name = str[start:end]
00219 return self
00220 except struct.error, e:
00221 raise roslib.message.DeserializationError(e)
00222
00223
00224 def serialize_numpy(self, buff, numpy):
00225 """
00226 serialize message with numpy array types into buffer
00227 @param buff: buffer
00228 @type buff: StringIO
00229 @param numpy: numpy python module
00230 @type numpy module
00231 """
00232 try:
00233 _x = self
00234 buff.write(_struct_3I.pack(_x.cluster.header.seq, _x.cluster.header.stamp.secs, _x.cluster.header.stamp.nsecs))
00235 _x = self.cluster.header.frame_id
00236 length = len(_x)
00237 buff.write(struct.pack('<I%ss'%length, length, _x))
00238 _x = self
00239 buff.write(_struct_2I.pack(_x.cluster.height, _x.cluster.width))
00240 length = len(self.cluster.fields)
00241 buff.write(_struct_I.pack(length))
00242 for val1 in self.cluster.fields:
00243 _x = val1.name
00244 length = len(_x)
00245 buff.write(struct.pack('<I%ss'%length, length, _x))
00246 _x = val1
00247 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00248 _x = self
00249 buff.write(_struct_B2I.pack(_x.cluster.is_bigendian, _x.cluster.point_step, _x.cluster.row_step))
00250 _x = self.cluster.data
00251 length = len(_x)
00252
00253 if type(_x) in [list, tuple]:
00254 buff.write(struct.pack('<I%sB'%length, length, *_x))
00255 else:
00256 buff.write(struct.pack('<I%ss'%length, length, _x))
00257 buff.write(_struct_B.pack(self.cluster.is_dense))
00258 _x = self.collision_name
00259 length = len(_x)
00260 buff.write(struct.pack('<I%ss'%length, length, _x))
00261 except struct.error, se: self._check_types(se)
00262 except TypeError, te: self._check_types(te)
00263
00264 def deserialize_numpy(self, str, numpy):
00265 """
00266 unpack serialized message in str into this message instance using numpy for array types
00267 @param str: byte array of serialized message
00268 @type str: str
00269 @param numpy: numpy python module
00270 @type numpy: module
00271 """
00272 try:
00273 if self.cluster is None:
00274 self.cluster = sensor_msgs.msg.PointCloud2()
00275 end = 0
00276 _x = self
00277 start = end
00278 end += 12
00279 (_x.cluster.header.seq, _x.cluster.header.stamp.secs, _x.cluster.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00280 start = end
00281 end += 4
00282 (length,) = _struct_I.unpack(str[start:end])
00283 start = end
00284 end += length
00285 self.cluster.header.frame_id = str[start:end]
00286 _x = self
00287 start = end
00288 end += 8
00289 (_x.cluster.height, _x.cluster.width,) = _struct_2I.unpack(str[start:end])
00290 start = end
00291 end += 4
00292 (length,) = _struct_I.unpack(str[start:end])
00293 self.cluster.fields = []
00294 for i in xrange(0, length):
00295 val1 = sensor_msgs.msg.PointField()
00296 start = end
00297 end += 4
00298 (length,) = _struct_I.unpack(str[start:end])
00299 start = end
00300 end += length
00301 val1.name = str[start:end]
00302 _x = val1
00303 start = end
00304 end += 9
00305 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00306 self.cluster.fields.append(val1)
00307 _x = self
00308 start = end
00309 end += 9
00310 (_x.cluster.is_bigendian, _x.cluster.point_step, _x.cluster.row_step,) = _struct_B2I.unpack(str[start:end])
00311 self.cluster.is_bigendian = bool(self.cluster.is_bigendian)
00312 start = end
00313 end += 4
00314 (length,) = _struct_I.unpack(str[start:end])
00315 start = end
00316 end += length
00317 self.cluster.data = str[start:end]
00318 start = end
00319 end += 1
00320 (self.cluster.is_dense,) = _struct_B.unpack(str[start:end])
00321 self.cluster.is_dense = bool(self.cluster.is_dense)
00322 start = end
00323 end += 4
00324 (length,) = _struct_I.unpack(str[start:end])
00325 start = end
00326 end += length
00327 self.collision_name = str[start:end]
00328 return self
00329 except struct.error, e:
00330 raise roslib.message.DeserializationError(e)
00331
00332 _struct_I = roslib.message.struct_I
00333 _struct_IBI = struct.Struct("<IBI")
00334 _struct_3I = struct.Struct("<3I")
00335 _struct_B = struct.Struct("<B")
00336 _struct_2I = struct.Struct("<2I")
00337 _struct_B2I = struct.Struct("<B2I")