energy change

This commit is contained in:
sun
2019-07-19 23:27:15 +08:00
parent cdc58c8e67
commit 39b32bf339
5 changed files with 16 additions and 9 deletions

View File

@@ -61,3 +61,4 @@ void Energy::circleLeastFit()
// cout << "The cycle center is: " << cycle_center << endl;
// cout << "The radius is: " << radius << endl;
}

View File

@@ -18,7 +18,6 @@ void Energy::clearAll(){
}
//----------------------------------------------------------------------------------------------------------------------
// 此函数用于图像预处理
// ---------------------------------------------------------------------------------------------------------------------

View File

@@ -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;
}

View File

@@ -101,17 +101,19 @@ void Energy::runBig(cv::Mat &gimbal_src) {
if (show_energy)showCenterR("R", gimbal_src);
changeTarget();
getTargetPolarAngle();
// cout<<circle_center_point<<endl;
// cout << target_point << '\t' << target_polar_angle << endl;
// cout << circle_center_point<< endl;
// judgeMode();
// if (energy_mode_init)return;
if (!getOrigin())return;
// if (!getOrigin())return;
if (energy_rotation_init) {
initRotation();
return;
}
if (is_predicting) {
getPredictPoint(target_point);
getAimPoint(predict_point);
@@ -144,7 +146,11 @@ void Energy::runSmall(cv::Mat &gimbal_src) {
if (show_energy)showArmors("armor", gimbal_src);
if (!findFlowStripFan(gimbal_src))return;
if (!findTargetInFlowStripFan()) return;
if (show_energy)showFlowStripFan("strip", gimbal_src);
//
// if (!findCenterROI(gimbal_src))return;
// if (show_energy)showFlowStripFan("strip", gimbal_src);
// if (!findCenterR(gimbal_src))return;
// if (show_energy)showCenterR("R", gimbal_src);
changeTarget();
// cout << "target point: " << target_point << endl;