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