00001 """autogenerated by genpy from blort_ros/ObjectPose.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 geometry_msgs.msg
00008 import blort_ros.msg
00009
00010 class ObjectPose(genpy.Message):
00011 _md5sum = "a1a9ddd9cdd7cb9b07994b75cc08bdcc"
00012 _type = "blort_ros/ObjectPose"
00013 _has_header = False
00014 _full_text = """string name
00015
00016 geometry_msgs/Pose pose
00017 geometry_msgs/Point32 pose2D
00018
00019 int16[] convex_hull_x
00020 int16[] convex_hull_y
00021
00022 float32 mean_quality
00023 int16 used_points
00024
00025 NameTypeValue[] properties
00026
00027 geometry_msgs/Pose[] pose_uncertainty_list
00028
00029 ================================================================================
00030 MSG: geometry_msgs/Pose
00031 # A representation of pose in free space, composed of postion and orientation.
00032 Point position
00033 Quaternion orientation
00034
00035 ================================================================================
00036 MSG: geometry_msgs/Point
00037 # This contains the position of a point in free space
00038 float64 x
00039 float64 y
00040 float64 z
00041
00042 ================================================================================
00043 MSG: geometry_msgs/Quaternion
00044 # This represents an orientation in free space in quaternion form.
00045
00046 float64 x
00047 float64 y
00048 float64 z
00049 float64 w
00050
00051 ================================================================================
00052 MSG: geometry_msgs/Point32
00053 # This contains the position of a point in free space(with 32 bits of precision).
00054 # It is recommeded to use Point wherever possible instead of Point32.
00055 #
00056 # This recommendation is to promote interoperability.
00057 #
00058 # This message is designed to take up less space when sending
00059 # lots of points at once, as in the case of a PointCloud.
00060
00061 float32 x
00062 float32 y
00063 float32 z
00064 ================================================================================
00065 MSG: blort_ros/NameTypeValue
00066 string name
00067 string type
00068 string value
00069
00070 """
00071 __slots__ = ['name','pose','pose2D','convex_hull_x','convex_hull_y','mean_quality','used_points','properties','pose_uncertainty_list']
00072 _slot_types = ['string','geometry_msgs/Pose','geometry_msgs/Point32','int16[]','int16[]','float32','int16','blort_ros/NameTypeValue[]','geometry_msgs/Pose[]']
00073
00074 def __init__(self, *args, **kwds):
00075 """
00076 Constructor. Any message fields that are implicitly/explicitly
00077 set to None will be assigned a default value. The recommend
00078 use is keyword arguments as this is more robust to future message
00079 changes. You cannot mix in-order arguments and keyword arguments.
00080
00081 The available fields are:
00082 name,pose,pose2D,convex_hull_x,convex_hull_y,mean_quality,used_points,properties,pose_uncertainty_list
00083
00084 :param args: complete set of field values, in .msg order
00085 :param kwds: use keyword arguments corresponding to message field names
00086 to set specific fields.
00087 """
00088 if args or kwds:
00089 super(ObjectPose, self).__init__(*args, **kwds)
00090
00091 if self.name is None:
00092 self.name = ''
00093 if self.pose is None:
00094 self.pose = geometry_msgs.msg.Pose()
00095 if self.pose2D is None:
00096 self.pose2D = geometry_msgs.msg.Point32()
00097 if self.convex_hull_x is None:
00098 self.convex_hull_x = []
00099 if self.convex_hull_y is None:
00100 self.convex_hull_y = []
00101 if self.mean_quality is None:
00102 self.mean_quality = 0.
00103 if self.used_points is None:
00104 self.used_points = 0
00105 if self.properties is None:
00106 self.properties = []
00107 if self.pose_uncertainty_list is None:
00108 self.pose_uncertainty_list = []
00109 else:
00110 self.name = ''
00111 self.pose = geometry_msgs.msg.Pose()
00112 self.pose2D = geometry_msgs.msg.Point32()
00113 self.convex_hull_x = []
00114 self.convex_hull_y = []
00115 self.mean_quality = 0.
00116 self.used_points = 0
00117 self.properties = []
00118 self.pose_uncertainty_list = []
00119
00120 def _get_types(self):
00121 """
00122 internal API method
00123 """
00124 return self._slot_types
00125
00126 def serialize(self, buff):
00127 """
00128 serialize message into buffer
00129 :param buff: buffer, ``StringIO``
00130 """
00131 try:
00132 _x = self.name
00133 length = len(_x)
00134 if python3 or type(_x) == unicode:
00135 _x = _x.encode('utf-8')
00136 length = len(_x)
00137 buff.write(struct.pack('<I%ss'%length, length, _x))
00138 _x = self
00139 buff.write(_struct_7d3f.pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w, _x.pose2D.x, _x.pose2D.y, _x.pose2D.z))
00140 length = len(self.convex_hull_x)
00141 buff.write(_struct_I.pack(length))
00142 pattern = '<%sh'%length
00143 buff.write(struct.pack(pattern, *self.convex_hull_x))
00144 length = len(self.convex_hull_y)
00145 buff.write(_struct_I.pack(length))
00146 pattern = '<%sh'%length
00147 buff.write(struct.pack(pattern, *self.convex_hull_y))
00148 _x = self
00149 buff.write(_struct_fh.pack(_x.mean_quality, _x.used_points))
00150 length = len(self.properties)
00151 buff.write(_struct_I.pack(length))
00152 for val1 in self.properties:
00153 _x = val1.name
00154 length = len(_x)
00155 if python3 or type(_x) == unicode:
00156 _x = _x.encode('utf-8')
00157 length = len(_x)
00158 buff.write(struct.pack('<I%ss'%length, length, _x))
00159 _x = val1.type
00160 length = len(_x)
00161 if python3 or type(_x) == unicode:
00162 _x = _x.encode('utf-8')
00163 length = len(_x)
00164 buff.write(struct.pack('<I%ss'%length, length, _x))
00165 _x = val1.value
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 length = len(self.pose_uncertainty_list)
00172 buff.write(_struct_I.pack(length))
00173 for val1 in self.pose_uncertainty_list:
00174 _v1 = val1.position
00175 _x = _v1
00176 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00177 _v2 = val1.orientation
00178 _x = _v2
00179 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00180 except struct.error as se: self._check_types(se)
00181 except TypeError as te: self._check_types(te)
00182
00183 def deserialize(self, str):
00184 """
00185 unpack serialized message in str into this message instance
00186 :param str: byte array of serialized message, ``str``
00187 """
00188 try:
00189 if self.pose is None:
00190 self.pose = geometry_msgs.msg.Pose()
00191 if self.pose2D is None:
00192 self.pose2D = geometry_msgs.msg.Point32()
00193 if self.properties is None:
00194 self.properties = None
00195 if self.pose_uncertainty_list is None:
00196 self.pose_uncertainty_list = None
00197 end = 0
00198 start = end
00199 end += 4
00200 (length,) = _struct_I.unpack(str[start:end])
00201 start = end
00202 end += length
00203 if python3:
00204 self.name = str[start:end].decode('utf-8')
00205 else:
00206 self.name = str[start:end]
00207 _x = self
00208 start = end
00209 end += 68
00210 (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w, _x.pose2D.x, _x.pose2D.y, _x.pose2D.z,) = _struct_7d3f.unpack(str[start:end])
00211 start = end
00212 end += 4
00213 (length,) = _struct_I.unpack(str[start:end])
00214 pattern = '<%sh'%length
00215 start = end
00216 end += struct.calcsize(pattern)
00217 self.convex_hull_x = struct.unpack(pattern, str[start:end])
00218 start = end
00219 end += 4
00220 (length,) = _struct_I.unpack(str[start:end])
00221 pattern = '<%sh'%length
00222 start = end
00223 end += struct.calcsize(pattern)
00224 self.convex_hull_y = struct.unpack(pattern, str[start:end])
00225 _x = self
00226 start = end
00227 end += 6
00228 (_x.mean_quality, _x.used_points,) = _struct_fh.unpack(str[start:end])
00229 start = end
00230 end += 4
00231 (length,) = _struct_I.unpack(str[start:end])
00232 self.properties = []
00233 for i in range(0, length):
00234 val1 = blort_ros.msg.NameTypeValue()
00235 start = end
00236 end += 4
00237 (length,) = _struct_I.unpack(str[start:end])
00238 start = end
00239 end += length
00240 if python3:
00241 val1.name = str[start:end].decode('utf-8')
00242 else:
00243 val1.name = str[start:end]
00244 start = end
00245 end += 4
00246 (length,) = _struct_I.unpack(str[start:end])
00247 start = end
00248 end += length
00249 if python3:
00250 val1.type = str[start:end].decode('utf-8')
00251 else:
00252 val1.type = str[start:end]
00253 start = end
00254 end += 4
00255 (length,) = _struct_I.unpack(str[start:end])
00256 start = end
00257 end += length
00258 if python3:
00259 val1.value = str[start:end].decode('utf-8')
00260 else:
00261 val1.value = str[start:end]
00262 self.properties.append(val1)
00263 start = end
00264 end += 4
00265 (length,) = _struct_I.unpack(str[start:end])
00266 self.pose_uncertainty_list = []
00267 for i in range(0, length):
00268 val1 = geometry_msgs.msg.Pose()
00269 _v3 = val1.position
00270 _x = _v3
00271 start = end
00272 end += 24
00273 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00274 _v4 = val1.orientation
00275 _x = _v4
00276 start = end
00277 end += 32
00278 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00279 self.pose_uncertainty_list.append(val1)
00280 return self
00281 except struct.error as e:
00282 raise genpy.DeserializationError(e)
00283
00284
00285 def serialize_numpy(self, buff, numpy):
00286 """
00287 serialize message with numpy array types into buffer
00288 :param buff: buffer, ``StringIO``
00289 :param numpy: numpy python module
00290 """
00291 try:
00292 _x = self.name
00293 length = len(_x)
00294 if python3 or type(_x) == unicode:
00295 _x = _x.encode('utf-8')
00296 length = len(_x)
00297 buff.write(struct.pack('<I%ss'%length, length, _x))
00298 _x = self
00299 buff.write(_struct_7d3f.pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w, _x.pose2D.x, _x.pose2D.y, _x.pose2D.z))
00300 length = len(self.convex_hull_x)
00301 buff.write(_struct_I.pack(length))
00302 pattern = '<%sh'%length
00303 buff.write(self.convex_hull_x.tostring())
00304 length = len(self.convex_hull_y)
00305 buff.write(_struct_I.pack(length))
00306 pattern = '<%sh'%length
00307 buff.write(self.convex_hull_y.tostring())
00308 _x = self
00309 buff.write(_struct_fh.pack(_x.mean_quality, _x.used_points))
00310 length = len(self.properties)
00311 buff.write(_struct_I.pack(length))
00312 for val1 in self.properties:
00313 _x = val1.name
00314 length = len(_x)
00315 if python3 or type(_x) == unicode:
00316 _x = _x.encode('utf-8')
00317 length = len(_x)
00318 buff.write(struct.pack('<I%ss'%length, length, _x))
00319 _x = val1.type
00320 length = len(_x)
00321 if python3 or type(_x) == unicode:
00322 _x = _x.encode('utf-8')
00323 length = len(_x)
00324 buff.write(struct.pack('<I%ss'%length, length, _x))
00325 _x = val1.value
00326 length = len(_x)
00327 if python3 or type(_x) == unicode:
00328 _x = _x.encode('utf-8')
00329 length = len(_x)
00330 buff.write(struct.pack('<I%ss'%length, length, _x))
00331 length = len(self.pose_uncertainty_list)
00332 buff.write(_struct_I.pack(length))
00333 for val1 in self.pose_uncertainty_list:
00334 _v5 = val1.position
00335 _x = _v5
00336 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00337 _v6 = val1.orientation
00338 _x = _v6
00339 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00340 except struct.error as se: self._check_types(se)
00341 except TypeError as te: self._check_types(te)
00342
00343 def deserialize_numpy(self, str, numpy):
00344 """
00345 unpack serialized message in str into this message instance using numpy for array types
00346 :param str: byte array of serialized message, ``str``
00347 :param numpy: numpy python module
00348 """
00349 try:
00350 if self.pose is None:
00351 self.pose = geometry_msgs.msg.Pose()
00352 if self.pose2D is None:
00353 self.pose2D = geometry_msgs.msg.Point32()
00354 if self.properties is None:
00355 self.properties = None
00356 if self.pose_uncertainty_list is None:
00357 self.pose_uncertainty_list = None
00358 end = 0
00359 start = end
00360 end += 4
00361 (length,) = _struct_I.unpack(str[start:end])
00362 start = end
00363 end += length
00364 if python3:
00365 self.name = str[start:end].decode('utf-8')
00366 else:
00367 self.name = str[start:end]
00368 _x = self
00369 start = end
00370 end += 68
00371 (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w, _x.pose2D.x, _x.pose2D.y, _x.pose2D.z,) = _struct_7d3f.unpack(str[start:end])
00372 start = end
00373 end += 4
00374 (length,) = _struct_I.unpack(str[start:end])
00375 pattern = '<%sh'%length
00376 start = end
00377 end += struct.calcsize(pattern)
00378 self.convex_hull_x = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=length)
00379 start = end
00380 end += 4
00381 (length,) = _struct_I.unpack(str[start:end])
00382 pattern = '<%sh'%length
00383 start = end
00384 end += struct.calcsize(pattern)
00385 self.convex_hull_y = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=length)
00386 _x = self
00387 start = end
00388 end += 6
00389 (_x.mean_quality, _x.used_points,) = _struct_fh.unpack(str[start:end])
00390 start = end
00391 end += 4
00392 (length,) = _struct_I.unpack(str[start:end])
00393 self.properties = []
00394 for i in range(0, length):
00395 val1 = blort_ros.msg.NameTypeValue()
00396 start = end
00397 end += 4
00398 (length,) = _struct_I.unpack(str[start:end])
00399 start = end
00400 end += length
00401 if python3:
00402 val1.name = str[start:end].decode('utf-8')
00403 else:
00404 val1.name = str[start:end]
00405 start = end
00406 end += 4
00407 (length,) = _struct_I.unpack(str[start:end])
00408 start = end
00409 end += length
00410 if python3:
00411 val1.type = str[start:end].decode('utf-8')
00412 else:
00413 val1.type = str[start:end]
00414 start = end
00415 end += 4
00416 (length,) = _struct_I.unpack(str[start:end])
00417 start = end
00418 end += length
00419 if python3:
00420 val1.value = str[start:end].decode('utf-8')
00421 else:
00422 val1.value = str[start:end]
00423 self.properties.append(val1)
00424 start = end
00425 end += 4
00426 (length,) = _struct_I.unpack(str[start:end])
00427 self.pose_uncertainty_list = []
00428 for i in range(0, length):
00429 val1 = geometry_msgs.msg.Pose()
00430 _v7 = val1.position
00431 _x = _v7
00432 start = end
00433 end += 24
00434 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00435 _v8 = val1.orientation
00436 _x = _v8
00437 start = end
00438 end += 32
00439 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00440 self.pose_uncertainty_list.append(val1)
00441 return self
00442 except struct.error as e:
00443 raise genpy.DeserializationError(e)
00444
00445 _struct_I = genpy.struct_I
00446 _struct_fh = struct.Struct("<fh")
00447 _struct_7d3f = struct.Struct("<7d3f")
00448 _struct_4d = struct.Struct("<4d")
00449 _struct_3d = struct.Struct("<3d")