$search
00001 """autogenerated by genmsg_py from OdometryMatrix.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class OdometryMatrix(roslib.message.Message): 00007 _md5sum = "1f7818e7ce16454badf1bee936b0ff16" 00008 _type = "pr2_mechanism_controllers/OdometryMatrix" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """float64[] m 00011 """ 00012 __slots__ = ['m'] 00013 _slot_types = ['float64[]'] 00014 00015 def __init__(self, *args, **kwds): 00016 """ 00017 Constructor. Any message fields that are implicitly/explicitly 00018 set to None will be assigned a default value. The recommend 00019 use is keyword arguments as this is more robust to future message 00020 changes. You cannot mix in-order arguments and keyword arguments. 00021 00022 The available fields are: 00023 m 00024 00025 @param args: complete set of field values, in .msg order 00026 @param kwds: use keyword arguments corresponding to message field names 00027 to set specific fields. 00028 """ 00029 if args or kwds: 00030 super(OdometryMatrix, self).__init__(*args, **kwds) 00031 #message fields cannot be None, assign default values for those that are 00032 if self.m is None: 00033 self.m = [] 00034 else: 00035 self.m = [] 00036 00037 def _get_types(self): 00038 """ 00039 internal API method 00040 """ 00041 return self._slot_types 00042 00043 def serialize(self, buff): 00044 """ 00045 serialize message into buffer 00046 @param buff: buffer 00047 @type buff: StringIO 00048 """ 00049 try: 00050 length = len(self.m) 00051 buff.write(_struct_I.pack(length)) 00052 pattern = '<%sd'%length 00053 buff.write(struct.pack(pattern, *self.m)) 00054 except struct.error as se: self._check_types(se) 00055 except TypeError as te: self._check_types(te) 00056 00057 def deserialize(self, str): 00058 """ 00059 unpack serialized message in str into this message instance 00060 @param str: byte array of serialized message 00061 @type str: str 00062 """ 00063 try: 00064 end = 0 00065 start = end 00066 end += 4 00067 (length,) = _struct_I.unpack(str[start:end]) 00068 pattern = '<%sd'%length 00069 start = end 00070 end += struct.calcsize(pattern) 00071 self.m = struct.unpack(pattern, str[start:end]) 00072 return self 00073 except struct.error as e: 00074 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00075 00076 00077 def serialize_numpy(self, buff, numpy): 00078 """ 00079 serialize message with numpy array types into buffer 00080 @param buff: buffer 00081 @type buff: StringIO 00082 @param numpy: numpy python module 00083 @type numpy module 00084 """ 00085 try: 00086 length = len(self.m) 00087 buff.write(_struct_I.pack(length)) 00088 pattern = '<%sd'%length 00089 buff.write(self.m.tostring()) 00090 except struct.error as se: self._check_types(se) 00091 except TypeError as te: self._check_types(te) 00092 00093 def deserialize_numpy(self, str, numpy): 00094 """ 00095 unpack serialized message in str into this message instance using numpy for array types 00096 @param str: byte array of serialized message 00097 @type str: str 00098 @param numpy: numpy python module 00099 @type numpy: module 00100 """ 00101 try: 00102 end = 0 00103 start = end 00104 end += 4 00105 (length,) = _struct_I.unpack(str[start:end]) 00106 pattern = '<%sd'%length 00107 start = end 00108 end += struct.calcsize(pattern) 00109 self.m = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00110 return self 00111 except struct.error as e: 00112 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00113 00114 _struct_I = roslib.message.struct_I