_MoveArmFeedback.py
Go to the documentation of this file.
00001 """autogenerated by genpy from arm_navigation_msgs/MoveArmFeedback.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 MoveArmFeedback(genpy.Message):
00010   _md5sum = "321f3feadd0d5c1b7d7135738e673560"
00011   _type = "arm_navigation_msgs/MoveArmFeedback"
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 # The internal state that the move arm action currently is in
00015 string state
00016 
00017 # Time to completion - this is a combination of requested planning time and trajectory completion time
00018 duration time_to_completion
00019 
00020 
00021 """
00022   __slots__ = ['state','time_to_completion']
00023   _slot_types = ['string','duration']
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        state,time_to_completion
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(MoveArmFeedback, self).__init__(*args, **kwds)
00041       #message fields cannot be None, assign default values for those that are
00042       if self.state is None:
00043         self.state = ''
00044       if self.time_to_completion is None:
00045         self.time_to_completion = genpy.Duration()
00046     else:
00047       self.state = ''
00048       self.time_to_completion = genpy.Duration()
00049 
00050   def _get_types(self):
00051     """
00052     internal API method
00053     """
00054     return self._slot_types
00055 
00056   def serialize(self, buff):
00057     """
00058     serialize message into buffer
00059     :param buff: buffer, ``StringIO``
00060     """
00061     try:
00062       _x = self.state
00063       length = len(_x)
00064       if python3 or type(_x) == unicode:
00065         _x = _x.encode('utf-8')
00066         length = len(_x)
00067       buff.write(struct.pack('<I%ss'%length, length, _x))
00068       _x = self
00069       buff.write(_struct_2i.pack(_x.time_to_completion.secs, _x.time_to_completion.nsecs))
00070     except struct.error as se: self._check_types(se)
00071     except TypeError as te: self._check_types(te)
00072 
00073   def deserialize(self, str):
00074     """
00075     unpack serialized message in str into this message instance
00076     :param str: byte array of serialized message, ``str``
00077     """
00078     try:
00079       if self.time_to_completion is None:
00080         self.time_to_completion = genpy.Duration()
00081       end = 0
00082       start = end
00083       end += 4
00084       (length,) = _struct_I.unpack(str[start:end])
00085       start = end
00086       end += length
00087       if python3:
00088         self.state = str[start:end].decode('utf-8')
00089       else:
00090         self.state = str[start:end]
00091       _x = self
00092       start = end
00093       end += 8
00094       (_x.time_to_completion.secs, _x.time_to_completion.nsecs,) = _struct_2i.unpack(str[start:end])
00095       self.time_to_completion.canon()
00096       return self
00097     except struct.error as e:
00098       raise genpy.DeserializationError(e) #most likely buffer underfill
00099 
00100 
00101   def serialize_numpy(self, buff, numpy):
00102     """
00103     serialize message with numpy array types into buffer
00104     :param buff: buffer, ``StringIO``
00105     :param numpy: numpy python module
00106     """
00107     try:
00108       _x = self.state
00109       length = len(_x)
00110       if python3 or type(_x) == unicode:
00111         _x = _x.encode('utf-8')
00112         length = len(_x)
00113       buff.write(struct.pack('<I%ss'%length, length, _x))
00114       _x = self
00115       buff.write(_struct_2i.pack(_x.time_to_completion.secs, _x.time_to_completion.nsecs))
00116     except struct.error as se: self._check_types(se)
00117     except TypeError as te: self._check_types(te)
00118 
00119   def deserialize_numpy(self, str, numpy):
00120     """
00121     unpack serialized message in str into this message instance using numpy for array types
00122     :param str: byte array of serialized message, ``str``
00123     :param numpy: numpy python module
00124     """
00125     try:
00126       if self.time_to_completion is None:
00127         self.time_to_completion = genpy.Duration()
00128       end = 0
00129       start = end
00130       end += 4
00131       (length,) = _struct_I.unpack(str[start:end])
00132       start = end
00133       end += length
00134       if python3:
00135         self.state = str[start:end].decode('utf-8')
00136       else:
00137         self.state = str[start:end]
00138       _x = self
00139       start = end
00140       end += 8
00141       (_x.time_to_completion.secs, _x.time_to_completion.nsecs,) = _struct_2i.unpack(str[start:end])
00142       self.time_to_completion.canon()
00143       return self
00144     except struct.error as e:
00145       raise genpy.DeserializationError(e) #most likely buffer underfill
00146 
00147 _struct_I = genpy.struct_I
00148 _struct_2i = struct.Struct("<2i")


arm_navigation_msgs
Author(s): Gil Jones
autogenerated on Mon Dec 2 2013 12:31:50