$search
00001 """autogenerated by genmsg_py from SetMultiWaveformRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import ethercat_trigger_controllers.msg 00006 00007 class SetMultiWaveformRequest(roslib.message.Message): 00008 _md5sum = "bfedad8205348a9bcc90e6ae4b778d86" 00009 _type = "ethercat_trigger_controllers/SetMultiWaveformRequest" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """MultiWaveform waveform 00012 00013 ================================================================================ 00014 MSG: ethercat_trigger_controllers/MultiWaveform 00015 # Transitions will occur at k * period + zero_offset + transitions[j].time, where j and 00016 # k are integers. 00017 00018 float64 period # Period of the waveform in seconds. 00019 float64 zero_offset # Time corresponding to a time of 0 in times[] in seconds 00020 MultiWaveformTransition[] transitions # Transitions in the waveform. Transition times should be in increasing order, and be between 0 (inclusive) and period (exclusive) 00021 00022 ================================================================================ 00023 MSG: ethercat_trigger_controllers/MultiWaveformTransition 00024 # Used to specify a transition in the SetMultiWaveform service. 00025 00026 float64 time # Transition time after start of period. 00027 uint32 value # Value of the digital output after the transition time. 00028 string topic # Topic to publish the transition timestamp to, or empty string if the transition should not be published. 00029 00030 """ 00031 __slots__ = ['waveform'] 00032 _slot_types = ['ethercat_trigger_controllers/MultiWaveform'] 00033 00034 def __init__(self, *args, **kwds): 00035 """ 00036 Constructor. Any message fields that are implicitly/explicitly 00037 set to None will be assigned a default value. The recommend 00038 use is keyword arguments as this is more robust to future message 00039 changes. You cannot mix in-order arguments and keyword arguments. 00040 00041 The available fields are: 00042 waveform 00043 00044 @param args: complete set of field values, in .msg order 00045 @param kwds: use keyword arguments corresponding to message field names 00046 to set specific fields. 00047 """ 00048 if args or kwds: 00049 super(SetMultiWaveformRequest, self).__init__(*args, **kwds) 00050 #message fields cannot be None, assign default values for those that are 00051 if self.waveform is None: 00052 self.waveform = ethercat_trigger_controllers.msg.MultiWaveform() 00053 else: 00054 self.waveform = ethercat_trigger_controllers.msg.MultiWaveform() 00055 00056 def _get_types(self): 00057 """ 00058 internal API method 00059 """ 00060 return self._slot_types 00061 00062 def serialize(self, buff): 00063 """ 00064 serialize message into buffer 00065 @param buff: buffer 00066 @type buff: StringIO 00067 """ 00068 try: 00069 _x = self 00070 buff.write(_struct_2d.pack(_x.waveform.period, _x.waveform.zero_offset)) 00071 length = len(self.waveform.transitions) 00072 buff.write(_struct_I.pack(length)) 00073 for val1 in self.waveform.transitions: 00074 _x = val1 00075 buff.write(_struct_dI.pack(_x.time, _x.value)) 00076 _x = val1.topic 00077 length = len(_x) 00078 buff.write(struct.pack('<I%ss'%length, length, _x)) 00079 except struct.error as se: self._check_types(se) 00080 except TypeError as te: self._check_types(te) 00081 00082 def deserialize(self, str): 00083 """ 00084 unpack serialized message in str into this message instance 00085 @param str: byte array of serialized message 00086 @type str: str 00087 """ 00088 try: 00089 if self.waveform is None: 00090 self.waveform = ethercat_trigger_controllers.msg.MultiWaveform() 00091 end = 0 00092 _x = self 00093 start = end 00094 end += 16 00095 (_x.waveform.period, _x.waveform.zero_offset,) = _struct_2d.unpack(str[start:end]) 00096 start = end 00097 end += 4 00098 (length,) = _struct_I.unpack(str[start:end]) 00099 self.waveform.transitions = [] 00100 for i in range(0, length): 00101 val1 = ethercat_trigger_controllers.msg.MultiWaveformTransition() 00102 _x = val1 00103 start = end 00104 end += 12 00105 (_x.time, _x.value,) = _struct_dI.unpack(str[start:end]) 00106 start = end 00107 end += 4 00108 (length,) = _struct_I.unpack(str[start:end]) 00109 start = end 00110 end += length 00111 val1.topic = str[start:end] 00112 self.waveform.transitions.append(val1) 00113 return self 00114 except struct.error as e: 00115 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00116 00117 00118 def serialize_numpy(self, buff, numpy): 00119 """ 00120 serialize message with numpy array types into buffer 00121 @param buff: buffer 00122 @type buff: StringIO 00123 @param numpy: numpy python module 00124 @type numpy module 00125 """ 00126 try: 00127 _x = self 00128 buff.write(_struct_2d.pack(_x.waveform.period, _x.waveform.zero_offset)) 00129 length = len(self.waveform.transitions) 00130 buff.write(_struct_I.pack(length)) 00131 for val1 in self.waveform.transitions: 00132 _x = val1 00133 buff.write(_struct_dI.pack(_x.time, _x.value)) 00134 _x = val1.topic 00135 length = len(_x) 00136 buff.write(struct.pack('<I%ss'%length, length, _x)) 00137 except struct.error as se: self._check_types(se) 00138 except TypeError as te: self._check_types(te) 00139 00140 def deserialize_numpy(self, str, numpy): 00141 """ 00142 unpack serialized message in str into this message instance using numpy for array types 00143 @param str: byte array of serialized message 00144 @type str: str 00145 @param numpy: numpy python module 00146 @type numpy: module 00147 """ 00148 try: 00149 if self.waveform is None: 00150 self.waveform = ethercat_trigger_controllers.msg.MultiWaveform() 00151 end = 0 00152 _x = self 00153 start = end 00154 end += 16 00155 (_x.waveform.period, _x.waveform.zero_offset,) = _struct_2d.unpack(str[start:end]) 00156 start = end 00157 end += 4 00158 (length,) = _struct_I.unpack(str[start:end]) 00159 self.waveform.transitions = [] 00160 for i in range(0, length): 00161 val1 = ethercat_trigger_controllers.msg.MultiWaveformTransition() 00162 _x = val1 00163 start = end 00164 end += 12 00165 (_x.time, _x.value,) = _struct_dI.unpack(str[start:end]) 00166 start = end 00167 end += 4 00168 (length,) = _struct_I.unpack(str[start:end]) 00169 start = end 00170 end += length 00171 val1.topic = str[start:end] 00172 self.waveform.transitions.append(val1) 00173 return self 00174 except struct.error as e: 00175 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00176 00177 _struct_I = roslib.message.struct_I 00178 _struct_2d = struct.Struct("<2d") 00179 _struct_dI = struct.Struct("<dI") 00180 """autogenerated by genmsg_py from SetMultiWaveformResponse.msg. Do not edit.""" 00181 import roslib.message 00182 import struct 00183 00184 00185 class SetMultiWaveformResponse(roslib.message.Message): 00186 _md5sum = "2ec6f3eff0161f4257b808b12bc830c2" 00187 _type = "ethercat_trigger_controllers/SetMultiWaveformResponse" 00188 _has_header = False #flag to mark the presence of a Header object 00189 _full_text = """bool success 00190 string status_message 00191 00192 00193 """ 00194 __slots__ = ['success','status_message'] 00195 _slot_types = ['bool','string'] 00196 00197 def __init__(self, *args, **kwds): 00198 """ 00199 Constructor. Any message fields that are implicitly/explicitly 00200 set to None will be assigned a default value. The recommend 00201 use is keyword arguments as this is more robust to future message 00202 changes. You cannot mix in-order arguments and keyword arguments. 00203 00204 The available fields are: 00205 success,status_message 00206 00207 @param args: complete set of field values, in .msg order 00208 @param kwds: use keyword arguments corresponding to message field names 00209 to set specific fields. 00210 """ 00211 if args or kwds: 00212 super(SetMultiWaveformResponse, self).__init__(*args, **kwds) 00213 #message fields cannot be None, assign default values for those that are 00214 if self.success is None: 00215 self.success = False 00216 if self.status_message is None: 00217 self.status_message = '' 00218 else: 00219 self.success = False 00220 self.status_message = '' 00221 00222 def _get_types(self): 00223 """ 00224 internal API method 00225 """ 00226 return self._slot_types 00227 00228 def serialize(self, buff): 00229 """ 00230 serialize message into buffer 00231 @param buff: buffer 00232 @type buff: StringIO 00233 """ 00234 try: 00235 buff.write(_struct_B.pack(self.success)) 00236 _x = self.status_message 00237 length = len(_x) 00238 buff.write(struct.pack('<I%ss'%length, length, _x)) 00239 except struct.error as se: self._check_types(se) 00240 except TypeError as te: self._check_types(te) 00241 00242 def deserialize(self, str): 00243 """ 00244 unpack serialized message in str into this message instance 00245 @param str: byte array of serialized message 00246 @type str: str 00247 """ 00248 try: 00249 end = 0 00250 start = end 00251 end += 1 00252 (self.success,) = _struct_B.unpack(str[start:end]) 00253 self.success = bool(self.success) 00254 start = end 00255 end += 4 00256 (length,) = _struct_I.unpack(str[start:end]) 00257 start = end 00258 end += length 00259 self.status_message = str[start:end] 00260 return self 00261 except struct.error as e: 00262 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00263 00264 00265 def serialize_numpy(self, buff, numpy): 00266 """ 00267 serialize message with numpy array types into buffer 00268 @param buff: buffer 00269 @type buff: StringIO 00270 @param numpy: numpy python module 00271 @type numpy module 00272 """ 00273 try: 00274 buff.write(_struct_B.pack(self.success)) 00275 _x = self.status_message 00276 length = len(_x) 00277 buff.write(struct.pack('<I%ss'%length, length, _x)) 00278 except struct.error as se: self._check_types(se) 00279 except TypeError as te: self._check_types(te) 00280 00281 def deserialize_numpy(self, str, numpy): 00282 """ 00283 unpack serialized message in str into this message instance using numpy for array types 00284 @param str: byte array of serialized message 00285 @type str: str 00286 @param numpy: numpy python module 00287 @type numpy: module 00288 """ 00289 try: 00290 end = 0 00291 start = end 00292 end += 1 00293 (self.success,) = _struct_B.unpack(str[start:end]) 00294 self.success = bool(self.success) 00295 start = end 00296 end += 4 00297 (length,) = _struct_I.unpack(str[start:end]) 00298 start = end 00299 end += length 00300 self.status_message = str[start:end] 00301 return self 00302 except struct.error as e: 00303 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00304 00305 _struct_I = roslib.message.struct_I 00306 _struct_B = struct.Struct("<B") 00307 class SetMultiWaveform(roslib.message.ServiceDefinition): 00308 _type = 'ethercat_trigger_controllers/SetMultiWaveform' 00309 _md5sum = 'cbb7e900a71a9a437da9999c8d39fff4' 00310 _request_class = SetMultiWaveformRequest 00311 _response_class = SetMultiWaveformResponse