$search
00001 """autogenerated by genmsg_py from TimeSyncControl.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class TimeSyncControl(roslib.message.Message): 00007 _md5sum = "1e6b12cc55fda44e001851a5e5433aad" 00008 _type = "applanix_msgs/TimeSyncControl" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """uint16 transaction 00011 00012 float64 user_pps_time 00013 float64 user_time_conversion_factor 00014 00015 """ 00016 __slots__ = ['transaction','user_pps_time','user_time_conversion_factor'] 00017 _slot_types = ['uint16','float64','float64'] 00018 00019 def __init__(self, *args, **kwds): 00020 """ 00021 Constructor. Any message fields that are implicitly/explicitly 00022 set to None will be assigned a default value. The recommend 00023 use is keyword arguments as this is more robust to future message 00024 changes. You cannot mix in-order arguments and keyword arguments. 00025 00026 The available fields are: 00027 transaction,user_pps_time,user_time_conversion_factor 00028 00029 @param args: complete set of field values, in .msg order 00030 @param kwds: use keyword arguments corresponding to message field names 00031 to set specific fields. 00032 """ 00033 if args or kwds: 00034 super(TimeSyncControl, self).__init__(*args, **kwds) 00035 #message fields cannot be None, assign default values for those that are 00036 if self.transaction is None: 00037 self.transaction = 0 00038 if self.user_pps_time is None: 00039 self.user_pps_time = 0. 00040 if self.user_time_conversion_factor is None: 00041 self.user_time_conversion_factor = 0. 00042 else: 00043 self.transaction = 0 00044 self.user_pps_time = 0. 00045 self.user_time_conversion_factor = 0. 00046 00047 def _get_types(self): 00048 """ 00049 internal API method 00050 """ 00051 return self._slot_types 00052 00053 def serialize(self, buff): 00054 """ 00055 serialize message into buffer 00056 @param buff: buffer 00057 @type buff: StringIO 00058 """ 00059 try: 00060 _x = self 00061 buff.write(_struct_H2d.pack(_x.transaction, _x.user_pps_time, _x.user_time_conversion_factor)) 00062 except struct.error as se: self._check_types(se) 00063 except TypeError as te: self._check_types(te) 00064 00065 def deserialize(self, str): 00066 """ 00067 unpack serialized message in str into this message instance 00068 @param str: byte array of serialized message 00069 @type str: str 00070 """ 00071 try: 00072 end = 0 00073 _x = self 00074 start = end 00075 end += 18 00076 (_x.transaction, _x.user_pps_time, _x.user_time_conversion_factor,) = _struct_H2d.unpack(str[start:end]) 00077 return self 00078 except struct.error as e: 00079 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00080 00081 00082 def serialize_numpy(self, buff, numpy): 00083 """ 00084 serialize message with numpy array types into buffer 00085 @param buff: buffer 00086 @type buff: StringIO 00087 @param numpy: numpy python module 00088 @type numpy module 00089 """ 00090 try: 00091 _x = self 00092 buff.write(_struct_H2d.pack(_x.transaction, _x.user_pps_time, _x.user_time_conversion_factor)) 00093 except struct.error as se: self._check_types(se) 00094 except TypeError as te: self._check_types(te) 00095 00096 def deserialize_numpy(self, str, numpy): 00097 """ 00098 unpack serialized message in str into this message instance using numpy for array types 00099 @param str: byte array of serialized message 00100 @type str: str 00101 @param numpy: numpy python module 00102 @type numpy: module 00103 """ 00104 try: 00105 end = 0 00106 _x = self 00107 start = end 00108 end += 18 00109 (_x.transaction, _x.user_pps_time, _x.user_time_conversion_factor,) = _struct_H2d.unpack(str[start:end]) 00110 return self 00111 except struct.error as e: 00112 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00113 00114 _struct_I = roslib.message.struct_I 00115 _struct_H2d = struct.Struct("<H2d")