-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Henning/vtd multi agent #12
Conversation
Instead loop in the transceiver's receive function until messages arrive.
8fac4bd
to
a71b948
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1, 2 of 2 files at r2, 4 of 4 files at r3.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @clssn)
plugins/vtd/src/vtd_binding.cpp, line 206 at r3 (raw file):
// Wait for creation of TaskControl client logger()->info("Wait for task control..."); scp_try_read_until([this]() { return static_cast<bool>(task_control_); });
return task_control_ != nullptr;
plugins/vtd/src/vtd_binding.cpp, line 211 at r3 (raw file):
if (!config_.scenario.size()) { logger()->info("Wait for scenario..."); scp_try_read_until([this]() { return config_.scenario.size(); });
I would say use scenario != ""
since the intention is clearer.
Otherwise I think it's best practice to not use 0 == false shortcuts and write it out explicitely for those things...
plugins/vtd/src/vtd_binding.cpp, line 212 at r3 (raw file):
logger()->info("Wait for scenario..."); scp_try_read_until([this]() { return config_.scenario.size(); }); // Stop to neutralize GUI's Init command sendt along with LoadScenario
Typo: "sent"
plugins/vtd/src/vtd_binding.cpp, line 220 at r3 (raw file):
query.scenario = config_.scenario; scp_client_->send(query); scp_try_read_until([this]() { return !agents_expected_.empty(); });
We should note for all these scp_try_read_until
function calls note where we expect the predicate to be set to true.
plugins/vtd/src/vtd_binding.cpp, line 464 at r3 (raw file):
*/ void scp_try_read_until(std::function<bool(void)> pred) { int tries_left = VTD_INIT_WAIT_RETRIES;
I thought VtdConf had a value for this...
plugins/vtd/src/vtd_binding.cpp, line 616 at r3 (raw file):
if (p.is_absolute()) { // make relative to first subdirectory called "Scenarios" auto s = std::find(p.begin(), p.end(), "Scenarios");
Print a warning if the path has more than one "Scenarios" element, letting the user know why this might be a problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @cassava and @clssn)
plugins/vtd/src/vtd_binding.cpp, line 464 at r3 (raw file):
Previously, cassava (Ben Morgan) wrote…
I thought VtdConf had a value for this...
We have individual TcpTransceiverConfiguration used for connecting to scp, paramserver, taskcontrol and the sensors. But there we want to sleep longer between the retries. It would stall initialization if we'd wait for seconds here. I propose to leave the sleep duration a constant and re-use the number of retries from the scp transceiver's config.
plugins/vtd/src/vtd_binding.cpp, line 464 at r3 (raw file): Previously, clssn (Henning Claßen) wrote…
Hm, sure. We can always add a configuration value later if we need it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 7 of 11 files reviewed, 6 unresolved discussions (waiting on @cassava)
plugins/vtd/src/vtd_binding.cpp, line 206 at r3 (raw file):
Previously, cassava (Ben Morgan) wrote…
return task_control_ != nullptr;
Done.
plugins/vtd/src/vtd_binding.cpp, line 211 at r3 (raw file):
Previously, cassava (Ben Morgan) wrote…
I would say use
scenario != ""
since the intention is clearer.
Otherwise I think it's best practice to not use 0 == false shortcuts and write it out explicitely for those things...
Done.
plugins/vtd/src/vtd_binding.cpp, line 212 at r3 (raw file):
Previously, cassava (Ben Morgan) wrote…
Typo: "sent"
Done.
plugins/vtd/src/vtd_binding.cpp, line 220 at r3 (raw file):
Previously, cassava (Ben Morgan) wrote…
We should note for all these
scp_try_read_until
function calls note where we expect the predicate to be set to true.
Done.
plugins/vtd/src/vtd_binding.cpp, line 464 at r3 (raw file):
Previously, cassava (Ben Morgan) wrote…
Hm, sure. We can always add a configuration value later if we need it.
Done.
plugins/vtd/src/vtd_binding.cpp, line 616 at r3 (raw file):
Previously, cassava (Ben Morgan) wrote…
Print a warning if the path has more than one "Scenarios" element, letting the user know why this might be a problem.
Done.
plugins/vtd/src/vtd_binding.cpp, line 212 at r5 (raw file):
Typo: VtdBiniding |
4f66f7e
to
f1446c8
Compare
plugins/vtd/src/vtd_binding.cpp, line 212 at r5 (raw file): Previously, cassava (Ben Morgan) wrote…
Done. |
plugins/vtd/src/vtd_binding.cpp, line 616 at r3 (raw file): Previously, clssn (Henning Claßen) wrote…
You missed this one. |
f1446c8
to
8c00bd6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 3 files at r4, 2 of 2 files at r5.
Reviewable status: 10 of 11 files reviewed, 1 unresolved discussion (waiting on @cassava and @clssn)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r7.
Reviewable status: 11 of 12 files reviewed, 1 unresolved discussion (waiting on @cassava and @clssn)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r6.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @clssn)
d8f66ed
to
982b5a2
Compare
plugins/vtd/src/vtd_binding.cpp, line 629 at r8 (raw file):
Missing { brackets } around content of for-loop :-( |
982b5a2
to
177e389
Compare
plugins/vtd/src/vtd_binding.cpp, line 632 at r8 (raw file):
This is not going to look great printed... |
177e389
to
256d635
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r8.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @clssn)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @cassava)
plugins/vtd/src/vtd_binding.cpp, line 616 at r3 (raw file):
Previously, cassava (Ben Morgan) wrote…
You missed this one.
Done.
plugins/vtd/src/vtd_binding.cpp, line 629 at r8 (raw file):
Previously, cassava (Ben Morgan) wrote…
Missing { brackets } around content of for-loop :-(
Done.
plugins/vtd/src/vtd_binding.cpp, line 632 at r8 (raw file):
Previously, cassava (Ben Morgan) wrote…
This is not going to look great printed...
"unambiguously becausethe chosen"
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r9.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @clssn)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r8.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @clssn)
Goood catch! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r10.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @clssn)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r10.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @clssn)
ac0be3d
to
82fc752
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r12.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @clssn)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1, 2 of 2 files at r2, 3 of 4 files at r3, 2 of 3 files at r4, 1 of 2 files at r5, 1 of 1 files at r6, 1 of 1 files at r9.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @clssn)
plugins/vtd/src/vtd_binding.cpp, line 211 at r3 (raw file):
Previously, clssn (Henning Claßen) wrote…
Done.
There are a couple more config_.scenario.size()
in this file. Should those be changed as well?
plugins/vtd/src/vtd_binding.cpp, line 324 at r6 (raw file):
// If in reset, block until VTD sends "Run" again then start next cycle while (!operational_) {
Should we take this chance to replace operational_
by is_operational()
?
plugins/vtd/src/vtd_binding.cpp, line 324 at r6 (raw file): Previously, tobifalk (Tobias Falkenstein) wrote…
I'd rather do it the other way around. Because |
plugins/vtd/src/vtd_binding.cpp, line 211 at r3 (raw file): Previously, tobifalk (Tobias Falkenstein) wrote…
Yes, definitely. Thanks! |
plugins/vtd/src/vtd_binding.cpp, line 211 at r3 (raw file): Previously, clssn (Henning Claßen) wrote…
Yes please? There's also |
plugins/vtd/src/vtd_binding.cpp, line 324 at r6 (raw file): Previously, cassava (Ben Morgan) wrote…
Agreed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @clssn)
plugins/vtd/src/vtd_binding.cpp, line 211 at r3 (raw file): Previously, cassava (Ben Morgan) wrote…
No empty() in strings. Only size(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @cassava and @tobifalk)
plugins/vtd/src/vtd_binding.cpp, line 211 at r3 (raw file):
Previously, clssn (Henning Claßen) wrote…
No empty() in strings. Only size().
Done.
plugins/vtd/src/vtd_binding.cpp, line 324 at r6 (raw file):
Previously, clssn (Henning Claßen) wrote…
Agreed.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r13.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @cassava and @tobifalk)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @tobifalk)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @clssn)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @clssn)
A major overhaul of the initialization was necessary to support multi-agent control with scenario selection both via GUI and config.
5f5611e
to
2972016
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 11 of 12 files reviewed, all discussions resolved (waiting on @cassava)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 11 of 12 files reviewed, all discussions resolved (waiting on @cassava)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r13.
Reviewable status: 11 of 12 files reviewed, all discussions resolved (waiting on @cassava)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r15.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @clssn)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @clssn)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @clssn)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @clssn)
This feature branch enables Cloe's VTD binding to perform multi-agent simulation.
Attention: We need to first finish the
ben/add-vtd-package
PR and then rebase this one here onto the resulting master.This change is