Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
November 2021 Blimp Competition
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Shahrul Kamil bin Hassan
November 2021 Blimp Competition
Commits
f37d20d5
Commit
f37d20d5
authored
4 years ago
by
Zhaoliang Zheng
Browse files
Options
Downloads
Patches
Plain Diff
add esp32 cam apriltag function into test function
parent
6f4802d5
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Control/Laptop_Code/main_keyboard.py
+22
-2
22 additions, 2 deletions
Code/Control/Laptop_Code/main_keyboard.py
with
22 additions
and
2 deletions
Code/Control/Laptop_Code/main_keyboard.py
+
22
−
2
View file @
f37d20d5
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment