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


move_arm_head_monitor
Author(s): Adam Harmat
autogenerated on Thu Dec 12 2013 11:08:12