IMUParamResponse.py
Go to the documentation of this file.
00001 __author__ = 'tom1231'
00002 import struct
00003 from BAL.Header.Response.ParamBuildResponse import ParamBuildResponse,IMU
00004 
00005 RES_LEN = 21 # -2
00006 
00007 class IMUParamResponse(ParamBuildResponse):
00008 
00009     def __init__(self, param):
00010         ParamBuildResponse.__init__(self, IMU, 0, param.getIMUPubHz())
00011         self._length = RES_LEN
00012         self._checkSum = 0
00013 
00014         self._camp = param.getIMUCamp()
00015         self._fusionHz = param.getIMUFusionHz()
00016         self._enableFuseGyro = param.isIMUFuseGyro()
00017 
00018         self._checkSum = self.calCheckSum(self.dataTosend())
00019 
00020     def dataTosend(self):
00021         return ParamBuildResponse.dataTosend(self)\
00022                + struct.pack('<f', self._camp) \
00023                + struct.pack('<H', self._fusionHz)\
00024                + struct.pack('<?', self._enableFuseGyro)
00025 
00026 


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