Ejemplo 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
Ejemplo 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
Ejemplo 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)
Ejemplo 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
Ejemplo 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)
Ejemplo 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
Ejemplo 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)
Ejemplo 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)
Ejemplo 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)
Ejemplo 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
Ejemplo 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
Ejemplo 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()
Ejemplo 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()
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo n.º 20
0
 def __init__(self, param):
     Device.__init__(self, param.getPPMName(), None)
     self._pub = Publisher('%s' % self._name, PPM, queue_size=param.getPPMPubHz())
Ejemplo n.º 21
0
 def __init__(self, param):
     Device.__init__(self, param.getBatteryName(), None)
     self._pub = Publisher('%s' % self._name, Float32, queue_size=param.getBatteryPubHz())
Ejemplo 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)
Ejemplo 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))
Ejemplo 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
Ejemplo 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())
Ejemplo 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
Ejemplo 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
Ejemplo 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)
Ejemplo 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)
Ejemplo 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)
Ejemplo 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)
Ejemplo 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
Ejemplo 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))