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