$search
00001 """autogenerated by genmsg_py from FadeRGB.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import roslib.rostime 00006 import std_msgs.msg 00007 00008 class FadeRGB(roslib.message.Message): 00009 _md5sum = "0df8c8fbe7f1de5f2168d6117ffced08" 00010 _type = "nao_msgs/FadeRGB" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """#Message to fade leds 00013 string led_name 00014 std_msgs/ColorRGBA color 00015 duration fade_duration 00016 00017 ================================================================================ 00018 MSG: std_msgs/ColorRGBA 00019 float32 r 00020 float32 g 00021 float32 b 00022 float32 a 00023 00024 """ 00025 __slots__ = ['led_name','color','fade_duration'] 00026 _slot_types = ['string','std_msgs/ColorRGBA','duration'] 00027 00028 def __init__(self, *args, **kwds): 00029 """ 00030 Constructor. Any message fields that are implicitly/explicitly 00031 set to None will be assigned a default value. The recommend 00032 use is keyword arguments as this is more robust to future message 00033 changes. You cannot mix in-order arguments and keyword arguments. 00034 00035 The available fields are: 00036 led_name,color,fade_duration 00037 00038 @param args: complete set of field values, in .msg order 00039 @param kwds: use keyword arguments corresponding to message field names 00040 to set specific fields. 00041 """ 00042 if args or kwds: 00043 super(FadeRGB, self).__init__(*args, **kwds) 00044 #message fields cannot be None, assign default values for those that are 00045 if self.led_name is None: 00046 self.led_name = '' 00047 if self.color is None: 00048 self.color = std_msgs.msg.ColorRGBA() 00049 if self.fade_duration is None: 00050 self.fade_duration = roslib.rostime.Duration() 00051 else: 00052 self.led_name = '' 00053 self.color = std_msgs.msg.ColorRGBA() 00054 self.fade_duration = roslib.rostime.Duration() 00055 00056 def _get_types(self): 00057 """ 00058 internal API method 00059 """ 00060 return self._slot_types 00061 00062 def serialize(self, buff): 00063 """ 00064 serialize message into buffer 00065 @param buff: buffer 00066 @type buff: StringIO 00067 """ 00068 try: 00069 _x = self.led_name 00070 length = len(_x) 00071 buff.write(struct.pack('<I%ss'%length, length, _x)) 00072 _x = self 00073 buff.write(_struct_4f2i.pack(_x.color.r, _x.color.g, _x.color.b, _x.color.a, _x.fade_duration.secs, _x.fade_duration.nsecs)) 00074 except struct.error as se: self._check_types(se) 00075 except TypeError as te: self._check_types(te) 00076 00077 def deserialize(self, str): 00078 """ 00079 unpack serialized message in str into this message instance 00080 @param str: byte array of serialized message 00081 @type str: str 00082 """ 00083 try: 00084 if self.color is None: 00085 self.color = std_msgs.msg.ColorRGBA() 00086 if self.fade_duration is None: 00087 self.fade_duration = roslib.rostime.Duration() 00088 end = 0 00089 start = end 00090 end += 4 00091 (length,) = _struct_I.unpack(str[start:end]) 00092 start = end 00093 end += length 00094 self.led_name = str[start:end] 00095 _x = self 00096 start = end 00097 end += 24 00098 (_x.color.r, _x.color.g, _x.color.b, _x.color.a, _x.fade_duration.secs, _x.fade_duration.nsecs,) = _struct_4f2i.unpack(str[start:end]) 00099 self.fade_duration.canon() 00100 return self 00101 except struct.error as e: 00102 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00103 00104 00105 def serialize_numpy(self, buff, numpy): 00106 """ 00107 serialize message with numpy array types into buffer 00108 @param buff: buffer 00109 @type buff: StringIO 00110 @param numpy: numpy python module 00111 @type numpy module 00112 """ 00113 try: 00114 _x = self.led_name 00115 length = len(_x) 00116 buff.write(struct.pack('<I%ss'%length, length, _x)) 00117 _x = self 00118 buff.write(_struct_4f2i.pack(_x.color.r, _x.color.g, _x.color.b, _x.color.a, _x.fade_duration.secs, _x.fade_duration.nsecs)) 00119 except struct.error as se: self._check_types(se) 00120 except TypeError as te: self._check_types(te) 00121 00122 def deserialize_numpy(self, str, numpy): 00123 """ 00124 unpack serialized message in str into this message instance using numpy for array types 00125 @param str: byte array of serialized message 00126 @type str: str 00127 @param numpy: numpy python module 00128 @type numpy: module 00129 """ 00130 try: 00131 if self.color is None: 00132 self.color = std_msgs.msg.ColorRGBA() 00133 if self.fade_duration is None: 00134 self.fade_duration = roslib.rostime.Duration() 00135 end = 0 00136 start = end 00137 end += 4 00138 (length,) = _struct_I.unpack(str[start:end]) 00139 start = end 00140 end += length 00141 self.led_name = str[start:end] 00142 _x = self 00143 start = end 00144 end += 24 00145 (_x.color.r, _x.color.g, _x.color.b, _x.color.a, _x.fade_duration.secs, _x.fade_duration.nsecs,) = _struct_4f2i.unpack(str[start:end]) 00146 self.fade_duration.canon() 00147 return self 00148 except struct.error as e: 00149 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00150 00151 _struct_I = roslib.message.struct_I 00152 _struct_4f2i = struct.Struct("<4f2i")