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
b9548574
Commit
b9548574
authored
Oct 02, 2015
by
Matthew Hausknecht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated low level angle-to-ball feature.
parent
6b188358
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
6 deletions
+37
-6
doc/figures/AngExample.pdf
doc/figures/AngExample.pdf
+0
-0
doc/figures/AngFeatExample.pdf
doc/figures/AngFeatExample.pdf
+0
-0
doc/manual.pdf
doc/manual.pdf
+0
-0
doc/manual.tex
doc/manual.tex
+33
-3
src/feature_extractor.cpp
src/feature_extractor.cpp
+1
-1
src/lowlevel_feature_extractor.cpp
src/lowlevel_feature_extractor.cpp
+3
-2
No files found.
doc/figures/AngExample.pdf
0 → 100644
View file @
b9548574
File added
doc/figures/AngFeatExample.pdf
0 → 100644
View file @
b9548574
File added
doc/manual.pdf
View file @
b9548574
No preview for this file type
doc/manual.tex
View file @
b9548574
...
...
@@ -13,6 +13,7 @@
\usepackage
{
hyperref,graphicx
}
\usepackage
{
fullpage
}
\usepackage
{
enumitem
}
\usepackage
{
subcaption
}
\title
{
RoboCup 2D Half Field Offense
\\
Technical Manual
}
\author
{
Matthew Hausknecht
}
...
...
@@ -273,9 +274,10 @@ the magnitude of self velocity will be set to zero.
\subsubsection
{
Angular Features
}
\textit
{
Angular features
}
(e.g. the angle to the ball), are encoded as two
floating point numbers -- the
$
sin
(
\theta
)
$
and
$
cos
(
\theta
)
$
where
$
\theta
$
is the original angle.
\textit
{
Angular features
}
(e.g. the angle to the ball), are encoded as
two floating point numbers -- the
$
sin
(
\theta
)
$
and
$
cos
(
\theta
)
$
where
$
\theta
$
is the original angle in radians. Figure
\ref
{
fig:ang
_
example
}
provides examples of the angular encoding.
This encoding allows the angle to vary smoothly for all possible
angular values. Other encodings such as radians or degrees have a
...
...
@@ -283,6 +285,34 @@ discontinuity that when normalized, could cause the feature value to
flip between the maximum and minimum value in response to small
changes in
$
\theta
$
.
Given an angular feature
$
\langle
\alpha
_
1
,
\alpha
_
2
\rangle
$
we can
recover the original angle
$
\theta
$
(in radians) by taking the
$
cos
^{
-
1
}
(
\alpha
_
2
)
$
and multiplying by the sign of
$
\alpha
_
1
$
.
\begin{figure*}
[htp]
\centering
\subcaptionbox
{
Angular Encoding
}{
\includegraphics
[width=.4\textwidth]
{
figures/AngExample
}
}
\hspace
{
3em
}
\subcaptionbox
{
Additional Examples
}{
\includegraphics
[width=.3\textwidth]
{
figures/AngFeatExample
}
}
\caption
{
\textbf
{
Angular Encoding:
}
Objects on the agents left/right
side result in a negative/positive
$
sin
(
\theta
)
$
.
$
cos
(
\theta
)
$
is
positive in front of the player and negative behind. For example,
an object directly in front of the player would have angular
features of
$
sin
(
\theta
)=
0
, cos
(
\theta
)=
1
$
. Additional examples:
\textbf
{
Angle to ball
}
$
\theta
=
60
^
\circ
$
or
$
1
.
0472
$
radians. This
results in angular features
$
\langle
sin
(
\theta
)=
.
86
,
cos
(
\theta
)=
.
49
\rangle
$
.
\textbf
{
Angle to teammate
}
:
$
\theta
=
135
^
\circ
,
2
.
35
$
radians.
$
\langle
sin
(
\theta
)=
.
71
,
cos
(
\theta
)=-
.
71
\rangle
$
.
\textbf
{
Angle to Opponent
}
:
$
\theta
=-
90
^
\circ
$
or
$
-
1
.
57
$
radians.
$
\langle
sin
(
\theta
)=-
1
,
cos
(
\theta
)=
0
\rangle
$
.
}
\label
{
fig:ang
_
example
}
\end{figure*}
\subsubsection
{
Distance Features
}
\textit
{
Distance features
}
encode the distance to objects of
...
...
src/feature_extractor.cpp
View file @
b9548574
...
...
@@ -62,7 +62,7 @@ void FeatureExtractor::addLandmarkFeatures(const rcsc::Vector2D& landmark,
addFeature
(
0
);
}
else
{
Vector2D
vec_to_landmark
=
landmark
-
self_pos
;
addAngFeature
(
self_ang
-
vec_to_landmark
.
th
()
);
addAngFeature
(
vec_to_landmark
.
th
()
-
self_ang
);
addDistFeature
(
vec_to_landmark
.
r
(),
maxHFORadius
);
}
}
...
...
src/lowlevel_feature_extractor.cpp
View file @
b9548574
...
...
@@ -127,8 +127,9 @@ const std::vector<float>& LowLevelFeatureExtractor::ExtractFeatures(
// Angle and distance to the ball
addFeature
(
ball
.
rposValid
()
?
FEAT_MAX
:
FEAT_MIN
);
if
(
ball
.
rposValid
())
{
addAngFeature
(
ball
.
angleFromSelf
());
addDistFeature
(
ball
.
distFromSelf
(),
maxHFORadius
);
addLandmarkFeatures
(
ball
.
pos
(),
self_pos
,
self_ang
);
// addAngFeature(ball.angleFromSelf());
// addDistFeature(ball.distFromSelf(), maxHFORadius);
}
else
{
addFeature
(
0
);
addFeature
(
0
);
...
...
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