$search
00001 """autogenerated by genmsg_py from PPSStatus.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import applanix_msgs.msg 00006 00007 class PPSStatus(roslib.message.Message): 00008 _md5sum = "87ec4e702614d1641123cb671569d144" 00009 _type = "applanix_msgs/PPSStatus" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """TimeDistance td 00012 uint32 pps_count 00013 00014 uint8 STATUS_NONE=0 00015 uint8 STATUS_SYNCING=1 00016 uint8 STATUS_SYNCED=2 00017 uint8 STATUS_OLD_OFFSET=3 00018 uint8 status 00019 00020 ================================================================================ 00021 MSG: applanix_msgs/TimeDistance 00022 float64 time1 00023 float64 time2 00024 float64 distance 00025 uint8 time_types 00026 uint8 distance_type 00027 00028 """ 00029 # Pseudo-constants 00030 STATUS_NONE = 0 00031 STATUS_SYNCING = 1 00032 STATUS_SYNCED = 2 00033 STATUS_OLD_OFFSET = 3 00034 00035 __slots__ = ['td','pps_count','status'] 00036 _slot_types = ['applanix_msgs/TimeDistance','uint32','uint8'] 00037 00038 def __init__(self, *args, **kwds): 00039 """ 00040 Constructor. Any message fields that are implicitly/explicitly 00041 set to None will be assigned a default value. The recommend 00042 use is keyword arguments as this is more robust to future message 00043 changes. You cannot mix in-order arguments and keyword arguments. 00044 00045 The available fields are: 00046 td,pps_count,status 00047 00048 @param args: complete set of field values, in .msg order 00049 @param kwds: use keyword arguments corresponding to message field names 00050 to set specific fields. 00051 """ 00052 if args or kwds: 00053 super(PPSStatus, self).__init__(*args, **kwds) 00054 #message fields cannot be None, assign default values for those that are 00055 if self.td is None: 00056 self.td = applanix_msgs.msg.TimeDistance() 00057 if self.pps_count is None: 00058 self.pps_count = 0 00059 if self.status is None: 00060 self.status = 0 00061 else: 00062 self.td = applanix_msgs.msg.TimeDistance() 00063 self.pps_count = 0 00064 self.status = 0 00065 00066 def _get_types(self): 00067 """ 00068 internal API method 00069 """ 00070 return self._slot_types 00071 00072 def serialize(self, buff): 00073 """ 00074 serialize message into buffer 00075 @param buff: buffer 00076 @type buff: StringIO 00077 """ 00078 try: 00079 _x = self 00080 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)) 00081 except struct.error as se: self._check_types(se) 00082 except TypeError as te: self._check_types(te) 00083 00084 def deserialize(self, str): 00085 """ 00086 unpack serialized message in str into this message instance 00087 @param str: byte array of serialized message 00088 @type str: 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 roslib.message.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 00107 @type buff: StringIO 00108 @param numpy: numpy python module 00109 @type numpy module 00110 """ 00111 try: 00112 _x = self 00113 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)) 00114 except struct.error as se: self._check_types(se) 00115 except TypeError as te: self._check_types(te) 00116 00117 def deserialize_numpy(self, str, numpy): 00118 """ 00119 unpack serialized message in str into this message instance using numpy for array types 00120 @param str: byte array of serialized message 00121 @type str: str 00122 @param numpy: numpy python module 00123 @type numpy: module 00124 """ 00125 try: 00126 if self.td is None: 00127 self.td = applanix_msgs.msg.TimeDistance() 00128 end = 0 00129 _x = self 00130 start = end 00131 end += 31 00132 (_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]) 00133 return self 00134 except struct.error as e: 00135 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00136 00137 _struct_I = roslib.message.struct_I 00138 _struct_3d2BIB = struct.Struct("<3d2BIB")