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