00001 """autogenerated by genmsg_py from WayPoint.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geographic_msgs.msg
00006
00007 class WayPoint(roslib.message.Message):
00008 _md5sum = "92283b4c5b198e9cad54296951823b02"
00009 _type = "geographic_msgs/WayPoint"
00010 _has_header = False
00011 _full_text = """# Way-point element for a geographic map.
00012
00013 UniqueID id # Unique way-point identifier
00014 GeoPoint position # Position relative to WGS 84 ellipsoid
00015 KeyValue[] props # Key/value properties for this point
00016
00017 ================================================================================
00018 MSG: geographic_msgs/UniqueID
00019 # A universally unique identifier (UUID) for a geographic feature.
00020 #
00021 # http://en.wikipedia.org/wiki/Universally_unique_identifier
00022 # http://tools.ietf.org/html/rfc4122.html
00023 #
00024 # For simplicity and human readability, the UUID is represented as a
00025 # string of hex digits and dashes.
00026 #
00027 # UUID generation is up to the programmer, but the intent is for
00028 # matching features within a domain such as Open Street Map to yield
00029 # the same UUID. The recommended method is RFC 4122 variant 5,
00030 # computing the SHA-1 hash of a URL encoded using the map source. For
00031 # example:
00032 #
00033 # http://openstreetmap.org/node/NUMBER
00034 # http://openstreetmap.org/way/NUMBER
00035 # http://openstreetmap.org/relation/NUMBER
00036 #
00037 # Here NUMBER is the decimal representation of the OSM node, way, or
00038 # relation ID without leading zeros.
00039 #
00040 # Other map sources should use similar conventions.
00041
00042 string uuid # format: 01234567-89ab-cdef-0123-456789abcdef
00043
00044 ================================================================================
00045 MSG: geographic_msgs/GeoPoint
00046 # Geographic point, using the WGS 84 reference ellipsoid.
00047
00048 # Latitude [degrees]. Positive is north of equator; negative is south
00049 # (-90 <= latitude <= +90).
00050 float64 latitude
00051
00052 # Longitude [degrees]. Positive is east of prime meridian; negative is
00053 # west (-180 <= longitude <= +180). At the poles, latitude is -90 or
00054 # +90, and longitude is irrelevant, but must be in range.
00055 float64 longitude
00056
00057 # Altitude [m]. Positive is above the WGS 84 ellipsoid (NaN if unspecified).
00058 float64 altitude
00059
00060 ================================================================================
00061 MSG: geographic_msgs/KeyValue
00062 # Geographic map tag (key, value) pair
00063 #
00064 # This is equivalent to diagnostic_msgs/KeyValue, repeated here to
00065 # avoid introducing a trivial stack dependency.
00066
00067 string key # tag label
00068 string value # corresponding value
00069
00070 """
00071 __slots__ = ['id','position','props']
00072 _slot_types = ['geographic_msgs/UniqueID','geographic_msgs/GeoPoint','geographic_msgs/KeyValue[]']
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 id,position,props
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(WayPoint, self).__init__(*args, **kwds)
00090
00091 if self.id is None:
00092 self.id = geographic_msgs.msg.UniqueID()
00093 if self.position is None:
00094 self.position = geographic_msgs.msg.GeoPoint()
00095 if self.props is None:
00096 self.props = []
00097 else:
00098 self.id = geographic_msgs.msg.UniqueID()
00099 self.position = geographic_msgs.msg.GeoPoint()
00100 self.props = []
00101
00102 def _get_types(self):
00103 """
00104 internal API method
00105 """
00106 return self._slot_types
00107
00108 def serialize(self, buff):
00109 """
00110 serialize message into buffer
00111 @param buff: buffer
00112 @type buff: StringIO
00113 """
00114 try:
00115 _x = self.id.uuid
00116 length = len(_x)
00117 buff.write(struct.pack('<I%ss'%length, length, _x))
00118 _x = self
00119 buff.write(_struct_3d.pack(_x.position.latitude, _x.position.longitude, _x.position.altitude))
00120 length = len(self.props)
00121 buff.write(_struct_I.pack(length))
00122 for val1 in self.props:
00123 _x = val1.key
00124 length = len(_x)
00125 buff.write(struct.pack('<I%ss'%length, length, _x))
00126 _x = val1.value
00127 length = len(_x)
00128 buff.write(struct.pack('<I%ss'%length, length, _x))
00129 except struct.error as se: self._check_types(se)
00130 except TypeError as te: self._check_types(te)
00131
00132 def deserialize(self, str):
00133 """
00134 unpack serialized message in str into this message instance
00135 @param str: byte array of serialized message
00136 @type str: str
00137 """
00138 try:
00139 if self.id is None:
00140 self.id = geographic_msgs.msg.UniqueID()
00141 if self.position is None:
00142 self.position = geographic_msgs.msg.GeoPoint()
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 _x = self
00151 start = end
00152 end += 24
00153 (_x.position.latitude, _x.position.longitude, _x.position.altitude,) = _struct_3d.unpack(str[start:end])
00154 start = end
00155 end += 4
00156 (length,) = _struct_I.unpack(str[start:end])
00157 self.props = []
00158 for i in range(0, length):
00159 val1 = geographic_msgs.msg.KeyValue()
00160 start = end
00161 end += 4
00162 (length,) = _struct_I.unpack(str[start:end])
00163 start = end
00164 end += length
00165 val1.key = str[start:end]
00166 start = end
00167 end += 4
00168 (length,) = _struct_I.unpack(str[start:end])
00169 start = end
00170 end += length
00171 val1.value = str[start:end]
00172 self.props.append(val1)
00173 return self
00174 except struct.error as e:
00175 raise roslib.message.DeserializationError(e)
00176
00177
00178 def serialize_numpy(self, buff, numpy):
00179 """
00180 serialize message with numpy array types into buffer
00181 @param buff: buffer
00182 @type buff: StringIO
00183 @param numpy: numpy python module
00184 @type numpy module
00185 """
00186 try:
00187 _x = self.id.uuid
00188 length = len(_x)
00189 buff.write(struct.pack('<I%ss'%length, length, _x))
00190 _x = self
00191 buff.write(_struct_3d.pack(_x.position.latitude, _x.position.longitude, _x.position.altitude))
00192 length = len(self.props)
00193 buff.write(_struct_I.pack(length))
00194 for val1 in self.props:
00195 _x = val1.key
00196 length = len(_x)
00197 buff.write(struct.pack('<I%ss'%length, length, _x))
00198 _x = val1.value
00199 length = len(_x)
00200 buff.write(struct.pack('<I%ss'%length, length, _x))
00201 except struct.error as se: self._check_types(se)
00202 except TypeError as te: self._check_types(te)
00203
00204 def deserialize_numpy(self, str, numpy):
00205 """
00206 unpack serialized message in str into this message instance using numpy for array types
00207 @param str: byte array of serialized message
00208 @type str: str
00209 @param numpy: numpy python module
00210 @type numpy: module
00211 """
00212 try:
00213 if self.id is None:
00214 self.id = geographic_msgs.msg.UniqueID()
00215 if self.position is None:
00216 self.position = geographic_msgs.msg.GeoPoint()
00217 end = 0
00218 start = end
00219 end += 4
00220 (length,) = _struct_I.unpack(str[start:end])
00221 start = end
00222 end += length
00223 self.id.uuid = str[start:end]
00224 _x = self
00225 start = end
00226 end += 24
00227 (_x.position.latitude, _x.position.longitude, _x.position.altitude,) = _struct_3d.unpack(str[start:end])
00228 start = end
00229 end += 4
00230 (length,) = _struct_I.unpack(str[start:end])
00231 self.props = []
00232 for i in range(0, length):
00233 val1 = geographic_msgs.msg.KeyValue()
00234 start = end
00235 end += 4
00236 (length,) = _struct_I.unpack(str[start:end])
00237 start = end
00238 end += length
00239 val1.key = str[start:end]
00240 start = end
00241 end += 4
00242 (length,) = _struct_I.unpack(str[start:end])
00243 start = end
00244 end += length
00245 val1.value = str[start:end]
00246 self.props.append(val1)
00247 return self
00248 except struct.error as e:
00249 raise roslib.message.DeserializationError(e)
00250
00251 _struct_I = roslib.message.struct_I
00252 _struct_3d = struct.Struct("<3d")