@@ -0,0 +1,985 @@
+import unittest%0Aimport time%0Aimport threading%0Aimport socket%0A%0Aimport json%0A%0Afrom robotd.master import MasterProcess%0A%0A%0Aclass TestVision(unittest.TestCase):%0A    def setUp(self):%0A        self.robotd = MasterProcess('/tmp/')%0A        self.run = True%0A        self.thread = threading.Thread(target=self.bg_thread)%0A        self.thread.start()%0A        time.sleep(0.5)%0A%0A    def bg_thread(self):%0A        while self.run:%0A            self.robotd.tick()%0A            time.sleep(1)%0A%0A    def test_vision_lag(self):%0A        # We're assuming you have a camera plugged in%0A        sock = socket.socket(socket.AF_UNIX, socket.SOCK_SEQPACKET)%0A        sock.connect(%22/tmp/robotd/camera/video0%22)%0A        while True:%0A            response = sock.recv(2048)%0A            print(%22i%22, json.loads(response.decode(%22utf-8%22)))%0A%0A    def tearDown(self):%0A        self.run = False%0A        self.robotd.cleanup()%0A%0A%0Aif __name__ == %22__main__%22:%0A    print(%22For these tests we assume you have a webcam plugged in.%22)%0A    unittest.main()%0A

add latency test for vision