00001 """autogenerated by genmsg_py from HeadLookGoal.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import roslib.rostime
00006
00007 class HeadLookGoal(roslib.message.Message):
00008 _md5sum = "ccb46f4d202beba6b2107eb8dcfa33ea"
00009 _type = "move_arm_head_monitor/HeadLookGoal"
00010 _has_header = False
00011 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00012 #goal definition
00013 time target_time
00014 string target_link
00015 float32 target_x
00016 float32 target_y
00017 float32 target_z
00018
00019 """
00020 __slots__ = ['target_time','target_link','target_x','target_y','target_z']
00021 _slot_types = ['time','string','float32','float32','float32']
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 target_time,target_link,target_x,target_y,target_z
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(HeadLookGoal, self).__init__(*args, **kwds)
00039
00040 if self.target_time is None:
00041 self.target_time = roslib.rostime.Time()
00042 if self.target_link is None:
00043 self.target_link = ''
00044 if self.target_x is None:
00045 self.target_x = 0.
00046 if self.target_y is None:
00047 self.target_y = 0.
00048 if self.target_z is None:
00049 self.target_z = 0.
00050 else:
00051 self.target_time = roslib.rostime.Time()
00052 self.target_link = ''
00053 self.target_x = 0.
00054 self.target_y = 0.
00055 self.target_z = 0.
00056
00057 def _get_types(self):
00058 """
00059 internal API method
00060 """
00061 return self._slot_types
00062
00063 def serialize(self, buff):
00064 """
00065 serialize message into buffer
00066 @param buff: buffer
00067 @type buff: StringIO
00068 """
00069 try:
00070 _x = self
00071 buff.write(_struct_2I.pack(_x.target_time.secs, _x.target_time.nsecs))
00072 _x = self.target_link
00073 length = len(_x)
00074 buff.write(struct.pack('<I%ss'%length, length, _x))
00075 _x = self
00076 buff.write(_struct_3f.pack(_x.target_x, _x.target_y, _x.target_z))
00077 except struct.error, se: self._check_types(se)
00078 except TypeError, te: self._check_types(te)
00079
00080 def deserialize(self, str):
00081 """
00082 unpack serialized message in str into this message instance
00083 @param str: byte array of serialized message
00084 @type str: str
00085 """
00086 try:
00087 if self.target_time is None:
00088 self.target_time = roslib.rostime.Time()
00089 end = 0
00090 _x = self
00091 start = end
00092 end += 8
00093 (_x.target_time.secs, _x.target_time.nsecs,) = _struct_2I.unpack(str[start:end])
00094 start = end
00095 end += 4
00096 (length,) = _struct_I.unpack(str[start:end])
00097 start = end
00098 end += length
00099 self.target_link = str[start:end]
00100 _x = self
00101 start = end
00102 end += 12
00103 (_x.target_x, _x.target_y, _x.target_z,) = _struct_3f.unpack(str[start:end])
00104 self.target_time.canon()
00105 return self
00106 except struct.error, e:
00107 raise roslib.message.DeserializationError(e)
00108
00109
00110 def serialize_numpy(self, buff, numpy):
00111 """
00112 serialize message with numpy array types into buffer
00113 @param buff: buffer
00114 @type buff: StringIO
00115 @param numpy: numpy python module
00116 @type numpy module
00117 """
00118 try:
00119 _x = self
00120 buff.write(_struct_2I.pack(_x.target_time.secs, _x.target_time.nsecs))
00121 _x = self.target_link
00122 length = len(_x)
00123 buff.write(struct.pack('<I%ss'%length, length, _x))
00124 _x = self
00125 buff.write(_struct_3f.pack(_x.target_x, _x.target_y, _x.target_z))
00126 except struct.error, se: self._check_types(se)
00127 except TypeError, te: self._check_types(te)
00128
00129 def deserialize_numpy(self, str, numpy):
00130 """
00131 unpack serialized message in str into this message instance using numpy for array types
00132 @param str: byte array of serialized message
00133 @type str: str
00134 @param numpy: numpy python module
00135 @type numpy: module
00136 """
00137 try:
00138 if self.target_time is None:
00139 self.target_time = roslib.rostime.Time()
00140 end = 0
00141 _x = self
00142 start = end
00143 end += 8
00144 (_x.target_time.secs, _x.target_time.nsecs,) = _struct_2I.unpack(str[start:end])
00145 start = end
00146 end += 4
00147 (length,) = _struct_I.unpack(str[start:end])
00148 start = end
00149 end += length
00150 self.target_link = str[start:end]
00151 _x = self
00152 start = end
00153 end += 12
00154 (_x.target_x, _x.target_y, _x.target_z,) = _struct_3f.unpack(str[start:end])
00155 self.target_time.canon()
00156 return self
00157 except struct.error, e:
00158 raise roslib.message.DeserializationError(e)
00159
00160 _struct_I = roslib.message.struct_I
00161 _struct_2I = struct.Struct("<2I")
00162 _struct_3f = struct.Struct("<3f")