Esempio n. 1
0
    def __init__(self, type, devId, param):
        ParamBuildResponse.__init__(self, type, devId, param.getURFPubHz(devId))
        self._length = RES_LEN
        self._checkSum = 0
        self._portNum = param.getURFPort(devId)

        self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 2
0
    def __init__(self, param):
        ParamBuildResponse.__init__(self, GPS, 0, param.getGpsPubHz())
        self._length = MSG_LEN
        self._checkSum = 0
        self._baudrate = param.getGpsBaudrate()

        self._checkSum = self.calCheckSum(self.dataTosend())
 def __init__(self, devId, param, type):
     ParamBuildResponse.__init__(self, type, devId, param.getCloseLoopMotorPubHz(devId))
     self._length = RES_LEN
     self._LPFHz = param.getCloseLoopMotorLPFHz(devId)
     self._LPFAlpha = param.getCloseLoopMotorLPFAlpha(devId)
     self._driverAddress = param.getCloseLoopMotorDriverAddress(devId)
     self._channel = param.getCloseLoopMotorChannel(devId)
     self._PIDHz = param.getCloseLoopMotorPIDHz(devId)
     self._KP = param.getCloseLoopMotorKp(devId)
     self._KI = param.getCloseLoopMotorKi(devId)
     self._KD = param.getCloseLoopMotorKd(devId)
     self._maxSpeed = param.getCloseLoopMotorMaxSpeed(devId)
     self._CPR = param.getCloseLoopMotorCpr(devId)
     self._timeout = param.getCloseLoopMotorTimeout(devId)
     self._timeout = param.getCloseLoopMotorTimeout(devId)
     self._limit = param.getCloseLoopMotorIntegralLimit(devId)
     port = param.getCloseLoopMotorEncoderPort(devId)
     if port == EN_PORT1:
         self._encoderPinA = 20
         self._encoderPinB = 21
     elif port == EN_PORT2:
         self._encoderPinA = 22
         self._encoderPinB = 23
     elif port == EN_PORT3:
         self._encoderPinA = 27
         self._encoderPinB = 28
     elif port == EN_PORT4:
         self._encoderPinA = 29
         self._encoderPinB = 30
     self._motorType = param.getCloseLoopMotorType(devId)
     self._motorDirection = param.getCloseLoopMotorDirection(devId)
     self._motorDirectionE = param.getCloseLoopMotorDirectionEncoder(devId)
     if param.getCloseLoopMotorEncoderType(devId) == 1:
         self._checkSum = 0
         self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 4
0
    def __init__(self, param):
        ParamBuildResponse.__init__(self, Battery, 0, param.getBatteryPubHz())
        self._length = MSG_LEN
        self._checkSum = 0
        self._voltageDividerRatio = param.getBatteryVoltageDividerRatio()

        self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 5
0
    def __init__(self, param):
        ParamBuildResponse.__init__(self, Battery, 0, param.getBatteryPubHz())
        self._length = MSG_LEN
        self._checkSum = 0
        self._voltageDividerRatio = param.getBatteryVoltageDividerRatio()

        self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 6
0
    def __init__(self, param):
        ParamBuildResponse.__init__(self, GPS, 0, param.getGpsPubHz())
        self._length = MSG_LEN
        self._checkSum = 0
        self._baudrate = param.getGpsBaudrate()

        self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 7
0
    def __init__(self, devId, param):
        ParamBuildResponse.__init__(self, Button, devId, param.getSwitchPubHz(devId))
        self._length = RES_LEN
        self._checkSum = 0
        self._port = param.getSwitchPort(devId)

        self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 8
0
    def __init__(self, devId, param):
        ParamBuildResponse.__init__(self, Rely, devId, 0)
        self._length = MSG_LEN
        self._checkSum = 0

        self._port = param.getRelayPort(devId)

        self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 9
0
    def __init__(self, devId, param):
        ParamBuildResponse.__init__(self, Button, devId,
                                    param.getSwitchPubHz(devId))
        self._length = RES_LEN
        self._checkSum = 0
        self._port = param.getSwitchPort(devId)

        self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 10
0
    def __init__(self, devId , param):
        ParamBuildResponse.__init__(self, Rely, devId, 0)
        self._length = MSG_LEN
        self._checkSum = 0

        self._port = param.getRelayPort(devId)

        self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 11
0
    def __init__(self, param):
        ParamBuildResponse.__init__(self, IMU, 0, param.getIMUPubHz())
        self._length = RES_LEN
        self._checkSum = 0

        self._camp = param.getIMUCamp()
        self._fusionHz = param.getIMUFusionHz()

        self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 12
0
    def __init__(self, switchNum, param):
        ParamBuildResponse.__init__(self, EmergencySwitch, switchNum, 0)
        self._length = MSG_LEN
        self._checkSum = 0

        self._listenToPin = param.getEmergencyPin(switchNum)
        self._status = param.getEmergencyState(switchNum)

        self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 13
