$search
00001 """autogenerated by genmsg_py from MultiWaveformTransition.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class MultiWaveformTransition(roslib.message.Message): 00007 _md5sum = "bdd47e5d1c3d77473af2df9833a0608a" 00008 _type = "ethercat_trigger_controllers/MultiWaveformTransition" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# Used to specify a transition in the SetMultiWaveform service. 00011 00012 float64 time # Transition time after start of period. 00013 uint32 value # Value of the digital output after the transition time. 00014 string topic # Topic to publish the transition timestamp to, or empty string if the transition should not be published. 00015 00016 """ 00017 __slots__ = ['time','value','topic'] 00018 _slot_types = ['float64','uint32','string'] 00019 00020 def __init__(self, *args, **kwds): 00021 """ 00022 Constructor. Any message fields that are implicitly/explicitly 00023 set to None will be assigned a default value. The recommend 00024 use is keyword arguments as this is more robust to future message 00025 changes. You cannot mix in-order arguments and keyword arguments. 00026 00027 The available fields are: 00028 time,value,topic 00029 00030 @param args: complete set of field values, in .msg order 00031 @param kwds: use keyword arguments corresponding to message field names 00032 to set specific fields. 00033 """ 00034 if args or kwds: 00035 super(MultiWaveformTransition, self).__init__(*args, **kwds) 00036 #message fields cannot be None, assign default values for those that are 00037 if self.time is None: 00038 self.time = 0. 00039 if self.value is None: 00040 self.value = 0 00041 if self.topic is None: 00042 self.topic = '' 00043 else: 00044 self.time = 0. 00045 self.value = 0 00046 self.topic = '' 00047 00048 def _get_types(self): 00049 """ 00050 internal API method 00051 """ 00052 return self._slot_types 00053 00054 def serialize(self, buff): 00055 """ 00056 serialize message into buffer 00057 @param buff: buffer 00058 @type buff: StringIO 00059 """ 00060 try: 00061 _x = self 00062 buff.write(_struct_dI.pack(_x.time, _x.value)) 00063 _x = self.topic 00064 length = len(_x) 00065 buff.write(struct.pack('<I%ss'%length, length, _x)) 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 end = 0 00077 _x = self 00078 start = end 00079 end += 12 00080 (_x.time, _x.value,) = _struct_dI.unpack(str[start:end]) 00081 start = end 00082 end += 4 00083 (length,) = _struct_I.unpack(str[start:end]) 00084 start = end 00085 end += length 00086 self.topic = str[start:end] 00087 return self 00088 except struct.error as e: 00089 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00090 00091 00092 def serialize_numpy(self, buff, numpy): 00093 """ 00094 serialize message with numpy array types into buffer 00095 @param buff: buffer 00096 @type buff: StringIO 00097 @param numpy: numpy python module 00098 @type numpy module 00099 """ 00100 try: 00101 _x = self 00102 buff.write(_struct_dI.pack(_x.time, _x.value)) 00103 _x = self.topic 00104 length = len(_x) 00105 buff.write(struct.pack('<I%ss'%length, length, _x)) 00106 except struct.error as se: self._check_types(se) 00107 except TypeError as te: self._check_types(te) 00108 00109 def deserialize_numpy(self, str, numpy): 00110 """ 00111 unpack serialized message in str into this message instance using numpy for array types 00112 @param str: byte array of serialized message 00113 @type str: str 00114 @param numpy: numpy python module 00115 @type numpy: module 00116 """ 00117 try: 00118 end = 0 00119 _x = self 00120 start = end 00121 end += 12 00122 (_x.time, _x.value,) = _struct_dI.unpack(str[start:end]) 00123 start = end 00124 end += 4 00125 (length,) = _struct_I.unpack(str[start:end]) 00126 start = end 00127 end += length 00128 self.topic = str[start:end] 00129 return self 00130 except struct.error as e: 00131 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00132 00133 _struct_I = roslib.message.struct_I 00134 _struct_dI = struct.Struct("<dI")