Esempio n. 1
0
    def __init__(self, params, servoNum, output):
        Device.__init__(self, params.getServoName(servoNum), output)
        self._servoNum = servoNum
        self._pub = Publisher('%s/Position' % self._name, Float32, queue_size=params.getServoPublishHz(servoNum))
        Subscriber('%s/command' % self._name, Float32, self.servoCallBack)

        self._haveRightToPublish = False
Esempio n. 2
0
 def __init__(self, param, output):
     Device.__init__(self, param.getIMUName(), output)
     self._frameId = param.getIMUFrameId()
     self._angle = param.getIMUOrientation()
     self._pub = Publisher("%s_AGQ" % self._name, Imu, queue_size=param.getIMUPubHz())
     self._pubMag = Publisher("%s_M" % self._name, MagneticField, queue_size=param.getIMUPubHz())
     Service("%s_Calibration" % self._name, calibIMU, self.serviceCallBack)
     self._haveRightToPublish = False
Esempio n. 3
0
 def __init__(self, param, output):
     Device.__init__(self, param.getGpsName(), output)
     self._frameId = param.getGpsFrameId()
     self._pub = Publisher('%s' % self._name, NavSatFix, queue_size=param.getGpsPubHz())
     self._haveRightToPublish = False
     self._old_fix = 0
     self._wd = int(round(time.time() * 1000))
     KeepAliveHandler(self._name, NavSatFix)
Esempio n. 4
0
 def __init__(self, params, servoNum, output):
     Device.__init__(self, params.getServoName(servoNum), output)
     self._servoNum = servoNum
     self._pub = Publisher('%s/Position' % self._name,
                           Float32,
                           queue_size=params.getServoPublishHz(servoNum))
     Subscriber('%s/command' % self._name, Float32, self.servoCallBack)
     #KeepAliveHandler('%s/Position' % self._name, Float32)
     self._haveRightToPublish = False
Esempio n. 5
0
 def __init__(self, param, motorL, motorR):
     Device.__init__(self, param.getCloseDiffName(), None)
     self._maxAng = param.getCloseDiffMaxAng()
     self._rWheel = param.getCloseDiffRWheel()
     self._width = param.getCloseDiffWidth()
     self._maxLin = param.getCloseDiffMaxLin()
     self._motorL = motorL
     self._motorR = motorR
     Subscriber('%s/command' % self._name, Twist, self.diffCallback)
Esempio n. 6
0
    def __init__(self, devId, param, output):
        Device.__init__(self, param.getURFName(devId), output)
        self._urfType = param.getURFType(devId)
        self._frameId = param.getURFFrameId(devId)
        self._pub = Publisher('%s' % self._name, Range, queue_size=param.getURFPubHz(devId))
        #KeepAliveHandler(self._name, Range)
        self._devId = devId

        self._haveRightToPublish = False
Esempio n. 7
0
 def __init__(self, param, motorL, motorR):
     Device.__init__(self, param.getCloseDiffName(), None)
     self._maxAng = param.getCloseDiffMaxAng()
     self._rWheel = param.getCloseDiffRWheel()
     self._width = param.getCloseDiffWidth()
     self._maxLin = param.getCloseDiffMaxLin()
     self._motorL = motorL
     self._motorR = motorR
     Subscriber('%s/command' % self._name, Twist, self.diffCallback)
Esempio n. 8
0
 def __init__(self, param, output):
     Device.__init__(self, param.getCloseDiffName(), output)
     self._baseLink = param.getCloseDiffBaseLink()
     self._odom = param.getCloseDiffOdom()
     self._maxAng = param.getCloseDiffMaxAng()
     self._maxLin = param.getCloseDiffMaxLin()
     self._pub = Publisher("%s/odometry" % self._name, Odometry, queue_size=param.getCloseDiffPubHz())
     self._broadCase = TransformBroadcaster()
     Subscriber('%s/command' % self._name, Twist, self.diffServiceCallback, queue_size=1)
     Service('%s/setOdometry' % self._name, set_odom, self.setOdom)
Esempio n. 9
0
 def __init__(self, param, output):
     Device.__init__(self, param.getGpsName(), output)
     self._frameId = param.getGpsFrameId()
     self._pub = Publisher('%s' % self._name,
                           NavSatFix,
                           queue_size=param.getGpsPubHz())
     self._haveRightToPublish = False
     self._old_fix = 0
     self._wd = int(round(time.time() * 1000))
     KeepAliveHandler(self._name, NavSatFix)
