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