Go to the documentation of this file.00001 __author__ = 'tom1231'
00002 from BAL.Header.RiCHeader import RiCHeader
00003 import struct
00004
00005 REQ_ID = 2
00006 REQ_LEN = 11
00007
00008 class ServoRequest(RiCHeader):
00009 def dataTosend(self):
00010 return RiCHeader.dataTosend(self)\
00011 + struct.pack('<B', self._servoId)\
00012 + struct.pack('<f', self._position)
00013
00014 def __init__(self, servoId, position):
00015 RiCHeader.__init__(self)
00016 self._id = REQ_ID
00017 self._des = 0x1001
00018 self._length = REQ_LEN
00019 self._servoId = servoId
00020 self._position = position
00021 self._checkSum = 0
00022 self._checkSum = self.calCheckSum(self.dataTosend())
00023
00024