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