_GPSStatus.py
Go to the documentation of this file.
00001 """autogenerated by genpy from corobot_msgs/GPSStatus.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import std_msgs.msg
00008 
00009 class GPSStatus(genpy.Message):
00010   _md5sum = "313baa8951fdd056c78bf61b1b07d249"
00011   _type = "corobot_msgs/GPSStatus"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """Header header
00014 
00015 # Satellites used in solution
00016 uint16 satellites_used # Number of satellites
00017 int32[] satellite_used_prn # PRN identifiers
00018 
00019 # Satellites visible
00020 uint16 satellites_visible
00021 int32[] satellite_visible_prn # PRN identifiers
00022 int32[] satellite_visible_z # Elevation of satellites
00023 int32[] satellite_visible_azimuth # Azimuth of satellites
00024 int32[] satellite_visible_snr # Signal-to-noise ratios (dB)
00025 
00026 # Measurement status
00027 int16 STATUS_NO_FIX=-1   # Unable to fix position
00028 int16 STATUS_FIX=0       # Normal fix
00029 int16 STATUS_SBAS_FIX=1  # Fixed using a satellite-based augmentation system
00030 int16 STATUS_GBAS_FIX=2  #          or a ground-based augmentation system
00031 int16 STATUS_DGPS_FIX=18 # Fixed with DGPS
00032 int16 STATUS_WAAS_FIX=33 # Fixed with WAAS
00033 int16 status
00034 
00035 uint16 SOURCE_NONE=0 # No information is available
00036 uint16 SOURCE_GPS=1 # Using standard GPS location [only valid for position_source]
00037 uint16 SOURCE_POINTS=2 # Motion/orientation fix is derived from successive points
00038 uint16 SOURCE_DOPPLER=4 # Motion is derived using the Doppler effect
00039 uint16 SOURCE_ALTIMETER=8 # Using an altimeter
00040 uint16 SOURCE_MAGNETIC=16 # Using magnetic sensors
00041 uint16 SOURCE_GYRO=32 # Using gyroscopes
00042 uint16 SOURCE_ACCEL=64 # Using accelerometers
00043 
00044 uint16 motion_source # Source for speed, climb and track
00045 uint16 orientation_source # Source for device orientation
00046 uint16 position_source # Source for position
00047 
00048 
00049 ================================================================================
00050 MSG: std_msgs/Header
00051 # Standard metadata for higher-level stamped data types.
00052 # This is generally used to communicate timestamped data 
00053 # in a particular coordinate frame.
00054 # 
00055 # sequence ID: consecutively increasing ID 
00056 uint32 seq
00057 #Two-integer timestamp that is expressed as:
00058 # * stamp.secs: seconds (stamp_secs) since epoch
00059 # * stamp.nsecs: nanoseconds since stamp_secs
00060 # time-handling sugar is provided by the client library
00061 time stamp
00062 #Frame this data is associated with
00063 # 0: no frame
00064 # 1: global frame
00065 string frame_id
00066 
00067 """
00068   # Pseudo-constants
00069   STATUS_NO_FIX = -1
00070   STATUS_FIX = 0
00071   STATUS_SBAS_FIX = 1
00072   STATUS_GBAS_FIX = 2
00073   STATUS_DGPS_FIX = 18
00074   STATUS_WAAS_FIX = 33
00075   SOURCE_NONE = 0
00076   SOURCE_GPS = 1
00077   SOURCE_POINTS = 2
00078   SOURCE_DOPPLER = 4
00079   SOURCE_ALTIMETER = 8
00080   SOURCE_MAGNETIC = 16
00081   SOURCE_GYRO = 32
00082   SOURCE_ACCEL = 64
00083 
00084   __slots__ = ['header','satellites_used','satellite_used_prn','satellites_visible','satellite_visible_prn','satellite_visible_z','satellite_visible_azimuth','satellite_visible_snr','status','motion_source','orientation_source','position_source']
00085   _slot_types = ['std_msgs/Header','uint16','int32[]','uint16','int32[]','int32[]','int32[]','int32[]','int16','uint16','uint16','uint16']
00086 
00087   def __init__(self, *args, **kwds):
00088     """
00089     Constructor. Any message fields that are implicitly/explicitly
00090     set to None will be assigned a default value. The recommend
00091     use is keyword arguments as this is more robust to future message
00092     changes.  You cannot mix in-order arguments and keyword arguments.
00093 
00094     The available fields are:
00095        header,satellites_used,satellite_used_prn,satellites_visible,satellite_visible_prn,satellite_visible_z,satellite_visible_azimuth,satellite_visible_snr,status,motion_source,orientation_source,position_source
00096 
00097     :param args: complete set of field values, in .msg order
00098     :param kwds: use keyword arguments corresponding to message field names
00099     to set specific fields.
00100     """
00101     if args or kwds:
00102       super(GPSStatus, self).__init__(*args, **kwds)
00103       #message fields cannot be None, assign default values for those that are
00104       if self.header is None:
00105         self.header = std_msgs.msg.Header()
00106       if self.satellites_used is None:
00107         self.satellites_used = 0
00108       if self.satellite_used_prn is None:
00109         self.satellite_used_prn = []
00110       if self.satellites_visible is None:
00111         self.satellites_visible = 0
00112       if self.satellite_visible_prn is None:
00113         self.satellite_visible_prn = []
00114       if self.satellite_visible_z is None:
00115         self.satellite_visible_z = []
00116       if self.satellite_visible_azimuth is None:
00117         self.satellite_visible_azimuth = []
00118       if self.satellite_visible_snr is None:
00119         self.satellite_visible_snr = []
00120       if self.status is None:
00121         self.status = 0
00122       if self.motion_source is None:
00123         self.motion_source = 0
00124       if self.orientation_source is None:
00125         self.orientation_source = 0
00126       if self.position_source is None:
00127         self.position_source = 0
00128     else:
00129       self.header = std_msgs.msg.Header()
00130       self.satellites_used = 0
00131       self.satellite_used_prn = []
00132       self.satellites_visible = 0
00133       self.satellite_visible_prn = []
00134       self.satellite_visible_z = []
00135       self.satellite_visible_azimuth = []
00136       self.satellite_visible_snr = []
00137       self.status = 0
00138       self.motion_source = 0
00139       self.orientation_source = 0
00140       self.position_source = 0
00141 
00142   def _get_types(self):
00143     """
00144     internal API method
00145     """
00146     return self._slot_types
00147 
00148   def serialize(self, buff):
00149     """
00150     serialize message into buffer
00151     :param buff: buffer, ``StringIO``
00152     """
00153     try:
00154       _x = self
00155       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00156       _x = self.header.frame_id
00157       length = len(_x)
00158       if python3 or type(_x) == unicode:
00159         _x = _x.encode('utf-8')
00160         length = len(_x)
00161       buff.write(struct.pack('<I%ss'%length, length, _x))
00162       buff.write(_struct_H.pack(self.satellites_used))
00163       length = len(self.satellite_used_prn)
00164       buff.write(_struct_I.pack(length))
00165       pattern = '<%si'%length
00166       buff.write(struct.pack(pattern, *self.satellite_used_prn))
00167       buff.write(_struct_H.pack(self.satellites_visible))
00168       length = len(self.satellite_visible_prn)
00169       buff.write(_struct_I.pack(length))
00170       pattern = '<%si'%length
00171       buff.write(struct.pack(pattern, *self.satellite_visible_prn))
00172       length = len(self.satellite_visible_z)
00173       buff.write(_struct_I.pack(length))
00174       pattern = '<%si'%length
00175       buff.write(struct.pack(pattern, *self.satellite_visible_z))
00176       length = len(self.satellite_visible_azimuth)
00177       buff.write(_struct_I.pack(length))
00178       pattern = '<%si'%length
00179       buff.write(struct.pack(pattern, *self.satellite_visible_azimuth))
00180       length = len(self.satellite_visible_snr)
00181       buff.write(_struct_I.pack(length))
00182       pattern = '<%si'%length
00183       buff.write(struct.pack(pattern, *self.satellite_visible_snr))
00184       _x = self
00185       buff.write(_struct_h3H.pack(_x.status, _x.motion_source, _x.orientation_source, _x.position_source))
00186     except struct.error as se: self._check_types(se)
00187     except TypeError as te: self._check_types(te)
00188 
00189   def deserialize(self, str):
00190     """
00191     unpack serialized message in str into this message instance
00192     :param str: byte array of serialized message, ``str``
00193     """
00194     try:
00195       if self.header is None:
00196         self.header = std_msgs.msg.Header()
00197       end = 0
00198       _x = self
00199       start = end
00200       end += 12
00201       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00202       start = end
00203       end += 4
00204       (length,) = _struct_I.unpack(str[start:end])
00205       start = end
00206       end += length
00207       if python3:
00208         self.header.frame_id = str[start:end].decode('utf-8')
00209       else:
00210         self.header.frame_id = str[start:end]
00211       start = end
00212       end += 2
00213       (self.satellites_used,) = _struct_H.unpack(str[start:end])
00214       start = end
00215       end += 4
00216       (length,) = _struct_I.unpack(str[start:end])
00217       pattern = '<%si'%length
00218       start = end
00219       end += struct.calcsize(pattern)
00220       self.satellite_used_prn = struct.unpack(pattern, str[start:end])
00221       start = end
00222       end += 2
00223       (self.satellites_visible,) = _struct_H.unpack(str[start:end])
00224       start = end
00225       end += 4
00226       (length,) = _struct_I.unpack(str[start:end])
00227       pattern = '<%si'%length
00228       start = end
00229       end += struct.calcsize(pattern)
00230       self.satellite_visible_prn = struct.unpack(pattern, str[start:end])
00231       start = end
00232       end += 4
00233       (length,) = _struct_I.unpack(str[start:end])
00234       pattern = '<%si'%length
00235       start = end
00236       end += struct.calcsize(pattern)
00237       self.satellite_visible_z = struct.unpack(pattern, str[start:end])
00238       start = end
00239       end += 4
00240       (length,) = _struct_I.unpack(str[start:end])
00241       pattern = '<%si'%length
00242       start = end
00243       end += struct.calcsize(pattern)
00244       self.satellite_visible_azimuth = struct.unpack(pattern, str[start:end])
00245       start = end
00246       end += 4
00247       (length,) = _struct_I.unpack(str[start:end])
00248       pattern = '<%si'%length
00249       start = end
00250       end += struct.calcsize(pattern)
00251       self.satellite_visible_snr = struct.unpack(pattern, str[start:end])
00252       _x = self
00253       start = end
00254       end += 8
00255       (_x.status, _x.motion_source, _x.orientation_source, _x.position_source,) = _struct_h3H.unpack(str[start:end])
00256       return self
00257     except struct.error as e:
00258       raise genpy.DeserializationError(e) #most likely buffer underfill
00259 
00260 
00261   def serialize_numpy(self, buff, numpy):
00262     """
00263     serialize message with numpy array types into buffer
00264     :param buff: buffer, ``StringIO``
00265     :param numpy: numpy python module
00266     """
00267     try:
00268       _x = self
00269       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00270       _x = self.header.frame_id
00271       length = len(_x)
00272       if python3 or type(_x) == unicode:
00273         _x = _x.encode('utf-8')
00274         length = len(_x)
00275       buff.write(struct.pack('<I%ss'%length, length, _x))
00276       buff.write(_struct_H.pack(self.satellites_used))
00277       length = len(self.satellite_used_prn)
00278       buff.write(_struct_I.pack(length))
00279       pattern = '<%si'%length
00280       buff.write(self.satellite_used_prn.tostring())
00281       buff.write(_struct_H.pack(self.satellites_visible))
00282       length = len(self.satellite_visible_prn)
00283       buff.write(_struct_I.pack(length))
00284       pattern = '<%si'%length
00285       buff.write(self.satellite_visible_prn.tostring())
00286       length = len(self.satellite_visible_z)
00287       buff.write(_struct_I.pack(length))
00288       pattern = '<%si'%length
00289       buff.write(self.satellite_visible_z.tostring())
00290       length = len(self.satellite_visible_azimuth)
00291       buff.write(_struct_I.pack(length))
00292       pattern = '<%si'%length
00293       buff.write(self.satellite_visible_azimuth.tostring())
00294       length = len(self.satellite_visible_snr)
00295       buff.write(_struct_I.pack(length))
00296       pattern = '<%si'%length
00297       buff.write(self.satellite_visible_snr.tostring())
00298       _x = self
00299       buff.write(_struct_h3H.pack(_x.status, _x.motion_source, _x.orientation_source, _x.position_source))
00300     except struct.error as se: self._check_types(se)
00301     except TypeError as te: self._check_types(te)
00302 
00303   def deserialize_numpy(self, str, numpy):
00304     """
00305     unpack serialized message in str into this message instance using numpy for array types
00306     :param str: byte array of serialized message, ``str``
00307     :param numpy: numpy python module
00308     """
00309     try:
00310       if self.header is None:
00311         self.header = std_msgs.msg.Header()
00312       end = 0
00313       _x = self
00314       start = end
00315       end += 12
00316       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00317       start = end
00318       end += 4
00319       (length,) = _struct_I.unpack(str[start:end])
00320       start = end
00321       end += length
00322       if python3:
00323         self.header.frame_id = str[start:end].decode('utf-8')
00324       else:
00325         self.header.frame_id = str[start:end]
00326       start = end
00327       end += 2
00328       (self.satellites_used,) = _struct_H.unpack(str[start:end])
00329       start = end
00330       end += 4
00331       (length,) = _struct_I.unpack(str[start:end])
00332       pattern = '<%si'%length
00333       start = end
00334       end += struct.calcsize(pattern)
00335       self.satellite_used_prn = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00336       start = end
00337       end += 2
00338       (self.satellites_visible,) = _struct_H.unpack(str[start:end])
00339       start = end
00340       end += 4
00341       (length,) = _struct_I.unpack(str[start:end])
00342       pattern = '<%si'%length
00343       start = end
00344       end += struct.calcsize(pattern)
00345       self.satellite_visible_prn = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00346       start = end
00347       end += 4
00348       (length,) = _struct_I.unpack(str[start:end])
00349       pattern = '<%si'%length
00350       start = end
00351       end += struct.calcsize(pattern)
00352       self.satellite_visible_z = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00353       start = end
00354       end += 4
00355       (length,) = _struct_I.unpack(str[start:end])
00356       pattern = '<%si'%length
00357       start = end
00358       end += struct.calcsize(pattern)
00359       self.satellite_visible_azimuth = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00360       start = end
00361       end += 4
00362       (length,) = _struct_I.unpack(str[start:end])
00363       pattern = '<%si'%length
00364       start = end
00365       end += struct.calcsize(pattern)
00366       self.satellite_visible_snr = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00367       _x = self
00368       start = end
00369       end += 8
00370       (_x.status, _x.motion_source, _x.orientation_source, _x.position_source,) = _struct_h3H.unpack(str[start:end])
00371       return self
00372     except struct.error as e:
00373       raise genpy.DeserializationError(e) #most likely buffer underfill
00374 
00375 _struct_I = genpy.struct_I
00376 _struct_H = struct.Struct("<H")
00377 _struct_3I = struct.Struct("<3I")
00378 _struct_h3H = struct.Struct("<h3H")


corobot_msgs
Author(s):
autogenerated on Wed Aug 26 2015 11:09:31