Skip to content

Commit

Permalink
Update GUI in pid tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-wieser committed Jan 21, 2016
1 parent 6fb0dae commit 15d68cd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions sw/gui/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .window import Window
6 changes: 4 additions & 2 deletions tests/pid_move_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from sw.hal import *
from sw.vision.window import Window
from sw.vision.window import Window as OldWindow
from sw.mapping import Mapper
from sw.gui import Window

import cv2

Expand All @@ -11,8 +12,9 @@
drive = RegulatedDrive(tamproxy)
arms = Arms(tamproxy)

w = Window("Control here")
w = OldWindow("Control here")
m = Mapper(drive.odometer)
w = Window(500, [m])

while True:
c = chr(cv2.waitKey(1) & 0xFF)
Expand Down
12 changes: 10 additions & 2 deletions tests/square_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from sw.hal import *
from sw.mapping import Mapper
from sw.gui import Window

import cv2
import numpy as np

from tamproxy import TAMProxy

Expand All @@ -10,13 +11,20 @@
drive = RegulatedDrive(tamproxy)

m = Mapper(drive.odometer)

w = Window(500, [m])
while True:
print 'A'
drive.turn_to(0)
drive.go_to([24,0])

print 'B'
drive.turn_to(np.pi * 0.5)
drive.go_to([24,24])

print 'C'
drive.turn_to(np.pi)
drive.go_to([0,24])

print 'D'
drive.turn_to(np.pi * 1.5)
drive.go_to([0,0])

0 comments on commit 15d68cd

Please sign in to comment.