30 explicit SensorFusion(TbotsProto::SensorFusionConfig sensor_fusion_config);
49 std::optional<World>
getWorld()
const;
53 static constexpr unsigned int VISION_PACKET_RESET_COUNT_THRESHOLD = 5;
56 static constexpr double VISION_PACKET_RESET_TIME_THRESHOLD = 0.5;
62 static constexpr double DISTANCE_THRESHOLD_FOR_BREAKBEAM_FAULT_DETECTION = 0.5;
70 void updateWorld(
const SSLProto::SSL_WrapperPacket &packet);
71 void updateWorld(
const SSLProto::Referee &packet);
72 void updateWorld(
const google::protobuf::RepeatedPtrField<TbotsProto::RobotStatus>
74 void updateWorld(
const SSLProto::SSL_GeometryData &geometry_packet);
75 void updateWorld(
const SSLProto::SSL_DetectionFrame &ssl_detection_frame);
82 void updateBall(
Ball new_ball);
91 std::optional<Ball> createBall(
const std::vector<BallDetection> &ball_detections);
100 Team createFriendlyTeam(
const std::vector<RobotDetection> &robot_detections);
101 Team createEnemyTeam(
const std::vector<RobotDetection> &robot_detections);
112 std::optional<Point> getBallPlacementPoint(
const SSLProto::Referee &packet);
128 void updateDribbleDisplacement();
136 bool checkForVisionReset(
double t_capture);
141 void resetWorldComponents();
151 static bool teamHasBall(
const Team &team,
const Ball &ball);
161 bool shouldTrustRobotStatus();
162 TbotsProto::SensorFusionConfig sensor_fusion_config;
163 std::optional<Field> field;
164 std::optional<Ball> ball;
168 std::optional<RefereeStage> referee_stage;
171 std::map<RobotId, Point> ball_contacts_by_friendly_robots;
184 std::optional<Segment> dribble_displacement;
191 TeamPossession possession;
192 std::shared_ptr<PossessionTracker> possession_tracker;
194 std::optional<RobotId> friendly_robot_id_with_ball_in_dribbler;
196 unsigned int friendly_goalie_id;
197 unsigned int enemy_goalie_id;
198 bool defending_positive_side;
199 int ball_in_dribbler_timeout;
204 unsigned int reset_time_vision_packets_detected;
207 double last_t_capture;