$search
00001 """autogenerated by genmsg_py from BlinkActionGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import nao_msgs.msg 00006 import roslib.rostime 00007 import actionlib_msgs.msg 00008 import std_msgs.msg 00009 00010 class BlinkActionGoal(roslib.message.Message): 00011 _md5sum = "8fb9f71a23feed1923381dc04a3cab38" 00012 _type = "nao_msgs/BlinkActionGoal" 00013 _has_header = True #flag to mark the presence of a Header object 00014 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00015 00016 Header header 00017 actionlib_msgs/GoalID goal_id 00018 BlinkGoal goal 00019 00020 ================================================================================ 00021 MSG: std_msgs/Header 00022 # Standard metadata for higher-level stamped data types. 00023 # This is generally used to communicate timestamped data 00024 # in a particular coordinate frame. 00025 # 00026 # sequence ID: consecutively increasing ID 00027 uint32 seq 00028 #Two-integer timestamp that is expressed as: 00029 # * stamp.secs: seconds (stamp_secs) since epoch 00030 # * stamp.nsecs: nanoseconds since stamp_secs 00031 # time-handling sugar is provided by the client library 00032 time stamp 00033 #Frame this data is associated with 00034 # 0: no frame 00035 # 1: global frame 00036 string frame_id 00037 00038 ================================================================================ 00039 MSG: actionlib_msgs/GoalID 00040 # The stamp should store the time at which this goal was requested. 00041 # It is used by an action server when it tries to preempt all 00042 # goals that were requested before a certain time 00043 time stamp 00044 00045 # The id provides a way to associate feedback and 00046 # result message with specific goal requests. The id 00047 # specified must be unique. 00048 string id 00049 00050 00051 ================================================================================ 00052 MSG: nao_msgs/BlinkGoal 00053 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00054 # Goal: colours to use for blinking, plus blinking rate mean and sd 00055 # Result: true if robot is still blinking (call was pre-empted by another user) 00056 # Feedback: last blinked colour 00057 std_msgs/ColorRGBA[] colors 00058 std_msgs/ColorRGBA bg_color 00059 duration blink_duration 00060 float32 blink_rate_mean 00061 float32 blink_rate_sd 00062 00063 ================================================================================ 00064 MSG: std_msgs/ColorRGBA 00065 float32 r 00066 float32 g 00067 float32 b 00068 float32 a 00069 00070 """ 00071 __slots__ = ['header','goal_id','goal'] 00072 _slot_types = ['Header','actionlib_msgs/GoalID','nao_msgs/BlinkGoal'] 00073 00074 def __init__(self, *args, **kwds): 00075 """ 00076 Constructor. Any message fields that are implicitly/explicitly 00077 set to None will be assigned a default value. The recommend 00078 use is keyword arguments as this is more robust to future message 00079 changes. You cannot mix in-order arguments and keyword arguments. 00080 00081 The available fields are: 00082 header,goal_id,goal 00083 00084 @param args: complete set of field values, in .msg order 00085 @param kwds: use keyword arguments corresponding to message field names 00086 to set specific fields. 00087 """ 00088 if args or kwds: 00089 super(BlinkActionGoal, self).__init__(*args, **kwds) 00090 #message fields cannot be None, assign default values for those that are 00091 if self.header is None: 00092 self.header = std_msgs.msg._Header.Header() 00093 if self.goal_id is None: 00094 self.goal_id = actionlib_msgs.msg.GoalID() 00095 if self.goal is None: 00096 self.goal = nao_msgs.msg.BlinkGoal() 00097 else: 00098 self.header = std_msgs.msg._Header.Header() 00099 self.goal_id = actionlib_msgs.msg.GoalID() 00100 self.goal = nao_msgs.msg.BlinkGoal() 00101 00102 def _get_types(self): 00103 """ 00104 internal API method 00105 """ 00106 return self._slot_types 00107 00108 def serialize(self, buff): 00109 """ 00110 serialize message into buffer 00111 @param buff: buffer 00112 @type buff: StringIO 00113 """ 00114 try: 00115 _x = self 00116 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00117 _x = self.header.frame_id 00118 length = len(_x) 00119 buff.write(struct.pack('<I%ss'%length, length, _x)) 00120 _x = self 00121 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs)) 00122 _x = self.goal_id.id 00123 length = len(_x) 00124 buff.write(struct.pack('<I%ss'%length, length, _x)) 00125 length = len(self.goal.colors) 00126 buff.write(_struct_I.pack(length)) 00127 for val1 in self.goal.colors: 00128 _x = val1 00129 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a)) 00130 _x = self 00131 buff.write(_struct_4f2i2f.pack(_x.goal.bg_color.r, _x.goal.bg_color.g, _x.goal.bg_color.b, _x.goal.bg_color.a, _x.goal.blink_duration.secs, _x.goal.blink_duration.nsecs, _x.goal.blink_rate_mean, _x.goal.blink_rate_sd)) 00132 except struct.error as se: self._check_types(se) 00133 except TypeError as te: self._check_types(te) 00134 00135 def deserialize(self, str): 00136 """ 00137 unpack serialized message in str into this message instance 00138 @param str: byte array of serialized message 00139 @type str: str 00140 """ 00141 try: 00142 if self.header is None: 00143 self.header = std_msgs.msg._Header.Header() 00144 if self.goal_id is None: 00145 self.goal_id = actionlib_msgs.msg.GoalID() 00146 if self.goal is None: 00147 self.goal = nao_msgs.msg.BlinkGoal() 00148 end = 0 00149 _x = self 00150 start = end 00151 end += 12 00152 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00153 start = end 00154 end += 4 00155 (length,) = _struct_I.unpack(str[start:end]) 00156 start = end 00157 end += length 00158 self.header.frame_id = str[start:end] 00159 _x = self 00160 start = end 00161 end += 8 00162 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00163 start = end 00164 end += 4 00165 (length,) = _struct_I.unpack(str[start:end]) 00166 start = end 00167 end += length 00168 self.goal_id.id = str[start:end] 00169 start = end 00170 end += 4 00171 (length,) = _struct_I.unpack(str[start:end]) 00172 self.goal.colors = [] 00173 for i in range(0, length): 00174 val1 = std_msgs.msg.ColorRGBA() 00175 _x = val1 00176 start = end 00177 end += 16 00178 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end]) 00179 self.goal.colors.append(val1) 00180 _x = self 00181 start = end 00182 end += 32 00183 (_x.goal.bg_color.r, _x.goal.bg_color.g, _x.goal.bg_color.b, _x.goal.bg_color.a, _x.goal.blink_duration.secs, _x.goal.blink_duration.nsecs, _x.goal.blink_rate_mean, _x.goal.blink_rate_sd,) = _struct_4f2i2f.unpack(str[start:end]) 00184 return self 00185 except struct.error as e: 00186 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00187 00188 00189 def serialize_numpy(self, buff, numpy): 00190 """ 00191 serialize message with numpy array types into buffer 00192 @param buff: buffer 00193 @type buff: StringIO 00194 @param numpy: numpy python module 00195 @type numpy module 00196 """ 00197 try: 00198 _x = self 00199 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00200 _x = self.header.frame_id 00201 length = len(_x) 00202 buff.write(struct.pack('<I%ss'%length, length, _x)) 00203 _x = self 00204 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs)) 00205 _x = self.goal_id.id 00206 length = len(_x) 00207 buff.write(struct.pack('<I%ss'%length, length, _x)) 00208 length = len(self.goal.colors) 00209 buff.write(_struct_I.pack(length)) 00210 for val1 in self.goal.colors: 00211 _x = val1 00212 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a)) 00213 _x = self 00214 buff.write(_struct_4f2i2f.pack(_x.goal.bg_color.r, _x.goal.bg_color.g, _x.goal.bg_color.b, _x.goal.bg_color.a, _x.goal.blink_duration.secs, _x.goal.blink_duration.nsecs, _x.goal.blink_rate_mean, _x.goal.blink_rate_sd)) 00215 except struct.error as se: self._check_types(se) 00216 except TypeError as te: self._check_types(te) 00217 00218 def deserialize_numpy(self, str, numpy): 00219 """ 00220 unpack serialized message in str into this message instance using numpy for array types 00221 @param str: byte array of serialized message 00222 @type str: str 00223 @param numpy: numpy python module 00224 @type numpy: module 00225 """ 00226 try: 00227 if self.header is None: 00228 self.header = std_msgs.msg._Header.Header() 00229 if self.goal_id is None: 00230 self.goal_id = actionlib_msgs.msg.GoalID() 00231 if self.goal is None: 00232 self.goal = nao_msgs.msg.BlinkGoal() 00233 end = 0 00234 _x = self 00235 start = end 00236 end += 12 00237 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00238 start = end 00239 end += 4 00240 (length,) = _struct_I.unpack(str[start:end]) 00241 start = end 00242 end += length 00243 self.header.frame_id = str[start:end] 00244 _x = self 00245 start = end 00246 end += 8 00247 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00248 start = end 00249 end += 4 00250 (length,) = _struct_I.unpack(str[start:end]) 00251 start = end 00252 end += length 00253 self.goal_id.id = str[start:end] 00254 start = end 00255 end += 4 00256 (length,) = _struct_I.unpack(str[start:end]) 00257 self.goal.colors = [] 00258 for i in range(0, length): 00259 val1 = std_msgs.msg.ColorRGBA() 00260 _x = val1 00261 start = end 00262 end += 16 00263 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end]) 00264 self.goal.colors.append(val1) 00265 _x = self 00266 start = end 00267 end += 32 00268 (_x.goal.bg_color.r, _x.goal.bg_color.g, _x.goal.bg_color.b, _x.goal.bg_color.a, _x.goal.blink_duration.secs, _x.goal.blink_duration.nsecs, _x.goal.blink_rate_mean, _x.goal.blink_rate_sd,) = _struct_4f2i2f.unpack(str[start:end]) 00269 return self 00270 except struct.error as e: 00271 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00272 00273 _struct_I = roslib.message.struct_I 00274 _struct_4f = struct.Struct("<4f") 00275 _struct_3I = struct.Struct("<3I") 00276 _struct_2I = struct.Struct("<2I") 00277 _struct_4f2i2f = struct.Struct("<4f2i2f")