From 39b32bf339fff88b31ef543ca5edb418f7b3e763 Mon Sep 17 00:00:00 2001 From: sun Date: Fri, 19 Jul 2019 23:27:15 +0800 Subject: [PATCH] energy change --- energy/src/energy/calculate/circle_calculate.cpp | 1 + energy/src/energy/clear/clear.cpp | 1 - energy/src/energy/get/aim_point_get.cpp | 6 +++--- energy/src/energy/run.cpp | 10 ++++++++-- main.cpp | 7 ++++--- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/energy/src/energy/calculate/circle_calculate.cpp b/energy/src/energy/calculate/circle_calculate.cpp index 52688e6..2217a3f 100644 --- a/energy/src/energy/calculate/circle_calculate.cpp +++ b/energy/src/energy/calculate/circle_calculate.cpp @@ -61,3 +61,4 @@ void Energy::circleLeastFit() // cout << "The cycle center is: " << cycle_center << endl; // cout << "The radius is: " << radius << endl; } + diff --git a/energy/src/energy/clear/clear.cpp b/energy/src/energy/clear/clear.cpp index 5aefa1b..a40bd6a 100644 --- a/energy/src/energy/clear/clear.cpp +++ b/energy/src/energy/clear/clear.cpp @@ -18,7 +18,6 @@ void Energy::clearAll(){ } - //---------------------------------------------------------------------------------------------------------------------- // 此函数用于图像预处理 // --------------------------------------------------------------------------------------------------------------------- diff --git a/energy/src/energy/get/aim_point_get.cpp b/energy/src/energy/get/aim_point_get.cpp index c15d61d..189811b 100644 --- a/energy/src/energy/get/aim_point_get.cpp +++ b/energy/src/energy/get/aim_point_get.cpp @@ -16,9 +16,9 @@ void Energy::getAimPoint(cv::Point target_point) { // double dx = -(target_point.x - 320 - 10); // double dy = -(target_point.y - 240 - 22); //四号车 - double dx = -(target_point.x - 320 - 0); - double dy = -(target_point.y - 240 - 69); + double dx = -(target_point.x - 320 - 5); + double dy = -(target_point.y - 240 - 74); yaw_rotation = atan(dx / FOCUS_PIXAL) * 180 / PI; pitch_rotation = atan(dy / FOCUS_PIXAL) * 180 / PI; - cout << "yaw: " << yaw_rotation << '\t' << "pitch: " << pitch_rotation << endl; +// cout << "yaw: " << yaw_rotation << '\t' << "pitch: " << pitch_rotation << endl; } diff --git a/energy/src/energy/run.cpp b/energy/src/energy/run.cpp index 355db0a..1568760 100644 --- a/energy/src/energy/run.cpp +++ b/energy/src/energy/run.cpp @@ -101,17 +101,19 @@ void Energy::runBig(cv::Mat &gimbal_src) { if (show_energy)showCenterR("R", gimbal_src); changeTarget(); getTargetPolarAngle(); +// cout<init()) { LOGM("video_gimbal source initialization successfully."); @@ -110,7 +110,8 @@ int main(int argc, char *argv[]) { if (!from_camera) extract(gimbal_src, chassis_src); if (save_video) saveVideos(gimbal_src, chassis_src);//保存视频 if (show_origin) showOrigin(gimbal_src, chassis_src);//显示原始图像 - energy.runBig(gimbal_src, chassis_src); +// energy.runBig(gimbal_src, chassis_src); + energy.runBig(gimbal_src); last_state = mcuData.state;//更新上一帧状态 } else if (mcuData.state == SMALL_ENERGY_STATE) { if (mcuData.state != SMALL_ENERGY_STATE) {