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
46762196
Commit
46762196
authored
6 years ago
by
Franz Bethke
Browse files
Options
Downloads
Patches
Plain Diff
Reimplements PlatoonController::run_CACC_FV
parent
10becaba
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/catkin_ws/src/car/include/mainNode/PlatoonController.h
+11
-9
11 additions, 9 deletions
...es/catkin_ws/src/car/include/mainNode/PlatoonController.h
modules/catkin_ws/src/car/src/mainNode/PlatoonController.cpp
+22
-19
22 additions, 19 deletions
modules/catkin_ws/src/car/src/mainNode/PlatoonController.cpp
with
33 additions
and
28 deletions
modules/catkin_ws/src/car/include/mainNode/PlatoonController.h
+
11
−
9
View file @
46762196
...
...
@@ -12,6 +12,7 @@
#include
"PC2CarLib/CommandReceiver.h"
#include
"EgoMotion.h"
#include
"PlatoonState.h"
#include
<atomic>
namespace
car
{
...
...
@@ -28,23 +29,24 @@ public:
void
run
();
Callback
cruiseControllerNotify
;
// TODO check these values !
// TODO make values ATOMIC !
// these values need to be stored and atomic, since they will be pulled from other modules
PlatoonState
curState
=
PlatoonState
::
CACC_FV
;
float
desSpeed
=
0.0
;
platoonProtocol
::
PlatoonConfig
platoonConfig
;
private:
platoonProtocol
::
VehicleFacade
&
c2c
;
bool
c2cAlive
=
false
;
pc2car
::
CommandReceiver
::
Ptr
pc
;
EgoMotion
&
egoMotion
;
// TODO check these values!
PlatoonState
curState
=
PlatoonState
::
CACC_FV
;
bool
wantsPlatoon
=
false
;
// TODO check these values!
float
desSpeed
=
0.0
;
// METHODS
void
run_ACC
();
void
run_CACC_FV
();
void
run_CACC_LV
();
...
...
This diff is collapsed.
Click to expand it.
modules/catkin_ws/src/car/src/mainNode/PlatoonController.cpp
+
22
−
19
View file @
46762196
...
...
@@ -11,10 +11,12 @@ namespace car
PlatoonController
::
PlatoonController
(
platoonProtocol
::
VehicleFacade
&
c2c
,
pc2car
::
CommandReceiver
::
Ptr
pc
,
EgoMotion
&
egoMotion
)
:
c2c
(
c2c
)
:
cruiseControllerNotify
()
,
platoonConfig
(
c2c
.
getPlatoonConfig
())
,
c2c
(
c2c
)
,
pc
(
pc
)
,
egoMotion
(
egoMotion
)
,
cruiseControllerNotify
()
{}
{}
void
car
::
PlatoonController
::
run
()
...
...
@@ -42,32 +44,33 @@ void car::PlatoonController::run()
void
car
::
PlatoonController
::
run_ACC
()
{
bool
inPlatoon
=
c2c
.
isPlatoonRunning
();
bool
wantsPlatoon
=
pc
->
isPlatoonEnabled
().
get
();
// platoonProtocol::PlatoonSpeed PS = pc.getPlatoonSpeed();
}
void
car
::
PlatoonController
::
run_CACC_FV
()
{
bool
inPlatoon
=
c2c
.
isPlatoonRunning
();
platoonProtocol
::
PlatoonConfig
platoonConfig
=
c2c
.
getPlatoonConfig
();
wantsPlatoon
=
pc
->
isPlatoonEnabled
().
get
();
bool
wantsPlatoon
=
pc
->
isPlatoonEnabled
().
get
();
std
::
cout
<<
"Running PlatoonController::run_CACC_FV: inPlatoon = "
<<
inPlatoon
<<
", wantsPlatoon = "
<<
wantsPlatoon
<<
std
::
endl
;
<<
", wantsPlatoon = "
<<
wantsPlatoon
<<
std
::
endl
;
//
if (inPlatoon && wantsPlatoon) {
//
cruiseControllerNotify();
//
return;
//
}
//
//
if (inPlatoon && !wantsPlatoon) {
//
c2c
->
leavePlatoon();
//
}
//
// // TODO: c2c->reset()
//
curState = PlatoonState::ACC;
//
cruiseControllerNotify();
//
run_ACC();
if
(
inPlatoon
&&
wantsPlatoon
)
{
cruiseControllerNotify
();
return
;
}
if
(
inPlatoon
&&
!
wantsPlatoon
)
{
c2c
.
leavePlatoon
();
}
c2cAlive
=
false
;
curState
=
PlatoonState
::
ACC
;
cruiseControllerNotify
();
run_ACC
();
return
;
}
...
...
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