_TabletopDetection.py
Go to the documentation of this file.
00001 """autogenerated by genpy from tabletop_object_detector/TabletopDetectionRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class TabletopDetectionRequest(genpy.Message):
00009   _md5sum = "f42d30308c026708dba683b43ccd22b8"
00010   _type = "tabletop_object_detector/TabletopDetectionRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 
00014 
00015 
00016 
00017 bool return_clusters
00018 
00019 
00020 
00021 bool return_models
00022 
00023 
00024 int32 num_models
00025 
00026 """
00027   __slots__ = ['return_clusters','return_models','num_models']
00028   _slot_types = ['bool','bool','int32']
00029 
00030   def __init__(self, *args, **kwds):
00031     """
00032     Constructor. Any message fields that are implicitly/explicitly
00033     set to None will be assigned a default value. The recommend
00034     use is keyword arguments as this is more robust to future message
00035     changes.  You cannot mix in-order arguments and keyword arguments.
00036 
00037     The available fields are:
00038        return_clusters,return_models,num_models
00039 
00040     :param args: complete set of field values, in .msg order
00041     :param kwds: use keyword arguments corresponding to message field names
00042     to set specific fields.
00043     """
00044     if args or kwds:
00045       super(TabletopDetectionRequest, self).__init__(*args, **kwds)
00046       #message fields cannot be None, assign default values for those that are
00047       if self.return_clusters is None:
00048         self.return_clusters = False
00049       if self.return_models is None:
00050         self.return_models = False
00051       if self.num_models is None:
00052         self.num_models = 0
00053     else:
00054       self.return_clusters = False
00055       self.return_models = False
00056       self.num_models = 0
00057 
00058   def _get_types(self):
00059     """
00060     internal API method
00061     """
00062     return self._slot_types
00063 
00064   def serialize(self, buff):
00065     """
00066     serialize message into buffer
00067     :param buff: buffer, ``StringIO``
00068     """
00069     try:
00070       _x = self
00071       buff.write(_struct_2Bi.pack(_x.return_clusters, _x.return_models, _x.num_models))
00072     except struct.error as se: self._check_types(se)
00073     except TypeError as te: self._check_types(te)
00074 
00075   def deserialize(self, str):
00076     """
00077     unpack serialized message in str into this message instance
00078     :param str: byte array of serialized message, ``str``
00079     """
00080     try:
00081       end = 0
00082       _x = self
00083       start = end
00084       end += 6
00085       (_x.return_clusters, _x.return_models, _x.num_models,) = _struct_2Bi.unpack(str[start:end])
00086       self.return_clusters = bool(self.return_clusters)
00087       self.return_models = bool(self.return_models)
00088       return self
00089     except struct.error as e:
00090       raise genpy.DeserializationError(e) #most likely buffer underfill
00091 
00092 
00093   def serialize_numpy(self, buff, numpy):
00094     """
00095     serialize message with numpy array types into buffer
00096     :param buff: buffer, ``StringIO``
00097     :param numpy: numpy python module
00098     """
00099     try:
00100       _x = self
00101       buff.write(_struct_2Bi.pack(_x.return_clusters, _x.return_models, _x.num_models))
00102     except struct.error as se: self._check_types(se)
00103     except TypeError as te: self._check_types(te)
00104 
00105   def deserialize_numpy(self, str, numpy):
00106     """
00107     unpack serialized message in str into this message instance using numpy for array types
00108     :param str: byte array of serialized message, ``str``
00109     :param numpy: numpy python module
00110     """
00111     try:
00112       end = 0
00113       _x = self
00114       start = end
00115       end += 6
00116       (_x.return_clusters, _x.return_models, _x.num_models,) = _struct_2Bi.unpack(str[start:end])
00117       self.return_clusters = bool(self.return_clusters)
00118       self.return_models = bool(self.return_models)
00119       return self
00120     except struct.error as e:
00121       raise genpy.DeserializationError(e) #most likely buffer underfill
00122 
00123 _struct_I = genpy.struct_I
00124 _struct_2Bi = struct.Struct("<2Bi")
00125 """autogenerated by genpy from tabletop_object_detector/TabletopDetectionResponse.msg. Do not edit."""
00126 import sys
00127 python3 = True if sys.hexversion > 0x03000000 else False
00128 import genpy
00129 import struct
00130 
00131 import arm_navigation_msgs.msg
00132 import tabletop_object_detector.msg
00133 import geometry_msgs.msg
00134 import sensor_msgs.msg
00135 import std_msgs.msg
00136 import household_objects_database_msgs.msg
00137 
00138 class TabletopDetectionResponse(genpy.Message):
00139   _md5sum = "1887016fd77eb33b9e6335b14d02b156"
00140   _type = "tabletop_object_detector/TabletopDetectionResponse"
00141   _has_header = False #flag to mark the presence of a Header object
00142   _full_text = """
00143 TabletopDetectionResult detection
00144 
00145 
00146 ================================================================================
00147 MSG: tabletop_object_detector/TabletopDetectionResult
00148 # Contains all the information from one run of the tabletop detection node
00149 
00150 # The information for the plane that has been detected
00151 Table table
00152 
00153 # The raw clusters detected in the scan 
00154 sensor_msgs/PointCloud[] clusters
00155 
00156 # The list of potential models that have been detected for each cluster
00157 # An empty list will be returned for a cluster that has no recognition results at all
00158 household_objects_database_msgs/DatabaseModelPoseList[] models
00159 
00160 # For each cluster, the index of the list of models that was fit to that cluster
00161 # keep in mind that multiple raw clusters can correspond to a single fit
00162 int32[] cluster_model_indices
00163 
00164 # Whether the detection has succeeded or failed
00165 int32 NO_CLOUD_RECEIVED = 1
00166 int32 NO_TABLE = 2
00167 int32 OTHER_ERROR = 3
00168 int32 SUCCESS = 4
00169 int32 result
00170 
00171 ================================================================================
00172 MSG: tabletop_object_detector/Table
00173 # Informs that a planar table has been detected at a given location
00174 
00175 # The pose gives you the transform that take you to the coordinate system
00176 # of the table, with the origin somewhere in the table plane and the 
00177 # z axis normal to the plane
00178 geometry_msgs/PoseStamped pose
00179 
00180 # These values give you the observed extents of the table, along x and y,
00181 # in the table's own coordinate system (above)
00182 # there is no guarantee that the origin of the table coordinate system is
00183 # inside the boundary defined by these values. 
00184 float32 x_min
00185 float32 x_max
00186 float32 y_min
00187 float32 y_max
00188 
00189 # There is no guarantee that the table does NOT extend further than these 
00190 # values; this is just as far as we've observed it.
00191 
00192 
00193 # Newer table definition as triangle mesh of convex hull (relative to pose)
00194 arm_navigation_msgs/Shape convex_hull
00195 
00196 ================================================================================
00197 MSG: geometry_msgs/PoseStamped
00198 # A Pose with reference coordinate frame and timestamp
00199 Header header
00200 Pose pose
00201 
00202 ================================================================================
00203 MSG: std_msgs/Header
00204 # Standard metadata for higher-level stamped data types.
00205 # This is generally used to communicate timestamped data 
00206 # in a particular coordinate frame.
00207 # 
00208 # sequence ID: consecutively increasing ID 
00209 uint32 seq
00210 #Two-integer timestamp that is expressed as:
00211 # * stamp.secs: seconds (stamp_secs) since epoch
00212 # * stamp.nsecs: nanoseconds since stamp_secs
00213 # time-handling sugar is provided by the client library
00214 time stamp
00215 #Frame this data is associated with
00216 # 0: no frame
00217 # 1: global frame
00218 string frame_id
00219 
00220 ================================================================================
00221 MSG: geometry_msgs/Pose
00222 # A representation of pose in free space, composed of postion and orientation. 
00223 Point position
00224 Quaternion orientation
00225 
00226 ================================================================================
00227 MSG: geometry_msgs/Point
00228 # This contains the position of a point in free space
00229 float64 x
00230 float64 y
00231 float64 z
00232 
00233 ================================================================================
00234 MSG: geometry_msgs/Quaternion
00235 # This represents an orientation in free space in quaternion form.
00236 
00237 float64 x
00238 float64 y
00239 float64 z
00240 float64 w
00241 
00242 ================================================================================
00243 MSG: arm_navigation_msgs/Shape
00244 byte SPHERE=0
00245 byte BOX=1
00246 byte CYLINDER=2
00247 byte MESH=3
00248 
00249 byte type
00250 
00251 
00252 #### define sphere, box, cylinder ####
00253 # the origin of each shape is considered at the shape's center
00254 
00255 # for sphere
00256 # radius := dimensions[0]
00257 
00258 # for cylinder
00259 # radius := dimensions[0]
00260 # length := dimensions[1]
00261 # the length is along the Z axis
00262 
00263 # for box
00264 # size_x := dimensions[0]
00265 # size_y := dimensions[1]
00266 # size_z := dimensions[2]
00267 float64[] dimensions
00268 
00269 
00270 #### define mesh ####
00271 
00272 # list of triangles; triangle k is defined by tre vertices located
00273 # at indices triangles[3k], triangles[3k+1], triangles[3k+2]
00274 int32[] triangles
00275 geometry_msgs/Point[] vertices
00276 
00277 ================================================================================
00278 MSG: sensor_msgs/PointCloud
00279 # This message holds a collection of 3d points, plus optional additional
00280 # information about each point.
00281 
00282 # Time of sensor data acquisition, coordinate frame ID.
00283 Header header
00284 
00285 # Array of 3d points. Each Point32 should be interpreted as a 3d point
00286 # in the frame given in the header.
00287 geometry_msgs/Point32[] points
00288 
00289 # Each channel should have the same number of elements as points array,
00290 # and the data in each channel should correspond 1:1 with each point.
00291 # Channel names in common practice are listed in ChannelFloat32.msg.
00292 ChannelFloat32[] channels
00293 
00294 ================================================================================
00295 MSG: geometry_msgs/Point32
00296 # This contains the position of a point in free space(with 32 bits of precision).
00297 # It is recommeded to use Point wherever possible instead of Point32.  
00298 # 
00299 # This recommendation is to promote interoperability.  
00300 #
00301 # This message is designed to take up less space when sending
00302 # lots of points at once, as in the case of a PointCloud.  
00303 
00304 float32 x
00305 float32 y
00306 float32 z
00307 ================================================================================
00308 MSG: sensor_msgs/ChannelFloat32
00309 # This message is used by the PointCloud message to hold optional data
00310 # associated with each point in the cloud. The length of the values
00311 # array should be the same as the length of the points array in the
00312 # PointCloud, and each value should be associated with the corresponding
00313 # point.
00314 
00315 # Channel names in existing practice include:
00316 #   "u", "v" - row and column (respectively) in the left stereo image.
00317 #              This is opposite to usual conventions but remains for
00318 #              historical reasons. The newer PointCloud2 message has no
00319 #              such problem.
00320 #   "rgb" - For point clouds produced by color stereo cameras. uint8
00321 #           (R,G,B) values packed into the least significant 24 bits,
00322 #           in order.
00323 #   "intensity" - laser or pixel intensity.
00324 #   "distance"
00325 
00326 # The channel name should give semantics of the channel (e.g.
00327 # "intensity" instead of "value").
00328 string name
00329 
00330 # The values array should be 1-1 with the elements of the associated
00331 # PointCloud.
00332 float32[] values
00333 
00334 ================================================================================
00335 MSG: household_objects_database_msgs/DatabaseModelPoseList
00336 # stores a list of possible database models recognition results
00337 DatabaseModelPose[] model_list
00338 ================================================================================
00339 MSG: household_objects_database_msgs/DatabaseModelPose
00340 # Informs that a specific model from the Model Database has been 
00341 # identified at a certain location
00342 
00343 # the database id of the model
00344 int32 model_id
00345 
00346 # the pose that it can be found in
00347 geometry_msgs/PoseStamped pose
00348 
00349 # a measure of the confidence level in this detection result
00350 float32 confidence
00351 
00352 # the name of the object detector that generated this detection result
00353 string detector_name
00354 
00355 """
00356   __slots__ = ['detection']
00357   _slot_types = ['tabletop_object_detector/TabletopDetectionResult']
00358 
00359   def __init__(self, *args, **kwds):
00360     """
00361     Constructor. Any message fields that are implicitly/explicitly
00362     set to None will be assigned a default value. The recommend
00363     use is keyword arguments as this is more robust to future message
00364     changes.  You cannot mix in-order arguments and keyword arguments.
00365 
00366     The available fields are:
00367        detection
00368 
00369     :param args: complete set of field values, in .msg order
00370     :param kwds: use keyword arguments corresponding to message field names
00371     to set specific fields.
00372     """
00373     if args or kwds:
00374       super(TabletopDetectionResponse, self).__init__(*args, **kwds)
00375       #message fields cannot be None, assign default values for those that are
00376       if self.detection is None:
00377         self.detection = tabletop_object_detector.msg.TabletopDetectionResult()
00378     else:
00379       self.detection = tabletop_object_detector.msg.TabletopDetectionResult()
00380 
00381   def _get_types(self):
00382     """
00383     internal API method
00384     """
00385     return self._slot_types
00386 
00387   def serialize(self, buff):
00388     """
00389     serialize message into buffer
00390     :param buff: buffer, ``StringIO``
00391     """
00392     try:
00393       _x = self
00394       buff.write(_struct_3I.pack(_x.detection.table.pose.header.seq, _x.detection.table.pose.header.stamp.secs, _x.detection.table.pose.header.stamp.nsecs))
00395       _x = self.detection.table.pose.header.frame_id
00396       length = len(_x)
00397       if python3 or type(_x) == unicode:
00398         _x = _x.encode('utf-8')
00399         length = len(_x)
00400       buff.write(struct.pack('<I%ss'%length, length, _x))
00401       _x = self
00402       buff.write(_struct_7d4fb.pack(_x.detection.table.pose.pose.position.x, _x.detection.table.pose.pose.position.y, _x.detection.table.pose.pose.position.z, _x.detection.table.pose.pose.orientation.x, _x.detection.table.pose.pose.orientation.y, _x.detection.table.pose.pose.orientation.z, _x.detection.table.pose.pose.orientation.w, _x.detection.table.x_min, _x.detection.table.x_max, _x.detection.table.y_min, _x.detection.table.y_max, _x.detection.table.convex_hull.type))
00403       length = len(self.detection.table.convex_hull.dimensions)
00404       buff.write(_struct_I.pack(length))
00405       pattern = '<%sd'%length
00406       buff.write(struct.pack(pattern, *self.detection.table.convex_hull.dimensions))
00407       length = len(self.detection.table.convex_hull.triangles)
00408       buff.write(_struct_I.pack(length))
00409       pattern = '<%si'%length
00410       buff.write(struct.pack(pattern, *self.detection.table.convex_hull.triangles))
00411       length = len(self.detection.table.convex_hull.vertices)
00412       buff.write(_struct_I.pack(length))
00413       for val1 in self.detection.table.convex_hull.vertices:
00414         _x = val1
00415         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00416       length = len(self.detection.clusters)
00417       buff.write(_struct_I.pack(length))
00418       for val1 in self.detection.clusters:
00419         _v1 = val1.header
00420         buff.write(_struct_I.pack(_v1.seq))
00421         _v2 = _v1.stamp
00422         _x = _v2
00423         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00424         _x = _v1.frame_id
00425         length = len(_x)
00426         if python3 or type(_x) == unicode:
00427           _x = _x.encode('utf-8')
00428           length = len(_x)
00429         buff.write(struct.pack('<I%ss'%length, length, _x))
00430         length = len(val1.points)
00431         buff.write(_struct_I.pack(length))
00432         for val2 in val1.points:
00433           _x = val2
00434           buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00435         length = len(val1.channels)
00436         buff.write(_struct_I.pack(length))
00437         for val2 in val1.channels:
00438           _x = val2.name
00439           length = len(_x)
00440           if python3 or type(_x) == unicode:
00441             _x = _x.encode('utf-8')
00442             length = len(_x)
00443           buff.write(struct.pack('<I%ss'%length, length, _x))
00444           length = len(val2.values)
00445           buff.write(_struct_I.pack(length))
00446           pattern = '<%sf'%length
00447           buff.write(struct.pack(pattern, *val2.values))
00448       length = len(self.detection.models)
00449       buff.write(_struct_I.pack(length))
00450       for val1 in self.detection.models:
00451         length = len(val1.model_list)
00452         buff.write(_struct_I.pack(length))
00453         for val2 in val1.model_list:
00454           buff.write(_struct_i.pack(val2.model_id))
00455           _v3 = val2.pose
00456           _v4 = _v3.header
00457           buff.write(_struct_I.pack(_v4.seq))
00458           _v5 = _v4.stamp
00459           _x = _v5
00460           buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00461           _x = _v4.frame_id
00462           length = len(_x)
00463           if python3 or type(_x) == unicode:
00464             _x = _x.encode('utf-8')
00465             length = len(_x)
00466           buff.write(struct.pack('<I%ss'%length, length, _x))
00467           _v6 = _v3.pose
00468           _v7 = _v6.position
00469           _x = _v7
00470           buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00471           _v8 = _v6.orientation
00472           _x = _v8
00473           buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00474           buff.write(_struct_f.pack(val2.confidence))
00475           _x = val2.detector_name
00476           length = len(_x)
00477           if python3 or type(_x) == unicode:
00478             _x = _x.encode('utf-8')
00479             length = len(_x)
00480           buff.write(struct.pack('<I%ss'%length, length, _x))
00481       length = len(self.detection.cluster_model_indices)
00482       buff.write(_struct_I.pack(length))
00483       pattern = '<%si'%length
00484       buff.write(struct.pack(pattern, *self.detection.cluster_model_indices))
00485       buff.write(_struct_i.pack(self.detection.result))
00486     except struct.error as se: self._check_types(se)
00487     except TypeError as te: self._check_types(te)
00488 
00489   def deserialize(self, str):
00490     """
00491     unpack serialized message in str into this message instance
00492     :param str: byte array of serialized message, ``str``
00493     """
00494     try:
00495       if self.detection is None:
00496         self.detection = tabletop_object_detector.msg.TabletopDetectionResult()
00497       end = 0
00498       _x = self
00499       start = end
00500       end += 12
00501       (_x.detection.table.pose.header.seq, _x.detection.table.pose.header.stamp.secs, _x.detection.table.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00502       start = end
00503       end += 4
00504       (length,) = _struct_I.unpack(str[start:end])
00505       start = end
00506       end += length
00507       if python3:
00508         self.detection.table.pose.header.frame_id = str[start:end].decode('utf-8')
00509       else:
00510         self.detection.table.pose.header.frame_id = str[start:end]
00511       _x = self
00512       start = end
00513       end += 73
00514       (_x.detection.table.pose.pose.position.x, _x.detection.table.pose.pose.position.y, _x.detection.table.pose.pose.position.z, _x.detection.table.pose.pose.orientation.x, _x.detection.table.pose.pose.orientation.y, _x.detection.table.pose.pose.orientation.z, _x.detection.table.pose.pose.orientation.w, _x.detection.table.x_min, _x.detection.table.x_max, _x.detection.table.y_min, _x.detection.table.y_max, _x.detection.table.convex_hull.type,) = _struct_7d4fb.unpack(str[start:end])
00515       start = end
00516       end += 4
00517       (length,) = _struct_I.unpack(str[start:end])
00518       pattern = '<%sd'%length
00519       start = end
00520       end += struct.calcsize(pattern)
00521       self.detection.table.convex_hull.dimensions = struct.unpack(pattern, str[start:end])
00522       start = end
00523       end += 4
00524       (length,) = _struct_I.unpack(str[start:end])
00525       pattern = '<%si'%length
00526       start = end
00527       end += struct.calcsize(pattern)
00528       self.detection.table.convex_hull.triangles = struct.unpack(pattern, str[start:end])
00529       start = end
00530       end += 4
00531       (length,) = _struct_I.unpack(str[start:end])
00532       self.detection.table.convex_hull.vertices = []
00533       for i in range(0, length):
00534         val1 = geometry_msgs.msg.Point()
00535         _x = val1
00536         start = end
00537         end += 24
00538         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00539         self.detection.table.convex_hull.vertices.append(val1)
00540       start = end
00541       end += 4
00542       (length,) = _struct_I.unpack(str[start:end])
00543       self.detection.clusters = []
00544       for i in range(0, length):
00545         val1 = sensor_msgs.msg.PointCloud()
00546         _v9 = val1.header
00547         start = end
00548         end += 4
00549         (_v9.seq,) = _struct_I.unpack(str[start:end])
00550         _v10 = _v9.stamp
00551         _x = _v10
00552         start = end
00553         end += 8
00554         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00555         start = end
00556         end += 4
00557         (length,) = _struct_I.unpack(str[start:end])
00558         start = end
00559         end += length
00560         if python3:
00561           _v9.frame_id = str[start:end].decode('utf-8')
00562         else:
00563           _v9.frame_id = str[start:end]
00564         start = end
00565         end += 4
00566         (length,) = _struct_I.unpack(str[start:end])
00567         val1.points = []
00568         for i in range(0, length):
00569           val2 = geometry_msgs.msg.Point32()
00570           _x = val2
00571           start = end
00572           end += 12
00573           (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00574           val1.points.append(val2)
00575         start = end
00576         end += 4
00577         (length,) = _struct_I.unpack(str[start:end])
00578         val1.channels = []
00579         for i in range(0, length):
00580           val2 = sensor_msgs.msg.ChannelFloat32()
00581           start = end
00582           end += 4
00583           (length,) = _struct_I.unpack(str[start:end])
00584           start = end
00585           end += length
00586           if python3:
00587             val2.name = str[start:end].decode('utf-8')
00588           else:
00589             val2.name = str[start:end]
00590           start = end
00591           end += 4
00592           (length,) = _struct_I.unpack(str[start:end])
00593           pattern = '<%sf'%length
00594           start = end
00595           end += struct.calcsize(pattern)
00596           val2.values = struct.unpack(pattern, str[start:end])
00597           val1.channels.append(val2)
00598         self.detection.clusters.append(val1)
00599       start = end
00600       end += 4
00601       (length,) = _struct_I.unpack(str[start:end])
00602       self.detection.models = []
00603       for i in range(0, length):
00604         val1 = household_objects_database_msgs.msg.DatabaseModelPoseList()
00605         start = end
00606         end += 4
00607         (length,) = _struct_I.unpack(str[start:end])
00608         val1.model_list = []
00609         for i in range(0, length):
00610           val2 = household_objects_database_msgs.msg.DatabaseModelPose()
00611           start = end
00612           end += 4
00613           (val2.model_id,) = _struct_i.unpack(str[start:end])
00614           _v11 = val2.pose
00615           _v12 = _v11.header
00616           start = end
00617           end += 4
00618           (_v12.seq,) = _struct_I.unpack(str[start:end])
00619           _v13 = _v12.stamp
00620           _x = _v13
00621           start = end
00622           end += 8
00623           (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00624           start = end
00625           end += 4
00626           (length,) = _struct_I.unpack(str[start:end])
00627           start = end
00628           end += length
00629           if python3:
00630             _v12.frame_id = str[start:end].decode('utf-8')
00631           else:
00632             _v12.frame_id = str[start:end]
00633           _v14 = _v11.pose
00634           _v15 = _v14.position
00635           _x = _v15
00636           start = end
00637           end += 24
00638           (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00639           _v16 = _v14.orientation
00640           _x = _v16
00641           start = end
00642           end += 32
00643           (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00644           start = end
00645           end += 4
00646           (val2.confidence,) = _struct_f.unpack(str[start:end])
00647           start = end
00648           end += 4
00649           (length,) = _struct_I.unpack(str[start:end])
00650           start = end
00651           end += length
00652           if python3:
00653             val2.detector_name = str[start:end].decode('utf-8')
00654           else:
00655             val2.detector_name = str[start:end]
00656           val1.model_list.append(val2)
00657         self.detection.models.append(val1)
00658       start = end
00659       end += 4
00660       (length,) = _struct_I.unpack(str[start:end])
00661       pattern = '<%si'%length
00662       start = end
00663       end += struct.calcsize(pattern)
00664       self.detection.cluster_model_indices = struct.unpack(pattern, str[start:end])
00665       start = end
00666       end += 4
00667       (self.detection.result,) = _struct_i.unpack(str[start:end])
00668       return self
00669     except struct.error as e:
00670       raise genpy.DeserializationError(e) #most likely buffer underfill
00671 
00672 
00673   def serialize_numpy(self, buff, numpy):
00674     """
00675     serialize message with numpy array types into buffer
00676     :param buff: buffer, ``StringIO``
00677     :param numpy: numpy python module
00678     """
00679     try:
00680       _x = self
00681       buff.write(_struct_3I.pack(_x.detection.table.pose.header.seq, _x.detection.table.pose.header.stamp.secs, _x.detection.table.pose.header.stamp.nsecs))
00682       _x = self.detection.table.pose.header.frame_id
00683       length = len(_x)
00684       if python3 or type(_x) == unicode:
00685         _x = _x.encode('utf-8')
00686         length = len(_x)
00687       buff.write(struct.pack('<I%ss'%length, length, _x))
00688       _x = self
00689       buff.write(_struct_7d4fb.pack(_x.detection.table.pose.pose.position.x, _x.detection.table.pose.pose.position.y, _x.detection.table.pose.pose.position.z, _x.detection.table.pose.pose.orientation.x, _x.detection.table.pose.pose.orientation.y, _x.detection.table.pose.pose.orientation.z, _x.detection.table.pose.pose.orientation.w, _x.detection.table.x_min, _x.detection.table.x_max, _x.detection.table.y_min, _x.detection.table.y_max, _x.detection.table.convex_hull.type))
00690       length = len(self.detection.table.convex_hull.dimensions)
00691       buff.write(_struct_I.pack(length))
00692       pattern = '<%sd'%length
00693       buff.write(self.detection.table.convex_hull.dimensions.tostring())
00694       length = len(self.detection.table.convex_hull.triangles)
00695       buff.write(_struct_I.pack(length))
00696       pattern = '<%si'%length
00697       buff.write(self.detection.table.convex_hull.triangles.tostring())
00698       length = len(self.detection.table.convex_hull.vertices)
00699       buff.write(_struct_I.pack(length))
00700       for val1 in self.detection.table.convex_hull.vertices:
00701         _x = val1
00702         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00703       length = len(self.detection.clusters)
00704       buff.write(_struct_I.pack(length))
00705       for val1 in self.detection.clusters:
00706         _v17 = val1.header
00707         buff.write(_struct_I.pack(_v17.seq))
00708         _v18 = _v17.stamp
00709         _x = _v18
00710         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00711         _x = _v17.frame_id
00712         length = len(_x)
00713         if python3 or type(_x) == unicode:
00714           _x = _x.encode('utf-8')
00715           length = len(_x)
00716         buff.write(struct.pack('<I%ss'%length, length, _x))
00717         length = len(val1.points)
00718         buff.write(_struct_I.pack(length))
00719         for val2 in val1.points:
00720           _x = val2
00721           buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00722         length = len(val1.channels)
00723         buff.write(_struct_I.pack(length))
00724         for val2 in val1.channels:
00725           _x = val2.name
00726           length = len(_x)
00727           if python3 or type(_x) == unicode:
00728             _x = _x.encode('utf-8')
00729             length = len(_x)
00730           buff.write(struct.pack('<I%ss'%length, length, _x))
00731           length = len(val2.values)
00732           buff.write(_struct_I.pack(length))
00733           pattern = '<%sf'%length
00734           buff.write(val2.values.tostring())
00735       length = len(self.detection.models)
00736       buff.write(_struct_I.pack(length))
00737       for val1 in self.detection.models:
00738         length = len(val1.model_list)
00739         buff.write(_struct_I.pack(length))
00740         for val2 in val1.model_list:
00741           buff.write(_struct_i.pack(val2.model_id))
00742           _v19 = val2.pose
00743           _v20 = _v19.header
00744           buff.write(_struct_I.pack(_v20.seq))
00745           _v21 = _v20.stamp
00746           _x = _v21
00747           buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00748           _x = _v20.frame_id
00749           length = len(_x)
00750           if python3 or type(_x) == unicode:
00751             _x = _x.encode('utf-8')
00752             length = len(_x)
00753           buff.write(struct.pack('<I%ss'%length, length, _x))
00754           _v22 = _v19.pose
00755           _v23 = _v22.position
00756           _x = _v23
00757           buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00758           _v24 = _v22.orientation
00759           _x = _v24
00760           buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00761           buff.write(_struct_f.pack(val2.confidence))
00762           _x = val2.detector_name
00763           length = len(_x)
00764           if python3 or type(_x) == unicode:
00765             _x = _x.encode('utf-8')
00766             length = len(_x)
00767           buff.write(struct.pack('<I%ss'%length, length, _x))
00768       length = len(self.detection.cluster_model_indices)
00769       buff.write(_struct_I.pack(length))
00770       pattern = '<%si'%length
00771       buff.write(self.detection.cluster_model_indices.tostring())
00772       buff.write(_struct_i.pack(self.detection.result))
00773     except struct.error as se: self._check_types(se)
00774     except TypeError as te: self._check_types(te)
00775 
00776   def deserialize_numpy(self, str, numpy):
00777     """
00778     unpack serialized message in str into this message instance using numpy for array types
00779     :param str: byte array of serialized message, ``str``
00780     :param numpy: numpy python module
00781     """
00782     try:
00783       if self.detection is None:
00784         self.detection = tabletop_object_detector.msg.TabletopDetectionResult()
00785       end = 0
00786       _x = self
00787       start = end
00788       end += 12
00789       (_x.detection.table.pose.header.seq, _x.detection.table.pose.header.stamp.secs, _x.detection.table.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00790       start = end
00791       end += 4
00792       (length,) = _struct_I.unpack(str[start:end])
00793       start = end
00794       end += length
00795       if python3:
00796         self.detection.table.pose.header.frame_id = str[start:end].decode('utf-8')
00797       else:
00798         self.detection.table.pose.header.frame_id = str[start:end]
00799       _x = self
00800       start = end
00801       end += 73
00802       (_x.detection.table.pose.pose.position.x, _x.detection.table.pose.pose.position.y, _x.detection.table.pose.pose.position.z, _x.detection.table.pose.pose.orientation.x, _x.detection.table.pose.pose.orientation.y, _x.detection.table.pose.pose.orientation.z, _x.detection.table.pose.pose.orientation.w, _x.detection.table.x_min, _x.detection.table.x_max, _x.detection.table.y_min, _x.detection.table.y_max, _x.detection.table.convex_hull.type,) = _struct_7d4fb.unpack(str[start:end])
00803       start = end
00804       end += 4
00805       (length,) = _struct_I.unpack(str[start:end])
00806       pattern = '<%sd'%length
00807       start = end
00808       end += struct.calcsize(pattern)
00809       self.detection.table.convex_hull.dimensions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00810       start = end
00811       end += 4
00812       (length,) = _struct_I.unpack(str[start:end])
00813       pattern = '<%si'%length
00814       start = end
00815       end += struct.calcsize(pattern)
00816       self.detection.table.convex_hull.triangles = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00817       start = end
00818       end += 4
00819       (length,) = _struct_I.unpack(str[start:end])
00820       self.detection.table.convex_hull.vertices = []
00821       for i in range(0, length):
00822         val1 = geometry_msgs.msg.Point()
00823         _x = val1
00824         start = end
00825         end += 24
00826         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00827         self.detection.table.convex_hull.vertices.append(val1)
00828       start = end
00829       end += 4
00830       (length,) = _struct_I.unpack(str[start:end])
00831       self.detection.clusters = []
00832       for i in range(0, length):
00833         val1 = sensor_msgs.msg.PointCloud()
00834         _v25 = val1.header
00835         start = end
00836         end += 4
00837         (_v25.seq,) = _struct_I.unpack(str[start:end])
00838         _v26 = _v25.stamp
00839         _x = _v26
00840         start = end
00841         end += 8
00842         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00843         start = end
00844         end += 4
00845         (length,) = _struct_I.unpack(str[start:end])
00846         start = end
00847         end += length
00848         if python3:
00849           _v25.frame_id = str[start:end].decode('utf-8')
00850         else:
00851           _v25.frame_id = str[start:end]
00852         start = end
00853         end += 4
00854         (length,) = _struct_I.unpack(str[start:end])
00855         val1.points = []
00856         for i in range(0, length):
00857           val2 = geometry_msgs.msg.Point32()
00858           _x = val2
00859           start = end
00860           end += 12
00861           (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00862           val1.points.append(val2)
00863         start = end
00864         end += 4
00865         (length,) = _struct_I.unpack(str[start:end])
00866         val1.channels = []
00867         for i in range(0, length):
00868           val2 = sensor_msgs.msg.ChannelFloat32()
00869           start = end
00870           end += 4
00871           (length,) = _struct_I.unpack(str[start:end])
00872           start = end
00873           end += length
00874           if python3:
00875             val2.name = str[start:end].decode('utf-8')
00876           else:
00877             val2.name = str[start:end]
00878           start = end
00879           end += 4
00880           (length,) = _struct_I.unpack(str[start:end])
00881           pattern = '<%sf'%length
00882           start = end
00883           end += struct.calcsize(pattern)
00884           val2.values = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00885           val1.channels.append(val2)
00886         self.detection.clusters.append(val1)
00887       start = end
00888       end += 4
00889       (length,) = _struct_I.unpack(str[start:end])
00890       self.detection.models = []
00891       for i in range(0, length):
00892         val1 = household_objects_database_msgs.msg.DatabaseModelPoseList()
00893         start = end
00894         end += 4
00895         (length,) = _struct_I.unpack(str[start:end])
00896         val1.model_list = []
00897         for i in range(0, length):
00898           val2 = household_objects_database_msgs.msg.DatabaseModelPose()
00899           start = end
00900           end += 4
00901           (val2.model_id,) = _struct_i.unpack(str[start:end])
00902           _v27 = val2.pose
00903           _v28 = _v27.header
00904           start = end
00905           end += 4
00906           (_v28.seq,) = _struct_I.unpack(str[start:end])
00907           _v29 = _v28.stamp
00908           _x = _v29
00909           start = end
00910           end += 8
00911           (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00912           start = end
00913           end += 4
00914           (length,) = _struct_I.unpack(str[start:end])
00915           start = end
00916           end += length
00917           if python3:
00918             _v28.frame_id = str[start:end].decode('utf-8')
00919           else:
00920             _v28.frame_id = str[start:end]
00921           _v30 = _v27.pose
00922           _v31 = _v30.position
00923           _x = _v31
00924           start = end
00925           end += 24
00926           (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00927           _v32 = _v30.orientation
00928           _x = _v32
00929           start = end
00930           end += 32
00931           (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00932           start = end
00933           end += 4
00934           (val2.confidence,) = _struct_f.unpack(str[start:end])
00935           start = end
00936           end += 4
00937           (length,) = _struct_I.unpack(str[start:end])
00938           start = end
00939           end += length
00940           if python3:
00941             val2.detector_name = str[start:end].decode('utf-8')
00942           else:
00943             val2.detector_name = str[start:end]
00944           val1.model_list.append(val2)
00945         self.detection.models.append(val1)
00946       start = end
00947       end += 4
00948       (length,) = _struct_I.unpack(str[start:end])
00949       pattern = '<%si'%length
00950       start = end
00951       end += struct.calcsize(pattern)
00952       self.detection.cluster_model_indices = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00953       start = end
00954       end += 4
00955       (self.detection.result,) = _struct_i.unpack(str[start:end])
00956       return self
00957     except struct.error as e:
00958       raise genpy.DeserializationError(e) #most likely buffer underfill
00959 
00960 _struct_I = genpy.struct_I
00961 _struct_f = struct.Struct("<f")
00962 _struct_7d4fb = struct.Struct("<7d4fb")
00963 _struct_2I = struct.Struct("<2I")
00964 _struct_i = struct.Struct("<i")
00965 _struct_3I = struct.Struct("<3I")
00966 _struct_4d = struct.Struct("<4d")
00967 _struct_3f = struct.Struct("<3f")
00968 _struct_3d = struct.Struct("<3d")
00969 class TabletopDetection(object):
00970   _type          = 'tabletop_object_detector/TabletopDetection'
00971   _md5sum = '2c2af970832ab0ca635bc95df7de690a'
00972   _request_class  = TabletopDetectionRequest
00973   _response_class = TabletopDetectionResponse


tabletop_object_detector
Author(s): Marius Muja and Matei Ciocarlie
autogenerated on Fri Jan 3 2014 11:48:47