$search
00001 """autogenerated by genmsg_py from maskRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import std_msgs.msg 00006 00007 class maskRequest(roslib.message.Message): 00008 _md5sum = "d7be0bb39af8fb9129d5a76e6b63a290" 00009 _type = "camera_self_filter/maskRequest" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """std_msgs/Header header 00012 00013 ================================================================================ 00014 MSG: std_msgs/Header 00015 # Standard metadata for higher-level stamped data types. 00016 # This is generally used to communicate timestamped data 00017 # in a particular coordinate frame. 00018 # 00019 # sequence ID: consecutively increasing ID 00020 uint32 seq 00021 #Two-integer timestamp that is expressed as: 00022 # * stamp.secs: seconds (stamp_secs) since epoch 00023 # * stamp.nsecs: nanoseconds since stamp_secs 00024 # time-handling sugar is provided by the client library 00025 time stamp 00026 #Frame this data is associated with 00027 # 0: no frame 00028 # 1: global frame 00029 string frame_id 00030 00031 """ 00032 __slots__ = ['header'] 00033 _slot_types = ['std_msgs/Header'] 00034 00035 def __init__(self, *args, **kwds): 00036 """ 00037 Constructor. Any message fields that are implicitly/explicitly 00038 set to None will be assigned a default value. The recommend 00039 use is keyword arguments as this is more robust to future message 00040 changes. You cannot mix in-order arguments and keyword arguments. 00041 00042 The available fields are: 00043 header 00044 00045 @param args: complete set of field values, in .msg order 00046 @param kwds: use keyword arguments corresponding to message field names 00047 to set specific fields. 00048 """ 00049 if args or kwds: 00050 super(maskRequest, self).__init__(*args, **kwds) 00051 #message fields cannot be None, assign default values for those that are 00052 if self.header is None: 00053 self.header = std_msgs.msg.Header() 00054 else: 00055 self.header = std_msgs.msg.Header() 00056 00057 def _get_types(self): 00058 """ 00059 internal API method 00060 """ 00061 return self._slot_types 00062 00063 def serialize(self, buff): 00064 """ 00065 serialize message into buffer 00066 @param buff: buffer 00067 @type buff: StringIO 00068 """ 00069 try: 00070 _x = self 00071 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00072 _x = self.header.frame_id 00073 length = len(_x) 00074 buff.write(struct.pack('<I%ss'%length, length, _x)) 00075 except struct.error as se: self._check_types(se) 00076 except TypeError as te: self._check_types(te) 00077 00078 def deserialize(self, str): 00079 """ 00080 unpack serialized message in str into this message instance 00081 @param str: byte array of serialized message 00082 @type str: str 00083 """ 00084 try: 00085 if self.header is None: 00086 self.header = std_msgs.msg.Header() 00087 end = 0 00088 _x = self 00089 start = end 00090 end += 12 00091 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00092 start = end 00093 end += 4 00094 (length,) = _struct_I.unpack(str[start:end]) 00095 start = end 00096 end += length 00097 self.header.frame_id = str[start:end] 00098 return self 00099 except struct.error as e: 00100 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00101 00102 00103 def serialize_numpy(self, buff, numpy): 00104 """ 00105 serialize message with numpy array types into buffer 00106 @param buff: buffer 00107 @type buff: StringIO 00108 @param numpy: numpy python module 00109 @type numpy module 00110 """ 00111 try: 00112 _x = self 00113 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00114 _x = self.header.frame_id 00115 length = len(_x) 00116 buff.write(struct.pack('<I%ss'%length, length, _x)) 00117 except struct.error as se: self._check_types(se) 00118 except TypeError as te: self._check_types(te) 00119 00120 def deserialize_numpy(self, str, numpy): 00121 """ 00122 unpack serialized message in str into this message instance using numpy for array types 00123 @param str: byte array of serialized message 00124 @type str: str 00125 @param numpy: numpy python module 00126 @type numpy: module 00127 """ 00128 try: 00129 if self.header is None: 00130 self.header = std_msgs.msg.Header() 00131 end = 0 00132 _x = self 00133 start = end 00134 end += 12 00135 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00136 start = end 00137 end += 4 00138 (length,) = _struct_I.unpack(str[start:end]) 00139 start = end 00140 end += length 00141 self.header.frame_id = str[start:end] 00142 return self 00143 except struct.error as e: 00144 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00145 00146 _struct_I = roslib.message.struct_I 00147 _struct_3I = struct.Struct("<3I") 00148 """autogenerated by genmsg_py from maskResponse.msg. Do not edit.""" 00149 import roslib.message 00150 import struct 00151 00152 import std_msgs.msg 00153 import sensor_msgs.msg 00154 00155 class maskResponse(roslib.message.Message): 00156 _md5sum = "39c74c093fa8b7c6d397ed7cbe6ce11f" 00157 _type = "camera_self_filter/maskResponse" 00158 _has_header = False #flag to mark the presence of a Header object 00159 _full_text = """sensor_msgs/Image mask_image 00160 00161 ================================================================================ 00162 MSG: sensor_msgs/Image 00163 # This message contains an uncompressed image 00164 # (0, 0) is at top-left corner of image 00165 # 00166 00167 Header header # Header timestamp should be acquisition time of image 00168 # Header frame_id should be optical frame of camera 00169 # origin of frame should be optical center of cameara 00170 # +x should point to the right in the image 00171 # +y should point down in the image 00172 # +z should point into to plane of the image 00173 # If the frame_id here and the frame_id of the CameraInfo 00174 # message associated with the image conflict 00175 # the behavior is undefined 00176 00177 uint32 height # image height, that is, number of rows 00178 uint32 width # image width, that is, number of columns 00179 00180 # The legal values for encoding are in file src/image_encodings.cpp 00181 # If you want to standardize a new string format, join 00182 # ros-users@lists.sourceforge.net and send an email proposing a new encoding. 00183 00184 string encoding # Encoding of pixels -- channel meaning, ordering, size 00185 # taken from the list of strings in src/image_encodings.cpp 00186 00187 uint8 is_bigendian # is this data bigendian? 00188 uint32 step # Full row length in bytes 00189 uint8[] data # actual matrix data, size is (step * rows) 00190 00191 ================================================================================ 00192 MSG: std_msgs/Header 00193 # Standard metadata for higher-level stamped data types. 00194 # This is generally used to communicate timestamped data 00195 # in a particular coordinate frame. 00196 # 00197 # sequence ID: consecutively increasing ID 00198 uint32 seq 00199 #Two-integer timestamp that is expressed as: 00200 # * stamp.secs: seconds (stamp_secs) since epoch 00201 # * stamp.nsecs: nanoseconds since stamp_secs 00202 # time-handling sugar is provided by the client library 00203 time stamp 00204 #Frame this data is associated with 00205 # 0: no frame 00206 # 1: global frame 00207 string frame_id 00208 00209 """ 00210 __slots__ = ['mask_image'] 00211 _slot_types = ['sensor_msgs/Image'] 00212 00213 def __init__(self, *args, **kwds): 00214 """ 00215 Constructor. Any message fields that are implicitly/explicitly 00216 set to None will be assigned a default value. The recommend 00217 use is keyword arguments as this is more robust to future message 00218 changes. You cannot mix in-order arguments and keyword arguments. 00219 00220 The available fields are: 00221 mask_image 00222 00223 @param args: complete set of field values, in .msg order 00224 @param kwds: use keyword arguments corresponding to message field names 00225 to set specific fields. 00226 """ 00227 if args or kwds: 00228 super(maskResponse, self).__init__(*args, **kwds) 00229 #message fields cannot be None, assign default values for those that are 00230 if self.mask_image is None: 00231 self.mask_image = sensor_msgs.msg.Image() 00232 else: 00233 self.mask_image = sensor_msgs.msg.Image() 00234 00235 def _get_types(self): 00236 """ 00237 internal API method 00238 """ 00239 return self._slot_types 00240 00241 def serialize(self, buff): 00242 """ 00243 serialize message into buffer 00244 @param buff: buffer 00245 @type buff: StringIO 00246 """ 00247 try: 00248 _x = self 00249 buff.write(_struct_3I.pack(_x.mask_image.header.seq, _x.mask_image.header.stamp.secs, _x.mask_image.header.stamp.nsecs)) 00250 _x = self.mask_image.header.frame_id 00251 length = len(_x) 00252 buff.write(struct.pack('<I%ss'%length, length, _x)) 00253 _x = self 00254 buff.write(_struct_2I.pack(_x.mask_image.height, _x.mask_image.width)) 00255 _x = self.mask_image.encoding 00256 length = len(_x) 00257 buff.write(struct.pack('<I%ss'%length, length, _x)) 00258 _x = self 00259 buff.write(_struct_BI.pack(_x.mask_image.is_bigendian, _x.mask_image.step)) 00260 _x = self.mask_image.data 00261 length = len(_x) 00262 # - if encoded as a list instead, serialize as bytes instead of string 00263 if type(_x) in [list, tuple]: 00264 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00265 else: 00266 buff.write(struct.pack('<I%ss'%length, length, _x)) 00267 except struct.error as se: self._check_types(se) 00268 except TypeError as te: self._check_types(te) 00269 00270 def deserialize(self, str): 00271 """ 00272 unpack serialized message in str into this message instance 00273 @param str: byte array of serialized message 00274 @type str: str 00275 """ 00276 try: 00277 if self.mask_image is None: 00278 self.mask_image = sensor_msgs.msg.Image() 00279 end = 0 00280 _x = self 00281 start = end 00282 end += 12 00283 (_x.mask_image.header.seq, _x.mask_image.header.stamp.secs, _x.mask_image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00284 start = end 00285 end += 4 00286 (length,) = _struct_I.unpack(str[start:end]) 00287 start = end 00288 end += length 00289 self.mask_image.header.frame_id = str[start:end] 00290 _x = self 00291 start = end 00292 end += 8 00293 (_x.mask_image.height, _x.mask_image.width,) = _struct_2I.unpack(str[start:end]) 00294 start = end 00295 end += 4 00296 (length,) = _struct_I.unpack(str[start:end]) 00297 start = end 00298 end += length 00299 self.mask_image.encoding = str[start:end] 00300 _x = self 00301 start = end 00302 end += 5 00303 (_x.mask_image.is_bigendian, _x.mask_image.step,) = _struct_BI.unpack(str[start:end]) 00304 start = end 00305 end += 4 00306 (length,) = _struct_I.unpack(str[start:end]) 00307 start = end 00308 end += length 00309 self.mask_image.data = str[start:end] 00310 return self 00311 except struct.error as e: 00312 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00313 00314 00315 def serialize_numpy(self, buff, numpy): 00316 """ 00317 serialize message with numpy array types into buffer 00318 @param buff: buffer 00319 @type buff: StringIO 00320 @param numpy: numpy python module 00321 @type numpy module 00322 """ 00323 try: 00324 _x = self 00325 buff.write(_struct_3I.pack(_x.mask_image.header.seq, _x.mask_image.header.stamp.secs, _x.mask_image.header.stamp.nsecs)) 00326 _x = self.mask_image.header.frame_id 00327 length = len(_x) 00328 buff.write(struct.pack('<I%ss'%length, length, _x)) 00329 _x = self 00330 buff.write(_struct_2I.pack(_x.mask_image.height, _x.mask_image.width)) 00331 _x = self.mask_image.encoding 00332 length = len(_x) 00333 buff.write(struct.pack('<I%ss'%length, length, _x)) 00334 _x = self 00335 buff.write(_struct_BI.pack(_x.mask_image.is_bigendian, _x.mask_image.step)) 00336 _x = self.mask_image.data 00337 length = len(_x) 00338 # - if encoded as a list instead, serialize as bytes instead of string 00339 if type(_x) in [list, tuple]: 00340 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00341 else: 00342 buff.write(struct.pack('<I%ss'%length, length, _x)) 00343 except struct.error as se: self._check_types(se) 00344 except TypeError as te: self._check_types(te) 00345 00346 def deserialize_numpy(self, str, numpy): 00347 """ 00348 unpack serialized message in str into this message instance using numpy for array types 00349 @param str: byte array of serialized message 00350 @type str: str 00351 @param numpy: numpy python module 00352 @type numpy: module 00353 """ 00354 try: 00355 if self.mask_image is None: 00356 self.mask_image = sensor_msgs.msg.Image() 00357 end = 0 00358 _x = self 00359 start = end 00360 end += 12 00361 (_x.mask_image.header.seq, _x.mask_image.header.stamp.secs, _x.mask_image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00362 start = end 00363 end += 4 00364 (length,) = _struct_I.unpack(str[start:end]) 00365 start = end 00366 end += length 00367 self.mask_image.header.frame_id = str[start:end] 00368 _x = self 00369 start = end 00370 end += 8 00371 (_x.mask_image.height, _x.mask_image.width,) = _struct_2I.unpack(str[start:end]) 00372 start = end 00373 end += 4 00374 (length,) = _struct_I.unpack(str[start:end]) 00375 start = end 00376 end += length 00377 self.mask_image.encoding = str[start:end] 00378 _x = self 00379 start = end 00380 end += 5 00381 (_x.mask_image.is_bigendian, _x.mask_image.step,) = _struct_BI.unpack(str[start:end]) 00382 start = end 00383 end += 4 00384 (length,) = _struct_I.unpack(str[start:end]) 00385 start = end 00386 end += length 00387 self.mask_image.data = str[start:end] 00388 return self 00389 except struct.error as e: 00390 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00391 00392 _struct_I = roslib.message.struct_I 00393 _struct_3I = struct.Struct("<3I") 00394 _struct_2I = struct.Struct("<2I") 00395 _struct_BI = struct.Struct("<BI") 00396 class mask(roslib.message.ServiceDefinition): 00397 _type = 'camera_self_filter/mask' 00398 _md5sum = 'b38ab8ce976ae4b6660575f6d4ca1ee4' 00399 _request_class = maskRequest 00400 _response_class = maskResponse