00001 """autogenerated by genmsg_py from GetModelScansRequest.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class GetModelScansRequest(roslib.message.Message):
00007 _md5sum = "4f31b0f27ba251f6d1f17eafced83cb7"
00008 _type = "household_objects_database_msgs/GetModelScansRequest"
00009 _has_header = False
00010 _full_text = """
00011
00012
00013 int32 model_id
00014
00015
00016 string scan_source
00017
00018
00019 """
00020 __slots__ = ['model_id','scan_source']
00021 _slot_types = ['int32','string']
00022
00023 def __init__(self, *args, **kwds):
00024 """
00025 Constructor. Any message fields that are implicitly/explicitly
00026 set to None will be assigned a default value. The recommend
00027 use is keyword arguments as this is more robust to future message
00028 changes. You cannot mix in-order arguments and keyword arguments.
00029
00030 The available fields are:
00031 model_id,scan_source
00032
00033 @param args: complete set of field values, in .msg order
00034 @param kwds: use keyword arguments corresponding to message field names
00035 to set specific fields.
00036 """
00037 if args or kwds:
00038 super(GetModelScansRequest, self).__init__(*args, **kwds)
00039
00040 if self.model_id is None:
00041 self.model_id = 0
00042 if self.scan_source is None:
00043 self.scan_source = ''
00044 else:
00045 self.model_id = 0
00046 self.scan_source = ''
00047
00048 def _get_types(self):
00049 """
00050 internal API method
00051 """
00052 return self._slot_types
00053
00054 def serialize(self, buff):
00055 """
00056 serialize message into buffer
00057 @param buff: buffer
00058 @type buff: StringIO
00059 """
00060 try:
00061 buff.write(_struct_i.pack(self.model_id))
00062 _x = self.scan_source
00063 length = len(_x)
00064 buff.write(struct.pack('<I%ss'%length, length, _x))
00065 except struct.error, se: self._check_types(se)
00066 except TypeError, te: self._check_types(te)
00067
00068 def deserialize(self, str):
00069 """
00070 unpack serialized message in str into this message instance
00071 @param str: byte array of serialized message
00072 @type str: str
00073 """
00074 try:
00075 end = 0
00076 start = end
00077 end += 4
00078 (self.model_id,) = _struct_i.unpack(str[start:end])
00079 start = end
00080 end += 4
00081 (length,) = _struct_I.unpack(str[start:end])
00082 start = end
00083 end += length
00084 self.scan_source = str[start:end]
00085 return self
00086 except struct.error, e:
00087 raise roslib.message.DeserializationError(e)
00088
00089
00090 def serialize_numpy(self, buff, numpy):
00091 """
00092 serialize message with numpy array types into buffer
00093 @param buff: buffer
00094 @type buff: StringIO
00095 @param numpy: numpy python module
00096 @type numpy module
00097 """
00098 try:
00099 buff.write(_struct_i.pack(self.model_id))
00100 _x = self.scan_source
00101 length = len(_x)
00102 buff.write(struct.pack('<I%ss'%length, length, _x))
00103 except struct.error, se: self._check_types(se)
00104 except TypeError, te: self._check_types(te)
00105
00106 def deserialize_numpy(self, str, numpy):
00107 """
00108 unpack serialized message in str into this message instance using numpy for array types
00109 @param str: byte array of serialized message
00110 @type str: str
00111 @param numpy: numpy python module
00112 @type numpy: module
00113 """
00114 try:
00115 end = 0
00116 start = end
00117 end += 4
00118 (self.model_id,) = _struct_i.unpack(str[start:end])
00119 start = end
00120 end += 4
00121 (length,) = _struct_I.unpack(str[start:end])
00122 start = end
00123 end += length
00124 self.scan_source = str[start:end]
00125 return self
00126 except struct.error, e:
00127 raise roslib.message.DeserializationError(e)
00128
00129 _struct_I = roslib.message.struct_I
00130 _struct_i = struct.Struct("<i")
00131 """autogenerated by genmsg_py from GetModelScansResponse.msg. Do not edit."""
00132 import roslib.message
00133 import struct
00134
00135 import std_msgs.msg
00136 import geometry_msgs.msg
00137 import household_objects_database_msgs.msg
00138
00139 class GetModelScansResponse(roslib.message.Message):
00140 _md5sum = "8d1bb6e95c26a5d891987d9d9195e958"
00141 _type = "household_objects_database_msgs/GetModelScansResponse"
00142 _has_header = False
00143 _full_text = """
00144
00145 DatabaseReturnCode return_code
00146
00147
00148 DatabaseScan[] matching_scans
00149
00150 ================================================================================
00151 MSG: household_objects_database_msgs/DatabaseReturnCode
00152 # return codes for database-related services
00153
00154 int32 UNKNOWN_ERROR = 1
00155 int32 DATABASE_NOT_CONNECTED = 2
00156 int32 DATABASE_QUERY_ERROR = 3
00157 int32 SUCCESS = -1
00158
00159 int32 code
00160 ================================================================================
00161 MSG: household_objects_database_msgs/DatabaseScan
00162 # Contains the location of a stored point cloud scan of an object,
00163 # as well as additional metadata about that scan
00164
00165 # the database id of the model
00166 int32 model_id
00167
00168 # the location of the bag file storing the scan
00169 string bagfile_location
00170
00171 # the source of the scan (e.g. simulation)
00172 string scan_source
00173
00174 # the ground truth pose of the object that was scanned
00175 geometry_msgs/PoseStamped pose
00176
00177 # the topic that the points in the bag are published on
00178 string cloud_topic
00179 ================================================================================
00180 MSG: geometry_msgs/PoseStamped
00181 # A Pose with reference coordinate frame and timestamp
00182 Header header
00183 Pose pose
00184
00185 ================================================================================
00186 MSG: std_msgs/Header
00187 # Standard metadata for higher-level stamped data types.
00188 # This is generally used to communicate timestamped data
00189 # in a particular coordinate frame.
00190 #
00191 # sequence ID: consecutively increasing ID
00192 uint32 seq
00193 #Two-integer timestamp that is expressed as:
00194 # * stamp.secs: seconds (stamp_secs) since epoch
00195 # * stamp.nsecs: nanoseconds since stamp_secs
00196 # time-handling sugar is provided by the client library
00197 time stamp
00198 #Frame this data is associated with
00199 # 0: no frame
00200 # 1: global frame
00201 string frame_id
00202
00203 ================================================================================
00204 MSG: geometry_msgs/Pose
00205 # A representation of pose in free space, composed of postion and orientation.
00206 Point position
00207 Quaternion orientation
00208
00209 ================================================================================
00210 MSG: geometry_msgs/Point
00211 # This contains the position of a point in free space
00212 float64 x
00213 float64 y
00214 float64 z
00215
00216 ================================================================================
00217 MSG: geometry_msgs/Quaternion
00218 # This represents an orientation in free space in quaternion form.
00219
00220 float64 x
00221 float64 y
00222 float64 z
00223 float64 w
00224
00225 """
00226 __slots__ = ['return_code','matching_scans']
00227 _slot_types = ['household_objects_database_msgs/DatabaseReturnCode','household_objects_database_msgs/DatabaseScan[]']
00228
00229 def __init__(self, *args, **kwds):
00230 """
00231 Constructor. Any message fields that are implicitly/explicitly
00232 set to None will be assigned a default value. The recommend
00233 use is keyword arguments as this is more robust to future message
00234 changes. You cannot mix in-order arguments and keyword arguments.
00235
00236 The available fields are:
00237 return_code,matching_scans
00238
00239 @param args: complete set of field values, in .msg order
00240 @param kwds: use keyword arguments corresponding to message field names
00241 to set specific fields.
00242 """
00243 if args or kwds:
00244 super(GetModelScansResponse, self).__init__(*args, **kwds)
00245
00246 if self.return_code is None:
00247 self.return_code = household_objects_database_msgs.msg.DatabaseReturnCode()
00248 if self.matching_scans is None:
00249 self.matching_scans = []
00250 else:
00251 self.return_code = household_objects_database_msgs.msg.DatabaseReturnCode()
00252 self.matching_scans = []
00253
00254 def _get_types(self):
00255 """
00256 internal API method
00257 """
00258 return self._slot_types
00259
00260 def serialize(self, buff):
00261 """
00262 serialize message into buffer
00263 @param buff: buffer
00264 @type buff: StringIO
00265 """
00266 try:
00267 buff.write(_struct_i.pack(self.return_code.code))
00268 length = len(self.matching_scans)
00269 buff.write(_struct_I.pack(length))
00270 for val1 in self.matching_scans:
00271 buff.write(_struct_i.pack(val1.model_id))
00272 _x = val1.bagfile_location
00273 length = len(_x)
00274 buff.write(struct.pack('<I%ss'%length, length, _x))
00275 _x = val1.scan_source
00276 length = len(_x)
00277 buff.write(struct.pack('<I%ss'%length, length, _x))
00278 _v1 = val1.pose
00279 _v2 = _v1.header
00280 buff.write(_struct_I.pack(_v2.seq))
00281 _v3 = _v2.stamp
00282 _x = _v3
00283 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00284 _x = _v2.frame_id
00285 length = len(_x)
00286 buff.write(struct.pack('<I%ss'%length, length, _x))
00287 _v4 = _v1.pose
00288 _v5 = _v4.position
00289 _x = _v5
00290 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00291 _v6 = _v4.orientation
00292 _x = _v6
00293 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00294 _x = val1.cloud_topic
00295 length = len(_x)
00296 buff.write(struct.pack('<I%ss'%length, length, _x))
00297 except struct.error, se: self._check_types(se)
00298 except TypeError, te: self._check_types(te)
00299
00300 def deserialize(self, str):
00301 """
00302 unpack serialized message in str into this message instance
00303 @param str: byte array of serialized message
00304 @type str: str
00305 """
00306 try:
00307 if self.return_code is None:
00308 self.return_code = household_objects_database_msgs.msg.DatabaseReturnCode()
00309 end = 0
00310 start = end
00311 end += 4
00312 (self.return_code.code,) = _struct_i.unpack(str[start:end])
00313 start = end
00314 end += 4
00315 (length,) = _struct_I.unpack(str[start:end])
00316 self.matching_scans = []
00317 for i in xrange(0, length):
00318 val1 = household_objects_database_msgs.msg.DatabaseScan()
00319 start = end
00320 end += 4
00321 (val1.model_id,) = _struct_i.unpack(str[start:end])
00322 start = end
00323 end += 4
00324 (length,) = _struct_I.unpack(str[start:end])
00325 start = end
00326 end += length
00327 val1.bagfile_location = str[start:end]
00328 start = end
00329 end += 4
00330 (length,) = _struct_I.unpack(str[start:end])
00331 start = end
00332 end += length
00333 val1.scan_source = str[start:end]
00334 _v7 = val1.pose
00335 _v8 = _v7.header
00336 start = end
00337 end += 4
00338 (_v8.seq,) = _struct_I.unpack(str[start:end])
00339 _v9 = _v8.stamp
00340 _x = _v9
00341 start = end
00342 end += 8
00343 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00344 start = end
00345 end += 4
00346 (length,) = _struct_I.unpack(str[start:end])
00347 start = end
00348 end += length
00349 _v8.frame_id = str[start:end]
00350 _v10 = _v7.pose
00351 _v11 = _v10.position
00352 _x = _v11
00353 start = end
00354 end += 24
00355 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00356 _v12 = _v10.orientation
00357 _x = _v12
00358 start = end
00359 end += 32
00360 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00361 start = end
00362 end += 4
00363 (length,) = _struct_I.unpack(str[start:end])
00364 start = end
00365 end += length
00366 val1.cloud_topic = str[start:end]
00367 self.matching_scans.append(val1)
00368 return self
00369 except struct.error, e:
00370 raise roslib.message.DeserializationError(e)
00371
00372
00373 def serialize_numpy(self, buff, numpy):
00374 """
00375 serialize message with numpy array types into buffer
00376 @param buff: buffer
00377 @type buff: StringIO
00378 @param numpy: numpy python module
00379 @type numpy module
00380 """
00381 try:
00382 buff.write(_struct_i.pack(self.return_code.code))
00383 length = len(self.matching_scans)
00384 buff.write(_struct_I.pack(length))
00385 for val1 in self.matching_scans:
00386 buff.write(_struct_i.pack(val1.model_id))
00387 _x = val1.bagfile_location
00388 length = len(_x)
00389 buff.write(struct.pack('<I%ss'%length, length, _x))
00390 _x = val1.scan_source
00391 length = len(_x)
00392 buff.write(struct.pack('<I%ss'%length, length, _x))
00393 _v13 = val1.pose
00394 _v14 = _v13.header
00395 buff.write(_struct_I.pack(_v14.seq))
00396 _v15 = _v14.stamp
00397 _x = _v15
00398 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00399 _x = _v14.frame_id
00400 length = len(_x)
00401 buff.write(struct.pack('<I%ss'%length, length, _x))
00402 _v16 = _v13.pose
00403 _v17 = _v16.position
00404 _x = _v17
00405 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00406 _v18 = _v16.orientation
00407 _x = _v18
00408 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00409 _x = val1.cloud_topic
00410 length = len(_x)
00411 buff.write(struct.pack('<I%ss'%length, length, _x))
00412 except struct.error, se: self._check_types(se)
00413 except TypeError, te: self._check_types(te)
00414
00415 def deserialize_numpy(self, str, numpy):
00416 """
00417 unpack serialized message in str into this message instance using numpy for array types
00418 @param str: byte array of serialized message
00419 @type str: str
00420 @param numpy: numpy python module
00421 @type numpy: module
00422 """
00423 try:
00424 if self.return_code is None:
00425 self.return_code = household_objects_database_msgs.msg.DatabaseReturnCode()
00426 end = 0
00427 start = end
00428 end += 4
00429 (self.return_code.code,) = _struct_i.unpack(str[start:end])
00430 start = end
00431 end += 4
00432 (length,) = _struct_I.unpack(str[start:end])
00433 self.matching_scans = []
00434 for i in xrange(0, length):
00435 val1 = household_objects_database_msgs.msg.DatabaseScan()
00436 start = end
00437 end += 4
00438 (val1.model_id,) = _struct_i.unpack(str[start:end])
00439 start = end
00440 end += 4
00441 (length,) = _struct_I.unpack(str[start:end])
00442 start = end
00443 end += length
00444 val1.bagfile_location = str[start:end]
00445 start = end
00446 end += 4
00447 (length,) = _struct_I.unpack(str[start:end])
00448 start = end
00449 end += length
00450 val1.scan_source = str[start:end]
00451 _v19 = val1.pose
00452 _v20 = _v19.header
00453 start = end
00454 end += 4
00455 (_v20.seq,) = _struct_I.unpack(str[start:end])
00456 _v21 = _v20.stamp
00457 _x = _v21
00458 start = end
00459 end += 8
00460 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00461 start = end
00462 end += 4
00463 (length,) = _struct_I.unpack(str[start:end])
00464 start = end
00465 end += length
00466 _v20.frame_id = str[start:end]
00467 _v22 = _v19.pose
00468 _v23 = _v22.position
00469 _x = _v23
00470 start = end
00471 end += 24
00472 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00473 _v24 = _v22.orientation
00474 _x = _v24
00475 start = end
00476 end += 32
00477 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00478 start = end
00479 end += 4
00480 (length,) = _struct_I.unpack(str[start:end])
00481 start = end
00482 end += length
00483 val1.cloud_topic = str[start:end]
00484 self.matching_scans.append(val1)
00485 return self
00486 except struct.error, e:
00487 raise roslib.message.DeserializationError(e)
00488
00489 _struct_I = roslib.message.struct_I
00490 _struct_i = struct.Struct("<i")
00491 _struct_4d = struct.Struct("<4d")
00492 _struct_2I = struct.Struct("<2I")
00493 _struct_3d = struct.Struct("<3d")
00494 class GetModelScans(roslib.message.ServiceDefinition):
00495 _type = 'household_objects_database_msgs/GetModelScans'
00496 _md5sum = '8e98ddfab8ff8e5fb3a60b1cd7645437'
00497 _request_class = GetModelScansRequest
00498 _response_class = GetModelScansResponse