_PPSStatus.py
Go to the documentation of this file.
00001 """autogenerated by genpy from applanix_msgs/PPSStatus.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 PPSStatus(genpy.Message):
00010   _md5sum = "87ec4e702614d1641123cb671569d144"
00011   _type = "applanix_msgs/PPSStatus"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """TimeDistance td
00014 uint32 pps_count
00015 
00016 uint8 STATUS_NONE=0
00017 uint8 STATUS_SYNCING=1
00018 uint8 STATUS_SYNCED=2
00019 uint8 STATUS_OLD_OFFSET=3
00020 uint8 status
00021 
00022 ================================================================================
00023 MSG: applanix_msgs/TimeDistance
00024 float64 time1
00025 float64 time2
00026 float64 distance
00027 uint8 time_types
00028 uint8 distance_type
00029 
00030 """
00031   # Pseudo-constants
00032   STATUS_NONE = 0
00033   STATUS_SYNCING = 1
00034   STATUS_SYNCED = 2
00035   STATUS_OLD_OFFSET = 3
00036 
00037   __slots__ = ['td','pps_count','status']
00038   _slot_types = ['applanix_msgs/TimeDistance','uint32','uint8']
00039 
00040   def __init__(self, *args, **kwds):
00041     """
00042     Constructor. Any message fields that are implicitly/explicitly
00043     set to None will be assigned a default value. The recommend
00044     use is keyword arguments as this is more robust to future message
00045     changes.  You cannot mix in-order arguments and keyword arguments.
00046 
00047     The available fields are:
00048        td,pps_count,status
00049 
00050     :param args: complete set of field values, in .msg order
00051     :param kwds: use keyword arguments corresponding to message field names
00052     to set specific fields.
00053     """
00054     if args or kwds:
00055       super(PPSStatus, self).__init__(*args, **kwds)
00056       #message fields cannot be None, assign default values for those that are
00057       if self.td is None:
00058         self.td = applanix_msgs.msg.TimeDistance()
00059       if self.pps_count is None:
00060         self.pps_count = 0
00061       if self.status is None:
00062         self.status = 0
00063     else:
00064       self.td = applanix_msgs.msg.TimeDistance()
00065       self.pps_count = 0
00066       self.status = 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_3d2BIB.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.pps_count, _x.status))
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       if self.td is None:
00092         self.td = applanix_msgs.msg.TimeDistance()
00093       end = 0
00094       _x = self
00095       start = end
00096       end += 31
00097       (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.pps_count, _x.status,) = _struct_3d2BIB.unpack(str[start:end])
00098       return self
00099     except struct.error as e:
00100       raise genpy.DeserializationError(e) #most likely buffer underfill
00101 
00102 
00103   def serialize_numpy(self, buff, numpy):
00104     """
00105     serialize message with numpy array types into buffer
00106     :param buff: buffer, ``StringIO``
00107     :param numpy: numpy python module
00108     """
00109     try:
00110       _x = self
00111       buff.write(_struct_3d2BIB.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.pps_count, _x.status))
00112     except struct.error as se: self._check_types(se)
00113     except TypeError as te: self._check_types(te)
00114 
00115   def deserialize_numpy(self, str, numpy):
00116     """
00117     unpack serialized message in str into this message instance using numpy for array types
00118     :param str: byte array of serialized message, ``str``
00119     :param numpy: numpy python module
00120     """
00121     try:
00122       if self.td is None:
00123         self.td = applanix_msgs.msg.TimeDistance()
00124       end = 0
00125       _x = self
00126       start = end
00127       end += 31
00128       (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.pps_count, _x.status,) = _struct_3d2BIB.unpack(str[start:end])
00129       return self
00130     except struct.error as e:
00131       raise genpy.DeserializationError(e) #most likely buffer underfill
00132 
00133 _struct_I = genpy.struct_I
00134 _struct_3d2BIB = struct.Struct("<3d2BIB")


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