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