_RawPPS.py
Go to the documentation of this file.
00001 """autogenerated by genpy from applanix_msgs/RawPPS.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 RawPPS(genpy.Message):
00010   _md5sum = "e33ff36fd1530481fcda257606892512"
00011   _type = "applanix_msgs/RawPPS"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """# Group 10003
00014 TimeDistance td
00015 uint32 pps_count
00016 
00017 ================================================================================
00018 MSG: applanix_msgs/TimeDistance
00019 float64 time1
00020 float64 time2
00021 float64 distance
00022 uint8 time_types
00023 uint8 distance_type
00024 
00025 """
00026   __slots__ = ['td','pps_count']
00027   _slot_types = ['applanix_msgs/TimeDistance','uint32']
00028 
00029   def __init__(self, *args, **kwds):
00030     """
00031     Constructor. Any message fields that are implicitly/explicitly
00032     set to None will be assigned a default value. The recommend
00033     use is keyword arguments as this is more robust to future message
00034     changes.  You cannot mix in-order arguments and keyword arguments.
00035 
00036     The available fields are:
00037        td,pps_count
00038 
00039     :param args: complete set of field values, in .msg order
00040     :param kwds: use keyword arguments corresponding to message field names
00041     to set specific fields.
00042     """
00043     if args or kwds:
00044       super(RawPPS, self).__init__(*args, **kwds)
00045       #message fields cannot be None, assign default values for those that are
00046       if self.td is None:
00047         self.td = applanix_msgs.msg.TimeDistance()
00048       if self.pps_count is None:
00049         self.pps_count = 0
00050     else:
00051       self.td = applanix_msgs.msg.TimeDistance()
00052       self.pps_count = 0
00053 
00054   def _get_types(self):
00055     """
00056     internal API method
00057     """
00058     return self._slot_types
00059 
00060   def serialize(self, buff):
00061     """
00062     serialize message into buffer
00063     :param buff: buffer, ``StringIO``
00064     """
00065     try:
00066       _x = self
00067       buff.write(_struct_3d2BI.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.pps_count))
00068     except struct.error as se: self._check_types(se)
00069     except TypeError as te: self._check_types(te)
00070 
00071   def deserialize(self, str):
00072     """
00073     unpack serialized message in str into this message instance
00074     :param str: byte array of serialized message, ``str``
00075     """
00076     try:
00077       if self.td is None:
00078         self.td = applanix_msgs.msg.TimeDistance()
00079       end = 0
00080       _x = self
00081       start = end
00082       end += 30
00083       (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.pps_count,) = _struct_3d2BI.unpack(str[start:end])
00084       return self
00085     except struct.error as e:
00086       raise genpy.DeserializationError(e) #most likely buffer underfill
00087 
00088 
00089   def serialize_numpy(self, buff, numpy):
00090     """
00091     serialize message with numpy array types into buffer
00092     :param buff: buffer, ``StringIO``
00093     :param numpy: numpy python module
00094     """
00095     try:
00096       _x = self
00097       buff.write(_struct_3d2BI.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.pps_count))
00098     except struct.error as se: self._check_types(se)
00099     except TypeError as te: self._check_types(te)
00100 
00101   def deserialize_numpy(self, str, numpy):
00102     """
00103     unpack serialized message in str into this message instance using numpy for array types
00104     :param str: byte array of serialized message, ``str``
00105     :param numpy: numpy python module
00106     """
00107     try:
00108       if self.td is None:
00109         self.td = applanix_msgs.msg.TimeDistance()
00110       end = 0
00111       _x = self
00112       start = end
00113       end += 30
00114       (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.pps_count,) = _struct_3d2BI.unpack(str[start:end])
00115       return self
00116     except struct.error as e:
00117       raise genpy.DeserializationError(e) #most likely buffer underfill
00118 
00119 _struct_I = genpy.struct_I
00120 _struct_3d2BI = struct.Struct("<3d2BI")


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