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