Skip to content
Snippets Groups Projects
Commit f37d20d5 authored by Zhaoliang Zheng's avatar Zhaoliang Zheng
Browse files

add esp32 cam apriltag function into test function

parent 6f4802d5
No related merge requests found
import time
import serial
import ball_detection.ball_detection as ball_detection
import simple_pid.PID as PID
import timeit
import pygame
from constants import *
from ESP32_AT.imageTread_AT import get_AT_6DOF_info
global ml
ml = 1
ml = 0
if ml == 1:
import ball_detection.ball_detection as ball_detection
# ========= Serial Port I/O ===========
def serial_port_in(serial_port):
......@@ -480,6 +484,16 @@ def decode_ctl(Ctl_com):
dir3 = Ctl_com[6]
dir4 = Ctl_com[7]
return pwm1, pwm2, pwm3, pwm4, dir1, dir2, dir3, dir4
def test_function():
url = 'http://192.168.1.118/cam-hi.jpg'
tid, tx, ty, tz, rx, ry, rz = get_AT_6DOF_info(url)
print("testing new function")
print("-----------------------")
print("tid:{}".format(tid))
print("tx,ty,tz:{},{},{}".format(tx,ty,tz))
print("rx,ry,rz:{},{},{}".format(rx,ry,rz))
# ===== Main Function =====
if __name__ == '__main__':
# =========== SET UP ============
......@@ -550,6 +564,12 @@ if __name__ == '__main__':
flag = 0
print_count = 1
elif get_key('t'):
flag = 4
while (flag == 4):
test_function()
flag, print_count = keyboard_stop(flag, print_count)
elif get_key('k'):
break
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment