$search
00001 """autogenerated by genmsg_py from DebugInfo.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class DebugInfo(roslib.message.Message): 00007 _md5sum = "6281356ce897e33da024b8eb319460f2" 00008 _type = "pr2_mechanism_controllers/DebugInfo" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """float64[] timing 00011 int32 sequence 00012 bool input_valid 00013 float64 residual 00014 """ 00015 __slots__ = ['timing','sequence','input_valid','residual'] 00016 _slot_types = ['float64[]','int32','bool','float64'] 00017 00018 def __init__(self, *args, **kwds): 00019 """ 00020 Constructor. Any message fields that are implicitly/explicitly 00021 set to None will be assigned a default value. The recommend 00022 use is keyword arguments as this is more robust to future message 00023 changes. You cannot mix in-order arguments and keyword arguments. 00024 00025 The available fields are: 00026 timing,sequence,input_valid,residual 00027 00028 @param args: complete set of field values, in .msg order 00029 @param kwds: use keyword arguments corresponding to message field names 00030 to set specific fields. 00031 """ 00032 if args or kwds: 00033 super(DebugInfo, self).__init__(*args, **kwds) 00034 #message fields cannot be None, assign default values for those that are 00035 if self.timing is None: 00036 self.timing = [] 00037 if self.sequence is None: 00038 self.sequence = 0 00039 if self.input_valid is None: 00040 self.input_valid = False 00041 if self.residual is None: 00042 self.residual = 0. 00043 else: 00044 self.timing = [] 00045 self.sequence = 0 00046 self.input_valid = False 00047 self.residual = 0. 00048 00049 def _get_types(self): 00050 """ 00051 internal API method 00052 """ 00053 return self._slot_types 00054 00055 def serialize(self, buff): 00056 """ 00057 serialize message into buffer 00058 @param buff: buffer 00059 @type buff: StringIO 00060 """ 00061 try: 00062 length = len(self.timing) 00063 buff.write(_struct_I.pack(length)) 00064 pattern = '<%sd'%length 00065 buff.write(struct.pack(pattern, *self.timing)) 00066 _x = self 00067 buff.write(_struct_iBd.pack(_x.sequence, _x.input_valid, _x.residual)) 00068 except struct.error as se: self._check_types(se) 00069 except TypeError as te: self._check_types(te) 00070 00071 def deserialize(self, str): 00072 """ 00073 unpack serialized message in str into this message instance 00074 @param str: byte array of serialized message 00075 @type str: str 00076 """ 00077 try: 00078 end = 0 00079 start = end 00080 end += 4 00081 (length,) = _struct_I.unpack(str[start:end]) 00082 pattern = '<%sd'%length 00083 start = end 00084 end += struct.calcsize(pattern) 00085 self.timing = struct.unpack(pattern, str[start:end]) 00086 _x = self 00087 start = end 00088 end += 13 00089 (_x.sequence, _x.input_valid, _x.residual,) = _struct_iBd.unpack(str[start:end]) 00090 self.input_valid = bool(self.input_valid) 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 length = len(self.timing) 00106 buff.write(_struct_I.pack(length)) 00107 pattern = '<%sd'%length 00108 buff.write(self.timing.tostring()) 00109 _x = self 00110 buff.write(_struct_iBd.pack(_x.sequence, _x.input_valid, _x.residual)) 00111 except struct.error as se: self._check_types(se) 00112 except TypeError as te: self._check_types(te) 00113 00114 def deserialize_numpy(self, str, numpy): 00115 """ 00116 unpack serialized message in str into this message instance using numpy for array types 00117 @param str: byte array of serialized message 00118 @type str: str 00119 @param numpy: numpy python module 00120 @type numpy: module 00121 """ 00122 try: 00123 end = 0 00124 start = end 00125 end += 4 00126 (length,) = _struct_I.unpack(str[start:end]) 00127 pattern = '<%sd'%length 00128 start = end 00129 end += struct.calcsize(pattern) 00130 self.timing = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00131 _x = self 00132 start = end 00133 end += 13 00134 (_x.sequence, _x.input_valid, _x.residual,) = _struct_iBd.unpack(str[start:end]) 00135 self.input_valid = bool(self.input_valid) 00136 return self 00137 except struct.error as e: 00138 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00139 00140 _struct_I = roslib.message.struct_I 00141 _struct_iBd = struct.Struct("<iBd")