00001 """autogenerated by genmsg_py from GoalID.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import roslib.rostime
00006
00007 class GoalID(roslib.message.Message):
00008 _md5sum = "302881f31927c1df708a2dbab0e80ee8"
00009 _type = "actionlib_msgs/GoalID"
00010 _has_header = False
00011 _full_text = """# The stamp should store the time at which this goal was requested.
00012 # It is used by an action server when it tries to preempt all
00013 # goals that were requested before a certain time
00014 time stamp
00015
00016 # The id provides a way to associate feedback and
00017 # result message with specific goal requests. The id
00018 # specified must be unique.
00019 string id
00020
00021
00022 """
00023 __slots__ = ['stamp','id']
00024 _slot_types = ['time','string']
00025
00026 def __init__(self, *args, **kwds):
00027 """
00028 Constructor. Any message fields that are implicitly/explicitly
00029 set to None will be assigned a default value. The recommend
00030 use is keyword arguments as this is more robust to future message
00031 changes. You cannot mix in-order arguments and keyword arguments.
00032
00033 The available fields are:
00034 stamp,id
00035
00036 @param args: complete set of field values, in .msg order
00037 @param kwds: use keyword arguments corresponding to message field names
00038 to set specific fields.
00039 """
00040 if args or kwds:
00041 super(GoalID, self).__init__(*args, **kwds)
00042
00043 if self.stamp is None:
00044 self.stamp = roslib.rostime.Time()
00045 if self.id is None:
00046 self.id = ''
00047 else:
00048 self.stamp = roslib.rostime.Time()
00049 self.id = ''
00050
00051 def _get_types(self):
00052 """
00053 internal API method
00054 """
00055 return self._slot_types
00056
00057 def serialize(self, buff):
00058 """
00059 serialize message into buffer
00060 @param buff: buffer
00061 @type buff: StringIO
00062 """
00063 try:
00064 _x = self
00065 buff.write(_struct_2I.pack(_x.stamp.secs, _x.stamp.nsecs))
00066 _x = self.id
00067 length = len(_x)
00068 buff.write(struct.pack('<I%ss'%length, length, _x))
00069 except struct.error, se: self._check_types(se)
00070 except TypeError, te: self._check_types(te)
00071
00072 def deserialize(self, str):
00073 """
00074 unpack serialized message in str into this message instance
00075 @param str: byte array of serialized message
00076 @type str: str
00077 """
00078 try:
00079 if self.stamp is None:
00080 self.stamp = roslib.rostime.Time()
00081 end = 0
00082 _x = self
00083 start = end
00084 end += 8
00085 (_x.stamp.secs, _x.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00086 start = end
00087 end += 4
00088 (length,) = _struct_I.unpack(str[start:end])
00089 start = end
00090 end += length
00091 self.id = str[start:end]
00092 self.stamp.canon()
00093 return self
00094 except struct.error, e:
00095 raise roslib.message.DeserializationError(e)
00096
00097
00098 def serialize_numpy(self, buff, numpy):
00099 """
00100 serialize message with numpy array types into buffer
00101 @param buff: buffer
00102 @type buff: StringIO
00103 @param numpy: numpy python module
00104 @type numpy module
00105 """
00106 try:
00107 _x = self
00108 buff.write(_struct_2I.pack(_x.stamp.secs, _x.stamp.nsecs))
00109 _x = self.id
00110 length = len(_x)
00111 buff.write(struct.pack('<I%ss'%length, length, _x))
00112 except struct.error, se: self._check_types(se)
00113 except TypeError, te: self._check_types(te)
00114
00115 def deserialize_numpy(self, str, numpy):
00116 """
00117 unpack serialized message in str into this message instance using numpy for array types
00118 @param str: byte array of serialized message
00119 @type str: str
00120 @param numpy: numpy python module
00121 @type numpy: module
00122 """
00123 try:
00124 if self.stamp is None:
00125 self.stamp = roslib.rostime.Time()
00126 end = 0
00127 _x = self
00128 start = end
00129 end += 8
00130 (_x.stamp.secs, _x.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00131 start = end
00132 end += 4
00133 (length,) = _struct_I.unpack(str[start:end])
00134 start = end
00135 end += length
00136 self.id = str[start:end]
00137 self.stamp.canon()
00138 return self
00139 except struct.error, e:
00140 raise roslib.message.DeserializationError(e)
00141
00142 _struct_I = roslib.message.struct_I
00143 _struct_2I = struct.Struct("<2I")