Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
blimp
Manage
Activity
Members
Labels
Plan
Issues
0
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
mehtank
blimp
Commits
81670905
Commit
81670905
authored
4 years ago
by
mehtank
Browse files
Options
Downloads
Patches
Plain Diff
Enable websockets
parent
6d2efe04
No related merge requests found
Pipeline
#9
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
joystick.py
+6
-6
6 additions, 6 deletions
joystick.py
with
6 additions
and
6 deletions
joystick.py
+
6
−
6
View file @
81670905
...
...
@@ -18,7 +18,7 @@ def convertServo(axis):
return
rescale
(
joystick
.
get_axis
(
axis
),
0
,
180
)
def
convertThrust
(
data
):
return
abs
(
rescale
(
data
,
-
255
,
255
))
return
abs
(
rescale
(
data
,
-
80
,
80
))
#helper function to assign the proper hbridge values
def
convertHBridge
(
data
):
...
...
@@ -35,7 +35,7 @@ def convertAxis(axis):
if
__name__
==
"
__main__
"
:
target
=
"
ws://192.168.4.1:81
"
#Set up connection to Blimp Board over websocket
#
ws = create_connection(target)
ws
=
create_connection
(
target
)
# Set up joystick
pygame
.
init
()
...
...
@@ -77,12 +77,12 @@ if __name__ == "__main__":
[
(
180
-
convertServo
(
camera_l
)
+
convertServo
(
camera_r
))
//
2
]
print
(
cmd
)
#
ws.send_binary(cmd)
ws
.
send_binary
(
cmd
)
pygame
.
time
.
wait
(
10
)
pygame
.
time
.
wait
(
10
0
)
except
KeyboardInterrupt
:
done
=
True
#
ws.close()
ws
.
close
()
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