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
597c2f72
Commit
597c2f72
authored
6 years ago
by
Hoop77
Committed by
lenoelda
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
updated TerminalControl
parent
84c7ccff
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/catkin_ws/src/VeloxProtocolLib/test/TerminalControl.cpp
+4
-9
4 additions, 9 deletions
...s/catkin_ws/src/VeloxProtocolLib/test/TerminalControl.cpp
with
4 additions
and
9 deletions
modules/catkin_ws/src/VeloxProtocolLib/test/TerminalControl.cpp
+
4
−
9
View file @
597c2f72
...
@@ -62,9 +62,8 @@ int main(int argc, char ** argv)
...
@@ -62,9 +62,8 @@ int main(int argc, char ** argv)
std
::
atomic
<
float
>
speed
{
0.0
f
};
std
::
atomic
<
float
>
speed
{
0.0
f
};
std
::
atomic
<
float
>
stopDistance
{
0
};
std
::
atomic
<
float
>
stopDistance
{
0
};
std
::
mutex
outputMutex
;
std
::
mutex
outputMutex
;
UltrasonicSensor
sensor
{
readDevId
()
}
;
auto
sensor
=
UltrasonicSensor
::
create
(
net
,
readDevId
()
)
;
car
::
StreamMeanFilter
streamMeanFilter
{
5
};
car
::
StreamMeanFilter
streamMeanFilter
{
5
};
auto
timer
=
networking
::
time
::
Timer
::
create
(
net
);
auto
conn
=
Connection
::
create
(
net
);
auto
conn
=
Connection
::
create
(
net
);
conn
->
open
(
conn
->
open
(
"/dev/ttySAC0"
,
"/dev/ttySAC0"
,
...
@@ -78,13 +77,10 @@ int main(int argc, char ** argv)
...
@@ -78,13 +77,10 @@ int main(int argc, char ** argv)
<<
"
\n
Steering Angle: "
<<
conn
->
getMeasuredSteeringAngle
().
get
()
<<
"
\n\n
"
;
<<
"
\n
Steering Angle: "
<<
conn
->
getMeasuredSteeringAngle
().
get
()
<<
"
\n\n
"
;
},
[]
{});
},
[]
{});
sensor
.
init
();
sensor
->
start
(
timer
=
networking
::
time
::
Timer
::
create
(
net
);
[
&
](
auto
distance
)
timer
->
startPeriodicTimeout
(
std
::
chrono
::
milliseconds
(
UltrasonicSensor
::
DELAY
),
[
&
]
{
{
auto
originalDistance
=
sensor
.
getD
istance
()
;
auto
originalDistance
=
d
istance
;
auto
filteredDistance
=
streamMeanFilter
.
moveWindow
(
originalDistance
);
auto
filteredDistance
=
streamMeanFilter
.
moveWindow
(
originalDistance
);
if
(
filteredDistance
<=
stopDistance
)
if
(
filteredDistance
<=
stopDistance
)
conn
->
setSpeed
(
BRAKE_SPEED
);
conn
->
setSpeed
(
BRAKE_SPEED
);
...
@@ -150,7 +146,6 @@ int main(int argc, char ** argv)
...
@@ -150,7 +146,6 @@ int main(int argc, char ** argv)
}
}
}
}
timer
->
stop
();
conn
->
setSpeed
(
BRAKE_SPEED
);
conn
->
setSpeed
(
BRAKE_SPEED
);
sleep
(
1
);
sleep
(
1
);
conn
->
close
();
conn
->
close
();
...
...
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