00001 """autogenerated by genpy from srs_assisted_arm_navigation_msgs/ManualArmManipResult.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 ManualArmManipResult(genpy.Message):
00010 _md5sum = "fd4ed8c447d4f279eb6d602b78f3777c"
00011 _type = "srs_assisted_arm_navigation_msgs/ManualArmManipResult"
00012 _has_header = False
00013 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00014 # result
00015 bool success
00016 bool failed
00017 bool repeat
00018 bool timeout
00019 bool collision
00020 duration time_elapsed
00021
00022 """
00023 __slots__ = ['success','failed','repeat','timeout','collision','time_elapsed']
00024 _slot_types = ['bool','bool','bool','bool','bool','duration']
00025
00026 def __init__(self, *args, **kwds):
00027 """
00028 Constructor. Any message fields that are implicitly/explicitly
00029 set to None will be assigned a default value. The recommend
00030 use is keyword arguments as this is more robust to future message
00031 changes. You cannot mix in-order arguments and keyword arguments.
00032
00033 The available fields are:
00034 success,failed,repeat,timeout,collision,time_elapsed
00035
00036 :param args: complete set of field values, in .msg order
00037 :param kwds: use keyword arguments corresponding to message field names
00038 to set specific fields.
00039 """
00040 if args or kwds:
00041 super(ManualArmManipResult, self).__init__(*args, **kwds)
00042
00043 if self.success is None:
00044 self.success = False
00045 if self.failed is None:
00046 self.failed = False
00047 if self.repeat is None:
00048 self.repeat = False
00049 if self.timeout is None:
00050 self.timeout = False
00051 if self.collision is None:
00052 self.collision = False
00053 if self.time_elapsed is None:
00054 self.time_elapsed = genpy.Duration()
00055 else:
00056 self.success = False
00057 self.failed = False
00058 self.repeat = False
00059 self.timeout = False
00060 self.collision = False
00061 self.time_elapsed = genpy.Duration()
00062
00063 def _get_types(self):
00064 """
00065 internal API method
00066 """
00067 return self._slot_types
00068
00069 def serialize(self, buff):
00070 """
00071 serialize message into buffer
00072 :param buff: buffer, ``StringIO``
00073 """
00074 try:
00075 _x = self
00076 buff.write(_struct_5B2i.pack(_x.success, _x.failed, _x.repeat, _x.timeout, _x.collision, _x.time_elapsed.secs, _x.time_elapsed.nsecs))
00077 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00078 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00079
00080 def deserialize(self, str):
00081 """
00082 unpack serialized message in str into this message instance
00083 :param str: byte array of serialized message, ``str``
00084 """
00085 try:
00086 if self.time_elapsed is None:
00087 self.time_elapsed = genpy.Duration()
00088 end = 0
00089 _x = self
00090 start = end
00091 end += 13
00092 (_x.success, _x.failed, _x.repeat, _x.timeout, _x.collision, _x.time_elapsed.secs, _x.time_elapsed.nsecs,) = _struct_5B2i.unpack(str[start:end])
00093 self.success = bool(self.success)
00094 self.failed = bool(self.failed)
00095 self.repeat = bool(self.repeat)
00096 self.timeout = bool(self.timeout)
00097 self.collision = bool(self.collision)
00098 self.time_elapsed.canon()
00099 return self
00100 except struct.error as e:
00101 raise genpy.DeserializationError(e)
00102
00103
00104 def serialize_numpy(self, buff, numpy):
00105 """
00106 serialize message with numpy array types into buffer
00107 :param buff: buffer, ``StringIO``
00108 :param numpy: numpy python module
00109 """
00110 try:
00111 _x = self
00112 buff.write(_struct_5B2i.pack(_x.success, _x.failed, _x.repeat, _x.timeout, _x.collision, _x.time_elapsed.secs, _x.time_elapsed.nsecs))
00113 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00114 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00115
00116 def deserialize_numpy(self, str, numpy):
00117 """
00118 unpack serialized message in str into this message instance using numpy for array types
00119 :param str: byte array of serialized message, ``str``
00120 :param numpy: numpy python module
00121 """
00122 try:
00123 if self.time_elapsed is None:
00124 self.time_elapsed = genpy.Duration()
00125 end = 0
00126 _x = self
00127 start = end
00128 end += 13
00129 (_x.success, _x.failed, _x.repeat, _x.timeout, _x.collision, _x.time_elapsed.secs, _x.time_elapsed.nsecs,) = _struct_5B2i.unpack(str[start:end])
00130 self.success = bool(self.success)
00131 self.failed = bool(self.failed)
00132 self.repeat = bool(self.repeat)
00133 self.timeout = bool(self.timeout)
00134 self.collision = bool(self.collision)
00135 self.time_elapsed.canon()
00136 return self
00137 except struct.error as e:
00138 raise genpy.DeserializationError(e)
00139
00140 _struct_I = genpy.struct_I
00141 _struct_5B2i = struct.Struct("<5B2i")