0
    def __init__(self, param):
        ParamBuildResponse.__init__(self, IMU, 0, param.getIMUPubHz())
        self._length = RES_LEN
        self._checkSum = 0

        self._camp = param.getIMUCamp()
        self._fusionHz = param.getIMUFusionHz()
        self._enableFuseGyro = param.isIMUFuseGyro()

        self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 14
0
 def __init__(self, devId, param):
     ParamBuildResponse.__init__(self, DiffDriverCL, devId, param.getCloseDiffPubHz())
     self._length = MSG_LEN
     self._checkSum = 0
     self._rWheel = param.getCloseDiffRWheel()
     self._width = param.getCloseDiffWidth()
     self._motorL = param.getCloseDiffMotorL()
     self._motorR = param.getCloseDiffMotorR()
     self._slip = param.getCloseDiffSlip()
     self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 15
0
    def __init__(self, devId, param):
        ParamBuildResponse.__init__(self, EngineOL, devId, 0)
        self._length = MSG_LEN
        self._checkSum = 0
        self._address = param.getOpenLoopAddress(devId)
        self._channel = param.getOpenLoopChannel(devId)
        self._timeout = param.getOpenLoopTimeout(devId)
        self._max = param.getOpenLoopMax(devId)

        self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 16
0
 def __init__(self, devId, param):
     ParamBuildResponse.__init__(self, DiffDriverCL, devId,
                                 param.getCloseDiffPubHz())
     self._length = MSG_LEN
     self._checkSum = 0
     self._rWheel = param.getCloseDiffRWheel()
     self._width = param.getCloseDiffWidth()
     self._motorL = param.getCloseDiffMotorL()
     self._motorR = param.getCloseDiffMotorR()
     self._slip = param.getCloseDiffSlip()
     self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 17
0
    def __init__(self, devId, param):
        ParamBuildResponse.__init__(self, SERVO, devId, param.getServoPublishHz(devId))
        self._length = SERVO_LEN_MSG
        self._port = param.getServoPort(devId)
        self._min = param.getServoMin(devId)
        self._max = param.getServoMax(devId)
        self._a = param.getServoAParameter(devId)
        self._b = param.getServoBParameter(devId)
        self._initPos = param.getServoInitMove(devId)

        self._checkSum = 0
        self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 18
0
    def __init__(self, devId, param):
        ParamBuildResponse.__init__(self, SERVO, devId, param.getServoPublishHz(devId))
        self._length = SERVO_LEN_MSG
        self._port = param.getServoPort(devId)
        self._min = param.getServoMin(devId)
        self._max = param.getServoMax(devId)
        self._a = param.getServoAParameter(devId)
        self._b = param.getServoBParameter(devId)
        self._initPos = param.getServoInitMove(devId)

        self._checkSum = 0
        self._checkSum = self.calCheckSum(self.dataTosend())
 def __init__(self, devId, param, type):
     ParamBuildResponse.__init__(self, type, devId,
                                 param.getCloseLoopMotorPubHz(devId))
     self._length = RES_LEN
     self._LPFHz = param.getCloseLoopMotorLPFHz(devId)
     self._LPFAlpha = param.getCloseLoopMotorLPFAlpha(devId)
     self._driverAddress = param.getCloseLoopMotorDriverAddress(devId)
     self._channel = param.getCloseLoopMotorChannel(devId)
     self._PIDHz = param.getCloseLoopMotorPIDHz(devId)
     self._KP = param.getCloseLoopMotorKp(devId)
     self._KI = param.getCloseLoopMotorKi(devId)
     self._KD = param.getCloseLoopMotorKd(devId)
     self._maxSpeed = param.getCloseLoopMotorMaxSpeed(devId)
     self._CPR = param.getCloseLoopMotorCpr(devId)
     self._timeout = param.getCloseLoopMotorTimeout(devId)
     self._timeout = param.getCloseLoopMotorTimeout(devId)
     self._limit = param.getCloseLoopMotorIntegralLimit(devId)
     port = param.getCloseLoopMotorEncoderPort(devId)
     if port == EN_PORT1:
         self._encoderPinA = 20
         self._encoderPinB = 21
     elif port == EN_PORT2:
         self._encoderPinA = 22
         self._encoderPinB = 23
     elif port == EN_PORT3:
         self._encoderPinA = 27
         self._encoderPinB = 28
     elif port == EN_PORT4:
         self._encoderPinA = 29
         self._encoderPinB = 30
     self._motorType = param.getCloseLoopMotorType(devId)
     self._motorDirection = param.getCloseLoopMotorDirection(devId)
     self._motorDirectionE = param.getCloseLoopMotorDirectionEncoder(devId)
     if param.getCloseLoopMotorEncoderType(devId) == 1:
         self._checkSum = 0
         self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 20
0
 def __init__(self, param):
     ParamBuildResponse.__init__(self, PPM, 0, param.getPPMPubHz())
     self._length = MSG_LEN
     self._checkSum = 0
     self._checkSum = self.calCheckSum(self.dataTosend())
Esempio n. 21
0
 def __init__(self, param):
     ParamBuildResponse.__init__(self, PPM, 0, param.getPPMPubHz())
     self._length = MSG_LEN
     self._checkSum = 0
     self._checkSum = self.calCheckSum(self.dataTosend())