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