Esempio n. 10
0
    def __init__(self, motorNum ,param,output):
        Device.__init__(self, param.getCloseLoopMotorName(motorNum), output)
        self._motorId = motorNum

        self._kp = param.getCloseLoopMotorKp(motorNum)
        self._ki = param.getCloseLoopMotorKi(motorNum)
        self._kd = param.getCloseLoopMotorKd(motorNum)

        self._pub = Publisher('%s/feedback' % self._name, Motor, queue_size=param.getCloseLoopMotorPubHz(motorNum))
        Subscriber('%s/command' % self._name, Float32, self.MotorCallback, queue_size=1)
        self._haveRightToPublish = False
Esempio n. 11
0
    def __init__(self, devId, param, output):
        Device.__init__(self, param.getURFName(devId), output)
        self._urfType = param.getURFType(devId)
        self._frameId = param.getURFFrameId(devId)
        self._pub = Publisher('%s' % self._name,
                              Range,
                              queue_size=param.getURFPubHz(devId))
        #KeepAliveHandler(self._name, Range)
        self._devId = devId

        self._haveRightToPublish = False
Esempio n. 12
0
    def __init__(self, param, output):
        """

        :param param:
        :type param: RiCParam
        :param output:
        :return:
        """
        Device.__init__(self, param.getBatteryName(), output)
        self._pub = Publisher('%s' % self._name, Battery, queue_size=param.getBatteryPubHz())
        self._haveRightToPublish = False

        self._min = param.getBatteryMin()
        self._max = param.getBatteryMax()
Esempio n. 13
0
    def __init__(self, param, output):
        """

        :param param:
        :type param: RiCParam
        :param output:
        :return:
        """
        Device.__init__(self, param.getBatteryName(), output)
        self._pub = Publisher('%s' % self._name,
                              Battery,
                              queue_size=param.getBatteryPubHz())
        self._haveRightToPublish = False

        self._min = param.getBatteryMin()
        self._max = param.getBatteryMax()
Esempio n. 14
0
 def __init__(self, param, output):
     Device.__init__(self, param.getIMUName(), output)
     self._frameId = param.getIMUFrameId()
     self._angle = param.getIMUOrientation()
     self._pub = Publisher('%s_AGQ' % self._name, Imu, queue_size=param.getIMUPubHz())
     self._pubMag = Publisher('%s_M' % self._name, MagneticField, queue_size=param.getIMUPubHz())
     self._pubCalib = Publisher('/imu_calib_publisher', imuCalib, queue_size=param.getIMUPubHz())
     Service('/imu_Calibration', calibIMU, self.serviceCallBack)
     self._haveRightToPublish = False
     self._calib = False
     self._xMax = 0.0
     self._yMax = 0.0
     self._zMax = 0.0
     self._xMin = 0.0
     self._yMin = 0.0
     self._zMin = 0.0
Esempio n. 15
0
    def __init__(self, motorNum, param, output):
        Device.__init__(self, param.getCloseLoopMotorName(motorNum), output)
        self._motorId = motorNum

        self._kp = param.getCloseLoopMotorKp(motorNum)
        self._ki = param.getCloseLoopMotorKi(motorNum)
        self._kd = param.getCloseLoopMotorKd(motorNum)

        self._pub = Publisher(
            '%s/feedback' % self._name,
            Motor,
            queue_size=param.getCloseLoopMotorPubHz(motorNum))
        Subscriber('%s/command' % self._name,
                   Float32,
                   self.MotorCallback,
                   queue_size=1)
        self._haveRightToPublish = False
Esempio n. 16
0
 def __init__(self, param, output):
     Device.__init__(self, param.getCloseDiffName(), output)
     self._baseLink = param.getCloseDiffBaseLink()
     self._odom = param.getCloseDiffOdom()
     self._maxAng = param.getCloseDiffMaxAng()
     self._maxLin = param.getCloseDiffMaxLin()
     self._pub = Publisher("%s/odometry" % self._name,
                           Odometry,
                           queue_size=param.getCloseDiffPubHz())
     self._broadCase = TransformBroadcaster()
     Subscriber('%s/command' % self._name,
                Twist,
                self.diffServiceCallback,
                queue_size=1)
     Service('%s/setOdometry' % self._name, set_odom, self.setOdom)
     self._haveRightToPublish = False
     self._prevOdom = None
     self._firstTimePub = True
Esempio n. 17
0
 def __init__(self, param, output):
     Device.__init__(self, param.getIMUName(), output)
     self._frameId = param.getIMUFrameId()
     self._angle = param.getIMUOrientation()
     self._pub = Publisher('%s_AGQ' % self._name,
                           Imu,
                           queue_size=param.getIMUPubHz())
     self._pubMag = Publisher('%s_M' % self._name,
                              MagneticField,
                              queue_size=param.getIMUPubHz())
     self._pubCalib = Publisher('/imu_calib_publisher',
                                imuCalib,
                                queue_size=param.getIMUPubHz())
     Service('/imu_Calibration', calibIMU, self.serviceCallBack)
     self._haveRightToPublish = False
     self._calib = False
     self._xMax = 0.0
     self._yMax = 0.0
     self._zMax = 0.0
     self._xMin = 0.0
     self._yMin = 0.0
     self._zMin = 0.0
