$search
00001 """autogenerated by genmsg_py from BlinkGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import roslib.rostime 00006 import std_msgs.msg 00007 00008 class BlinkGoal(roslib.message.Message): 00009 _md5sum = "5e5d3c2ba9976dc121a0bb6ef7c66d79" 00010 _type = "nao_msgs/BlinkGoal" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00013 # Goal: colours to use for blinking, plus blinking rate mean and sd 00014 # Result: true if robot is still blinking (call was pre-empted by another user) 00015 # Feedback: last blinked colour 00016 std_msgs/ColorRGBA[] colors 00017 std_msgs/ColorRGBA bg_color 00018 duration blink_duration 00019 float32 blink_rate_mean 00020 float32 blink_rate_sd 00021 00022 ================================================================================ 00023 MSG: std_msgs/ColorRGBA 00024 float32 r 00025 float32 g 00026 float32 b 00027 float32 a 00028 00029 """ 00030 __slots__ = ['colors','bg_color','blink_duration','blink_rate_mean','blink_rate_sd'] 00031 _slot_types = ['std_msgs/ColorRGBA[]','std_msgs/ColorRGBA','duration','float32','float32'] 00032 00033 def __init__(self, *args, **kwds): 00034 """ 00035 Constructor. Any message fields that are implicitly/explicitly 00036 set to None will be assigned a default value. The recommend 00037 use is keyword arguments as this is more robust to future message 00038 changes. You cannot mix in-order arguments and keyword arguments. 00039 00040 The available fields are: 00041 colors,bg_color,blink_duration,blink_rate_mean,blink_rate_sd 00042 00043 @param args: complete set of field values, in .msg order 00044 @param kwds: use keyword arguments corresponding to message field names 00045 to set specific fields. 00046 """ 00047 if args or kwds: 00048 super(BlinkGoal, self).__init__(*args, **kwds) 00049 #message fields cannot be None, assign default values for those that are 00050 if self.colors is None: 00051 self.colors = [] 00052 if self.bg_color is None: 00053 self.bg_color = std_msgs.msg.ColorRGBA() 00054 if self.blink_duration is None: 00055 self.blink_duration = roslib.rostime.Duration() 00056 if self.blink_rate_mean is None: 00057 self.blink_rate_mean = 0. 00058 if self.blink_rate_sd is None: 00059 self.blink_rate_sd = 0. 00060 else: 00061 self.colors = [] 00062 self.bg_color = std_msgs.msg.ColorRGBA() 00063 self.blink_duration = roslib.rostime.Duration() 00064 self.blink_rate_mean = 0. 00065 self.blink_rate_sd = 0. 00066 00067 def _get_types(self): 00068 """ 00069 internal API method 00070 """ 00071 return self._slot_types 00072 00073 def serialize(self, buff): 00074 """ 00075 serialize message into buffer 00076 @param buff: buffer 00077 @type buff: StringIO 00078 """ 00079 try: 00080 length = len(self.colors) 00081 buff.write(_struct_I.pack(length)) 00082 for val1 in self.colors: 00083 _x = val1 00084 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a)) 00085 _x = self 00086 buff.write(_struct_4f2i2f.pack(_x.bg_color.r, _x.bg_color.g, _x.bg_color.b, _x.bg_color.a, _x.blink_duration.secs, _x.blink_duration.nsecs, _x.blink_rate_mean, _x.blink_rate_sd)) 00087 except struct.error as se: self._check_types(se) 00088 except TypeError as te: self._check_types(te) 00089 00090 def deserialize(self, str): 00091 """ 00092 unpack serialized message in str into this message instance 00093 @param str: byte array of serialized message 00094 @type str: str 00095 """ 00096 try: 00097 if self.bg_color is None: 00098 self.bg_color = std_msgs.msg.ColorRGBA() 00099 if self.blink_duration is None: 00100 self.blink_duration = roslib.rostime.Duration() 00101 end = 0 00102 start = end 00103 end += 4 00104 (length,) = _struct_I.unpack(str[start:end]) 00105 self.colors = [] 00106 for i in range(0, length): 00107 val1 = std_msgs.msg.ColorRGBA() 00108 _x = val1 00109 start = end 00110 end += 16 00111 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end]) 00112 self.colors.append(val1) 00113 _x = self 00114 start = end 00115 end += 32 00116 (_x.bg_color.r, _x.bg_color.g, _x.bg_color.b, _x.bg_color.a, _x.blink_duration.secs, _x.blink_duration.nsecs, _x.blink_rate_mean, _x.blink_rate_sd,) = _struct_4f2i2f.unpack(str[start:end]) 00117 self.blink_duration.canon() 00118 return self 00119 except struct.error as e: 00120 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00121 00122 00123 def serialize_numpy(self, buff, numpy): 00124 """ 00125 serialize message with numpy array types into buffer 00126 @param buff: buffer 00127 @type buff: StringIO 00128 @param numpy: numpy python module 00129 @type numpy module 00130 """ 00131 try: 00132 length = len(self.colors) 00133 buff.write(_struct_I.pack(length)) 00134 for val1 in self.colors: 00135 _x = val1 00136 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a)) 00137 _x = self 00138 buff.write(_struct_4f2i2f.pack(_x.bg_color.r, _x.bg_color.g, _x.bg_color.b, _x.bg_color.a, _x.blink_duration.secs, _x.blink_duration.nsecs, _x.blink_rate_mean, _x.blink_rate_sd)) 00139 except struct.error as se: self._check_types(se) 00140 except TypeError as te: self._check_types(te) 00141 00142 def deserialize_numpy(self, str, numpy): 00143 """ 00144 unpack serialized message in str into this message instance using numpy for array types 00145 @param str: byte array of serialized message 00146 @type str: str 00147 @param numpy: numpy python module 00148 @type numpy: module 00149 """ 00150 try: 00151 if self.bg_color is None: 00152 self.bg_color = std_msgs.msg.ColorRGBA() 00153 if self.blink_duration is None: 00154 self.blink_duration = roslib.rostime.Duration() 00155 end = 0 00156 start = end 00157 end += 4 00158 (length,) = _struct_I.unpack(str[start:end]) 00159 self.colors = [] 00160 for i in range(0, length): 00161 val1 = std_msgs.msg.ColorRGBA() 00162 _x = val1 00163 start = end 00164 end += 16 00165 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end]) 00166 self.colors.append(val1) 00167 _x = self 00168 start = end 00169 end += 32 00170 (_x.bg_color.r, _x.bg_color.g, _x.bg_color.b, _x.bg_color.a, _x.blink_duration.secs, _x.blink_duration.nsecs, _x.blink_rate_mean, _x.blink_rate_sd,) = _struct_4f2i2f.unpack(str[start:end]) 00171 self.blink_duration.canon() 00172 return self 00173 except struct.error as e: 00174 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00175 00176 _struct_I = roslib.message.struct_I 00177 _struct_4f = struct.Struct("<4f") 00178 _struct_4f2i2f = struct.Struct("<4f2i2f")