Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hochautomatisiertes-Fahren
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Philipp Badenhoop
Hochautomatisiertes-Fahren
Commits
a75d99d8
Commit
a75d99d8
authored
6 years ago
by
Hoop77
Browse files
Options
Downloads
Patches
Plain Diff
-
parent
b251ff36
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/catkin_ws/src/VeloxProtocolLib/test/TerminalControl.cpp
+3
-3
3 additions, 3 deletions
...s/catkin_ws/src/VeloxProtocolLib/test/TerminalControl.cpp
scripts/remote_control.py
+5
-23
5 additions, 23 deletions
scripts/remote_control.py
with
8 additions
and
26 deletions
modules/catkin_ws/src/VeloxProtocolLib/test/TerminalControl.cpp
+
3
−
3
View file @
a75d99d8
...
@@ -94,9 +94,9 @@ int main(int argc, char ** argv)
...
@@ -94,9 +94,9 @@ int main(int argc, char ** argv)
auto
originalDistance
=
distance
;
auto
originalDistance
=
distance
;
//auto filteredDistance = streamMeanFilter.moveWindow(originalDistance);
//auto filteredDistance = streamMeanFilter.moveWindow(originalDistance);
auto
filteredDistance
=
distance
;
auto
filteredDistance
=
distance
;
if
(
filteredDistance
<=
stopDistance
)
//
if (filteredDistance <= stopDistance)
conn
->
setSpeed
(
brakeSpeed
);
//
conn->setSpeed(brakeSpeed);
else
//
else
conn
->
setSpeed
(
speed
);
conn
->
setSpeed
(
speed
);
if
(
!
monitorUSS
)
if
(
!
monitorUSS
)
...
...
This diff is collapsed.
Click to expand it.
scripts/remote_control.py
+
5
−
23
View file @
a75d99d8
...
@@ -97,10 +97,6 @@ class Button:
...
@@ -97,10 +97,6 @@ class Button:
surf
.
blit
(
text
,
text_rect
)
surf
.
blit
(
text
,
text_rect
)
speedLock
=
threading
.
Lock
()
speed
=
0
def
receive_speed
():
def
receive_speed
():
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
server_address
=
(
'
0.0.0.0
'
,
10150
)
server_address
=
(
'
0.0.0.0
'
,
10150
)
...
@@ -108,25 +104,14 @@ def receive_speed():
...
@@ -108,25 +104,14 @@ def receive_speed():
while
True
:
while
True
:
data
,
address
=
sock
.
recvfrom
(
30
)
data
,
address
=
sock
.
recvfrom
(
30
)
if
data
:
if
data
:
print
(
data
)
print
(
float
(
data
[
4
:]))
speedLock
.
acquire
()
speed
=
float
(
data
[
4
:])
speedLock
.
release
()
def
renderSpeed
(
surf
):
font
=
pygame
.
font
.
Font
(
None
,
36
)
speedLock
.
acquire
()
text
=
font
.
render
(
str
(
speed
),
True
,
(
10
,
10
,
10
))
speedLock
.
release
()
text_rect
=
text
.
get_rect
()
surf
.
blit
(
text
,
text_rect
)
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
conn
=
OdroidConnection
(
ODROID_HOST_ADDRESS
,
"
/root/repos/Hochautomatisiertes-Fahren/modules/catkin_ws/src/VeloxProtocolLib/cmake-build-debug/TerminalControl
"
)
conn
=
OdroidConnection
(
ODROID_HOST_ADDRESS
,
"
/root/repos/Hochautomatisiertes-Fahren/modules/catkin_ws/src/VeloxProtocolLib/cmake-build-debug/TerminalControl
"
)
conn
.
connect
()
conn
.
connect
()
threading
.
Thread
(
target
=
receive_speed
)
speedReceiver
=
threading
.
Thread
(
target
=
receive_speed
)
speedReceiver
.
start
()
FPS
=
60
FPS
=
60
pygame
.
init
()
pygame
.
init
()
...
@@ -150,8 +135,8 @@ if __name__ == '__main__':
...
@@ -150,8 +135,8 @@ if __name__ == '__main__':
buttonsSurface
=
buttonsSurface
.
convert
()
buttonsSurface
=
buttonsSurface
.
convert
()
buttonsSurface
.
fill
(
BACKGROUND_COLOR
)
buttonsSurface
.
fill
(
BACKGROUND_COLOR
)
SPEED
=
0.
6
SPEED
=
0.
8
ANGLE
=
2
0
ANGLE
=
3
0
ZERO_SPEED
=
0
ZERO_SPEED
=
0
ZERO_ANGLE
=
-
4
ZERO_ANGLE
=
-
4
...
@@ -214,9 +199,6 @@ if __name__ == '__main__':
...
@@ -214,9 +199,6 @@ if __name__ == '__main__':
button
.
draw
(
buttonsSurface
)
button
.
draw
(
buttonsSurface
)
background
.
blit
(
buttonsSurface
,
buttons_rect
)
background
.
blit
(
buttonsSurface
,
buttons_rect
)
renderSpeed
(
background
)
screen
.
blit
(
background
,
(
0
,
0
))
screen
.
blit
(
background
,
(
0
,
0
))
pygame
.
display
.
update
()
pygame
.
display
.
update
()
fpsClock
.
tick
(
FPS
)
fpsClock
.
tick
(
FPS
)
\ No newline at end of file
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