00001 """autogenerated by genpy from household_objects_database_msgs/DatabaseModelPoseList.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 geometry_msgs.msg
00009 import household_objects_database_msgs.msg
00010
00011 class DatabaseModelPoseList(genpy.Message):
00012 _md5sum = "0d9ed435b245615af39f223ce2d9a142"
00013 _type = "household_objects_database_msgs/DatabaseModelPoseList"
00014 _has_header = False
00015 _full_text = """# stores a list of possible database models recognition results
00016 DatabaseModelPose[] model_list
00017 ================================================================================
00018 MSG: household_objects_database_msgs/DatabaseModelPose
00019 # Informs that a specific model from the Model Database has been
00020 # identified at a certain location
00021
00022 # the database id of the model
00023 int32 model_id
00024
00025 # the pose that it can be found in
00026 geometry_msgs/PoseStamped pose
00027
00028 # a measure of the confidence level in this detection result
00029 float32 confidence
00030
00031 # the name of the object detector that generated this detection result
00032 string detector_name
00033
00034 ================================================================================
00035 MSG: geometry_msgs/PoseStamped
00036 # A Pose with reference coordinate frame and timestamp
00037 Header header
00038 Pose pose
00039
00040 ================================================================================
00041 MSG: std_msgs/Header
00042 # Standard metadata for higher-level stamped data types.
00043 # This is generally used to communicate timestamped data
00044 # in a particular coordinate frame.
00045 #
00046 # sequence ID: consecutively increasing ID
00047 uint32 seq
00048 #Two-integer timestamp that is expressed as:
00049 # * stamp.secs: seconds (stamp_secs) since epoch
00050 # * stamp.nsecs: nanoseconds since stamp_secs
00051 # time-handling sugar is provided by the client library
00052 time stamp
00053 #Frame this data is associated with
00054 # 0: no frame
00055 # 1: global frame
00056 string frame_id
00057
00058 ================================================================================
00059 MSG: geometry_msgs/Pose
00060 # A representation of pose in free space, composed of postion and orientation.
00061 Point position
00062 Quaternion orientation
00063
00064 ================================================================================
00065 MSG: geometry_msgs/Point
00066 # This contains the position of a point in free space
00067 float64 x
00068 float64 y
00069 float64 z
00070
00071 ================================================================================
00072 MSG: geometry_msgs/Quaternion
00073 # This represents an orientation in free space in quaternion form.
00074
00075 float64 x
00076 float64 y
00077 float64 z
00078 float64 w
00079
00080 """
00081 __slots__ = ['model_list']
00082 _slot_types = ['household_objects_database_msgs/DatabaseModelPose[]']
00083
00084 def __init__(self, *args, **kwds):
00085 """
00086 Constructor. Any message fields that are implicitly/explicitly
00087 set to None will be assigned a default value. The recommend
00088 use is keyword arguments as this is more robust to future message
00089 changes. You cannot mix in-order arguments and keyword arguments.
00090
00091 The available fields are:
00092 model_list
00093
00094 :param args: complete set of field values, in .msg order
00095 :param kwds: use keyword arguments corresponding to message field names
00096 to set specific fields.
00097 """
00098 if args or kwds:
00099 super(DatabaseModelPoseList, self).__init__(*args, **kwds)
00100
00101 if self.model_list is None:
00102 self.model_list = []
00103 else:
00104 self.model_list = []
00105
00106 def _get_types(self):
00107 """
00108 internal API method
00109 """
00110 return self._slot_types
00111
00112 def serialize(self, buff):
00113 """
00114 serialize message into buffer
00115 :param buff: buffer, ``StringIO``
00116 """
00117 try:
00118 length = len(self.model_list)
00119 buff.write(_struct_I.pack(length))
00120 for val1 in self.model_list:
00121 buff.write(_struct_i.pack(val1.model_id))
00122 _v1 = val1.pose
00123 _v2 = _v1.header
00124 buff.write(_struct_I.pack(_v2.seq))
00125 _v3 = _v2.stamp
00126 _x = _v3
00127 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00128 _x = _v2.frame_id
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 _v4 = _v1.pose
00135 _v5 = _v4.position
00136 _x = _v5
00137 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00138 _v6 = _v4.orientation
00139 _x = _v6
00140 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00141 buff.write(_struct_f.pack(val1.confidence))
00142 _x = val1.detector_name
00143 length = len(_x)
00144 if python3 or type(_x) == unicode:
00145 _x = _x.encode('utf-8')
00146 length = len(_x)
00147 buff.write(struct.pack('<I%ss'%length, length, _x))
00148 except struct.error as se: self._check_types(se)
00149 except TypeError as te: self._check_types(te)
00150
00151 def deserialize(self, str):
00152 """
00153 unpack serialized message in str into this message instance
00154 :param str: byte array of serialized message, ``str``
00155 """
00156 try:
00157 if self.model_list is None:
00158 self.model_list = None
00159 end = 0
00160 start = end
00161 end += 4
00162 (length,) = _struct_I.unpack(str[start:end])
00163 self.model_list = []
00164 for i in range(0, length):
00165 val1 = household_objects_database_msgs.msg.DatabaseModelPose()
00166 start = end
00167 end += 4
00168 (val1.model_id,) = _struct_i.unpack(str[start:end])
00169 _v7 = val1.pose
00170 _v8 = _v7.header
00171 start = end
00172 end += 4
00173 (_v8.seq,) = _struct_I.unpack(str[start:end])
00174 _v9 = _v8.stamp
00175 _x = _v9
00176 start = end
00177 end += 8
00178 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00179 start = end
00180 end += 4
00181 (length,) = _struct_I.unpack(str[start:end])
00182 start = end
00183 end += length
00184 if python3:
00185 _v8.frame_id = str[start:end].decode('utf-8')
00186 else:
00187 _v8.frame_id = str[start:end]
00188 _v10 = _v7.pose
00189 _v11 = _v10.position
00190 _x = _v11
00191 start = end
00192 end += 24
00193 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00194 _v12 = _v10.orientation
00195 _x = _v12
00196 start = end
00197 end += 32
00198 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00199 start = end
00200 end += 4
00201 (val1.confidence,) = _struct_f.unpack(str[start:end])
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.detector_name = str[start:end].decode('utf-8')
00209 else:
00210 val1.detector_name = str[start:end]
00211 self.model_list.append(val1)
00212 return self
00213 except struct.error as e:
00214 raise genpy.DeserializationError(e)
00215
00216
00217 def serialize_numpy(self, buff, numpy):
00218 """
00219 serialize message with numpy array types into buffer
00220 :param buff: buffer, ``StringIO``
00221 :param numpy: numpy python module
00222 """
00223 try:
00224 length = len(self.model_list)
00225 buff.write(_struct_I.pack(length))
00226 for val1 in self.model_list:
00227 buff.write(_struct_i.pack(val1.model_id))
00228 _v13 = val1.pose
00229 _v14 = _v13.header
00230 buff.write(_struct_I.pack(_v14.seq))
00231 _v15 = _v14.stamp
00232 _x = _v15
00233 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00234 _x = _v14.frame_id
00235 length = len(_x)
00236 if python3 or type(_x) == unicode:
00237 _x = _x.encode('utf-8')
00238 length = len(_x)
00239 buff.write(struct.pack('<I%ss'%length, length, _x))
00240 _v16 = _v13.pose
00241 _v17 = _v16.position
00242 _x = _v17
00243 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00244 _v18 = _v16.orientation
00245 _x = _v18
00246 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00247 buff.write(_struct_f.pack(val1.confidence))
00248 _x = val1.detector_name
00249 length = len(_x)
00250 if python3 or type(_x) == unicode:
00251 _x = _x.encode('utf-8')
00252 length = len(_x)
00253 buff.write(struct.pack('<I%ss'%length, length, _x))
00254 except struct.error as se: self._check_types(se)
00255 except TypeError as te: self._check_types(te)
00256
00257 def deserialize_numpy(self, str, numpy):
00258 """
00259 unpack serialized message in str into this message instance using numpy for array types
00260 :param str: byte array of serialized message, ``str``
00261 :param numpy: numpy python module
00262 """
00263 try:
00264 if self.model_list is None:
00265 self.model_list = None
00266 end = 0
00267 start = end
00268 end += 4
00269 (length,) = _struct_I.unpack(str[start:end])
00270 self.model_list = []
00271 for i in range(0, length):
00272 val1 = household_objects_database_msgs.msg.DatabaseModelPose()
00273 start = end
00274 end += 4
00275 (val1.model_id,) = _struct_i.unpack(str[start:end])
00276 _v19 = val1.pose
00277 _v20 = _v19.header
00278 start = end
00279 end += 4
00280 (_v20.seq,) = _struct_I.unpack(str[start:end])
00281 _v21 = _v20.stamp
00282 _x = _v21
00283 start = end
00284 end += 8
00285 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00286 start = end
00287 end += 4
00288 (length,) = _struct_I.unpack(str[start:end])
00289 start = end
00290 end += length
00291 if python3:
00292 _v20.frame_id = str[start:end].decode('utf-8')
00293 else:
00294 _v20.frame_id = str[start:end]
00295 _v22 = _v19.pose
00296 _v23 = _v22.position
00297 _x = _v23
00298 start = end
00299 end += 24
00300 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00301 _v24 = _v22.orientation
00302 _x = _v24
00303 start = end
00304 end += 32
00305 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00306 start = end
00307 end += 4
00308 (val1.confidence,) = _struct_f.unpack(str[start:end])
00309 start = end
00310 end += 4
00311 (length,) = _struct_I.unpack(str[start:end])
00312 start = end
00313 end += length
00314 if python3:
00315 val1.detector_name = str[start:end].decode('utf-8')
00316 else:
00317 val1.detector_name = str[start:end]
00318 self.model_list.append(val1)
00319 return self
00320 except struct.error as e:
00321 raise genpy.DeserializationError(e)
00322
00323 _struct_I = genpy.struct_I
00324 _struct_f = struct.Struct("<f")
00325 _struct_i = struct.Struct("<i")
00326 _struct_4d = struct.Struct("<4d")
00327 _struct_2I = struct.Struct("<2I")
00328 _struct_3d = struct.Struct("<3d")