00001 """autogenerated by genmsg_py from GpsInfo.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import std_msgs.msg
00006
00007 class GpsInfo(roslib.message.Message):
00008 _md5sum = "4f5e197f8744c1a11f1c94dc6e9a77a6"
00009 _type = "art_msgs/GpsInfo"
00010 _has_header = True
00011 _full_text = """# GPS position message
00012 #
00013 # Probably to be replaced by a standard ROS message for Diamondback.
00014
00015 # $Id: GpsInfo.msg 604 2010-09-22 15:50:16Z jack.oquin $
00016
00017 # standard ROS header, includes time stamp
00018 Header header
00019
00020 # Latitude in degrees. Positive is north of equator, negative is
00021 # south of equator.
00022 float64 latitude
00023
00024 # Longitude in degrees. Positive is east of prime meridian, negative
00025 # is west of prime meridian.
00026 float64 longitude
00027
00028 # Altitude, in meters. Positive is above reference (e.g., sea-level),
00029 # and negative is below.
00030 float64 altitude
00031
00032 # UTM WGS84 coordinates, easting [m]
00033 float64 utm_e
00034
00035 # UTM WGS84 coordinates, northing [m]
00036 float64 utm_n
00037
00038 # UTM zone
00039 string zone
00040
00041 # Horizontal dilution of position (HDOP)
00042 float64 hdop
00043
00044 # Vertical dilution of position (VDOP)
00045 float64 vdop
00046
00047 # Horizonal error [m]
00048 float64 err_horz
00049
00050 # Vertical error [m]
00051 float64 err_vert
00052
00053 # Quality of fix 0 = invalid, 1 = GPS fix, 2 = Differential GPS fix
00054 uint16 INVALID_FIX = 0
00055 uint16 GPS_FIX = 1
00056 uint16 DGPS_FIX = 2
00057 uint16 quality
00058
00059 # Number of satellites in view.
00060 uint16 num_sats
00061
00062 ================================================================================
00063 MSG: std_msgs/Header
00064 # Standard metadata for higher-level stamped data types.
00065 # This is generally used to communicate timestamped data
00066 # in a particular coordinate frame.
00067 #
00068 # sequence ID: consecutively increasing ID
00069 uint32 seq
00070 #Two-integer timestamp that is expressed as:
00071 # * stamp.secs: seconds (stamp_secs) since epoch
00072 # * stamp.nsecs: nanoseconds since stamp_secs
00073 # time-handling sugar is provided by the client library
00074 time stamp
00075 #Frame this data is associated with
00076 # 0: no frame
00077 # 1: global frame
00078 string frame_id
00079
00080 """
00081
00082 INVALID_FIX = 0
00083 GPS_FIX = 1
00084 DGPS_FIX = 2
00085
00086 __slots__ = ['header','latitude','longitude','altitude','utm_e','utm_n','zone','hdop','vdop','err_horz','err_vert','quality','num_sats']
00087 _slot_types = ['Header','float64','float64','float64','float64','float64','string','float64','float64','float64','float64','uint16','uint16']
00088
00089 def __init__(self, *args, **kwds):
00090 """
00091 Constructor. Any message fields that are implicitly/explicitly
00092 set to None will be assigned a default value. The recommend
00093 use is keyword arguments as this is more robust to future message
00094 changes. You cannot mix in-order arguments and keyword arguments.
00095
00096 The available fields are:
00097 header,latitude,longitude,altitude,utm_e,utm_n,zone,hdop,vdop,err_horz,err_vert,quality,num_sats
00098
00099 @param args: complete set of field values, in .msg order
00100 @param kwds: use keyword arguments corresponding to message field names
00101 to set specific fields.
00102 """
00103 if args or kwds:
00104 super(GpsInfo, self).__init__(*args, **kwds)
00105
00106 if self.header is None:
00107 self.header = std_msgs.msg._Header.Header()
00108 if self.latitude is None:
00109 self.latitude = 0.
00110 if self.longitude is None:
00111 self.longitude = 0.
00112 if self.altitude is None:
00113 self.altitude = 0.
00114 if self.utm_e is None:
00115 self.utm_e = 0.
00116 if self.utm_n is None:
00117 self.utm_n = 0.
00118 if self.zone is None:
00119 self.zone = ''
00120 if self.hdop is None:
00121 self.hdop = 0.
00122 if self.vdop is None:
00123 self.vdop = 0.
00124 if self.err_horz is None:
00125 self.err_horz = 0.
00126 if self.err_vert is None:
00127 self.err_vert = 0.
00128 if self.quality is None:
00129 self.quality = 0
00130 if self.num_sats is None:
00131 self.num_sats = 0
00132 else:
00133 self.header = std_msgs.msg._Header.Header()
00134 self.latitude = 0.
00135 self.longitude = 0.
00136 self.altitude = 0.
00137 self.utm_e = 0.
00138 self.utm_n = 0.
00139 self.zone = ''
00140 self.hdop = 0.
00141 self.vdop = 0.
00142 self.err_horz = 0.
00143 self.err_vert = 0.
00144 self.quality = 0
00145 self.num_sats = 0
00146
00147 def _get_types(self):
00148 """
00149 internal API method
00150 """
00151 return self._slot_types
00152
00153 def serialize(self, buff):
00154 """
00155 serialize message into buffer
00156 @param buff: buffer
00157 @type buff: StringIO
00158 """
00159 try:
00160 _x = self
00161 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00162 _x = self.header.frame_id
00163 length = len(_x)
00164 buff.write(struct.pack('<I%ss'%length, length, _x))
00165 _x = self
00166 buff.write(_struct_5d.pack(_x.latitude, _x.longitude, _x.altitude, _x.utm_e, _x.utm_n))
00167 _x = self.zone
00168 length = len(_x)
00169 buff.write(struct.pack('<I%ss'%length, length, _x))
00170 _x = self
00171 buff.write(_struct_4d2H.pack(_x.hdop, _x.vdop, _x.err_horz, _x.err_vert, _x.quality, _x.num_sats))
00172 except struct.error, se: self._check_types(se)
00173 except TypeError, te: self._check_types(te)
00174
00175 def deserialize(self, str):
00176 """
00177 unpack serialized message in str into this message instance
00178 @param str: byte array of serialized message
00179 @type str: str
00180 """
00181 try:
00182 if self.header is None:
00183 self.header = std_msgs.msg._Header.Header()
00184 end = 0
00185 _x = self
00186 start = end
00187 end += 12
00188 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00189 start = end
00190 end += 4
00191 (length,) = _struct_I.unpack(str[start:end])
00192 start = end
00193 end += length
00194 self.header.frame_id = str[start:end]
00195 _x = self
00196 start = end
00197 end += 40
00198 (_x.latitude, _x.longitude, _x.altitude, _x.utm_e, _x.utm_n,) = _struct_5d.unpack(str[start:end])
00199 start = end
00200 end += 4
00201 (length,) = _struct_I.unpack(str[start:end])
00202 start = end
00203 end += length
00204 self.zone = str[start:end]
00205 _x = self
00206 start = end
00207 end += 36
00208 (_x.hdop, _x.vdop, _x.err_horz, _x.err_vert, _x.quality, _x.num_sats,) = _struct_4d2H.unpack(str[start:end])
00209 return self
00210 except struct.error, e:
00211 raise roslib.message.DeserializationError(e)
00212
00213
00214 def serialize_numpy(self, buff, numpy):
00215 """
00216 serialize message with numpy array types into buffer
00217 @param buff: buffer
00218 @type buff: StringIO
00219 @param numpy: numpy python module
00220 @type numpy module
00221 """
00222 try:
00223 _x = self
00224 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00225 _x = self.header.frame_id
00226 length = len(_x)
00227 buff.write(struct.pack('<I%ss'%length, length, _x))
00228 _x = self
00229 buff.write(_struct_5d.pack(_x.latitude, _x.longitude, _x.altitude, _x.utm_e, _x.utm_n))
00230 _x = self.zone
00231 length = len(_x)
00232 buff.write(struct.pack('<I%ss'%length, length, _x))
00233 _x = self
00234 buff.write(_struct_4d2H.pack(_x.hdop, _x.vdop, _x.err_horz, _x.err_vert, _x.quality, _x.num_sats))
00235 except struct.error, se: self._check_types(se)
00236 except TypeError, te: self._check_types(te)
00237
00238 def deserialize_numpy(self, str, numpy):
00239 """
00240 unpack serialized message in str into this message instance using numpy for array types
00241 @param str: byte array of serialized message
00242 @type str: str
00243 @param numpy: numpy python module
00244 @type numpy: module
00245 """
00246 try:
00247 if self.header is None:
00248 self.header = std_msgs.msg._Header.Header()
00249 end = 0
00250 _x = self
00251 start = end
00252 end += 12
00253 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00254 start = end
00255 end += 4
00256 (length,) = _struct_I.unpack(str[start:end])
00257 start = end
00258 end += length
00259 self.header.frame_id = str[start:end]
00260 _x = self
00261 start = end
00262 end += 40
00263 (_x.latitude, _x.longitude, _x.altitude, _x.utm_e, _x.utm_n,) = _struct_5d.unpack(str[start:end])
00264 start = end
00265 end += 4
00266 (length,) = _struct_I.unpack(str[start:end])
00267 start = end
00268 end += length
00269 self.zone = str[start:end]
00270 _x = self
00271 start = end
00272 end += 36
00273 (_x.hdop, _x.vdop, _x.err_horz, _x.err_vert, _x.quality, _x.num_sats,) = _struct_4d2H.unpack(str[start:end])
00274 return self
00275 except struct.error, e:
00276 raise roslib.message.DeserializationError(e)
00277
00278 _struct_I = roslib.message.struct_I
00279 _struct_5d = struct.Struct("<5d")
00280 _struct_3I = struct.Struct("<3I")
00281 _struct_4d2H = struct.Struct("<4d2H")