$search
00001 """autogenerated by genmsg_py from LightModeRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import std_msgs.msg 00006 00007 class LightModeRequest(roslib.message.Message): 00008 _md5sum = "368658e7feae72d08c2715eeb4c7b2d9" 00009 _type = "cob_lightmode/LightModeRequest" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """int32 mode 00012 std_msgs/ColorRGBA color 00013 00014 ================================================================================ 00015 MSG: std_msgs/ColorRGBA 00016 float32 r 00017 float32 g 00018 float32 b 00019 float32 a 00020 00021 """ 00022 __slots__ = ['mode','color'] 00023 _slot_types = ['int32','std_msgs/ColorRGBA'] 00024 00025 def __init__(self, *args, **kwds): 00026 """ 00027 Constructor. Any message fields that are implicitly/explicitly 00028 set to None will be assigned a default value. The recommend 00029 use is keyword arguments as this is more robust to future message 00030 changes. You cannot mix in-order arguments and keyword arguments. 00031 00032 The available fields are: 00033 mode,color 00034 00035 @param args: complete set of field values, in .msg order 00036 @param kwds: use keyword arguments corresponding to message field names 00037 to set specific fields. 00038 """ 00039 if args or kwds: 00040 super(LightModeRequest, self).__init__(*args, **kwds) 00041 #message fields cannot be None, assign default values for those that are 00042 if self.mode is None: 00043 self.mode = 0 00044 if self.color is None: 00045 self.color = std_msgs.msg.ColorRGBA() 00046 else: 00047 self.mode = 0 00048 self.color = std_msgs.msg.ColorRGBA() 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_i4f.pack(_x.mode, _x.color.r, _x.color.g, _x.color.b, _x.color.a)) 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 if self.color is None: 00076 self.color = std_msgs.msg.ColorRGBA() 00077 end = 0 00078 _x = self 00079 start = end 00080 end += 20 00081 (_x.mode, _x.color.r, _x.color.g, _x.color.b, _x.color.a,) = _struct_i4f.unpack(str[start:end]) 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_i4f.pack(_x.mode, _x.color.r, _x.color.g, _x.color.b, _x.color.a)) 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 if self.color is None: 00111 self.color = std_msgs.msg.ColorRGBA() 00112 end = 0 00113 _x = self 00114 start = end 00115 end += 20 00116 (_x.mode, _x.color.r, _x.color.g, _x.color.b, _x.color.a,) = _struct_i4f.unpack(str[start:end]) 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_i4f = struct.Struct("<i4f") 00123 """autogenerated by genmsg_py from LightModeResponse.msg. Do not edit.""" 00124 import roslib.message 00125 import struct 00126 00127 00128 class LightModeResponse(roslib.message.Message): 00129 _md5sum = "70fb6e48e8cdd4279997f73b5e61a8d3" 00130 _type = "cob_lightmode/LightModeResponse" 00131 _has_header = False #flag to mark the presence of a Header object 00132 _full_text = """int32 error_type 00133 string error_msg 00134 00135 00136 """ 00137 __slots__ = ['error_type','error_msg'] 00138 _slot_types = ['int32','string'] 00139 00140 def __init__(self, *args, **kwds): 00141 """ 00142 Constructor. Any message fields that are implicitly/explicitly 00143 set to None will be assigned a default value. The recommend 00144 use is keyword arguments as this is more robust to future message 00145 changes. You cannot mix in-order arguments and keyword arguments. 00146 00147 The available fields are: 00148 error_type,error_msg 00149 00150 @param args: complete set of field values, in .msg order 00151 @param kwds: use keyword arguments corresponding to message field names 00152 to set specific fields. 00153 """ 00154 if args or kwds: 00155 super(LightModeResponse, self).__init__(*args, **kwds) 00156 #message fields cannot be None, assign default values for those that are 00157 if self.error_type is None: 00158 self.error_type = 0 00159 if self.error_msg is None: 00160 self.error_msg = '' 00161 else: 00162 self.error_type = 0 00163 self.error_msg = '' 00164 00165 def _get_types(self): 00166 """ 00167 internal API method 00168 """ 00169 return self._slot_types 00170 00171 def serialize(self, buff): 00172 """ 00173 serialize message into buffer 00174 @param buff: buffer 00175 @type buff: StringIO 00176 """ 00177 try: 00178 buff.write(_struct_i.pack(self.error_type)) 00179 _x = self.error_msg 00180 length = len(_x) 00181 buff.write(struct.pack('<I%ss'%length, length, _x)) 00182 except struct.error as se: self._check_types(se) 00183 except TypeError as te: self._check_types(te) 00184 00185 def deserialize(self, str): 00186 """ 00187 unpack serialized message in str into this message instance 00188 @param str: byte array of serialized message 00189 @type str: str 00190 """ 00191 try: 00192 end = 0 00193 start = end 00194 end += 4 00195 (self.error_type,) = _struct_i.unpack(str[start:end]) 00196 start = end 00197 end += 4 00198 (length,) = _struct_I.unpack(str[start:end]) 00199 start = end 00200 end += length 00201 self.error_msg = str[start:end] 00202 return self 00203 except struct.error as e: 00204 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00205 00206 00207 def serialize_numpy(self, buff, numpy): 00208 """ 00209 serialize message with numpy array types into buffer 00210 @param buff: buffer 00211 @type buff: StringIO 00212 @param numpy: numpy python module 00213 @type numpy module 00214 """ 00215 try: 00216 buff.write(_struct_i.pack(self.error_type)) 00217 _x = self.error_msg 00218 length = len(_x) 00219 buff.write(struct.pack('<I%ss'%length, length, _x)) 00220 except struct.error as se: self._check_types(se) 00221 except TypeError as te: self._check_types(te) 00222 00223 def deserialize_numpy(self, str, numpy): 00224 """ 00225 unpack serialized message in str into this message instance using numpy for array types 00226 @param str: byte array of serialized message 00227 @type str: str 00228 @param numpy: numpy python module 00229 @type numpy: module 00230 """ 00231 try: 00232 end = 0 00233 start = end 00234 end += 4 00235 (self.error_type,) = _struct_i.unpack(str[start:end]) 00236 start = end 00237 end += 4 00238 (length,) = _struct_I.unpack(str[start:end]) 00239 start = end 00240 end += length 00241 self.error_msg = str[start:end] 00242 return self 00243 except struct.error as e: 00244 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00245 00246 _struct_I = roslib.message.struct_I 00247 _struct_i = struct.Struct("<i") 00248 class LightMode(roslib.message.ServiceDefinition): 00249 _type = 'cob_lightmode/LightMode' 00250 _md5sum = '6116a3e4964d803aabbed484e797d809' 00251 _request_class = LightModeRequest 00252 _response_class = LightModeResponse