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


move_arm_head_monitor
Author(s): Adam Harmat
autogenerated on Fri Dec 6 2013 21:09:57