_MoveArmFeedback.py
Go to the documentation of this file.
00001 """autogenerated by genpy from simple_arm_server/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 = "b0dec5233ed20df76ef7558be848d9bf"
00011   _type = "simple_arm_server/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 duration time_to_completion
00015 
00016 
00017 """
00018   __slots__ = ['time_to_completion']
00019   _slot_types = ['duration']
00020 
00021   def __init__(self, *args, **kwds):
00022     """
00023     Constructor. Any message fields that are implicitly/explicitly
00024     set to None will be assigned a default value. The recommend
00025     use is keyword arguments as this is more robust to future message
00026     changes.  You cannot mix in-order arguments and keyword arguments.
00027 
00028     The available fields are:
00029        time_to_completion
00030 
00031     :param args: complete set of field values, in .msg order
00032     :param kwds: use keyword arguments corresponding to message field names
00033     to set specific fields.
00034     """
00035     if args or kwds:
00036       super(MoveArmFeedback, self).__init__(*args, **kwds)
00037       #message fields cannot be None, assign default values for those that are
00038       if self.time_to_completion is None:
00039         self.time_to_completion = genpy.Duration()
00040     else:
00041       self.time_to_completion = genpy.Duration()
00042 
00043   def _get_types(self):
00044     """
00045     internal API method
00046     """
00047     return self._slot_types
00048 
00049   def serialize(self, buff):
00050     """
00051     serialize message into buffer
00052     :param buff: buffer, ``StringIO``
00053     """
00054     try:
00055       _x = self
00056       buff.write(_struct_2i.pack(_x.time_to_completion.secs, _x.time_to_completion.nsecs))
00057     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00058     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00059 
00060   def deserialize(self, str):
00061     """
00062     unpack serialized message in str into this message instance
00063     :param str: byte array of serialized message, ``str``
00064     """
00065     try:
00066       if self.time_to_completion is None:
00067         self.time_to_completion = genpy.Duration()
00068       end = 0
00069       _x = self
00070       start = end
00071       end += 8
00072       (_x.time_to_completion.secs, _x.time_to_completion.nsecs,) = _struct_2i.unpack(str[start:end])
00073       self.time_to_completion.canon()
00074       return self
00075     except struct.error as e:
00076       raise genpy.DeserializationError(e) #most likely buffer underfill
00077 
00078 
00079   def serialize_numpy(self, buff, numpy):
00080     """
00081     serialize message with numpy array types into buffer
00082     :param buff: buffer, ``StringIO``
00083     :param numpy: numpy python module
00084     """
00085     try:
00086       _x = self
00087       buff.write(_struct_2i.pack(_x.time_to_completion.secs, _x.time_to_completion.nsecs))
00088     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00089     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00090 
00091   def deserialize_numpy(self, str, numpy):
00092     """
00093     unpack serialized message in str into this message instance using numpy for array types
00094     :param str: byte array of serialized message, ``str``
00095     :param numpy: numpy python module
00096     """
00097     try:
00098       if self.time_to_completion is None:
00099         self.time_to_completion = genpy.Duration()
00100       end = 0
00101       _x = self
00102       start = end
00103       end += 8
00104       (_x.time_to_completion.secs, _x.time_to_completion.nsecs,) = _struct_2i.unpack(str[start:end])
00105       self.time_to_completion.canon()
00106       return self
00107     except struct.error as e:
00108       raise genpy.DeserializationError(e) #most likely buffer underfill
00109 
00110 _struct_I = genpy.struct_I
00111 _struct_2i = struct.Struct("<2i")


simple_arm_server
Author(s): Michael Ferguson
autogenerated on Mon Oct 6 2014 07:42:06