imuCalibResponse.py
Go to the documentation of this file.
00001 from BAL.Header.RiCHeader import RiCHeader
00002 
00003 __author__ = 'tom'
00004 import struct
00005 
00006 X = 10
00007 Y = 14
00008 Z = 18
00009 
00010 
00011 
00012 
00013 class ImuCalibResponse(RiCHeader):
00014     def __init__(self):
00015         RiCHeader.__init__(self)
00016         self._x = 0.0
00017         self._y = 0.0
00018         self._z = 0.0
00019 
00020 
00021     def getImuMsgId(self):
00022         return 1
00023 
00024 
00025     def buildRequest(self, data):
00026         RiCHeader.buildRequest(self, data)
00027         bytes = bytearray()
00028 
00029         while self.index < X:
00030             bytes.append(data[self.index])
00031             self.index += 1
00032 
00033         self._x = struct.unpack('<f', bytes)[0]
00034 
00035         bytes = bytearray()
00036 
00037         while self.index < Y:
00038             bytes.append(data[self.index])
00039             self.index += 1
00040 
00041         self._y = struct.unpack('<f', bytes)[0]
00042 
00043         bytes = bytearray()
00044 
00045         while self.index < Z:
00046             bytes.append(data[self.index])
00047             self.index += 1
00048 
00049         self._z = struct.unpack('<f', bytes)[0]
00050 
00051     def getValues(self):
00052 
00053         return (
00054             self._x,
00055             self._y,
00056             self._z,
00057         )


ric_board
Author(s): RoboTiCan
autogenerated on Fri Oct 27 2017 03:02:30