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