00001 """autogenerated by genmsg_py from GeoPoint.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class GeoPoint(roslib.message.Message):
00007 _md5sum = "c48027a852aeff972be80478ff38e81a"
00008 _type = "geographic_msgs/GeoPoint"
00009 _has_header = False
00010 _full_text = """# Geographic point, using the WGS 84 reference ellipsoid.
00011
00012 # Latitude [degrees]. Positive is north of equator; negative is south
00013 # (-90 <= latitude <= +90).
00014 float64 latitude
00015
00016 # Longitude [degrees]. Positive is east of prime meridian; negative is
00017 # west (-180 <= longitude <= +180). At the poles, latitude is -90 or
00018 # +90, and longitude is irrelevant, but must be in range.
00019 float64 longitude
00020
00021 # Altitude [m]. Positive is above the WGS 84 ellipsoid (NaN if unspecified).
00022 float64 altitude
00023
00024 """
00025 __slots__ = ['latitude','longitude','altitude']
00026 _slot_types = ['float64','float64','float64']
00027
00028 def __init__(self, *args, **kwds):
00029 """
00030 Constructor. Any message fields that are implicitly/explicitly
00031 set to None will be assigned a default value. The recommend
00032 use is keyword arguments as this is more robust to future message
00033 changes. You cannot mix in-order arguments and keyword arguments.
00034
00035 The available fields are:
00036 latitude,longitude,altitude
00037
00038 @param args: complete set of field values, in .msg order
00039 @param kwds: use keyword arguments corresponding to message field names
00040 to set specific fields.
00041 """
00042 if args or kwds:
00043 super(GeoPoint, self).__init__(*args, **kwds)
00044
00045 if self.latitude is None:
00046 self.latitude = 0.
00047 if self.longitude is None:
00048 self.longitude = 0.
00049 if self.altitude is None:
00050 self.altitude = 0.
00051 else:
00052 self.latitude = 0.
00053 self.longitude = 0.
00054 self.altitude = 0.
00055
00056 def _get_types(self):
00057 """
00058 internal API method
00059 """
00060 return self._slot_types
00061
00062 def serialize(self, buff):
00063 """
00064 serialize message into buffer
00065 @param buff: buffer
00066 @type buff: StringIO
00067 """
00068 try:
00069 _x = self
00070 buff.write(_struct_3d.pack(_x.latitude, _x.longitude, _x.altitude))
00071 except struct.error as se: self._check_types(se)
00072 except TypeError as te: self._check_types(te)
00073
00074 def deserialize(self, str):
00075 """
00076 unpack serialized message in str into this message instance
00077 @param str: byte array of serialized message
00078 @type str: str
00079 """
00080 try:
00081 end = 0
00082 _x = self
00083 start = end
00084 end += 24
00085 (_x.latitude, _x.longitude, _x.altitude,) = _struct_3d.unpack(str[start:end])
00086 return self
00087 except struct.error as e:
00088 raise roslib.message.DeserializationError(e)
00089
00090
00091 def serialize_numpy(self, buff, numpy):
00092 """
00093 serialize message with numpy array types into buffer
00094 @param buff: buffer
00095 @type buff: StringIO
00096 @param numpy: numpy python module
00097 @type numpy module
00098 """
00099 try:
00100 _x = self
00101 buff.write(_struct_3d.pack(_x.latitude, _x.longitude, _x.altitude))
00102 except struct.error as se: self._check_types(se)
00103 except TypeError as te: self._check_types(te)
00104
00105 def deserialize_numpy(self, str, numpy):
00106 """
00107 unpack serialized message in str into this message instance using numpy for array types
00108 @param str: byte array of serialized message
00109 @type str: str
00110 @param numpy: numpy python module
00111 @type numpy: module
00112 """
00113 try:
00114 end = 0
00115 _x = self
00116 start = end
00117 end += 24
00118 (_x.latitude, _x.longitude, _x.altitude,) = _struct_3d.unpack(str[start:end])
00119 return self
00120 except struct.error as e:
00121 raise roslib.message.DeserializationError(e)
00122
00123 _struct_I = roslib.message.struct_I
00124 _struct_3d = struct.Struct("<3d")