closeDiffParamResponse.py
Go to the documentation of this file.
00001 __author__ = 'tom1231'
00002 import struct
00003 from BAL.Header.Response.ParamBuildResponse import ParamBuildResponse, DiffDriverCL
00004 
00005 MSG_LEN = 34
00006 
00007 class CloseDiffParamResponse(ParamBuildResponse):
00008 
00009     def __init__(self, devId, param):
00010         ParamBuildResponse.__init__(self, DiffDriverCL, devId, param.getCloseDiffPubHz())
00011         self._length = MSG_LEN
00012         self._checkSum = 0
00013         self._rWheel = param.getCloseDiffRWheel()
00014         self._width = param.getCloseDiffWidth()
00015         self._motorL = param.getCloseDiffMotorL()
00016         self._motorR = param.getCloseDiffMotorR()
00017         self._slip = param.getCloseDiffSlip()
00018         self._checkSum = self.calCheckSum(self.dataTosend())
00019 
00020     def dataTosend(self):
00021         return ParamBuildResponse.dataTosend(self) \
00022                + struct.pack('<f', self._rWheel) \
00023                + struct.pack('<f', self._width) \
00024                + struct.pack('<i', self._motorL) \
00025                + struct.pack('<i', self._motorR) \
00026                + struct.pack('<f', self._slip)


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