From c0ee46911821821005d70d186a60f2f27f5e7799 Mon Sep 17 00:00:00 2001 From: HelixCopex Date: Tue, 17 Mar 2026 18:10:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=20PID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- others/include/config/setconfig.h | 6 +++--- others/include/constants.h | 2 +- others/src/additions.cpp | 22 +++++++++++----------- others/src/options.cpp | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/others/include/config/setconfig.h b/others/include/config/setconfig.h index ce24c39..2ff0a4b 100644 --- a/others/include/config/setconfig.h +++ b/others/include/config/setconfig.h @@ -50,13 +50,13 @@ #define YAW_AIM_KI (0.01) #endif #ifndef PITCH_AIM_KD - #define PITCH_AIM_KD (0.4) + #define PITCH_AIM_KD (0) #endif #ifndef PITCH_AIM_KP - #define PITCH_AIM_KP (0.75) + #define PITCH_AIM_KP (0) #endif #ifndef PITCH_AIM_KI - #define PITCH_AIM_KI (0.01) + #define PITCH_AIM_KI (0) #endif #ifndef RED_COMPENSATE_YAW diff --git a/others/include/constants.h b/others/include/constants.h index 34290c9..4d2467f 100644 --- a/others/include/constants.h +++ b/others/include/constants.h @@ -19,6 +19,6 @@ #define FOCUS_PIXAL_8MM (1488) #define FOCUS_PIXAL_5MM (917) -#define FOCUS_PIXAL FOCUS_PIXAL_5MM +#define FOCUS_PIXAL FOCUS_PIXAL_8MM #endif /* _CONSTANTS_H */ diff --git a/others/src/additions.cpp b/others/src/additions.cpp index d0bb008..a46d58d 100644 --- a/others/src/additions.cpp +++ b/others/src/additions.cpp @@ -36,10 +36,10 @@ void uartReceive(Serial *pSerial) { pSerial->ReadData((uint8_t *) buffer, sizeof(mcu_data)+1); if (buffer[sizeof(mcu_data)] == '\n') { memcpy(&mcu_data, buffer, sizeof(mcu_data)); -// LOGM("Get, state:%c, mark:%d!", mcu_data.state, (int) mcu_data.mark); -// LOGM("Get yaw: %f, pitch: %f!", mcu_data.curr_yaw, mcu_data.curr_pitch); -// LOGM("Get delta x: %d, delta y: %d!", mcu_data.delta_x, mcu_data.delta_y); -// static int t = time(nullptr); + LOGM("Get, state:%c, mark:%d!", mcu_data.state, (int) mcu_data.mark); + LOGM("Get yaw: %f, pitch: %f!", mcu_data.curr_yaw, mcu_data.curr_pitch); + LOGM("Get delta x: %d, delta y: %d!", mcu_data.delta_x, mcu_data.delta_y); + // static int t = time(nullptr); // static int cnt = 0; // if(time(nullptr) > t){ // t = time(nullptr); @@ -103,14 +103,14 @@ void extract(cv::Mat &src) {//图像预处理,将视频切成640×480的大小 if (src.empty()) return; float length = static_cast(src.cols); float width = static_cast(src.rows); - if (length / width > 640.0 / 480.0) { - length *= 480.0 / width; - resize(src, src, cv::Size(length, 480)); - src = src(Rect((length - 640) / 2, 0, 640, 480)); + if (length / width > 1280.0 / 1024.0) { + length *= 1024 / width; + resize(src, src, cv::Size(length, 1024)); + src = src(Rect((length - 1280) / 2, 0, 1280, 1024)); } else { - width *= 640.0 / length; - resize(src, src, cv::Size(640, width)); - src = src(Rect(0, (width - 480) / 2, 640, 480)); + width *= 1280.0 / length; + resize(src, src, cv::Size(1280, width)); + src = src(Rect(0, (width - 1024) / 2, 1280, 1024)); } } diff --git a/others/src/options.cpp b/others/src/options.cpp index cde8ada..acb507d 100644 --- a/others/src/options.cpp +++ b/others/src/options.cpp @@ -14,12 +14,12 @@ bool show_light_blobs = false; bool show_origin = false; bool run_with_camera = true; bool save_video = false; -bool wait_uart = false; +bool wait_uart = true; bool save_labelled_boxes = false; bool show_process = false; bool show_energy = false; bool save_mark = false; -bool show_info = false; +bool show_info = true; bool run_by_frame = false; // 使用map保存所有选项及其描述和操作,加快查找速度。