1
Src/Representations/Perception/FieldFeatures/FieldMarker.h

在这个文件中表示了在 bhuman 中标记线的一些方法。
MarkedLine(线)、MarkedIntersection(交点)、MarkedPoint(点)。
线的相交分为 X、L、T 型,这个很形象。其中,T includes L; X includes T and L

关于线的交叉点结构在下面这个文件中:

1
Src/Representations/Perception/FieldPercepts/FieldLineIntersections.h

MarkedLine

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
STREAMABLE(MarkedLine,
{
/*
___________3__________
| 4|______|5 |
| 6 |
|2 |
| |
|___________1__________|

*/
ENUM(LineMarker,
{,
midLine, // --> 1
sideLine, // --> 2
groundLine, // --> 3
sidePenaltyL, // --> 4
sidePenaltyR, // --> 5
groundPenalty, // --> 6

firstLineMarkerOther,
otherSideLine = firstLineMarkerOther,
otherGroundLine,
otherSidePenaltyL,
otherSidePenaltyR,
otherGroundPenalty,
});
static LineMarker mirror(const LineMarker marker); // mirror 镜子
LineMarker mirror() const;

MarkedLine() = default;
MarkedLine(unsigned line, LineMarker marker);
void draw() const,

(unsigned) lineIndex,
(LineMarker)(numOfLineMarkers) marker,
});

inline MarkedLine::MarkedLine(unsigned line, LineMarker marker) : lineIndex(line), marker(marker) {}

MarkedIntersection 交点处的标记方式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
STREAMABLE(MarkedIntersection,
{
/*
STL STR
BLL _______v______v_______ BLR
| |______| |
| SLL SLR |
| |
| |
|______________________|
BT otherBT

*/
/**
* marker name components: (S/B)(L/T)(L/R)
* (Small/Big)(L-intersection, T-intersection)(Left/Right)
*/
ENUM(IntersectionMarker,
{,
BT,
STL,
STR,
BLL,
SLL,
SLR,
BLR,

firstIntersectionMarkerOther,
otherBT = firstIntersectionMarkerOther,
otherSTL,
otherSTR,
otherBLL,
otherSLL,
otherSLR,
otherBLR,
});
static IntersectionMarker mirror(const IntersectionMarker& marker);
IntersectionMarker mirror() const;

MarkedIntersection() = default;
MarkedIntersection(unsigned intersection, IntersectionMarker marker);

void draw() const,

(unsigned) intersectionIndex,
(IntersectionMarker)(numOfIntersectionMarkers) marker,
});

inline MarkedIntersection::MarkedIntersection(unsigned intersection, IntersectionMarker marker)
: intersectionIndex(intersection), marker(marker) {};

MarkedPoint

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
STREAMABLE(MarkedPoint,
{
ENUM(PointMarker,
{,
midCircle, //Circle
penaltyMark, //PenaltyMark
goalPostL, //left goal post 左目标门柱
goalPostR, //right goal post 右目标门柱

firstPointMarkerOther,
otherpenaltyMark = firstPointMarkerOther,
othergoalPostL,
othergoalPostR,
});
static PointMarker mirror(const PointMarker& marker);
PointMarker mirror() const;

MarkedPoint() = default;
MarkedPoint(const Vector2f& p, PointMarker marker, bool outOfCurrentFrame = true);

void draw() const,//TODO

(Vector2f)(Vector2f()) point,
(PointMarker)(numOfPointMarkers) marker,
(bool)(false) outOfCurrentFrame,
});

inline MarkedPoint::MarkedPoint(const Vector2f& p, PointMarker marker, bool outOfCurrentFrame)
: point(p), marker(marker), outOfCurrentFrame(outOfCurrentFrame) {}