_GAMS.py
Go to the documentation of this file.
00001 """autogenerated by genpy from applanix_msgs/GAMS.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 applanix_msgs.msg
00008 
00009 class GAMS(genpy.Message):
00010   _md5sum = "018cc2b2b8ae19d409c9e0d80bd8927e"
00011   _type = "applanix_msgs/GAMS"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """TimeDistance td
00014 
00015 uint8 num_satellites
00016 float32 a_priori_pdop
00017 float32 antenna_separation
00018 
00019 uint8 STATUS_FIXED_INTEGER=0
00020 uint8 STATUS_FIXED_INTEGER_TEST_INSTALL_DATA=1
00021 uint8 STATUS_DEGRADED_FIXED_INTEGER=2
00022 uint8 STATUS_FLOATED_AMBIGUITY=3
00023 uint8 STATUS_DEGRADED_FLOATED_AMBIGUITY=4
00024 uint8 STATUS_SOLUTION_WITHOUT_INSTALL_DATA=5
00025 uint8 STATUS_SOLUTION_FROM_ATTITUDE_AND_INSTALL_DATA=6
00026 uint8 STATUS_NO_SOLUTION=7
00027 uint8 status
00028 
00029 uint8 PRN_UNASSIGNED=0
00030 uint8[12] prn_assignment
00031 
00032 uint16 cycle_slip_flag
00033 
00034 float64 gams_heading
00035 float64 gams_heading_rms_err
00036 
00037 ================================================================================
00038 MSG: applanix_msgs/TimeDistance
00039 float64 time1
00040 float64 time2
00041 float64 distance
00042 uint8 time_types
00043 uint8 distance_type
00044 
00045 """
00046   # Pseudo-constants
00047   STATUS_FIXED_INTEGER = 0
00048   STATUS_FIXED_INTEGER_TEST_INSTALL_DATA = 1
00049   STATUS_DEGRADED_FIXED_INTEGER = 2
00050   STATUS_FLOATED_AMBIGUITY = 3
00051   STATUS_DEGRADED_FLOATED_AMBIGUITY = 4
00052   STATUS_SOLUTION_WITHOUT_INSTALL_DATA = 5
00053   STATUS_SOLUTION_FROM_ATTITUDE_AND_INSTALL_DATA = 6
00054   STATUS_NO_SOLUTION = 7
00055   PRN_UNASSIGNED = 0
00056 
00057   __slots__ = ['td','num_satellites','a_priori_pdop','antenna_separation','status','prn_assignment','cycle_slip_flag','gams_heading','gams_heading_rms_err']
00058   _slot_types = ['applanix_msgs/TimeDistance','uint8','float32','float32','uint8','uint8[12]','uint16','float64','float64']
00059 
00060   def __init__(self, *args, **kwds):
00061     """
00062     Constructor. Any message fields that are implicitly/explicitly
00063     set to None will be assigned a default value. The recommend
00064     use is keyword arguments as this is more robust to future message
00065     changes.  You cannot mix in-order arguments and keyword arguments.
00066 
00067     The available fields are:
00068        td,num_satellites,a_priori_pdop,antenna_separation,status,prn_assignment,cycle_slip_flag,gams_heading,gams_heading_rms_err
00069 
00070     :param args: complete set of field values, in .msg order
00071     :param kwds: use keyword arguments corresponding to message field names
00072     to set specific fields.
00073     """
00074     if args or kwds:
00075       super(GAMS, self).__init__(*args, **kwds)
00076       #message fields cannot be None, assign default values for those that are
00077       if self.td is None:
00078         self.td = applanix_msgs.msg.TimeDistance()
00079       if self.num_satellites is None:
00080         self.num_satellites = 0
00081       if self.a_priori_pdop is None:
00082         self.a_priori_pdop = 0.
00083       if self.antenna_separation is None:
00084         self.antenna_separation = 0.
00085       if self.status is None:
00086         self.status = 0
00087       if self.prn_assignment is None:
00088         self.prn_assignment = chr(0)*12
00089       if self.cycle_slip_flag is None:
00090         self.cycle_slip_flag = 0
00091       if self.gams_heading is None:
00092         self.gams_heading = 0.
00093       if self.gams_heading_rms_err is None:
00094         self.gams_heading_rms_err = 0.
00095     else:
00096       self.td = applanix_msgs.msg.TimeDistance()
00097       self.num_satellites = 0
00098       self.a_priori_pdop = 0.
00099       self.antenna_separation = 0.
00100       self.status = 0
00101       self.prn_assignment = chr(0)*12
00102       self.cycle_slip_flag = 0
00103       self.gams_heading = 0.
00104       self.gams_heading_rms_err = 0.
00105 
00106   def _get_types(self):
00107     """
00108     internal API method
00109     """
00110     return self._slot_types
00111 
00112   def serialize(self, buff):
00113     """
00114     serialize message into buffer
00115     :param buff: buffer, ``StringIO``
00116     """
00117     try:
00118       _x = self
00119       buff.write(_struct_3d3B2fB.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.num_satellites, _x.a_priori_pdop, _x.antenna_separation, _x.status))
00120       _x = self.prn_assignment
00121       # - if encoded as a list instead, serialize as bytes instead of string
00122       if type(_x) in [list, tuple]:
00123         buff.write(_struct_12B.pack(*_x))
00124       else:
00125         buff.write(_struct_12s.pack(_x))
00126       _x = self
00127       buff.write(_struct_H2d.pack(_x.cycle_slip_flag, _x.gams_heading, _x.gams_heading_rms_err))
00128     except struct.error as se: self._check_types(se)
00129     except TypeError as te: self._check_types(te)
00130 
00131   def deserialize(self, str):
00132     """
00133     unpack serialized message in str into this message instance
00134     :param str: byte array of serialized message, ``str``
00135     """
00136     try:
00137       if self.td is None:
00138         self.td = applanix_msgs.msg.TimeDistance()
00139       end = 0
00140       _x = self
00141       start = end
00142       end += 36
00143       (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.num_satellites, _x.a_priori_pdop, _x.antenna_separation, _x.status,) = _struct_3d3B2fB.unpack(str[start:end])
00144       start = end
00145       end += 12
00146       self.prn_assignment = str[start:end]
00147       _x = self
00148       start = end
00149       end += 18
00150       (_x.cycle_slip_flag, _x.gams_heading, _x.gams_heading_rms_err,) = _struct_H2d.unpack(str[start:end])
00151       return self
00152     except struct.error as e:
00153       raise genpy.DeserializationError(e) #most likely buffer underfill
00154 
00155 
00156   def serialize_numpy(self, buff, numpy):
00157     """
00158     serialize message with numpy array types into buffer
00159     :param buff: buffer, ``StringIO``
00160     :param numpy: numpy python module
00161     """
00162     try:
00163       _x = self
00164       buff.write(_struct_3d3B2fB.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.num_satellites, _x.a_priori_pdop, _x.antenna_separation, _x.status))
00165       _x = self.prn_assignment
00166       # - if encoded as a list instead, serialize as bytes instead of string
00167       if type(_x) in [list, tuple]:
00168         buff.write(_struct_12B.pack(*_x))
00169       else:
00170         buff.write(_struct_12s.pack(_x))
00171       _x = self
00172       buff.write(_struct_H2d.pack(_x.cycle_slip_flag, _x.gams_heading, _x.gams_heading_rms_err))
00173     except struct.error as se: self._check_types(se)
00174     except TypeError as te: self._check_types(te)
00175 
00176   def deserialize_numpy(self, str, numpy):
00177     """
00178     unpack serialized message in str into this message instance using numpy for array types
00179     :param str: byte array of serialized message, ``str``
00180     :param numpy: numpy python module
00181     """
00182     try:
00183       if self.td is None:
00184         self.td = applanix_msgs.msg.TimeDistance()
00185       end = 0
00186       _x = self
00187       start = end
00188       end += 36
00189       (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.num_satellites, _x.a_priori_pdop, _x.antenna_separation, _x.status,) = _struct_3d3B2fB.unpack(str[start:end])
00190       start = end
00191       end += 12
00192       self.prn_assignment = str[start:end]
00193       _x = self
00194       start = end
00195       end += 18
00196       (_x.cycle_slip_flag, _x.gams_heading, _x.gams_heading_rms_err,) = _struct_H2d.unpack(str[start:end])
00197       return self
00198     except struct.error as e:
00199       raise genpy.DeserializationError(e) #most likely buffer underfill
00200 
00201 _struct_I = genpy.struct_I
00202 _struct_H2d = struct.Struct("<H2d")
00203 _struct_12B = struct.Struct("<12B")
00204 _struct_12s = struct.Struct("<12s")
00205 _struct_3d3B2fB = struct.Struct("<3d3B2fB")


applanix_msgs
Author(s): Mike Purvis
autogenerated on Thu Jan 2 2014 11:04:51