_SetLightModeActionGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from cob_light/SetLightModeActionGoal.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 cob_light.msg
00008 import genpy
00009 import actionlib_msgs.msg
00010 import std_msgs.msg
00011 
00012 class SetLightModeActionGoal(genpy.Message):
00013   _md5sum = "5a0fbb41ccbcad3e400fdff9a37682eb"
00014   _type = "cob_light/SetLightModeActionGoal"
00015   _has_header = True #flag to mark the presence of a Header object
00016   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00017 
00018 Header header
00019 actionlib_msgs/GoalID goal_id
00020 SetLightModeGoal 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: cob_light/SetLightModeGoal
00055 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00056 # The goal
00057 cob_light/LightMode mode
00058 
00059 ================================================================================
00060 MSG: cob_light/LightMode
00061 uint8 mode
00062 uint8 NONE = 0                  # will turn everything off
00063 uint8 STATIC = 1                # will change the LEDs to "color"
00064 uint8 FLASH = 2                 # will change the LEDs frequently with "frequency" from "color" to black
00065 uint8 BREATH = 3                # will change the LEDs smoothly with "frequency" from "color" to black
00066 uint8 BREATH_COLOR = 4  # will change the LEDs smoothly with "frequency" from "color" to black
00067                                                 # and flips color in time
00068 uint8 FADE_COLOR = 5    # will fade the colors in rainbow
00069 
00070 std_msgs/ColorRGBA color #the color which will be used
00071 float32 frequency               # in Hz
00072 float32 timeout                 # in s, requested mode will be executed for max timout s.
00073                                                 # default is 0 and meens no timeout.
00074 int32 pulses                    # spezifies the amount of pulses which will be executed.
00075                                                 # eg: mode = flash, pulses = 2. Meens the light will flash two times
00076 int8 priority                   # priority [-20,20] default = 0. Modes with same or higher priorities will 
00077                                                 # be executed.
00078 ================================================================================
00079 MSG: std_msgs/ColorRGBA
00080 float32 r
00081 float32 g
00082 float32 b
00083 float32 a
00084 
00085 """
00086   __slots__ = ['header','goal_id','goal']
00087   _slot_types = ['std_msgs/Header','actionlib_msgs/GoalID','cob_light/SetLightModeGoal']
00088 
00089   def __init__(self, *args, **kwds):
00090     """
00091     Constructor. Any message fields that are implicitly/explicitly
00092     set to None will be assigned a default value. The recommend
00093     use is keyword arguments as this is more robust to future message
00094     changes.  You cannot mix in-order arguments and keyword arguments.
00095 
00096     The available fields are:
00097        header,goal_id,goal
00098 
00099     :param args: complete set of field values, in .msg order
00100     :param kwds: use keyword arguments corresponding to message field names
00101     to set specific fields.
00102     """
00103     if args or kwds:
00104       super(SetLightModeActionGoal, self).__init__(*args, **kwds)
00105       #message fields cannot be None, assign default values for those that are
00106       if self.header is None:
00107         self.header = std_msgs.msg.Header()
00108       if self.goal_id is None:
00109         self.goal_id = actionlib_msgs.msg.GoalID()
00110       if self.goal is None:
00111         self.goal = cob_light.msg.SetLightModeGoal()
00112     else:
00113       self.header = std_msgs.msg.Header()
00114       self.goal_id = actionlib_msgs.msg.GoalID()
00115       self.goal = cob_light.msg.SetLightModeGoal()
00116 
00117   def _get_types(self):
00118     """
00119     internal API method
00120     """
00121     return self._slot_types
00122 
00123   def serialize(self, buff):
00124     """
00125     serialize message into buffer
00126     :param buff: buffer, ``StringIO``
00127     """
00128     try:
00129       _x = self
00130       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00131       _x = self.header.frame_id
00132       length = len(_x)
00133       if python3 or type(_x) == unicode:
00134         _x = _x.encode('utf-8')
00135         length = len(_x)
00136       buff.write(struct.pack('<I%ss'%length, length, _x))
00137       _x = self
00138       buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00139       _x = self.goal_id.id
00140       length = len(_x)
00141       if python3 or type(_x) == unicode:
00142         _x = _x.encode('utf-8')
00143         length = len(_x)
00144       buff.write(struct.pack('<I%ss'%length, length, _x))
00145       _x = self
00146       buff.write(_struct_B6fib.pack(_x.goal.mode.mode, _x.goal.mode.color.r, _x.goal.mode.color.g, _x.goal.mode.color.b, _x.goal.mode.color.a, _x.goal.mode.frequency, _x.goal.mode.timeout, _x.goal.mode.pulses, _x.goal.mode.priority))
00147     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00148     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00149 
00150   def deserialize(self, str):
00151     """
00152     unpack serialized message in str into this message instance
00153     :param str: byte array of serialized message, ``str``
00154     """
00155     try:
00156       if self.header is None:
00157         self.header = std_msgs.msg.Header()
00158       if self.goal_id is None:
00159         self.goal_id = actionlib_msgs.msg.GoalID()
00160       if self.goal is None:
00161         self.goal = cob_light.msg.SetLightModeGoal()
00162       end = 0
00163       _x = self
00164       start = end
00165       end += 12
00166       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00167       start = end
00168       end += 4
00169       (length,) = _struct_I.unpack(str[start:end])
00170       start = end
00171       end += length
00172       if python3:
00173         self.header.frame_id = str[start:end].decode('utf-8')
00174       else:
00175         self.header.frame_id = str[start:end]
00176       _x = self
00177       start = end
00178       end += 8
00179       (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00180       start = end
00181       end += 4
00182       (length,) = _struct_I.unpack(str[start:end])
00183       start = end
00184       end += length
00185       if python3:
00186         self.goal_id.id = str[start:end].decode('utf-8')
00187       else:
00188         self.goal_id.id = str[start:end]
00189       _x = self
00190       start = end
00191       end += 30
00192       (_x.goal.mode.mode, _x.goal.mode.color.r, _x.goal.mode.color.g, _x.goal.mode.color.b, _x.goal.mode.color.a, _x.goal.mode.frequency, _x.goal.mode.timeout, _x.goal.mode.pulses, _x.goal.mode.priority,) = _struct_B6fib.unpack(str[start:end])
00193       return self
00194     except struct.error as e:
00195       raise genpy.DeserializationError(e) #most likely buffer underfill
00196 
00197 
00198   def serialize_numpy(self, buff, numpy):
00199     """
00200     serialize message with numpy array types into buffer
00201     :param buff: buffer, ``StringIO``
00202     :param numpy: numpy python module
00203     """
00204     try:
00205       _x = self
00206       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00207       _x = self.header.frame_id
00208       length = len(_x)
00209       if python3 or type(_x) == unicode:
00210         _x = _x.encode('utf-8')
00211         length = len(_x)
00212       buff.write(struct.pack('<I%ss'%length, length, _x))
00213       _x = self
00214       buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00215       _x = self.goal_id.id
00216       length = len(_x)
00217       if python3 or type(_x) == unicode:
00218         _x = _x.encode('utf-8')
00219         length = len(_x)
00220       buff.write(struct.pack('<I%ss'%length, length, _x))
00221       _x = self
00222       buff.write(_struct_B6fib.pack(_x.goal.mode.mode, _x.goal.mode.color.r, _x.goal.mode.color.g, _x.goal.mode.color.b, _x.goal.mode.color.a, _x.goal.mode.frequency, _x.goal.mode.timeout, _x.goal.mode.pulses, _x.goal.mode.priority))
00223     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00224     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
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       if self.header is None:
00234         self.header = std_msgs.msg.Header()
00235       if self.goal_id is None:
00236         self.goal_id = actionlib_msgs.msg.GoalID()
00237       if self.goal is None:
00238         self.goal = cob_light.msg.SetLightModeGoal()
00239       end = 0
00240       _x = self
00241       start = end
00242       end += 12
00243       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00244       start = end
00245       end += 4
00246       (length,) = _struct_I.unpack(str[start:end])
00247       start = end
00248       end += length
00249       if python3:
00250         self.header.frame_id = str[start:end].decode('utf-8')
00251       else:
00252         self.header.frame_id = str[start:end]
00253       _x = self
00254       start = end
00255       end += 8
00256       (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00257       start = end
00258       end += 4
00259       (length,) = _struct_I.unpack(str[start:end])
00260       start = end
00261       end += length
00262       if python3:
00263         self.goal_id.id = str[start:end].decode('utf-8')
00264       else:
00265         self.goal_id.id = str[start:end]
00266       _x = self
00267       start = end
00268       end += 30
00269       (_x.goal.mode.mode, _x.goal.mode.color.r, _x.goal.mode.color.g, _x.goal.mode.color.b, _x.goal.mode.color.a, _x.goal.mode.frequency, _x.goal.mode.timeout, _x.goal.mode.pulses, _x.goal.mode.priority,) = _struct_B6fib.unpack(str[start:end])
00270       return self
00271     except struct.error as e:
00272       raise genpy.DeserializationError(e) #most likely buffer underfill
00273 
00274 _struct_I = genpy.struct_I
00275 _struct_3I = struct.Struct("<3I")
00276 _struct_2I = struct.Struct("<2I")
00277 _struct_B6fib = struct.Struct("<B6fib")


cob_light
Author(s): Benjamin Maidel
autogenerated on Sun Oct 5 2014 23:09:07