_PreciseGravitySpecs.py
Go to the documentation of this file.
00001 """autogenerated by genpy from applanix_msgs/PreciseGravitySpecs.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class PreciseGravitySpecs(genpy.Message):
00009   _md5sum = "60a1e48489b4ff46feb6027343f9931a"
00010   _type = "applanix_msgs/PreciseGravitySpecs"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# Msg 40
00013 uint16 transaction
00014 
00015 float64 gravity_magnitude
00016 
00017 float64 north_deflection
00018 float64 east_deflection
00019 
00020 float64 latitude_of_validity
00021 float64 longitude_of_validity
00022 float64 altitude_of_validity
00023 
00024 """
00025   __slots__ = ['transaction','gravity_magnitude','north_deflection','east_deflection','latitude_of_validity','longitude_of_validity','altitude_of_validity']
00026   _slot_types = ['uint16','float64','float64','float64','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        transaction,gravity_magnitude,north_deflection,east_deflection,latitude_of_validity,longitude_of_validity,altitude_of_validity
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(PreciseGravitySpecs, self).__init__(*args, **kwds)
00044       #message fields cannot be None, assign default values for those that are
00045       if self.transaction is None:
00046         self.transaction = 0
00047       if self.gravity_magnitude is None:
00048         self.gravity_magnitude = 0.
00049       if self.north_deflection is None:
00050         self.north_deflection = 0.
00051       if self.east_deflection is None:
00052         self.east_deflection = 0.
00053       if self.latitude_of_validity is None:
00054         self.latitude_of_validity = 0.
00055       if self.longitude_of_validity is None:
00056         self.longitude_of_validity = 0.
00057       if self.altitude_of_validity is None:
00058         self.altitude_of_validity = 0.
00059     else:
00060       self.transaction = 0
00061       self.gravity_magnitude = 0.
00062       self.north_deflection = 0.
00063       self.east_deflection = 0.
00064       self.latitude_of_validity = 0.
00065       self.longitude_of_validity = 0.
00066       self.altitude_of_validity = 0.
00067 
00068   def _get_types(self):
00069     """
00070     internal API method
00071     """
00072     return self._slot_types
00073 
00074   def serialize(self, buff):
00075     """
00076     serialize message into buffer
00077     :param buff: buffer, ``StringIO``
00078     """
00079     try:
00080       _x = self
00081       buff.write(_struct_H6d.pack(_x.transaction, _x.gravity_magnitude, _x.north_deflection, _x.east_deflection, _x.latitude_of_validity, _x.longitude_of_validity, _x.altitude_of_validity))
00082     except struct.error as se: self._check_types(se)
00083     except TypeError as te: self._check_types(te)
00084 
00085   def deserialize(self, str):
00086     """
00087     unpack serialized message in str into this message instance
00088     :param str: byte array of serialized message, ``str``
00089     """
00090     try:
00091       end = 0
00092       _x = self
00093       start = end
00094       end += 50
00095       (_x.transaction, _x.gravity_magnitude, _x.north_deflection, _x.east_deflection, _x.latitude_of_validity, _x.longitude_of_validity, _x.altitude_of_validity,) = _struct_H6d.unpack(str[start:end])
00096       return self
00097     except struct.error as e:
00098       raise genpy.DeserializationError(e) #most likely buffer underfill
00099 
00100 
00101   def serialize_numpy(self, buff, numpy):
00102     """
00103     serialize message with numpy array types into buffer
00104     :param buff: buffer, ``StringIO``
00105     :param numpy: numpy python module
00106     """
00107     try:
00108       _x = self
00109       buff.write(_struct_H6d.pack(_x.transaction, _x.gravity_magnitude, _x.north_deflection, _x.east_deflection, _x.latitude_of_validity, _x.longitude_of_validity, _x.altitude_of_validity))
00110     except struct.error as se: self._check_types(se)
00111     except TypeError as te: self._check_types(te)
00112 
00113   def deserialize_numpy(self, str, numpy):
00114     """
00115     unpack serialized message in str into this message instance using numpy for array types
00116     :param str: byte array of serialized message, ``str``
00117     :param numpy: numpy python module
00118     """
00119     try:
00120       end = 0
00121       _x = self
00122       start = end
00123       end += 50
00124       (_x.transaction, _x.gravity_magnitude, _x.north_deflection, _x.east_deflection, _x.latitude_of_validity, _x.longitude_of_validity, _x.altitude_of_validity,) = _struct_H6d.unpack(str[start:end])
00125       return self
00126     except struct.error as e:
00127       raise genpy.DeserializationError(e) #most likely buffer underfill
00128 
00129 _struct_I = genpy.struct_I
00130 _struct_H6d = struct.Struct("<H6d")


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