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