Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Seminar-HFO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
Seminar-HFO
Commits
7cd8aea9
Commit
7cd8aea9
authored
Mar 01, 2016
by
Matthew Hausknecht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More informative communication example.
parent
74c61f55
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
example/communication_agent.cpp
example/communication_agent.cpp
+2
-1
No files found.
example/communication_agent.cpp
View file @
7cd8aea9
...
@@ -41,7 +41,7 @@ int main(int argc, char** argv) {
...
@@ -41,7 +41,7 @@ int main(int argc, char** argv) {
// Get any incoming communication
// Get any incoming communication
std
::
string
msg
=
hfo
.
hear
();
std
::
string
msg
=
hfo
.
hear
();
if
(
!
msg
.
empty
())
{
if
(
!
msg
.
empty
())
{
cout
<<
"Agent-"
<<
unum
<<
"
HEARD
: "
<<
msg
.
c_str
()
<<
endl
;
cout
<<
"Agent-"
<<
unum
<<
"
heard
: "
<<
msg
.
c_str
()
<<
endl
;
if
(
msg
==
"Pass"
)
{
if
(
msg
==
"Pass"
)
{
agent_on_ball
=
unum
;
agent_on_ball
=
unum
;
}
}
...
@@ -58,6 +58,7 @@ int main(int argc, char** argv) {
...
@@ -58,6 +58,7 @@ int main(int argc, char** argv) {
float
teammate_y_pos
=
-
target_y
;
float
teammate_y_pos
=
-
target_y
;
hfo
.
act
(
KICK_TO
,
teammate_x_pos
,
teammate_y_pos
,
2.0
);
hfo
.
act
(
KICK_TO
,
teammate_x_pos
,
teammate_y_pos
,
2.0
);
hfo
.
say
(
"Pass"
);
hfo
.
say
(
"Pass"
);
cout
<<
"Agent-"
<<
unum
<<
" said: Pass"
<<
endl
;
agent_on_ball
=
teammate_unum
;
agent_on_ball
=
teammate_unum
;
}
else
{
}
else
{
float
dist_to_ball
=
feature_vec
[
3
];
float
dist_to_ball
=
feature_vec
[
3
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment