#ifndef AUTO_AIM__TRACKER_HPP #define AUTO_AIM__TRACKER_HPP #include #include #include #include #include "armor.hpp" #include "solver.hpp" #include "target.hpp" #include "tasks/omniperception/perceptron.hpp" #include "tools/thread_safe_queue.hpp" namespace auto_aim { class Tracker { public: Tracker(const std::string & config_path, Solver & solver); std::string state() const; std::list track( std::list & armors, std::chrono::steady_clock::time_point t, bool use_enemy_color = true); std::tuple> track( const std::vector & detection_queue, std::list & armors, std::chrono::steady_clock::time_point t, bool use_enemy_color = true); private: Solver & solver_; Color enemy_color_; int min_detect_count_; int max_temp_lost_count_; int detect_count_; int temp_lost_count_; int outpost_max_temp_lost_count_; int normal_temp_lost_count_; std::string state_, pre_state_; Target target_; std::chrono::steady_clock::time_point last_timestamp_; ArmorPriority omni_target_priority_; void state_machine(bool found); bool set_target(std::list & armors, std::chrono::steady_clock::time_point t); bool update_target(std::list & armors, std::chrono::steady_clock::time_point t); }; } // namespace auto_aim #endif // AUTO_AIM__TRACKER_HPP