Beispiel #1
0
def test_ptu():
    ptu = PTU("10.5.1.2", 4000)
    ptu.connect()
    print(1)
    ptu.slew_to_angle((0, 0))
    print(2)
    print(ptu.get_angle())
    time.sleep(3)
    print(3)
    ptu.slew_to_angle((10, 10))
    print(4)
    print(ptu.get_angle())
Beispiel #2
0
        kd = 3 * Ku * Tu / 40
    elif mode == "noovershoot":
        print("No Over Shoot")
        # No overshoot
        kp = Ku / 5
        ki = (2 / 5) * Ku / Tu
        kd = Ku * Tu / 15
    else:
        print("invaild mdoe")

    print("kp: ", kp, "ki: ", ki, "kd: ", kd)
    return [kp, ki, kd]


x = PTU("192.168.1.110", 4000, debug=False)
x.connect()

# x.reset()
# x.wait()

x.set_speed_mode()
x.wait()

# set upper speed limit
x.pan_speed_max(11448)
x.wait()

# # read accel
# x.pan_accel()
# x.wait()
Beispiel #3
0
from flir_ptu.ptu import PTU
import logging


logger = logging.getLogger()
handler = logging.StreamHandler()
formatter = logging.Formatter('%(levelname)s:%(name)s:- %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)

logger.setLevel(logging.DEBUG)

x = PTU("129.219.136.149", 4000)
x.connect()

value = 3

if value == 1:
    x.pan(25)
    print(x.pan())
elif value == 2:
    x.pan_angle(45)
    print(x.pan())
elif value == 3:
    x.pan_offset(-10)
    print("XX", x.pan())

x.stream.close()