Go to the documentation of this file.00001 """autogenerated by genpy from srs_assisted_arm_navigation_msgs/ManualBBEstimationResult.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class ManualBBEstimationResult(genpy.Message):
00009 _md5sum = "363df5631fa30ccd790dae289b1dbcc0"
00010 _type = "srs_assisted_arm_navigation_msgs/ManualBBEstimationResult"
00011 _has_header = False
00012 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00013 # result
00014 int16[2] p1
00015 int16[2] p2
00016 #string im_primitive_name
00017
00018 """
00019 __slots__ = ['p1','p2']
00020 _slot_types = ['int16[2]','int16[2]']
00021
00022 def __init__(self, *args, **kwds):
00023 """
00024 Constructor. Any message fields that are implicitly/explicitly
00025 set to None will be assigned a default value. The recommend
00026 use is keyword arguments as this is more robust to future message
00027 changes. You cannot mix in-order arguments and keyword arguments.
00028
00029 The available fields are:
00030 p1,p2
00031
00032 :param args: complete set of field values, in .msg order
00033 :param kwds: use keyword arguments corresponding to message field names
00034 to set specific fields.
00035 """
00036 if args or kwds:
00037 super(ManualBBEstimationResult, self).__init__(*args, **kwds)
00038
00039 if self.p1 is None:
00040 self.p1 = [0,0]
00041 if self.p2 is None:
00042 self.p2 = [0,0]
00043 else:
00044 self.p1 = [0,0]
00045 self.p2 = [0,0]
00046
00047 def _get_types(self):
00048 """
00049 internal API method
00050 """
00051 return self._slot_types
00052
00053 def serialize(self, buff):
00054 """
00055 serialize message into buffer
00056 :param buff: buffer, ``StringIO``
00057 """
00058 try:
00059 buff.write(_struct_2h.pack(*self.p1))
00060 buff.write(_struct_2h.pack(*self.p2))
00061 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00062 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00063
00064 def deserialize(self, str):
00065 """
00066 unpack serialized message in str into this message instance
00067 :param str: byte array of serialized message, ``str``
00068 """
00069 try:
00070 end = 0
00071 start = end
00072 end += 4
00073 self.p1 = _struct_2h.unpack(str[start:end])
00074 start = end
00075 end += 4
00076 self.p2 = _struct_2h.unpack(str[start:end])
00077 return self
00078 except struct.error as e:
00079 raise genpy.DeserializationError(e)
00080
00081
00082 def serialize_numpy(self, buff, numpy):
00083 """
00084 serialize message with numpy array types into buffer
00085 :param buff: buffer, ``StringIO``
00086 :param numpy: numpy python module
00087 """
00088 try:
00089 buff.write(self.p1.tostring())
00090 buff.write(self.p2.tostring())
00091 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00092 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00093
00094 def deserialize_numpy(self, str, numpy):
00095 """
00096 unpack serialized message in str into this message instance using numpy for array types
00097 :param str: byte array of serialized message, ``str``
00098 :param numpy: numpy python module
00099 """
00100 try:
00101 end = 0
00102 start = end
00103 end += 4
00104 self.p1 = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=2)
00105 start = end
00106 end += 4
00107 self.p2 = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=2)
00108 return self
00109 except struct.error as e:
00110 raise genpy.DeserializationError(e)
00111
00112 _struct_I = genpy.struct_I
00113 _struct_2h = struct.Struct("<2h")