$search
00001 """autogenerated by genmsg_py from ManualBBEstimationFeedback.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import roslib.rostime 00006 00007 class ManualBBEstimationFeedback(roslib.message.Message): 00008 _md5sum = "d31ce382f901a080bff420c1b6767fec" 00009 _type = "srs_assisted_arm_navigation_msgs/ManualBBEstimationFeedback" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00012 # feedback 00013 time timestamp 00014 int16[2] p1 00015 int16[2] p2 00016 00017 00018 """ 00019 __slots__ = ['timestamp','p1','p2'] 00020 _slot_types = ['time','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 timestamp,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(ManualBBEstimationFeedback, self).__init__(*args, **kwds) 00038 #message fields cannot be None, assign default values for those that are 00039 if self.timestamp is None: 00040 self.timestamp = roslib.rostime.Time() 00041 if self.p1 is None: 00042 self.p1 = [0,0] 00043 if self.p2 is None: 00044 self.p2 = [0,0] 00045 else: 00046 self.timestamp = roslib.rostime.Time() 00047 self.p1 = [0,0] 00048 self.p2 = [0,0] 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 00060 @type buff: StringIO 00061 """ 00062 try: 00063 _x = self 00064 buff.write(_struct_2I.pack(_x.timestamp.secs, _x.timestamp.nsecs)) 00065 buff.write(_struct_2h.pack(*self.p1)) 00066 buff.write(_struct_2h.pack(*self.p2)) 00067 except struct.error as se: self._check_types(se) 00068 except TypeError as te: self._check_types(te) 00069 00070 def deserialize(self, str): 00071 """ 00072 unpack serialized message in str into this message instance 00073 @param str: byte array of serialized message 00074 @type str: str 00075 """ 00076 try: 00077 if self.timestamp is None: 00078 self.timestamp = roslib.rostime.Time() 00079 end = 0 00080 _x = self 00081 start = end 00082 end += 8 00083 (_x.timestamp.secs, _x.timestamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00084 start = end 00085 end += 4 00086 self.p1 = _struct_2h.unpack(str[start:end]) 00087 start = end 00088 end += 4 00089 self.p2 = _struct_2h.unpack(str[start:end]) 00090 self.timestamp.canon() 00091 return self 00092 except struct.error as e: 00093 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00094 00095 00096 def serialize_numpy(self, buff, numpy): 00097 """ 00098 serialize message with numpy array types into buffer 00099 @param buff: buffer 00100 @type buff: StringIO 00101 @param numpy: numpy python module 00102 @type numpy module 00103 """ 00104 try: 00105 _x = self 00106 buff.write(_struct_2I.pack(_x.timestamp.secs, _x.timestamp.nsecs)) 00107 buff.write(self.p1.tostring()) 00108 buff.write(self.p2.tostring()) 00109 except struct.error as se: self._check_types(se) 00110 except TypeError as te: self._check_types(te) 00111 00112 def deserialize_numpy(self, str, numpy): 00113 """ 00114 unpack serialized message in str into this message instance using numpy for array types 00115 @param str: byte array of serialized message 00116 @type str: str 00117 @param numpy: numpy python module 00118 @type numpy: module 00119 """ 00120 try: 00121 if self.timestamp is None: 00122 self.timestamp = roslib.rostime.Time() 00123 end = 0 00124 _x = self 00125 start = end 00126 end += 8 00127 (_x.timestamp.secs, _x.timestamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00128 start = end 00129 end += 4 00130 self.p1 = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=2) 00131 start = end 00132 end += 4 00133 self.p2 = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=2) 00134 self.timestamp.canon() 00135 return self 00136 except struct.error as e: 00137 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00138 00139 _struct_I = roslib.message.struct_I 00140 _struct_2h = struct.Struct("<2h") 00141 _struct_2I = struct.Struct("<2I")