00001 """autogenerated by genmsg_py from SayGoal.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import std_msgs.msg
00006
00007 class SayGoal(roslib.message.Message):
00008 _md5sum = "7fb91077b93c329c9eeaea1c488c03e0"
00009 _type = "cob_sound/SayGoal"
00010 _has_header = False
00011 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00012 # goal
00013 std_msgs/String text
00014
00015 ================================================================================
00016 MSG: std_msgs/String
00017 string data
00018
00019 """
00020 __slots__ = ['text']
00021 _slot_types = ['std_msgs/String']
00022
00023 def __init__(self, *args, **kwds):
00024 """
00025 Constructor. Any message fields that are implicitly/explicitly
00026 set to None will be assigned a default value. The recommend
00027 use is keyword arguments as this is more robust to future message
00028 changes. You cannot mix in-order arguments and keyword arguments.
00029
00030 The available fields are:
00031 text
00032
00033 @param args: complete set of field values, in .msg order
00034 @param kwds: use keyword arguments corresponding to message field names
00035 to set specific fields.
00036 """
00037 if args or kwds:
00038 super(SayGoal, self).__init__(*args, **kwds)
00039
00040 if self.text is None:
00041 self.text = std_msgs.msg.String()
00042 else:
00043 self.text = std_msgs.msg.String()
00044
00045 def _get_types(self):
00046 """
00047 internal API method
00048 """
00049 return self._slot_types
00050
00051 def serialize(self, buff):
00052 """
00053 serialize message into buffer
00054 @param buff: buffer
00055 @type buff: StringIO
00056 """
00057 try:
00058 _x = self.text.data
00059 length = len(_x)
00060 buff.write(struct.pack('<I%ss'%length, length, _x))
00061 except struct.error, se: self._check_types(se)
00062 except TypeError, te: self._check_types(te)
00063
00064 def deserialize(self, str):
00065 """
00066 unpack serialized message in str into this message instance
00067 @param str: byte array of serialized message
00068 @type str: str
00069 """
00070 try:
00071 if self.text is None:
00072 self.text = std_msgs.msg.String()
00073 end = 0
00074 start = end
00075 end += 4
00076 (length,) = _struct_I.unpack(str[start:end])
00077 start = end
00078 end += length
00079 self.text.data = str[start:end]
00080 return self
00081 except struct.error, e:
00082 raise roslib.message.DeserializationError(e)
00083
00084
00085 def serialize_numpy(self, buff, numpy):
00086 """
00087 serialize message with numpy array types into buffer
00088 @param buff: buffer
00089 @type buff: StringIO
00090 @param numpy: numpy python module
00091 @type numpy module
00092 """
00093 try:
00094 _x = self.text.data
00095 length = len(_x)
00096 buff.write(struct.pack('<I%ss'%length, length, _x))
00097 except struct.error, se: self._check_types(se)
00098 except TypeError, te: self._check_types(te)
00099
00100 def deserialize_numpy(self, str, numpy):
00101 """
00102 unpack serialized message in str into this message instance using numpy for array types
00103 @param str: byte array of serialized message
00104 @type str: str
00105 @param numpy: numpy python module
00106 @type numpy: module
00107 """
00108 try:
00109 if self.text is None:
00110 self.text = std_msgs.msg.String()
00111 end = 0
00112 start = end
00113 end += 4
00114 (length,) = _struct_I.unpack(str[start:end])
00115 start = end
00116 end += length
00117 self.text.data = str[start:end]
00118 return self
00119 except struct.error, e:
00120 raise roslib.message.DeserializationError(e)
00121
00122 _struct_I = roslib.message.struct_I