00001 """autogenerated by genmsg_py from RouteSegment.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geographic_msgs.msg
00006
00007 class RouteSegment(roslib.message.Message):
00008 _md5sum = "5dbb6653390b36b363da32054b24a902"
00009 _type = "geographic_msgs/RouteSegment"
00010 _has_header = False
00011 _full_text = """# Route network segment.
00012 #
00013 # This is one directed edge of a RouteNetwork graph. It represents a
00014 # known path from one way point to another. If the path is two-way,
00015 # there will be another RouteSegment with "start" and "end" reversed.
00016
00017 UniqueID id # Unique identifier for this segment
00018
00019 UniqueID start # beginning way point of segment
00020 UniqueID end # ending way point of segment
00021
00022 KeyValue[] props # segment properties
00023
00024 ================================================================================
00025 MSG: geographic_msgs/UniqueID
00026 # A universally unique identifier (UUID) for a geographic feature.
00027 #
00028 # http://en.wikipedia.org/wiki/Universally_unique_identifier
00029 # http://tools.ietf.org/html/rfc4122.html
00030 #
00031 # For simplicity and human readability, the UUID is represented as a
00032 # string of hex digits and dashes.
00033 #
00034 # UUID generation is up to the programmer, but the intent is for
00035 # matching features within a domain such as Open Street Map to yield
00036 # the same UUID. The recommended method is RFC 4122 variant 5,
00037 # computing the SHA-1 hash of a URL encoded using the map source. For
00038 # example:
00039 #
00040 # http://openstreetmap.org/node/NUMBER
00041 # http://openstreetmap.org/way/NUMBER
00042 # http://openstreetmap.org/relation/NUMBER
00043 #
00044 # Here NUMBER is the decimal representation of the OSM node, way, or
00045 # relation ID without leading zeros.
00046 #
00047 # Other map sources should use similar conventions.
00048
00049 string uuid # format: 01234567-89ab-cdef-0123-456789abcdef
00050
00051 ================================================================================
00052 MSG: geographic_msgs/KeyValue
00053 # Geographic map tag (key, value) pair
00054 #
00055 # This is equivalent to diagnostic_msgs/KeyValue, repeated here to
00056 # avoid introducing a trivial stack dependency.
00057
00058 string key # tag label
00059 string value # corresponding value
00060
00061 """
00062 __slots__ = ['id','start','end','props']
00063 _slot_types = ['geographic_msgs/UniqueID','geographic_msgs/UniqueID','geographic_msgs/UniqueID','geographic_msgs/KeyValue[]']
00064
00065 def __init__(self, *args, **kwds):
00066 """
00067 Constructor. Any message fields that are implicitly/explicitly
00068 set to None will be assigned a default value. The recommend
00069 use is keyword arguments as this is more robust to future message
00070 changes. You cannot mix in-order arguments and keyword arguments.
00071
00072 The available fields are:
00073 id,start,end,props
00074
00075 @param args: complete set of field values, in .msg order
00076 @param kwds: use keyword arguments corresponding to message field names
00077 to set specific fields.
00078 """
00079 if args or kwds:
00080 super(RouteSegment, self).__init__(*args, **kwds)
00081
00082 if self.id is None:
00083 self.id = geographic_msgs.msg.UniqueID()
00084 if self.start is None:
00085 self.start = geographic_msgs.msg.UniqueID()
00086 if self.end is None:
00087 self.end = geographic_msgs.msg.UniqueID()
00088 if self.props is None:
00089 self.props = []
00090 else:
00091 self.id = geographic_msgs.msg.UniqueID()
00092 self.start = geographic_msgs.msg.UniqueID()
00093 self.end = geographic_msgs.msg.UniqueID()
00094 self.props = []
00095
00096 def _get_types(self):
00097 """
00098 internal API method
00099 """
00100 return self._slot_types
00101
00102 def serialize(self, buff):
00103 """
00104 serialize message into buffer
00105 @param buff: buffer
00106 @type buff: StringIO
00107 """
00108 try:
00109 _x = self.id.uuid
00110 length = len(_x)
00111 buff.write(struct.pack('<I%ss'%length, length, _x))
00112 _x = self.start.uuid
00113 length = len(_x)
00114 buff.write(struct.pack('<I%ss'%length, length, _x))
00115 _x = self.end.uuid
00116 length = len(_x)
00117 buff.write(struct.pack('<I%ss'%length, length, _x))
00118 length = len(self.props)
00119 buff.write(_struct_I.pack(length))
00120 for val1 in self.props:
00121 _x = val1.key
00122 length = len(_x)
00123 buff.write(struct.pack('<I%ss'%length, length, _x))
00124 _x = val1.value
00125 length = len(_x)
00126 buff.write(struct.pack('<I%ss'%length, length, _x))
00127 except struct.error as se: self._check_types(se)
00128 except TypeError as te: self._check_types(te)
00129
00130 def deserialize(self, str):
00131 """
00132 unpack serialized message in str into this message instance
00133 @param str: byte array of serialized message
00134 @type str: str
00135 """
00136 try:
00137 if self.id is None:
00138 self.id = geographic_msgs.msg.UniqueID()
00139 if self.start is None:
00140 self.start = geographic_msgs.msg.UniqueID()
00141 if self.end is None:
00142 self.end = geographic_msgs.msg.UniqueID()
00143 end = 0
00144 start = end
00145 end += 4
00146 (length,) = _struct_I.unpack(str[start:end])
00147 start = end
00148 end += length
00149 self.id.uuid = str[start:end]
00150 start = end
00151 end += 4
00152 (length,) = _struct_I.unpack(str[start:end])
00153 start = end
00154 end += length
00155 self.start.uuid = str[start:end]
00156 start = end
00157 end += 4
00158 (length,) = _struct_I.unpack(str[start:end])
00159 start = end
00160 end += length
00161 self.end.uuid = str[start:end]
00162 start = end
00163 end += 4
00164 (length,) = _struct_I.unpack(str[start:end])
00165 self.props = []
00166 for i in range(0, length):
00167 val1 = geographic_msgs.msg.KeyValue()
00168 start = end
00169 end += 4
00170 (length,) = _struct_I.unpack(str[start:end])
00171 start = end
00172 end += length
00173 val1.key = str[start:end]
00174 start = end
00175 end += 4
00176 (length,) = _struct_I.unpack(str[start:end])
00177 start = end
00178 end += length
00179 val1.value = str[start:end]
00180 self.props.append(val1)
00181 return self
00182 except struct.error as e:
00183 raise roslib.message.DeserializationError(e)
00184
00185
00186 def serialize_numpy(self, buff, numpy):
00187 """
00188 serialize message with numpy array types into buffer
00189 @param buff: buffer
00190 @type buff: StringIO
00191 @param numpy: numpy python module
00192 @type numpy module
00193 """
00194 try:
00195 _x = self.id.uuid
00196 length = len(_x)
00197 buff.write(struct.pack('<I%ss'%length, length, _x))
00198 _x = self.start.uuid
00199 length = len(_x)
00200 buff.write(struct.pack('<I%ss'%length, length, _x))
00201 _x = self.end.uuid
00202 length = len(_x)
00203 buff.write(struct.pack('<I%ss'%length, length, _x))
00204 length = len(self.props)
00205 buff.write(_struct_I.pack(length))
00206 for val1 in self.props:
00207 _x = val1.key
00208 length = len(_x)
00209 buff.write(struct.pack('<I%ss'%length, length, _x))
00210 _x = val1.value
00211 length = len(_x)
00212 buff.write(struct.pack('<I%ss'%length, length, _x))
00213 except struct.error as se: self._check_types(se)
00214 except TypeError as te: self._check_types(te)
00215
00216 def deserialize_numpy(self, str, numpy):
00217 """
00218 unpack serialized message in str into this message instance using numpy for array types
00219 @param str: byte array of serialized message
00220 @type str: str
00221 @param numpy: numpy python module
00222 @type numpy: module
00223 """
00224 try:
00225 if self.id is None:
00226 self.id = geographic_msgs.msg.UniqueID()
00227 if self.start is None:
00228 self.start = geographic_msgs.msg.UniqueID()
00229 if self.end is None:
00230 self.end = geographic_msgs.msg.UniqueID()
00231 end = 0
00232 start = end
00233 end += 4
00234 (length,) = _struct_I.unpack(str[start:end])
00235 start = end
00236 end += length
00237 self.id.uuid = str[start:end]
00238 start = end
00239 end += 4
00240 (length,) = _struct_I.unpack(str[start:end])
00241 start = end
00242 end += length
00243 self.start.uuid = str[start:end]
00244 start = end
00245 end += 4
00246 (length,) = _struct_I.unpack(str[start:end])
00247 start = end
00248 end += length
00249 self.end.uuid = str[start:end]
00250 start = end
00251 end += 4
00252 (length,) = _struct_I.unpack(str[start:end])
00253 self.props = []
00254 for i in range(0, length):
00255 val1 = geographic_msgs.msg.KeyValue()
00256 start = end
00257 end += 4
00258 (length,) = _struct_I.unpack(str[start:end])
00259 start = end
00260 end += length
00261 val1.key = str[start:end]
00262 start = end
00263 end += 4
00264 (length,) = _struct_I.unpack(str[start:end])
00265 start = end
00266 end += length
00267 val1.value = str[start:end]
00268 self.props.append(val1)
00269 return self
00270 except struct.error as e:
00271 raise roslib.message.DeserializationError(e)
00272
00273 _struct_I = roslib.message.struct_I