00001 """autogenerated by genpy from geographic_msgs/RoutePath.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 uuid_msgs.msg
00008 import geographic_msgs.msg
00009 import std_msgs.msg
00010
00011 class RoutePath(genpy.Message):
00012 _md5sum = "0aa2dd809a8091bdb4466dfefecbb8cf"
00013 _type = "geographic_msgs/RoutePath"
00014 _has_header = True
00015 _full_text = """# Path through a route network.
00016 #
00017 # A path is a sequence of RouteSegment edges. This information is
00018 # extracted from a RouteNetwork graph. A RoutePath lists the route
00019 # segments needed to reach some chosen goal.
00020
00021 Header header
00022
00023 uuid_msgs/UniqueID network # Route network containing this path
00024 uuid_msgs/UniqueID[] segments # Sequence of RouteSegment IDs
00025 KeyValue[] props # Key/value properties
00026
00027 ================================================================================
00028 MSG: std_msgs/Header
00029 # Standard metadata for higher-level stamped data types.
00030 # This is generally used to communicate timestamped data
00031 # in a particular coordinate frame.
00032 #
00033 # sequence ID: consecutively increasing ID
00034 uint32 seq
00035 #Two-integer timestamp that is expressed as:
00036 # * stamp.secs: seconds (stamp_secs) since epoch
00037 # * stamp.nsecs: nanoseconds since stamp_secs
00038 # time-handling sugar is provided by the client library
00039 time stamp
00040 #Frame this data is associated with
00041 # 0: no frame
00042 # 1: global frame
00043 string frame_id
00044
00045 ================================================================================
00046 MSG: uuid_msgs/UniqueID
00047 # A universally unique identifier (UUID).
00048 #
00049 # http://en.wikipedia.org/wiki/Universally_unique_identifier
00050 # http://tools.ietf.org/html/rfc4122.html
00051
00052 uint8[16] uuid
00053
00054 ================================================================================
00055 MSG: geographic_msgs/KeyValue
00056 # Geographic map tag (key, value) pair
00057 #
00058 # This is equivalent to diagnostic_msgs/KeyValue, repeated here to
00059 # avoid introducing a trivial stack dependency.
00060
00061 string key # tag label
00062 string value # corresponding value
00063
00064 """
00065 __slots__ = ['header','network','segments','props']
00066 _slot_types = ['std_msgs/Header','uuid_msgs/UniqueID','uuid_msgs/UniqueID[]','geographic_msgs/KeyValue[]']
00067
00068 def __init__(self, *args, **kwds):
00069 """
00070 Constructor. Any message fields that are implicitly/explicitly
00071 set to None will be assigned a default value. The recommend
00072 use is keyword arguments as this is more robust to future message
00073 changes. You cannot mix in-order arguments and keyword arguments.
00074
00075 The available fields are:
00076 header,network,segments,props
00077
00078 :param args: complete set of field values, in .msg order
00079 :param kwds: use keyword arguments corresponding to message field names
00080 to set specific fields.
00081 """
00082 if args or kwds:
00083 super(RoutePath, self).__init__(*args, **kwds)
00084
00085 if self.header is None:
00086 self.header = std_msgs.msg.Header()
00087 if self.network is None:
00088 self.network = uuid_msgs.msg.UniqueID()
00089 if self.segments is None:
00090 self.segments = []
00091 if self.props is None:
00092 self.props = []
00093 else:
00094 self.header = std_msgs.msg.Header()
00095 self.network = uuid_msgs.msg.UniqueID()
00096 self.segments = []
00097 self.props = []
00098
00099 def _get_types(self):
00100 """
00101 internal API method
00102 """
00103 return self._slot_types
00104
00105 def serialize(self, buff):
00106 """
00107 serialize message into buffer
00108 :param buff: buffer, ``StringIO``
00109 """
00110 try:
00111 _x = self
00112 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00113 _x = self.header.frame_id
00114 length = len(_x)
00115 if python3 or type(_x) == unicode:
00116 _x = _x.encode('utf-8')
00117 length = len(_x)
00118 buff.write(struct.pack('<I%ss'%length, length, _x))
00119 _x = self.network.uuid
00120
00121 if type(_x) in [list, tuple]:
00122 buff.write(_struct_16B.pack(*_x))
00123 else:
00124 buff.write(_struct_16s.pack(_x))
00125 length = len(self.segments)
00126 buff.write(_struct_I.pack(length))
00127 for val1 in self.segments:
00128 _x = val1.uuid
00129
00130 if type(_x) in [list, tuple]:
00131 buff.write(_struct_16B.pack(*_x))
00132 else:
00133 buff.write(_struct_16s.pack(_x))
00134 length = len(self.props)
00135 buff.write(_struct_I.pack(length))
00136 for val1 in self.props:
00137 _x = val1.key
00138 length = len(_x)
00139 if python3 or type(_x) == unicode:
00140 _x = _x.encode('utf-8')
00141 length = len(_x)
00142 buff.write(struct.pack('<I%ss'%length, length, _x))
00143 _x = val1.value
00144 length = len(_x)
00145 if python3 or type(_x) == unicode:
00146 _x = _x.encode('utf-8')
00147 length = len(_x)
00148 buff.write(struct.pack('<I%ss'%length, length, _x))
00149 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00150 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00151
00152 def deserialize(self, str):
00153 """
00154 unpack serialized message in str into this message instance
00155 :param str: byte array of serialized message, ``str``
00156 """
00157 try:
00158 if self.header is None:
00159 self.header = std_msgs.msg.Header()
00160 if self.network is None:
00161 self.network = uuid_msgs.msg.UniqueID()
00162 if self.segments is None:
00163 self.segments = None
00164 if self.props is None:
00165 self.props = None
00166 end = 0
00167 _x = self
00168 start = end
00169 end += 12
00170 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00171 start = end
00172 end += 4
00173 (length,) = _struct_I.unpack(str[start:end])
00174 start = end
00175 end += length
00176 if python3:
00177 self.header.frame_id = str[start:end].decode('utf-8')
00178 else:
00179 self.header.frame_id = str[start:end]
00180 start = end
00181 end += 16
00182 self.network.uuid = str[start:end]
00183 start = end
00184 end += 4
00185 (length,) = _struct_I.unpack(str[start:end])
00186 self.segments = []
00187 for i in range(0, length):
00188 val1 = uuid_msgs.msg.UniqueID()
00189 start = end
00190 end += 16
00191 val1.uuid = str[start:end]
00192 self.segments.append(val1)
00193 start = end
00194 end += 4
00195 (length,) = _struct_I.unpack(str[start:end])
00196 self.props = []
00197 for i in range(0, length):
00198 val1 = geographic_msgs.msg.KeyValue()
00199 start = end
00200 end += 4
00201 (length,) = _struct_I.unpack(str[start:end])
00202 start = end
00203 end += length
00204 if python3:
00205 val1.key = str[start:end].decode('utf-8')
00206 else:
00207 val1.key = str[start:end]
00208 start = end
00209 end += 4
00210 (length,) = _struct_I.unpack(str[start:end])
00211 start = end
00212 end += length
00213 if python3:
00214 val1.value = str[start:end].decode('utf-8')
00215 else:
00216 val1.value = str[start:end]
00217 self.props.append(val1)
00218 return self
00219 except struct.error as e:
00220 raise genpy.DeserializationError(e)
00221
00222
00223 def serialize_numpy(self, buff, numpy):
00224 """
00225 serialize message with numpy array types into buffer
00226 :param buff: buffer, ``StringIO``
00227 :param numpy: numpy python module
00228 """
00229 try:
00230 _x = self
00231 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00232 _x = self.header.frame_id
00233 length = len(_x)
00234 if python3 or type(_x) == unicode:
00235 _x = _x.encode('utf-8')
00236 length = len(_x)
00237 buff.write(struct.pack('<I%ss'%length, length, _x))
00238 _x = self.network.uuid
00239
00240 if type(_x) in [list, tuple]:
00241 buff.write(_struct_16B.pack(*_x))
00242 else:
00243 buff.write(_struct_16s.pack(_x))
00244 length = len(self.segments)
00245 buff.write(_struct_I.pack(length))
00246 for val1 in self.segments:
00247 _x = val1.uuid
00248
00249 if type(_x) in [list, tuple]:
00250 buff.write(_struct_16B.pack(*_x))
00251 else:
00252 buff.write(_struct_16s.pack(_x))
00253 length = len(self.props)
00254 buff.write(_struct_I.pack(length))
00255 for val1 in self.props:
00256 _x = val1.key
00257 length = len(_x)
00258 if python3 or type(_x) == unicode:
00259 _x = _x.encode('utf-8')
00260 length = len(_x)
00261 buff.write(struct.pack('<I%ss'%length, length, _x))
00262 _x = val1.value
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 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00269 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00270
00271 def deserialize_numpy(self, str, numpy):
00272 """
00273 unpack serialized message in str into this message instance using numpy for array types
00274 :param str: byte array of serialized message, ``str``
00275 :param numpy: numpy python module
00276 """
00277 try:
00278 if self.header is None:
00279 self.header = std_msgs.msg.Header()
00280 if self.network is None:
00281 self.network = uuid_msgs.msg.UniqueID()
00282 if self.segments is None:
00283 self.segments = None
00284 if self.props is None:
00285 self.props = None
00286 end = 0
00287 _x = self
00288 start = end
00289 end += 12
00290 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00291 start = end
00292 end += 4
00293 (length,) = _struct_I.unpack(str[start:end])
00294 start = end
00295 end += length
00296 if python3:
00297 self.header.frame_id = str[start:end].decode('utf-8')
00298 else:
00299 self.header.frame_id = str[start:end]
00300 start = end
00301 end += 16
00302 self.network.uuid = str[start:end]
00303 start = end
00304 end += 4
00305 (length,) = _struct_I.unpack(str[start:end])
00306 self.segments = []
00307 for i in range(0, length):
00308 val1 = uuid_msgs.msg.UniqueID()
00309 start = end
00310 end += 16
00311 val1.uuid = str[start:end]
00312 self.segments.append(val1)
00313 start = end
00314 end += 4
00315 (length,) = _struct_I.unpack(str[start:end])
00316 self.props = []
00317 for i in range(0, length):
00318 val1 = geographic_msgs.msg.KeyValue()
00319 start = end
00320 end += 4
00321 (length,) = _struct_I.unpack(str[start:end])
00322 start = end
00323 end += length
00324 if python3:
00325 val1.key = str[start:end].decode('utf-8')
00326 else:
00327 val1.key = str[start:end]
00328 start = end
00329 end += 4
00330 (length,) = _struct_I.unpack(str[start:end])
00331 start = end
00332 end += length
00333 if python3:
00334 val1.value = str[start:end].decode('utf-8')
00335 else:
00336 val1.value = str[start:end]
00337 self.props.append(val1)
00338 return self
00339 except struct.error as e:
00340 raise genpy.DeserializationError(e)
00341
00342 _struct_I = genpy.struct_I
00343 _struct_3I = struct.Struct("<3I")
00344 _struct_16B = struct.Struct("<16B")
00345 _struct_16s = struct.Struct("<16s")