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
74027172
Commit
74027172
authored
3 years ago
by
Zhiying Li
Browse files
Options
Downloads
Patches
Plain Diff
change variable name
parent
8bb273ad
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_joystick.py
+5
-5
5 additions, 5 deletions
Code/Control/Laptop_Code/main_joystick.py
with
5 additions
and
5 deletions
Code/Control/Laptop_Code/main_joystick.py
+
5
−
5
View file @
74027172
...
...
@@ -168,7 +168,7 @@ def auto_init(serial_port,auto_init_count,gbx, gby, gb_dist, tx, ty, tz, rx, ry,
def
auto_control
(
serial_port
):
# Ctl_com = [0, 0, 0, 0, "+", "+", "+", "+"]
if
ml
==
1
:
if
ml
_on
==
1
:
gbx
,
gby
,
gb_dist
=
ball_detection
.
detectLive
(
url_gb
,
model
,
minDetectionScore
,
showSight
=
True
)
print
(
"
gbx,gby:{},{}
"
.
format
(
gbx
,
gby
))
...
...
@@ -487,7 +487,7 @@ if __name__ == '__main__':
# =========== SET UP ============
# Defining Variables for ESP 32 Serial I/O
PORT
=
"
COM
11
"
# for Alienware
PORT
=
"
COM
9
"
# for Alienware
serial_port
=
serial
.
Serial
(
PORT
,
115200
)
serial_port
.
close
()
serial_port
.
open
()
...
...
@@ -517,13 +517,13 @@ if __name__ == '__main__':
done
=
False
# Loading the PyTorch ML model for ball detection
if
ml
==
1
:
if
ml
_on
==
1
:
ball_detection
.
modifyCore
()
model
=
ball_detection
.
returnModel
(
device
,
labelSet
,
modelLoc
,
modelFile
)
# =========== DECLARE VARIABLES ===========
# game controller id
controller_id
=
1
# default is 0 if you plug in only one game controller
controller_id
=
0
# default is 0 if you plug in only one game controller
# ESP CAM In
gbx
,
gby
=
-
1
,
-
1
# by default (-1 means no found green ball)
...
...
@@ -598,4 +598,4 @@ if __name__ == '__main__':
print_count
=
0
pygame
.
time
.
wait
(
100
)
pygame
.
quit
()
\ No newline at end of file
pygame
.
quit
()
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