_IntegrationDiagnosticsControl.py
Go to the documentation of this file.
00001 """autogenerated by genpy from applanix_msgs/IntegrationDiagnosticsControl.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 IntegrationDiagnosticsControl(genpy.Message):
00009   _md5sum = "c9348736c3ef1fae7afe188eacd6d167"
00010   _type = "applanix_msgs/IntegrationDiagnosticsControl"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# Msg 92
00013 uint16 transaction
00014 
00015 uint8 OUTPUT_IMU_FRAME=0
00016 uint8 OUTPUT_USER_PARAM=1
00017 uint8 output_data
00018 
00019 float32 user_roll
00020 float32 user_pitch
00021 float32 user_heading
00022 uint8[4] reserved
00023 
00024 """
00025   # Pseudo-constants
00026   OUTPUT_IMU_FRAME = 0
00027   OUTPUT_USER_PARAM = 1
00028 
00029   __slots__ = ['transaction','output_data','user_roll','user_pitch','user_heading','reserved']
00030   _slot_types = ['uint16','uint8','float32','float32','float32','uint8[4]']
00031 
00032   def __init__(self, *args, **kwds):
00033     """
00034     Constructor. Any message fields that are implicitly/explicitly
00035     set to None will be assigned a default value. The recommend
00036     use is keyword arguments as this is more robust to future message
00037     changes.  You cannot mix in-order arguments and keyword arguments.
00038 
00039     The available fields are:
00040        transaction,output_data,user_roll,user_pitch,user_heading,reserved
00041 
00042     :param args: complete set of field values, in .msg order
00043     :param kwds: use keyword arguments corresponding to message field names
00044     to set specific fields.
00045     """
00046     if args or kwds:
00047       super(IntegrationDiagnosticsControl, self).__init__(*args, **kwds)
00048       #message fields cannot be None, assign default values for those that are
00049       if self.transaction is None:
00050         self.transaction = 0
00051       if self.output_data is None:
00052         self.output_data = 0
00053       if self.user_roll is None:
00054         self.user_roll = 0.
00055       if self.user_pitch is None:
00056         self.user_pitch = 0.
00057       if self.user_heading is None:
00058         self.user_heading = 0.
00059       if self.reserved is None:
00060         self.reserved = chr(0)*4
00061     else:
00062       self.transaction = 0
00063       self.output_data = 0
00064       self.user_roll = 0.
00065       self.user_pitch = 0.
00066       self.user_heading = 0.
00067       self.reserved = chr(0)*4
00068 
00069   def _get_types(self):
00070     """
00071     internal API method
00072     """
00073     return self._slot_types
00074 
00075   def serialize(self, buff):
00076     """
00077     serialize message into buffer
00078     :param buff: buffer, ``StringIO``
00079     """
00080     try:
00081       _x = self
00082       buff.write(_struct_HB3f.pack(_x.transaction, _x.output_data, _x.user_roll, _x.user_pitch, _x.user_heading))
00083       _x = self.reserved
00084       # - if encoded as a list instead, serialize as bytes instead of string
00085       if type(_x) in [list, tuple]:
00086         buff.write(_struct_4B.pack(*_x))
00087       else:
00088         buff.write(_struct_4s.pack(_x))
00089     except struct.error as se: self._check_types(se)
00090     except TypeError as te: self._check_types(te)
00091 
00092   def deserialize(self, str):
00093     """
00094     unpack serialized message in str into this message instance
00095     :param str: byte array of serialized message, ``str``
00096     """
00097     try:
00098       end = 0
00099       _x = self
00100       start = end
00101       end += 15
00102       (_x.transaction, _x.output_data, _x.user_roll, _x.user_pitch, _x.user_heading,) = _struct_HB3f.unpack(str[start:end])
00103       start = end
00104       end += 4
00105       self.reserved = str[start:end]
00106       return self
00107     except struct.error as e:
00108       raise genpy.DeserializationError(e) #most likely buffer underfill
00109 
00110 
00111   def serialize_numpy(self, buff, numpy):
00112     """
00113     serialize message with numpy array types into buffer
00114     :param buff: buffer, ``StringIO``
00115     :param numpy: numpy python module
00116     """
00117     try:
00118       _x = self
00119       buff.write(_struct_HB3f.pack(_x.transaction, _x.output_data, _x.user_roll, _x.user_pitch, _x.user_heading))
00120       _x = self.reserved
00121       # - if encoded as a list instead, serialize as bytes instead of string
00122       if type(_x) in [list, tuple]:
00123         buff.write(_struct_4B.pack(*_x))
00124       else:
00125         buff.write(_struct_4s.pack(_x))
00126     except struct.error as se: self._check_types(se)
00127     except TypeError as te: self._check_types(te)
00128 
00129   def deserialize_numpy(self, str, numpy):
00130     """
00131     unpack serialized message in str into this message instance using numpy for array types
00132     :param str: byte array of serialized message, ``str``
00133     :param numpy: numpy python module
00134     """
00135     try:
00136       end = 0
00137       _x = self
00138       start = end
00139       end += 15
00140       (_x.transaction, _x.output_data, _x.user_roll, _x.user_pitch, _x.user_heading,) = _struct_HB3f.unpack(str[start:end])
00141       start = end
00142       end += 4
00143       self.reserved = str[start:end]
00144       return self
00145     except struct.error as e:
00146       raise genpy.DeserializationError(e) #most likely buffer underfill
00147 
00148 _struct_I = genpy.struct_I
00149 _struct_4B = struct.Struct("<4B")
00150 _struct_HB3f = struct.Struct("<HB3f")
00151 _struct_4s = struct.Struct("<4s")


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