00001 """autogenerated by genmsg_py from HeadMonitorGoal.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import roslib.rostime
00006
00007 class HeadMonitorGoal(roslib.message.Message):
00008 _md5sum = "d91d67751e9588f062802fb3978b7e79"
00009 _type = "move_arm_head_monitor/HeadMonitorGoal"
00010 _has_header = False
00011 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00012 #goal definition
00013 time stop_time
00014 float32 max_frequency
00015 duration time_offset
00016 string target_link
00017 float32 target_x
00018 float32 target_y
00019 float32 target_z
00020
00021 """
00022 __slots__ = ['stop_time','max_frequency','time_offset','target_link','target_x','target_y','target_z']
00023 _slot_types = ['time','float32','duration','string','float32','float32','float32']
00024
00025 def __init__(self, *args, **kwds):
00026 """
00027 Constructor. Any message fields that are implicitly/explicitly
00028 set to None will be assigned a default value. The recommend
00029 use is keyword arguments as this is more robust to future message
00030 changes. You cannot mix in-order arguments and keyword arguments.
00031
00032 The available fields are:
00033 stop_time,max_frequency,time_offset,target_link,target_x,target_y,target_z
00034
00035 @param args: complete set of field values, in .msg order
00036 @param kwds: use keyword arguments corresponding to message field names
00037 to set specific fields.
00038 """
00039 if args or kwds:
00040 super(HeadMonitorGoal, self).__init__(*args, **kwds)
00041
00042 if self.stop_time is None:
00043 self.stop_time = roslib.rostime.Time()
00044 if self.max_frequency is None:
00045 self.max_frequency = 0.
00046 if self.time_offset is None:
00047 self.time_offset = roslib.rostime.Duration()
00048 if self.target_link is None:
00049 self.target_link = ''
00050 if self.target_x is None:
00051 self.target_x = 0.
00052 if self.target_y is None:
00053 self.target_y = 0.
00054 if self.target_z is None:
00055 self.target_z = 0.
00056 else:
00057 self.stop_time = roslib.rostime.Time()
00058 self.max_frequency = 0.
00059 self.time_offset = roslib.rostime.Duration()
00060 self.target_link = ''
00061 self.target_x = 0.
00062 self.target_y = 0.
00063 self.target_z = 0.
00064
00065 def _get_types(self):
00066 """
00067 internal API method
00068 """
00069 return self._slot_types
00070
00071 def serialize(self, buff):
00072 """
00073 serialize message into buffer
00074 @param buff: buffer
00075 @type buff: StringIO
00076 """
00077 try:
00078 _x = self
00079 buff.write(_struct_2If2i.pack(_x.stop_time.secs, _x.stop_time.nsecs, _x.max_frequency, _x.time_offset.secs, _x.time_offset.nsecs))
00080 _x = self.target_link
00081 length = len(_x)
00082 buff.write(struct.pack('<I%ss'%length, length, _x))
00083 _x = self
00084 buff.write(_struct_3f.pack(_x.target_x, _x.target_y, _x.target_z))
00085 except struct.error, se: self._check_types(se)
00086 except TypeError, te: self._check_types(te)
00087
00088 def deserialize(self, str):
00089 """
00090 unpack serialized message in str into this message instance
00091 @param str: byte array of serialized message
00092 @type str: str
00093 """
00094 try:
00095 if self.stop_time is None:
00096 self.stop_time = roslib.rostime.Time()
00097 if self.time_offset is None:
00098 self.time_offset = roslib.rostime.Duration()
00099 end = 0
00100 _x = self
00101 start = end
00102 end += 20
00103 (_x.stop_time.secs, _x.stop_time.nsecs, _x.max_frequency, _x.time_offset.secs, _x.time_offset.nsecs,) = _struct_2If2i.unpack(str[start:end])
00104 start = end
00105 end += 4
00106 (length,) = _struct_I.unpack(str[start:end])
00107 start = end
00108 end += length
00109 self.target_link = str[start:end]
00110 _x = self
00111 start = end
00112 end += 12
00113 (_x.target_x, _x.target_y, _x.target_z,) = _struct_3f.unpack(str[start:end])
00114 self.stop_time.canon()
00115 self.time_offset.canon()
00116 return self
00117 except struct.error, e:
00118 raise roslib.message.DeserializationError(e)
00119
00120
00121 def serialize_numpy(self, buff, numpy):
00122 """
00123 serialize message with numpy array types into buffer
00124 @param buff: buffer
00125 @type buff: StringIO
00126 @param numpy: numpy python module
00127 @type numpy module
00128 """
00129 try:
00130 _x = self
00131 buff.write(_struct_2If2i.pack(_x.stop_time.secs, _x.stop_time.nsecs, _x.max_frequency, _x.time_offset.secs, _x.time_offset.nsecs))
00132 _x = self.target_link
00133 length = len(_x)
00134 buff.write(struct.pack('<I%ss'%length, length, _x))
00135 _x = self
00136 buff.write(_struct_3f.pack(_x.target_x, _x.target_y, _x.target_z))
00137 except struct.error, se: self._check_types(se)
00138 except TypeError, te: self._check_types(te)
00139
00140 def deserialize_numpy(self, str, numpy):
00141 """
00142 unpack serialized message in str into this message instance using numpy for array types
00143 @param str: byte array of serialized message
00144 @type str: str
00145 @param numpy: numpy python module
00146 @type numpy: module
00147 """
00148 try:
00149 if self.stop_time is None:
00150 self.stop_time = roslib.rostime.Time()
00151 if self.time_offset is None:
00152 self.time_offset = roslib.rostime.Duration()
00153 end = 0
00154 _x = self
00155 start = end
00156 end += 20
00157 (_x.stop_time.secs, _x.stop_time.nsecs, _x.max_frequency, _x.time_offset.secs, _x.time_offset.nsecs,) = _struct_2If2i.unpack(str[start:end])
00158 start = end
00159 end += 4
00160 (length,) = _struct_I.unpack(str[start:end])
00161 start = end
00162 end += length
00163 self.target_link = str[start:end]
00164 _x = self
00165 start = end
00166 end += 12
00167 (_x.target_x, _x.target_y, _x.target_z,) = _struct_3f.unpack(str[start:end])
00168 self.stop_time.canon()
00169 self.time_offset.canon()
00170 return self
00171 except struct.error, e:
00172 raise roslib.message.DeserializationError(e)
00173
00174 _struct_I = roslib.message.struct_I
00175 _struct_2If2i = struct.Struct("<2If2i")
00176 _struct_3f = struct.Struct("<3f")