Thunderbots Project
Loading...
Searching...
No Matches
possession_tracker.h
1
#pragma once
2
3
#include "proto/parameters.pb.h"
4
#include "software/time/duration.h"
5
#include "software/time/timestamp.h"
6
#include "software/world/ball.h"
7
#include "software/world/field.h"
8
#include "software/world/team.h"
9
18
class
PossessionTracker
19
{
20
public
:
21
explicit
PossessionTracker
(
const
TbotsProto::PossessionTrackerConfig &config);
22
32
TeamPossession
getTeamWithPossession
(
const
Team
&friendly_team,
33
const
Team
&enemy_team,
const
Ball
&ball,
34
const
Field
&field);
35
36
private
:
37
// Max distance in meters between robot and ball for robot
38
// to be considered near the ball
39
double
distance_near_tolerance_meters;
40
41
// Min distance in meters between robot and ball for robot
42
// to be considered far away from the ball
43
double
distance_far_tolerance_meters;
44
45
// Min time that robot must stay close to ball for it to be considered near
46
Duration
time_near_threshold;
47
48
// Min time that robot must stay away from ball for it to be considered far away
49
Duration
time_far_threshold;
50
51
// The timestamp of last game snapshot the PossessionTracker was updated with
52
Timestamp
last_timestamp;
53
54
// The amount of time that the friendly team has spent near the ball
55
Duration
time_near_friendly;
56
57
// The amount of time that the enemy team has spent near the ball
58
Duration
time_near_enemy;
59
60
// The amount of time that the friendly team has spent far away from the ball
61
Duration
time_far_friendly;
62
63
// The amount of time that the enemy team has spent far away from the ball
64
Duration
time_far_enemy;
65
66
// The team currently with possession of the ball
67
TeamPossession possession;
68
77
void
updateTimes(
const
Team
&friendly_team,
const
Team
&enemy_team,
const
Ball
&ball,
78
const
Field
&field);
79
};
Ball
Definition
ball.h:11
Duration
Definition
duration.h:12
Field
Definition
field.h:36
PossessionTracker
Definition
possession_tracker.h:19
PossessionTracker::getTeamWithPossession
TeamPossession getTeamWithPossession(const Team &friendly_team, const Team &enemy_team, const Ball &ball, const Field &field)
Definition
possession_tracker.cpp:21
Team
Definition
team.h:15
Timestamp
Definition
timestamp.h:21
src
software
sensor_fusion
possession
possession_tracker.h
Generated by
1.9.8