参数修改,确认 PID
This commit is contained in:
@@ -50,13 +50,13 @@
|
|||||||
#define YAW_AIM_KI (0.01)
|
#define YAW_AIM_KI (0.01)
|
||||||
#endif
|
#endif
|
||||||
#ifndef PITCH_AIM_KD
|
#ifndef PITCH_AIM_KD
|
||||||
#define PITCH_AIM_KD (0.4)
|
#define PITCH_AIM_KD (0)
|
||||||
#endif
|
#endif
|
||||||
#ifndef PITCH_AIM_KP
|
#ifndef PITCH_AIM_KP
|
||||||
#define PITCH_AIM_KP (0.75)
|
#define PITCH_AIM_KP (0)
|
||||||
#endif
|
#endif
|
||||||
#ifndef PITCH_AIM_KI
|
#ifndef PITCH_AIM_KI
|
||||||
#define PITCH_AIM_KI (0.01)
|
#define PITCH_AIM_KI (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef RED_COMPENSATE_YAW
|
#ifndef RED_COMPENSATE_YAW
|
||||||
|
|||||||
@@ -19,6 +19,6 @@
|
|||||||
|
|
||||||
#define FOCUS_PIXAL_8MM (1488)
|
#define FOCUS_PIXAL_8MM (1488)
|
||||||
#define FOCUS_PIXAL_5MM (917)
|
#define FOCUS_PIXAL_5MM (917)
|
||||||
#define FOCUS_PIXAL FOCUS_PIXAL_5MM
|
#define FOCUS_PIXAL FOCUS_PIXAL_8MM
|
||||||
|
|
||||||
#endif /* _CONSTANTS_H */
|
#endif /* _CONSTANTS_H */
|
||||||
|
|||||||
@@ -36,9 +36,9 @@ void uartReceive(Serial *pSerial) {
|
|||||||
pSerial->ReadData((uint8_t *) buffer, sizeof(mcu_data)+1);
|
pSerial->ReadData((uint8_t *) buffer, sizeof(mcu_data)+1);
|
||||||
if (buffer[sizeof(mcu_data)] == '\n') {
|
if (buffer[sizeof(mcu_data)] == '\n') {
|
||||||
memcpy(&mcu_data, buffer, sizeof(mcu_data));
|
memcpy(&mcu_data, buffer, sizeof(mcu_data));
|
||||||
// LOGM("Get, state:%c, mark:%d!", mcu_data.state, (int) mcu_data.mark);
|
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 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);
|
LOGM("Get delta x: %d, delta y: %d!", mcu_data.delta_x, mcu_data.delta_y);
|
||||||
// static int t = time(nullptr);
|
// static int t = time(nullptr);
|
||||||
// static int cnt = 0;
|
// static int cnt = 0;
|
||||||
// if(time(nullptr) > t){
|
// if(time(nullptr) > t){
|
||||||
@@ -103,14 +103,14 @@ void extract(cv::Mat &src) {//图像预处理,将视频切成640×480的大小
|
|||||||
if (src.empty()) return;
|
if (src.empty()) return;
|
||||||
float length = static_cast<float>(src.cols);
|
float length = static_cast<float>(src.cols);
|
||||||
float width = static_cast<float>(src.rows);
|
float width = static_cast<float>(src.rows);
|
||||||
if (length / width > 640.0 / 480.0) {
|
if (length / width > 1280.0 / 1024.0) {
|
||||||
length *= 480.0 / width;
|
length *= 1024 / width;
|
||||||
resize(src, src, cv::Size(length, 480));
|
resize(src, src, cv::Size(length, 1024));
|
||||||
src = src(Rect((length - 640) / 2, 0, 640, 480));
|
src = src(Rect((length - 1280) / 2, 0, 1280, 1024));
|
||||||
} else {
|
} else {
|
||||||
width *= 640.0 / length;
|
width *= 1280.0 / length;
|
||||||
resize(src, src, cv::Size(640, width));
|
resize(src, src, cv::Size(1280, width));
|
||||||
src = src(Rect(0, (width - 480) / 2, 640, 480));
|
src = src(Rect(0, (width - 1024) / 2, 1280, 1024));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ bool show_light_blobs = false;
|
|||||||
bool show_origin = false;
|
bool show_origin = false;
|
||||||
bool run_with_camera = true;
|
bool run_with_camera = true;
|
||||||
bool save_video = false;
|
bool save_video = false;
|
||||||
bool wait_uart = false;
|
bool wait_uart = true;
|
||||||
bool save_labelled_boxes = false;
|
bool save_labelled_boxes = false;
|
||||||
bool show_process = false;
|
bool show_process = false;
|
||||||
bool show_energy = false;
|
bool show_energy = false;
|
||||||
bool save_mark = false;
|
bool save_mark = false;
|
||||||
bool show_info = false;
|
bool show_info = true;
|
||||||
bool run_by_frame = false;
|
bool run_by_frame = false;
|
||||||
|
|
||||||
// 使用map保存所有选项及其描述和操作,加快查找速度。
|
// 使用map保存所有选项及其描述和操作,加快查找速度。
|
||||||
|
|||||||
Reference in New Issue
Block a user