00001 """autogenerated by genpy from ros_rt_wmp_msgs/WMPControlRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class WMPControlRequest(genpy.Message):
00009 _md5sum = "ac59f0105392ab5509d9e9144f394c87"
00010 _type = "ros_rt_wmp_msgs/WMPControlRequest"
00011 _has_header = False
00012 _full_text = """int32 dest
00013 int32 priority
00014 int32 command
00015 int32 param1
00016 int32 param2
00017 string param3
00018
00019 """
00020 __slots__ = ['dest','priority','command','param1','param2','param3']
00021 _slot_types = ['int32','int32','int32','int32','int32','string']
00022
00023 def __init__(self, *args, **kwds):
00024 """
00025 Constructor. Any message fields that are implicitly/explicitly
00026 set to None will be assigned a default value. The recommend
00027 use is keyword arguments as this is more robust to future message
00028 changes. You cannot mix in-order arguments and keyword arguments.
00029
00030 The available fields are:
00031 dest,priority,command,param1,param2,param3
00032
00033 :param args: complete set of field values, in .msg order
00034 :param kwds: use keyword arguments corresponding to message field names
00035 to set specific fields.
00036 """
00037 if args or kwds:
00038 super(WMPControlRequest, self).__init__(*args, **kwds)
00039
00040 if self.dest is None:
00041 self.dest = 0
00042 if self.priority is None:
00043 self.priority = 0
00044 if self.command is None:
00045 self.command = 0
00046 if self.param1 is None:
00047 self.param1 = 0
00048 if self.param2 is None:
00049 self.param2 = 0
00050 if self.param3 is None:
00051 self.param3 = ''
00052 else:
00053 self.dest = 0
00054 self.priority = 0
00055 self.command = 0
00056 self.param1 = 0
00057 self.param2 = 0
00058 self.param3 = ''
00059
00060 def _get_types(self):
00061 """
00062 internal API method
00063 """
00064 return self._slot_types
00065
00066 def serialize(self, buff):
00067 """
00068 serialize message into buffer
00069 :param buff: buffer, ``StringIO``
00070 """
00071 try:
00072 _x = self
00073 buff.write(_struct_5i.pack(_x.dest, _x.priority, _x.command, _x.param1, _x.param2))
00074 _x = self.param3
00075 length = len(_x)
00076 if python3 or type(_x) == unicode:
00077 _x = _x.encode('utf-8')
00078 length = len(_x)
00079 buff.write(struct.pack('<I%ss'%length, length, _x))
00080 except struct.error as se: self._check_types(se)
00081 except TypeError as te: self._check_types(te)
00082
00083 def deserialize(self, str):
00084 """
00085 unpack serialized message in str into this message instance
00086 :param str: byte array of serialized message, ``str``
00087 """
00088 try:
00089 end = 0
00090 _x = self
00091 start = end
00092 end += 20
00093 (_x.dest, _x.priority, _x.command, _x.param1, _x.param2,) = _struct_5i.unpack(str[start:end])
00094 start = end
00095 end += 4
00096 (length,) = _struct_I.unpack(str[start:end])
00097 start = end
00098 end += length
00099 if python3:
00100 self.param3 = str[start:end].decode('utf-8')
00101 else:
00102 self.param3 = str[start:end]
00103 return self
00104 except struct.error as e:
00105 raise genpy.DeserializationError(e)
00106
00107
00108 def serialize_numpy(self, buff, numpy):
00109 """
00110 serialize message with numpy array types into buffer
00111 :param buff: buffer, ``StringIO``
00112 :param numpy: numpy python module
00113 """
00114 try:
00115 _x = self
00116 buff.write(_struct_5i.pack(_x.dest, _x.priority, _x.command, _x.param1, _x.param2))
00117 _x = self.param3
00118 length = len(_x)
00119 if python3 or type(_x) == unicode:
00120 _x = _x.encode('utf-8')
00121 length = len(_x)
00122 buff.write(struct.pack('<I%ss'%length, length, _x))
00123 except struct.error as se: self._check_types(se)
00124 except TypeError as te: self._check_types(te)
00125
00126 def deserialize_numpy(self, str, numpy):
00127 """
00128 unpack serialized message in str into this message instance using numpy for array types
00129 :param str: byte array of serialized message, ``str``
00130 :param numpy: numpy python module
00131 """
00132 try:
00133 end = 0
00134 _x = self
00135 start = end
00136 end += 20
00137 (_x.dest, _x.priority, _x.command, _x.param1, _x.param2,) = _struct_5i.unpack(str[start:end])
00138 start = end
00139 end += 4
00140 (length,) = _struct_I.unpack(str[start:end])
00141 start = end
00142 end += length
00143 if python3:
00144 self.param3 = str[start:end].decode('utf-8')
00145 else:
00146 self.param3 = str[start:end]
00147 return self
00148 except struct.error as e:
00149 raise genpy.DeserializationError(e)
00150
00151 _struct_I = genpy.struct_I
00152 _struct_5i = struct.Struct("<5i")
00153 """autogenerated by genpy from ros_rt_wmp_msgs/WMPControlResponse.msg. Do not edit."""
00154 import sys
00155 python3 = True if sys.hexversion > 0x03000000 else False
00156 import genpy
00157 import struct
00158
00159
00160 class WMPControlResponse(genpy.Message):
00161 _md5sum = "b8d5529764683fc60728d4e69e7da09e"
00162 _type = "ros_rt_wmp_msgs/WMPControlResponse"
00163 _has_header = False
00164 _full_text = """int32 result
00165 string info
00166
00167
00168 """
00169 __slots__ = ['result','info']
00170 _slot_types = ['int32','string']
00171
00172 def __init__(self, *args, **kwds):
00173 """
00174 Constructor. Any message fields that are implicitly/explicitly
00175 set to None will be assigned a default value. The recommend
00176 use is keyword arguments as this is more robust to future message
00177 changes. You cannot mix in-order arguments and keyword arguments.
00178
00179 The available fields are:
00180 result,info
00181
00182 :param args: complete set of field values, in .msg order
00183 :param kwds: use keyword arguments corresponding to message field names
00184 to set specific fields.
00185 """
00186 if args or kwds:
00187 super(WMPControlResponse, self).__init__(*args, **kwds)
00188
00189 if self.result is None:
00190 self.result = 0
00191 if self.info is None:
00192 self.info = ''
00193 else:
00194 self.result = 0
00195 self.info = ''
00196
00197 def _get_types(self):
00198 """
00199 internal API method
00200 """
00201 return self._slot_types
00202
00203 def serialize(self, buff):
00204 """
00205 serialize message into buffer
00206 :param buff: buffer, ``StringIO``
00207 """
00208 try:
00209 buff.write(_struct_i.pack(self.result))
00210 _x = self.info
00211 length = len(_x)
00212 if python3 or type(_x) == unicode:
00213 _x = _x.encode('utf-8')
00214 length = len(_x)
00215 buff.write(struct.pack('<I%ss'%length, length, _x))
00216 except struct.error as se: self._check_types(se)
00217 except TypeError as te: self._check_types(te)
00218
00219 def deserialize(self, str):
00220 """
00221 unpack serialized message in str into this message instance
00222 :param str: byte array of serialized message, ``str``
00223 """
00224 try:
00225 end = 0
00226 start = end
00227 end += 4
00228 (self.result,) = _struct_i.unpack(str[start:end])
00229 start = end
00230 end += 4
00231 (length,) = _struct_I.unpack(str[start:end])
00232 start = end
00233 end += length
00234 if python3:
00235 self.info = str[start:end].decode('utf-8')
00236 else:
00237 self.info = str[start:end]
00238 return self
00239 except struct.error as e:
00240 raise genpy.DeserializationError(e)
00241
00242
00243 def serialize_numpy(self, buff, numpy):
00244 """
00245 serialize message with numpy array types into buffer
00246 :param buff: buffer, ``StringIO``
00247 :param numpy: numpy python module
00248 """
00249 try:
00250 buff.write(_struct_i.pack(self.result))
00251 _x = self.info
00252 length = len(_x)
00253 if python3 or type(_x) == unicode:
00254 _x = _x.encode('utf-8')
00255 length = len(_x)
00256 buff.write(struct.pack('<I%ss'%length, length, _x))
00257 except struct.error as se: self._check_types(se)
00258 except TypeError as te: self._check_types(te)
00259
00260 def deserialize_numpy(self, str, numpy):
00261 """
00262 unpack serialized message in str into this message instance using numpy for array types
00263 :param str: byte array of serialized message, ``str``
00264 :param numpy: numpy python module
00265 """
00266 try:
00267 end = 0
00268 start = end
00269 end += 4
00270 (self.result,) = _struct_i.unpack(str[start:end])
00271 start = end
00272 end += 4
00273 (length,) = _struct_I.unpack(str[start:end])
00274 start = end
00275 end += length
00276 if python3:
00277 self.info = str[start:end].decode('utf-8')
00278 else:
00279 self.info = str[start:end]
00280 return self
00281 except struct.error as e:
00282 raise genpy.DeserializationError(e)
00283
00284 _struct_I = genpy.struct_I
00285 _struct_i = struct.Struct("<i")
00286 class WMPControl(object):
00287 _type = 'ros_rt_wmp_msgs/WMPControl'
00288 _md5sum = '057b7f22e78aff9caf58f4ed30066271'
00289 _request_class = WMPControlRequest
00290 _response_class = WMPControlResponse