コード例 #1
0
ファイル: tuner.py プロジェクト: bluecube/robomower2
        current = self.states[-1]
        if what == "P":
            new = _TunerState(current.kP + 1, current.kI, current.kD)
        if what == "I":
            new = _TunerState(current.kP, current.kI + 1, current.kD)
        if what == "D":
            new = _TunerState(current.kP, current.kI, current.kD + 1)
        self.states.append(new)
        self.upload_params()

    def undo(self):
        self.states.pop()
        self.upload_params()


r = robonet.RoboNet('/dev/ttyUSB1', 38400)

proxy = layer2.proxy.MultiInterfaceProxy(
    [(1, "drive", "src_avr/drive/drive.interface")],
    robonet.RoboNet('/dev/ttyUSB1', 38400))
tuner = Tuner(proxy.drive)

pygame.display.init()
pygame.joystick.init()
joystick = pygame.joystick.Joystick(0)

joystick.init()

#value = int(32 * joystick.get_axis(0))
value = 15
max_ticks = 0
コード例 #2
0
ファイル: test.py プロジェクト: bluecube/robomower2
#!/usr/bin/python3
from src_python import robonet
from src_python import layer2

proxy = layer2.proxy.MultiInterfaceProxy([(1, "minimal", "minimal.interface"),
                                          (2, "other", "other.interface")],
                                         robonet.RoboNet(
                                             '/dev/ttyUSB1', 38400), False)

print("command to reject")
try:
    proxy.other.test(1, 2)
except robonet.RoboNetException as e:
    print(str(e))

print("Checking again")
proxy.minimal.check_status()
print("ok")