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
a0ffcb91
Commit
a0ffcb91
authored
Jul 07, 2017
by
drallensmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename to Reorient - clearer
parent
f54c759c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
16 deletions
+17
-16
hfo/hfo.py
hfo/hfo.py
+1
-1
src/agent.cpp
src/agent.cpp
+11
-10
src/agent.h
src/agent.h
+1
-1
src/common.hpp
src/common.hpp
+4
-4
No files found.
hfo/hfo.py
View file @
a0ffcb91
...
@@ -26,7 +26,7 @@ LOW_LEVEL_FEATURE_SET, HIGH_LEVEL_FEATURE_SET = list(range(2))
...
@@ -26,7 +26,7 @@ LOW_LEVEL_FEATURE_SET, HIGH_LEVEL_FEATURE_SET = list(range(2))
NOOP(): Do Nothing
NOOP(): Do Nothing
QUIT(): Quit the game '''
QUIT(): Quit the game '''
DASH
,
TURN
,
TACKLE
,
KICK
,
KICK_TO
,
MOVE_TO
,
DRIBBLE_TO
,
INTERCEPT
,
\
DASH
,
TURN
,
TACKLE
,
KICK
,
KICK_TO
,
MOVE_TO
,
DRIBBLE_TO
,
INTERCEPT
,
\
MOVE
,
SHOOT
,
PASS
,
DRIBBLE
,
CATCH
,
NOOP
,
QUIT
,
REDUCE_ANGLE_TO_GOAL
,
MARK_PLAYER
,
DEFEND_GOAL
,
GO_TO_BALL
,
PREPROCESS
=
list
(
range
(
20
))
MOVE
,
SHOOT
,
PASS
,
DRIBBLE
,
CATCH
,
NOOP
,
QUIT
,
REDUCE_ANGLE_TO_GOAL
,
MARK_PLAYER
,
DEFEND_GOAL
,
GO_TO_BALL
,
REORIENT
=
list
(
range
(
20
))
''' Possible game status
''' Possible game status
[IN_GAME] Game is currently active
[IN_GAME] Game is currently active
...
...
src/agent.cpp
View file @
a0ffcb91
...
@@ -317,8 +317,8 @@ void Agent::actionImpl() {
...
@@ -317,8 +317,8 @@ void Agent::actionImpl() {
case
GO_TO_BALL
:
case
GO_TO_BALL
:
this
->
doGoToBall
();
this
->
doGoToBall
();
break
;
break
;
case
PREPROCESS
:
case
REORIENT
:
this
->
do
PreprocessAsAction
();
this
->
do
Reorient
();
break
;
break
;
default:
default:
std
::
cerr
<<
"ERROR: Unsupported Action: "
std
::
cerr
<<
"ERROR: Unsupported Action: "
...
@@ -704,10 +704,10 @@ Agent::doPreprocess()
...
@@ -704,10 +704,10 @@ Agent::doPreprocess()
/*-------------------------------------------------------------------*/
/*-------------------------------------------------------------------*/
/*!
/*!
Alternative high-level action to always doing "Move"; usable by either side, although
Alternative high-level action to always doing "Move"; usable by either side, although
probably more useful for offense.
probably more useful for offense.
Variant of doPreprocess (above), which is called by doDribble.
*/
*/
bool
bool
Agent
::
do
PreprocessAsAction
()
Agent
::
do
Reorient
()
{
{
// check tackle expires
// check tackle expires
// check self position accuracy
// check self position accuracy
...
@@ -763,6 +763,12 @@ Agent::doPreprocessAsAction()
...
@@ -763,6 +763,12 @@ Agent::doPreprocessAsAction()
return
true
;
return
true
;
}
}
//
// set default change view
//
this
->
setViewAction
(
new
View_Tactical
()
);
//
//
// ball localization error
// ball localization error
//
//
...
@@ -775,16 +781,11 @@ Agent::doPreprocessAsAction()
...
@@ -775,16 +781,11 @@ Agent::doPreprocessAsAction()
{
{
dlog
.
addText
(
Logger
::
TEAM
,
dlog
.
addText
(
Logger
::
TEAM
,
__FILE__
": search ball"
);
__FILE__
": search ball"
);
this
->
setViewAction
(
new
View_Tactical
()
);
Bhv_NeckBodyToBall
().
execute
(
this
);
Bhv_NeckBodyToBall
().
execute
(
this
);
return
true
;
return
true
;
}
}
//
// set default change view
//
this
->
setViewAction
(
new
View_Tactical
()
);
//
//
// check queued action
// check queued action
...
@@ -805,7 +806,7 @@ Agent::doPreprocessAsAction()
...
@@ -805,7 +806,7 @@ Agent::doPreprocessAsAction()
}
}
const
BallObject
&
ball
=
wm
.
ball
();
const
BallObject
&
ball
=
wm
.
ball
();
if
(
!
(
ball
.
rposValid
()
&&
ball
.
r
velValid
()
))
{
if
(
!
(
ball
.
rposValid
()
&&
ball
.
velValid
()
))
{
dlog
.
addText
(
Logger
::
TEAM
,
dlog
.
addText
(
Logger
::
TEAM
,
__FILE__
": search ball"
);
__FILE__
": search ball"
);
Bhv_NeckBodyToBall
().
execute
(
this
);
Bhv_NeckBodyToBall
().
execute
(
this
);
...
...
src/agent.h
View file @
a0ffcb91
...
@@ -76,7 +76,7 @@ protected:
...
@@ -76,7 +76,7 @@ protected:
private:
private:
bool
doPreprocess
();
bool
doPreprocess
();
bool
do
PreprocessAsAction
();
bool
do
Reorient
();
bool
doSmartKick
();
bool
doSmartKick
();
bool
doShoot
();
bool
doShoot
();
bool
doPass
();
bool
doPass
();
...
...
src/common.hpp
View file @
a0ffcb91
...
@@ -38,7 +38,7 @@ enum action_t
...
@@ -38,7 +38,7 @@ enum action_t
MARK_PLAYER
,
// [High-Level] Mark_Player(opponent_unum [0,11]) : Moves to the position in between the kicker and a given player
MARK_PLAYER
,
// [High-Level] Mark_Player(opponent_unum [0,11]) : Moves to the position in between the kicker and a given player
DEFEND_GOAL
,
DEFEND_GOAL
,
GO_TO_BALL
,
GO_TO_BALL
,
PREPROCESS
// [High-Level] Handle lost position of self/ball; variant
called in DRIBBLE
REORIENT
// [High-Level] Handle lost position of self/ball, misc other situations; variant of doPreprocess
called in DRIBBLE
};
};
// Status of a HFO game
// Status of a HFO game
...
@@ -118,7 +118,7 @@ inline int NumParams(const action_t action) {
...
@@ -118,7 +118,7 @@ inline int NumParams(const action_t action) {
return
0
;
return
0
;
case
GO_TO_BALL
:
case
GO_TO_BALL
:
return
0
;
return
0
;
case
PREPROCESS
:
case
REORIENT
:
return
0
;
return
0
;
}
}
std
::
cerr
<<
"Unrecognized Action: "
<<
action
<<
std
::
endl
;
std
::
cerr
<<
"Unrecognized Action: "
<<
action
<<
std
::
endl
;
...
@@ -168,8 +168,8 @@ inline std::string ActionToString(action_t action) {
...
@@ -168,8 +168,8 @@ inline std::string ActionToString(action_t action) {
return
"Defend_Goal"
;
return
"Defend_Goal"
;
case
GO_TO_BALL
:
case
GO_TO_BALL
:
return
"Go_To_Ball"
;
return
"Go_To_Ball"
;
case
PREPROCESS
:
case
REORIENT
:
return
"
PreProcessAsAction
"
;
return
"
Reorient
"
;
default:
default:
return
"Unknown"
;
return
"Unknown"
;
}
}
...
...
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