You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1003 B
28 lines
1003 B
from TelloModule import TelloModule
|
|
import time
|
|
|
|
mod = TelloModule()
|
|
|
|
print ("\n -------- Test blocking mode --------- \n")
|
|
for i in range(10):
|
|
line = mod.get_block_dist()
|
|
print ("Test " + str(i) +
|
|
" count = " + str(line[0]) +
|
|
" forward = " + str(line[1]) +
|
|
" right = " + str(line[2]) +
|
|
" back = " + str(line[3]) +
|
|
" left = " + str(line[4]) +
|
|
" light = " + str(line[5]))
|
|
print ("\n ------ Test NON Blocking mode ------- \n")
|
|
mod.module_init('distance')
|
|
for i in range(10):
|
|
print ("Test " + str(i) +
|
|
" count = " + str(mod.get_count()) +
|
|
" forward = " + str(mod.get_forward_dist()) +
|
|
" right = " + str(mod.get_right_dist()) +
|
|
" back = " + str(mod.get_back_dist()) +
|
|
" left = " + str(mod.get_left_dist()) +
|
|
" light = " + str(mod.get_light()))
|
|
time.sleep(0.5)
|
|
mod.module_deinit()
|
|
print ("\n ------------ Finish Test ------------ \n") |