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
4a4d146c
Commit
4a4d146c
authored
3 years ago
by
Zhiying Li
Browse files
Options
Downloads
Patches
Plain Diff
modify conditions in the keyboard code to make all function work
parent
ccd7cba1
Branches
Branches containing commit
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
+11
-11
11 additions, 11 deletions
Code/Control/Laptop_Code/main_keyboard.py
with
11 additions
and
11 deletions
Code/Control/Laptop_Code/main_keyboard.py
+
11
−
11
View file @
4a4d146c
...
@@ -8,9 +8,9 @@ from constants import *
...
@@ -8,9 +8,9 @@ from constants import *
from
ESP32_AT.imageTread_AT
import
get_AT_6DOF_info
from
ESP32_AT.imageTread_AT
import
get_AT_6DOF_info
global
ml
,
esp_cam_on
,
openmv_on
global
ml
,
esp_cam_on
,
openmv_on
ml
=
0
ml
=
1
esp_cam_on
=
1
esp_cam_on
=
1
openmv_on
=
0
openmv_on
=
1
seekVertDir
=
1
seekVertDir
=
1
AT_detected_time
=
time
.
time
()
AT_detected_time
=
time
.
time
()
if
ml
==
1
:
if
ml
==
1
:
...
@@ -33,7 +33,7 @@ def serial_port_in_v1(serial_port):
...
@@ -33,7 +33,7 @@ def serial_port_in_v1(serial_port):
# DEBUG Verbose
# DEBUG Verbose
print
(
"
initiating one round of serial in ...
"
)
print
(
"
initiating one round of serial in ...
"
)
for
i
in
range
(
7
):
for
i
in
range
(
8
):
line
=
serial_port
.
readline
()
line
=
serial_port
.
readline
()
val
=
int
(
line
.
decode
())
val
=
int
(
line
.
decode
())
...
@@ -51,10 +51,10 @@ def serial_port_in_v1(serial_port):
...
@@ -51,10 +51,10 @@ def serial_port_in_v1(serial_port):
rz
=
val
rz
=
val
elif
i
==
6
:
elif
i
==
6
:
LIDAR_dist1
=
val
LIDAR_dist1
=
val
#
elif i == 7:
elif
i
==
7
:
#
LIDAR_dist2 = val
LIDAR_dist2
=
val
LIDAR_dist2
=
0
#
LIDAR_dist2 = 0
line
=
serial_port
.
readline
()
line
=
serial_port
.
readline
()
debugM
=
line
.
decode
()
debugM
=
line
.
decode
()
...
@@ -435,7 +435,7 @@ def main_control(gbx, gby, gb_dist, tx, ty, tz, rx, ry, rz, LIDAR_dist1, LIDAR_d
...
@@ -435,7 +435,7 @@ def main_control(gbx, gby, gb_dist, tx, ty, tz, rx, ry, rz, LIDAR_dist1, LIDAR_d
ballCapture
=
0
ballCapture
=
0
# debug
# debug
ballCapture
=
1
#
ballCapture = 1
# goalDetect = 0
# goalDetect = 0
# ballDetect = 0
# ballDetect = 0
if
ballCapture
:
# Ball captured
if
ballCapture
:
# Ball captured
...
@@ -473,10 +473,10 @@ def auto_control(serial_port,gbx, gby, gb_dist, tx, ty, tz, rx, ry, rz, LIDAR_di
...
@@ -473,10 +473,10 @@ def auto_control(serial_port,gbx, gby, gb_dist, tx, ty, tz, rx, ry, rz, LIDAR_di
if
esp_cam_on
==
1
:
if
esp_cam_on
==
1
:
url
=
'
http://1
92.168.0.204
/cam-hi.jpg
'
url
=
'
http://1
0.0.0.3
/cam-hi.jpg
'
tid
,
tx
,
ty
,
tz
,
rx
,
ry
,
rz
=
get_AT_6DOF_info
(
url
)
tid
,
tx
,
ty
,
tz
,
rx
,
ry
,
rz
=
get_AT_6DOF_info
(
url
)
LIDAR_dist1
=
0
#
LIDAR_dist1 = 0
LIDAR_dist2
=
0
#
LIDAR_dist2 = 0
debugM
=
"
using two esp32 cam
"
debugM
=
"
using two esp32 cam
"
...
@@ -673,7 +673,7 @@ def test_function1():
...
@@ -673,7 +673,7 @@ def test_function1():
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
# =========== SET UP ============
# =========== SET UP ============
# Defining Variables for ESP 32 Serial I/O
# Defining Variables for ESP 32 Serial I/O
PORT
=
"
COM
9
"
# for Alienware
PORT
=
"
COM
6
"
# for Alienware
serial_port
=
serial
.
Serial
(
PORT
,
115200
)
serial_port
=
serial
.
Serial
(
PORT
,
115200
)
serial_port
.
close
()
serial_port
.
close
()
serial_port
.
open
()
serial_port
.
open
()
...
...
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