This commit is contained in:
2026-03-21 20:15:56 +08:00
parent 52301bcf8d
commit 681785f2f3
2 changed files with 6 additions and 3 deletions

View File

@@ -109,9 +109,6 @@ private:
const uint8_t &enemy_color; // 敌方颜色,引用外部变量,自动变化 const uint8_t &enemy_color; // 敌方颜色,引用外部变量,自动变化
const uint8_t &is_anti_top; // 进入反陀螺,引用外部变量,自动变化 const uint8_t &is_anti_top; // 进入反陀螺,引用外部变量,自动变化
State state; // 自瞄状态对象实例 State state; // 自瞄状态对象实例
ArmorBox target_box, last_box; // 目标装甲板
cv::Point2f target_area_center; // 目标大框像素中心
double z_min_filtered = 0; // 目标深度极小值
ArmorBoxes current_target_boxes; // 聚类后的同一车体装甲板 ArmorBoxes current_target_boxes; // 聚类后的同一车体装甲板
int anti_switch_cnt; // 防止乱切目标计数器 int anti_switch_cnt; // 防止乱切目标计数器
cv::Ptr<cv::Tracker> tracker; // tracker对象实例 cv::Ptr<cv::Tracker> tracker; // tracker对象实例
@@ -145,6 +142,10 @@ private:
bool sendBoxPosition(uint16_t shoot_delay); // 发送装甲板位置 bool sendBoxPosition(uint16_t shoot_delay); // 发送装甲板位置
bool shouldFire() const { return can_fire; } // 获取开火建议 bool shouldFire() const { return can_fire; } // 获取开火建议
public: public:
ArmorBox target_box, last_box; // 目标装甲板
cv::Point2f target_area_center; // 目标大框像素中心
double z_min_filtered = 0; // 目标深度极小值
void run(cv::Mat &src); // 自瞄主函数 void run(cv::Mat &src); // 自瞄主函数
struct HistoryItem { struct HistoryItem {
cv::Point3f pos; cv::Point3f pos;

View File

@@ -4,7 +4,9 @@
#ifndef _SETCONFIG_H_ #ifndef _SETCONFIG_H_
#define _SETCONFIG_H_ #define _SETCONFIG_H_
#ifndef WITH_CONFIG
#define WITH_CONFIG #define WITH_CONFIG
#endif
#ifdef WITH_CONFIG #ifdef WITH_CONFIG
#include <config/config.h> #include <config/config.h>