コード例 #1
0
def resetPan(self, cs):
    """
    """
    print(PAN_RESET)
    result = subprocess.Popen([UVCDYNCTRL_LOC, "-s", TILT_REL, "3"],
                              stdout=subprocess.PIPE)
    cs.pan = 0
    if (self.debug):
        printProcessResult("Resetting Pan", result)
コード例 #2
0
def resetTilt(self, cs):
    """
    """
    print(TILT_RESET)
    result = subprocess.Popen([UVCDYNCTRL_LOC, "-s", TILT_RESET, "0"],
                              stdout=subprocess.PIPE)
    cs.tilt = 0
    if (self.debug):
        printProcessResult("Resetting Tilt", result)
コード例 #3
0
def panRightRelative(self, camState, amount):
    """ Pans the camera right.
    """
    amt = amount * -1
    if (camState.pan - amount) <= PAN_RIGHT_MAX:
        amt = (camState.pan - amount) - PAN_RIGHT_MAX
        camState.pan = PAN_RIGHT_MAX
    else:
        camState.pan = camState.pan + amount

    result = subprocess.Popen([UVCDYNCTRL_LOC, "-s", PAN_REL, "--",
                               str(amt)],
                              stdout=subprocess.PIPE)
    if (self.debug):
        printProcessResult("Panning right", result)
コード例 #4
0
def panLeftRelative(self, camState, amount):
    """ Pans the camera left.
    """
    amt = amount
    if (camState.pan + amount) >= PAN_LEFT_MAX:
        amt = (camState.pan + amount) - PAN_LEFT_MAX
        camState.pan = PAN_LEFT_MAX
    else:
        camState.pan = camState.pan + amount

    result = subprocess.Popen([UVCDYNCTRL_LOC, "-s", PAN_REL, "--",
                               str(amt)],
                              stdout=subprocess.PIPE)
    if (self.debug):
        printProcessResult("Panning left", result)
コード例 #5
0
def tiltUpRelative(self, camState, amount):
    """ Tilts the camera up.
    """
    amt = amount * -1
    if (camState.tilt - amount) <= TILT_UP_MAX:
        amt = (camState.tilt - amount) - TILT_UP_MAX
        camState.tilt = TILT_UP_MAX
    else:
        camState.tilt = camState.tilt - amount

    result = subprocess.Popen([UVCDYNCTRL_LOC, "-s", TILT_REL, "--",
                               str(amt)],
                              stdout=subprocess.PIPE)
    if (self.debug):
        printProcessResult("Tilting up", result)
コード例 #6
0
def tiltDownRelative(self, camState, amount):
    """ Tilts the camera down.
    """
    amt = amount
    if (camState.tilt + amount) >= TILT_DOWN_MAX:
        amt = (camState.tilt + amount) - TILT_DOWN_MAX
        camState.tilt = TILT_DOWN_MAX
    else:
        camState.tilt = camState.tilt + amount

    result = subprocess.Popen([UVCDYNCTRL_LOC, "-s", TILT_REL, "--",
                               str(amt)],
                              stdout=subprocess.PIPE)

    if (self.debug):
        printProcessResult("Tilting down", result)
コード例 #7
0
def ledMode(self, cs, option):
    """ Sets the mode of the LED on the camera.
    
        Parameters:
            cs - the current CamState object for this camera.
            option - the LED Mode to set the LED to.  Valid options are 
                     "0", "1", "2" or "3" meaning OFF, ON, BLINK or AUTO
                     respectively.
    """
    if (option != LED_ON and option != LED_OFF and option != LED_BLINK
            and option != LED_AUTO):
        raise ValueError(
            "Parameter 'option' must between 0 and 3.  Value was:  " +
            str(option))

    result = subprocess.Popen([UVCDYNCTRL_LOC, "-s", "LED1 Mode",
                               str(option)],
                              stdout=subprocess.PIPE)
    cs.ledState = option
    if (self.debug):
        printProcessResult("Setting LED mode", result)