00001 """autogenerated by genmsg_py from RoutePath.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geographic_msgs.msg
00006 import std_msgs.msg
00007
00008 class RoutePath(roslib.message.Message):
00009 _md5sum = "2283414fe3f92830800873bcc8e94e2a"
00010 _type = "geographic_msgs/RoutePath"
00011 _has_header = True
00012 _full_text = """# Path through a route network.
00013 #
00014 # A path is a sequence of RouteSegment edges. This information is
00015 # extracted from a RouteNetwork graph. A RoutePath lists the route
00016 # segments needed to reach some chosen goal.
00017
00018 Header header
00019
00020 UniqueID network # Route network containing this path
00021 UniqueID[] segments # Sequence of RouteSegment IDs
00022 KeyValue[] props # Key/value properties
00023
00024 ================================================================================
00025 MSG: std_msgs/Header
00026 # Standard metadata for higher-level stamped data types.
00027 # This is generally used to communicate timestamped data
00028 # in a particular coordinate frame.
00029 #
00030 # sequence ID: consecutively increasing ID
00031 uint32 seq
00032 #Two-integer timestamp that is expressed as:
00033 # * stamp.secs: seconds (stamp_secs) since epoch
00034 # * stamp.nsecs: nanoseconds since stamp_secs
00035 # time-handling sugar is provided by the client library
00036 time stamp
00037 #Frame this data is associated with
00038 # 0: no frame
00039 # 1: global frame
00040 string frame_id
00041
00042 ================================================================================
00043 MSG: geographic_msgs/UniqueID
00044 # A universally unique identifier (UUID) for a geographic feature.
00045 #
00046 # http://en.wikipedia.org/wiki/Universally_unique_identifier
00047 # http://tools.ietf.org/html/rfc4122.html
00048 #
00049 # For simplicity and human readability, the UUID is represented as a
00050 # string of hex digits and dashes.
00051 #
00052 # UUID generation is up to the programmer, but the intent is for
00053 # matching features within a domain such as Open Street Map to yield
00054 # the same UUID. The recommended method is RFC 4122 variant 5,
00055 # computing the SHA-1 hash of a URL encoded using the map source. For
00056 # example:
00057 #
00058 # http://openstreetmap.org/node/NUMBER
00059 # http://openstreetmap.org/way/NUMBER
00060 # http://openstreetmap.org/relation/NUMBER
00061 #
00062 # Here NUMBER is the decimal representation of the OSM node, way, or
00063 # relation ID without leading zeros.
00064 #
00065 # Other map sources should use similar conventions.
00066
00067 string uuid # format: 01234567-89ab-cdef-0123-456789abcdef
00068
00069 ================================================================================
00070 MSG: geographic_msgs/KeyValue
00071 # Geographic map tag (key, value) pair
00072 #
00073 # This is equivalent to diagnostic_msgs/KeyValue, repeated here to
00074 # avoid introducing a trivial stack dependency.
00075
00076 string key # tag label
00077 string value # corresponding value
00078
00079 """
00080 __slots__ = ['header','network','segments','props']
00081 _slot_types = ['Header','geographic_msgs/UniqueID','geographic_msgs/UniqueID[]','geographic_msgs/KeyValue[]']
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 header,network,segments,props
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(RoutePath, self).__init__(*args, **kwds)
00099
00100 if self.header is None:
00101 self.header = std_msgs.msg._Header.Header()
00102 if self.network is None:
00103 self.network = geographic_msgs.msg.UniqueID()
00104 if self.segments is None:
00105 self.segments = []
00106 if self.props is None:
00107 self.props = []
00108 else:
00109 self.header = std_msgs.msg._Header.Header()
00110 self.network = geographic_msgs.msg.UniqueID()
00111 self.segments = []
00112 self.props = []
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
00124 @type buff: StringIO
00125 """
00126 try:
00127 _x = self
00128 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00129 _x = self.header.frame_id
00130 length = len(_x)
00131 buff.write(struct.pack('<I%ss'%length, length, _x))
00132 _x = self.network.uuid
00133 length = len(_x)
00134 buff.write(struct.pack('<I%ss'%length, length, _x))
00135 length = len(self.segments)
00136 buff.write(_struct_I.pack(length))
00137 for val1 in self.segments:
00138 _x = val1.uuid
00139 length = len(_x)
00140 buff.write(struct.pack('<I%ss'%length, length, _x))
00141 length = len(self.props)
00142 buff.write(_struct_I.pack(length))
00143 for val1 in self.props:
00144 _x = val1.key
00145 length = len(_x)
00146 buff.write(struct.pack('<I%ss'%length, length, _x))
00147 _x = val1.value
00148 length = len(_x)
00149 buff.write(struct.pack('<I%ss'%length, length, _x))
00150 except struct.error as se: self._check_types(se)
00151 except TypeError as te: self._check_types(te)
00152
00153 def deserialize(self, str):
00154 """
00155 unpack serialized message in str into this message instance
00156 @param str: byte array of serialized message
00157 @type str: str
00158 """
00159 try:
00160 if self.header is None:
00161 self.header = std_msgs.msg._Header.Header()
00162 if self.network is None:
00163 self.network = geographic_msgs.msg.UniqueID()
00164 end = 0
00165 _x = self
00166 start = end
00167 end += 12
00168 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00169 start = end
00170 end += 4
00171 (length,) = _struct_I.unpack(str[start:end])
00172 start = end
00173 end += length
00174 self.header.frame_id = str[start:end]
00175 start = end
00176 end += 4
00177 (length,) = _struct_I.unpack(str[start:end])
00178 start = end
00179 end += length
00180 self.network.uuid = str[start:end]
00181 start = end
00182 end += 4
00183 (length,) = _struct_I.unpack(str[start:end])
00184 self.segments = []
00185 for i in range(0, length):
00186 val1 = geographic_msgs.msg.UniqueID()
00187 start = end
00188 end += 4
00189 (length,) = _struct_I.unpack(str[start:end])
00190 start = end
00191 end += length
00192 val1.uuid = str[start:end]
00193 self.segments.append(val1)
00194 start = end
00195 end += 4
00196 (length,) = _struct_I.unpack(str[start:end])
00197 self.props = []
00198 for i in range(0, length):
00199 val1 = geographic_msgs.msg.KeyValue()
00200 start = end
00201 end += 4
00202 (length,) = _struct_I.unpack(str[start:end])
00203 start = end
00204 end += length
00205 val1.key = str[start:end]
00206 start = end
00207 end += 4
00208 (length,) = _struct_I.unpack(str[start:end])
00209 start = end
00210 end += length
00211 val1.value = str[start:end]
00212 self.props.append(val1)
00213 return self
00214 except struct.error as e:
00215 raise roslib.message.DeserializationError(e)
00216
00217
00218 def serialize_numpy(self, buff, numpy):
00219 """
00220 serialize message with numpy array types into buffer
00221 @param buff: buffer
00222 @type buff: StringIO
00223 @param numpy: numpy python module
00224 @type numpy module
00225 """
00226 try:
00227 _x = self
00228 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00229 _x = self.header.frame_id
00230 length = len(_x)
00231 buff.write(struct.pack('<I%ss'%length, length, _x))
00232 _x = self.network.uuid
00233 length = len(_x)
00234 buff.write(struct.pack('<I%ss'%length, length, _x))
00235 length = len(self.segments)
00236 buff.write(_struct_I.pack(length))
00237 for val1 in self.segments:
00238 _x = val1.uuid
00239 length = len(_x)
00240 buff.write(struct.pack('<I%ss'%length, length, _x))
00241 length = len(self.props)
00242 buff.write(_struct_I.pack(length))
00243 for val1 in self.props:
00244 _x = val1.key
00245 length = len(_x)
00246 buff.write(struct.pack('<I%ss'%length, length, _x))
00247 _x = val1.value
00248 length = len(_x)
00249 buff.write(struct.pack('<I%ss'%length, length, _x))
00250 except struct.error as se: self._check_types(se)
00251 except TypeError as te: self._check_types(te)
00252
00253 def deserialize_numpy(self, str, numpy):
00254 """
00255 unpack serialized message in str into this message instance using numpy for array types
00256 @param str: byte array of serialized message
00257 @type str: str
00258 @param numpy: numpy python module
00259 @type numpy: module
00260 """
00261 try:
00262 if self.header is None:
00263 self.header = std_msgs.msg._Header.Header()
00264 if self.network is None:
00265 self.network = geographic_msgs.msg.UniqueID()
00266 end = 0
00267 _x = self
00268 start = end
00269 end += 12
00270 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00271 start = end
00272 end += 4
00273 (length,) = _struct_I.unpack(str[start:end])
00274 start = end
00275 end += length
00276 self.header.frame_id = str[start:end]
00277 start = end
00278 end += 4
00279 (length,) = _struct_I.unpack(str[start:end])
00280 start = end
00281 end += length
00282 self.network.uuid = str[start:end]
00283 start = end
00284 end += 4
00285 (length,) = _struct_I.unpack(str[start:end])
00286 self.segments = []
00287 for i in range(0, length):
00288 val1 = geographic_msgs.msg.UniqueID()
00289 start = end
00290 end += 4
00291 (length,) = _struct_I.unpack(str[start:end])
00292 start = end
00293 end += length
00294 val1.uuid = str[start:end]
00295 self.segments.append(val1)
00296 start = end
00297 end += 4
00298 (length,) = _struct_I.unpack(str[start:end])
00299 self.props = []
00300 for i in range(0, length):
00301 val1 = geographic_msgs.msg.KeyValue()
00302 start = end
00303 end += 4
00304 (length,) = _struct_I.unpack(str[start:end])
00305 start = end
00306 end += length
00307 val1.key = str[start:end]
00308 start = end
00309 end += 4
00310 (length,) = _struct_I.unpack(str[start:end])
00311 start = end
00312 end += length
00313 val1.value = str[start:end]
00314 self.props.append(val1)
00315 return self
00316 except struct.error as e:
00317 raise roslib.message.DeserializationError(e)
00318
00319 _struct_I = roslib.message.struct_I
00320 _struct_3I = struct.Struct("<3I")