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
560e917d
Commit
560e917d
authored
Aug 04, 2015
by
Matthew Hausknecht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed normalization of high-level hfo features.
parent
94c1d9a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
22 deletions
+17
-22
src/highlevel_feature_extractor.cpp
src/highlevel_feature_extractor.cpp
+17
-22
No files found.
src/highlevel_feature_extractor.cpp
View file @
560e917d
...
...
@@ -41,16 +41,12 @@ const std::vector<float>& HighLevelFeatureExtractor::ExtractFeatures(
// Allow the agent to go 10% over the playfield in any direction
float
tolerance_x
=
.1
*
SP
.
pitchHalfLength
();
float
tolerance_y
=
.1
*
SP
.
pitchHalfWidth
();
if
(
playingOffense
)
{
// Feature[0]: Xpostion
addNormFeature
(
self_pos
.
x
,
-
tolerance_x
,
SP
.
pitchHalfLength
()
+
tolerance_x
);
}
else
{
addNormFeature
(
self_pos
.
x
,
-
SP
.
pitchHalfLength
()
-
tolerance_x
,
tolerance_x
);
}
// Feature[0]: Xpostion
addFeature
(
self_pos
.
x
);
// Feature[1]: YPosition
addNormFeature
(
self_pos
.
y
,
-
SP
.
pitchHalfWidth
()
-
tolerance_y
,
SP
.
pitchHalfWidth
()
+
tolerance_y
);
addFeature
(
self_pos
.
y
);
// Feature[2]: Self Angle
add
NormFeature
(
self_ang
,
-
2
*
M_PI
,
2
*
M_PI
);
add
Feature
(
self_ang
);
float
r
;
float
th
;
...
...
@@ -58,11 +54,11 @@ const std::vector<float>& HighLevelFeatureExtractor::ExtractFeatures(
Vector2D
ball_pos
=
wm
.
ball
().
pos
();
angleDistToPoint
(
self_pos
,
ball_pos
,
th
,
r
);
// Feature[3]: Dist to ball
add
NormFeature
(
r
,
0
,
maxR
);
add
Feature
(
r
);
// Feature[4]: Ang to ball
add
NormFeature
(
th
,
-
2
*
M_PI
,
2
*
M_PI
);
add
Feature
(
th
);
// Feature[5]: Able to kick
add
NormFeature
(
self
.
isKickable
(),
false
,
true
);
add
Feature
(
self
.
isKickable
()
);
// features about distance to goal center
Vector2D
goalCenter
(
SP
.
pitchHalfLength
(),
0
);
...
...
@@ -71,18 +67,18 @@ const std::vector<float>& HighLevelFeatureExtractor::ExtractFeatures(
}
angleDistToPoint
(
self_pos
,
goalCenter
,
th
,
r
);
// Feature[6]: Goal Center Distance
add
NormFeature
(
r
,
0
,
maxR
);
// Distance to goal center
add
Feature
(
r
);
// Feature[7]: Angle to goal center
add
NormFeature
(
th
,
-
2
*
M_PI
,
2
*
M_PI
);
// Ang to goal center
add
Feature
(
th
);
// Feature[8]: largest open goal angle
add
NormFeature
(
calcLargestGoalAngle
(
wm
,
self_pos
),
0
,
M_PI
);
add
Feature
(
calcLargestGoalAngle
(
wm
,
self_pos
)
);
// Feature [9+T]: teammate's open angle to goal
int
detected_teammates
=
0
;
for
(
PlayerCont
::
const_iterator
it
=
teammates
.
begin
();
it
!=
teammates
.
end
();
++
it
)
{
const
PlayerObject
&
teammate
=
*
it
;
if
(
valid
(
teammate
)
&&
detected_teammates
<
numTeammates
)
{
add
NormFeature
(
calcLargestGoalAngle
(
wm
,
teammate
.
pos
()),
0
,
M_PI
);
add
Feature
(
calcLargestGoalAngle
(
wm
,
teammate
.
pos
())
);
detected_teammates
++
;
}
}
...
...
@@ -94,8 +90,7 @@ const std::vector<float>& HighLevelFeatureExtractor::ExtractFeatures(
// dist to our closest opp
if
(
numOpponents
>
0
)
{
calcClosestOpp
(
wm
,
self_pos
,
th
,
r
);
addNormFeature
(
r
,
0
,
maxR
);
//addNormFeature(th,-M_PI,M_PI);
addFeature
(
r
);
// teammates dists to closest opps
detected_teammates
=
0
;
...
...
@@ -104,7 +99,7 @@ const std::vector<float>& HighLevelFeatureExtractor::ExtractFeatures(
if
(
valid
(
teammate
)
&&
detected_teammates
<
numTeammates
)
{
//addNormFeature(calcClosestOpp(wm,teammate.pos),0,maxR);
calcClosestOpp
(
wm
,
teammate
.
pos
(),
th
,
r
);
add
NormFeature
(
r
,
0
,
maxR
);
add
Feature
(
r
);
//addNormFeature(th,-M_PI,M_PI);
detected_teammates
++
;
}
...
...
@@ -120,7 +115,7 @@ const std::vector<float>& HighLevelFeatureExtractor::ExtractFeatures(
for
(
PlayerCont
::
const_iterator
it
=
teammates
.
begin
();
it
!=
teammates
.
end
();
++
it
)
{
const
PlayerObject
&
teammate
=
*
it
;
if
(
valid
(
teammate
)
&&
detected_teammates
<
numTeammates
)
{
add
NormFeature
(
calcLargestTeammateAngle
(
wm
,
self_pos
,
teammate
.
pos
()),
0
,
M_PI
);
add
Feature
(
calcLargestTeammateAngle
(
wm
,
self_pos
,
teammate
.
pos
())
);
detected_teammates
++
;
}
}
...
...
@@ -135,8 +130,8 @@ const std::vector<float>& HighLevelFeatureExtractor::ExtractFeatures(
const
PlayerObject
&
teammate
=
*
it
;
if
(
valid
(
teammate
)
&&
detected_teammates
<
numTeammates
)
{
angleDistToPoint
(
self_pos
,
teammate
.
pos
(),
th
,
r
);
add
NormFeature
(
r
,
0
,
maxR
);
add
NormFeature
(
th
,
-
M_PI
,
M_PI
);
add
Feature
(
r
);
add
Feature
(
th
);
detected_teammates
++
;
}
}
...
...
@@ -147,7 +142,7 @@ const std::vector<float>& HighLevelFeatureExtractor::ExtractFeatures(
}
assert
(
featIndx
==
numFeatures
);
checkFeatures
();
//
checkFeatures();
//std::cout << "features: " << features.rows(0,ind-1).t();
return
feature_vec
;
}
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