00001 """autogenerated by genpy from cob_lightmode/LightModeRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import std_msgs.msg
00008
00009 class LightModeRequest(genpy.Message):
00010 _md5sum = "368658e7feae72d08c2715eeb4c7b2d9"
00011 _type = "cob_lightmode/LightModeRequest"
00012 _has_header = False
00013 _full_text = """int32 mode
00014 std_msgs/ColorRGBA color
00015
00016 ================================================================================
00017 MSG: std_msgs/ColorRGBA
00018 float32 r
00019 float32 g
00020 float32 b
00021 float32 a
00022
00023 """
00024 __slots__ = ['mode','color']
00025 _slot_types = ['int32','std_msgs/ColorRGBA']
00026
00027 def __init__(self, *args, **kwds):
00028 """
00029 Constructor. Any message fields that are implicitly/explicitly
00030 set to None will be assigned a default value. The recommend
00031 use is keyword arguments as this is more robust to future message
00032 changes. You cannot mix in-order arguments and keyword arguments.
00033
00034 The available fields are:
00035 mode,color
00036
00037 :param args: complete set of field values, in .msg order
00038 :param kwds: use keyword arguments corresponding to message field names
00039 to set specific fields.
00040 """
00041 if args or kwds:
00042 super(LightModeRequest, self).__init__(*args, **kwds)
00043
00044 if self.mode is None:
00045 self.mode = 0
00046 if self.color is None:
00047 self.color = std_msgs.msg.ColorRGBA()
00048 else:
00049 self.mode = 0
00050 self.color = std_msgs.msg.ColorRGBA()
00051
00052 def _get_types(self):
00053 """
00054 internal API method
00055 """
00056 return self._slot_types
00057
00058 def serialize(self, buff):
00059 """
00060 serialize message into buffer
00061 :param buff: buffer, ``StringIO``
00062 """
00063 try:
00064 _x = self
00065 buff.write(_struct_i4f.pack(_x.mode, _x.color.r, _x.color.g, _x.color.b, _x.color.a))
00066 except struct.error as se: self._check_types(se)
00067 except TypeError as te: self._check_types(te)
00068
00069 def deserialize(self, str):
00070 """
00071 unpack serialized message in str into this message instance
00072 :param str: byte array of serialized message, ``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 genpy.DeserializationError(e)
00085
00086
00087 def serialize_numpy(self, buff, numpy):
00088 """
00089 serialize message with numpy array types into buffer
00090 :param buff: buffer, ``StringIO``
00091 :param numpy: numpy python module
00092 """
00093 try:
00094 _x = self
00095 buff.write(_struct_i4f.pack(_x.mode, _x.color.r, _x.color.g, _x.color.b, _x.color.a))
00096 except struct.error as se: self._check_types(se)
00097 except TypeError as te: self._check_types(te)
00098
00099 def deserialize_numpy(self, str, numpy):
00100 """
00101 unpack serialized message in str into this message instance using numpy for array types
00102 :param str: byte array of serialized message, ``str``
00103 :param numpy: numpy python module
00104 """
00105 try:
00106 if self.color is None:
00107 self.color = std_msgs.msg.ColorRGBA()
00108 end = 0
00109 _x = self
00110 start = end
00111 end += 20
00112 (_x.mode, _x.color.r, _x.color.g, _x.color.b, _x.color.a,) = _struct_i4f.unpack(str[start:end])
00113 return self
00114 except struct.error as e:
00115 raise genpy.DeserializationError(e)
00116
00117 _struct_I = genpy.struct_I
00118 _struct_i4f = struct.Struct("<i4f")
00119 """autogenerated by genpy from cob_lightmode/LightModeResponse.msg. Do not edit."""
00120 import sys
00121 python3 = True if sys.hexversion > 0x03000000 else False
00122 import genpy
00123 import struct
00124
00125
00126 class LightModeResponse(genpy.Message):
00127 _md5sum = "70fb6e48e8cdd4279997f73b5e61a8d3"
00128 _type = "cob_lightmode/LightModeResponse"
00129 _has_header = False
00130 _full_text = """int32 error_type
00131 string error_msg
00132
00133
00134 """
00135 __slots__ = ['error_type','error_msg']
00136 _slot_types = ['int32','string']
00137
00138 def __init__(self, *args, **kwds):
00139 """
00140 Constructor. Any message fields that are implicitly/explicitly
00141 set to None will be assigned a default value. The recommend
00142 use is keyword arguments as this is more robust to future message
00143 changes. You cannot mix in-order arguments and keyword arguments.
00144
00145 The available fields are:
00146 error_type,error_msg
00147
00148 :param args: complete set of field values, in .msg order
00149 :param kwds: use keyword arguments corresponding to message field names
00150 to set specific fields.
00151 """
00152 if args or kwds:
00153 super(LightModeResponse, self).__init__(*args, **kwds)
00154
00155 if self.error_type is None:
00156 self.error_type = 0
00157 if self.error_msg is None:
00158 self.error_msg = ''
00159 else:
00160 self.error_type = 0
00161 self.error_msg = ''
00162
00163 def _get_types(self):
00164 """
00165 internal API method
00166 """
00167 return self._slot_types
00168
00169 def serialize(self, buff):
00170 """
00171 serialize message into buffer
00172 :param buff: buffer, ``StringIO``
00173 """
00174 try:
00175 buff.write(_struct_i.pack(self.error_type))
00176 _x = self.error_msg
00177 length = len(_x)
00178 if python3 or type(_x) == unicode:
00179 _x = _x.encode('utf-8')
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, ``str``
00189 """
00190 try:
00191 end = 0
00192 start = end
00193 end += 4
00194 (self.error_type,) = _struct_i.unpack(str[start:end])
00195 start = end
00196 end += 4
00197 (length,) = _struct_I.unpack(str[start:end])
00198 start = end
00199 end += length
00200 if python3:
00201 self.error_msg = str[start:end].decode('utf-8')
00202 else:
00203 self.error_msg = str[start:end]
00204 return self
00205 except struct.error as e:
00206 raise genpy.DeserializationError(e)
00207
00208
00209 def serialize_numpy(self, buff, numpy):
00210 """
00211 serialize message with numpy array types into buffer
00212 :param buff: buffer, ``StringIO``
00213 :param numpy: numpy python module
00214 """
00215 try:
00216 buff.write(_struct_i.pack(self.error_type))
00217 _x = self.error_msg
00218 length = len(_x)
00219 if python3 or type(_x) == unicode:
00220 _x = _x.encode('utf-8')
00221 length = len(_x)
00222 buff.write(struct.pack('<I%ss'%length, length, _x))
00223 except struct.error as se: self._check_types(se)
00224 except TypeError as te: self._check_types(te)
00225
00226 def deserialize_numpy(self, str, numpy):
00227 """
00228 unpack serialized message in str into this message instance using numpy for array types
00229 :param str: byte array of serialized message, ``str``
00230 :param numpy: numpy python module
00231 """
00232 try:
00233 end = 0
00234 start = end
00235 end += 4
00236 (self.error_type,) = _struct_i.unpack(str[start:end])
00237 start = end
00238 end += 4
00239 (length,) = _struct_I.unpack(str[start:end])
00240 start = end
00241 end += length
00242 if python3:
00243 self.error_msg = str[start:end].decode('utf-8')
00244 else:
00245 self.error_msg = str[start:end]
00246 return self
00247 except struct.error as e:
00248 raise genpy.DeserializationError(e)
00249
00250 _struct_I = genpy.struct_I
00251 _struct_i = struct.Struct("<i")
00252 class LightMode(object):
00253 _type = 'cob_lightmode/LightMode'
00254 _md5sum = '6116a3e4964d803aabbed484e797d809'
00255 _request_class = LightModeRequest
00256 _response_class = LightModeResponse