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