openLoopMotorRequest.py
Go to the documentation of this file.
00001 __author__ = 'tom1231'
00002 import struct
00003 from BAL.Header.RiCHeader import RiCHeader
00004 from BAL.Handlers.incomingHandler import OPEN_LOOP_REQ
00005 
00006 MSG_LEN = 11
00007 
00008 class OpenLoopMotorRequest(RiCHeader):
00009     def __init__(self, motorNum, speed):
00010         RiCHeader.__init__(self)
00011         self._id = OPEN_LOOP_REQ
00012         self._length = MSG_LEN
00013         self._des = 0x1001
00014         self._checkSum = 0
00015         self._motorNum = motorNum
00016         self._speed = speed
00017 
00018         self._checkSum = self.calCheckSum(self.dataTosend())
00019 
00020     def dataTosend(self):
00021         return RiCHeader.dataTosend(self) \
00022                + struct.pack('<B', self._motorNum) \
00023                + struct.pack('<f', self._speed)
00024 


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