Esempio n. 18
0
 def __init__(self, devId,param, output):
     Device.__init__(self, param.getSwitchName(devId), output)
     self._pub = Publisher('%s' % self._name, Bool, queue_size=param.getSwitchPubHz(devId))
     self._switchId = devId
     self._haveRightToPublish = False
Esempio n. 19
0
 def __init__(self, param, output):
     Device.__init__(self, param.getPPMName(), output)
     self._pub = Publisher('%s' % self._name, PPM, queue_size=param.getPPMPubHz())
     self._haveRightToPublish = False
Esempio n. 20
0
 def __init__(self, param):
     Device.__init__(self, param.getPPMName(), None)
     self._pub = Publisher('%s' % self._name, PPM, queue_size=param.getPPMPubHz())
Esempio n. 21
0
 def __init__(self, param):
     Device.__init__(self, param.getBatteryName(), None)
     self._pub = Publisher('%s' % self._name, Float32, queue_size=param.getBatteryPubHz())
Esempio n. 22
0
 def __init__(self, motorId, param, output):
     Device.__init__(self, param.getOpenLoopName(motorId), output)
     self._id = motorId
     self._direction = param.getOpenLoopDirection(motorId)
     Subscriber('%s/command' % self._name, Float32, self.openLoopCallback)
Esempio n. 23
0
 def __init__(self, devId, param):
     Device.__init__(self, param.getURFName(devId), None)
     self._urfType = param.getURFType(devId)
     self._frameId = param.getURFFrameId(devId)
     self._pub = Publisher('%s' % self._name, Range, queue_size=param.getURFPubHz(devId))
Esempio n. 24
0
 def __init__(self, param, output):
     Device.__init__(self, param.getGpsName(), output)
     self._frameId = param.getGpsFrameId()
     self._pub = Publisher('%s' % self._name, NavSatFix, queue_size=param.getGpsPubHz())
     self._haveRightToPublish = False
Esempio n. 25
0
 def __init__(self,param ,output):
     Device.__init__(self, param.getIMUName(), output)
     self._frameId = param.getIMUFrameId()
     self._pub = Publisher('%s_AGQ' % self._name, Imu, queue_size=param.getIMUPubHz())
     self._pubMag = Publisher('%s_M' % self._name, MagneticField, queue_size=param.getIMUPubHz())
Esempio n. 26
0
 def __init__(self, param, output):
     Device.__init__(self, param.getPPMName(), output)
     self._pub = Publisher('%s' % self._name, PPM, queue_size=param.getPPMPubHz())
     self._haveRightToPublish = False
Esempio n. 27
0
 def __init__(self, param, output):
     Device.__init__(self, param.getBatteryName(), output)
     self._pub = Publisher('%s' % self._name, Float32, queue_size=param.getBatteryPubHz())
     self._haveRightToPublish = False
Esempio n. 28
0
 def __init__(self, motorId,param, output):
     Device.__init__(self, param.getOpenLoopName(motorId), output)
     self._id = motorId
     self._direction = param.getOpenLoopDirection(motorId)
     Subscriber('%s/command' % self._name, Float32, self.openLoopCallback)
Esempio n. 29
0
 def __init__(self, motorNum ,param,output):
     Device.__init__(self, param.getCloseLoopMotorName(motorNum), output)
     self._motorId = motorNum
     self._pub = Publisher('%s/feedback' % self._name, Motor, queue_size=param.getCloseLoopMotorPubHz(motorNum))
     Subscriber('%s/command' % self._name, Float32, self.MotorCallback)
Esempio n. 30
0
 def __init__(self, param, relayNum, output):
     Device.__init__(self, param.getRelayName(relayNum), output)
     self._relayNum = relayNum
     Service('%s/setRelay' % self._name, Relay, self.setRelayCallBack)
Esempio n. 31
0
 def __init__(self, param, relayNum, output):
     Device.__init__(self, param.getRelayName(relayNum), output)
     self._relayNum = relayNum
     Service('%s/setRelay' % self._name, Relay, self.setRelayCallBack)
Esempio n. 32
0
 def __init__(self, devId,param, output):
     Device.__init__(self, param.getSwitchName(devId), output)
     self._pub = Publisher('%s' % self._name, Bool, queue_size=param.getSwitchPubHz(devId))
     self._switchId = devId
     self._haveRightToPublish = False
Esempio n. 33
0
 def __init__(self, devId,param):
     Device.__init__(self, param.getSwitchName(devId), None)
     self._pub = Publisher('%s' % self._name, Bool, queue_size=param.getSwitchPubHz(devId))