Auto Aim
This commit is contained in:
@@ -8,7 +8,7 @@ using std::cout;
|
|||||||
using std::endl;
|
using std::endl;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|
||||||
extern float mark_yaw, mark_pitch;
|
extern float curr_yaw, curr_pitch, mark_yaw, mark_pitch;
|
||||||
extern int mark;
|
extern int mark;
|
||||||
|
|
||||||
int Energy::run(cv::Mat &src){
|
int Energy::run(cv::Mat &src){
|
||||||
@@ -31,11 +31,11 @@ int Energy::run(cv::Mat &src){
|
|||||||
// imshow("bin",src);
|
// imshow("bin",src);
|
||||||
|
|
||||||
|
|
||||||
fans_cnt = findFan(src, fans, last_fans_cnt);
|
// fans_cnt = findFan(src, fans, last_fans_cnt);
|
||||||
// cout<<"fans_cnt: "<<fans_cnt<<endl;
|
// cout<<"fans_cnt: "<<fans_cnt<<endl;
|
||||||
if(fans_cnt==-1) return 0;//滤去漏判的帧
|
// if(fans_cnt==-1) return 0;//滤去漏判的帧
|
||||||
// if(fans_cnt>0)showFanContours("fan",src,fans);
|
// if(fans_cnt>0)showFanContours("fan",src,fans);
|
||||||
// fans_cnt=0;
|
fans_cnt=0;
|
||||||
|
|
||||||
armors_cnt = findArmor(src, armors, last_armors_cnt);
|
armors_cnt = findArmor(src, armors, last_armors_cnt);
|
||||||
// cout<<"armors_cnt: "<<armors_cnt<<endl;
|
// cout<<"armors_cnt: "<<armors_cnt<<endl;
|
||||||
@@ -78,12 +78,11 @@ int Energy::run(cv::Mat &src){
|
|||||||
|
|
||||||
sendTargetByUart(yaw_rotation, pitch_rotation, attack_distance);
|
sendTargetByUart(yaw_rotation, pitch_rotation, attack_distance);
|
||||||
cout<<"yaw: "<<yaw_rotation<<'\t'<<"pitch: "<<pitch_rotation<<endl;
|
cout<<"yaw: "<<yaw_rotation<<'\t'<<"pitch: "<<pitch_rotation<<endl;
|
||||||
|
cout<<"curr_yaw: "<<curr_yaw<<'\t'<<"curr_pitch: "<<curr_pitch<<endl;
|
||||||
cout<<"mark_yaw: "<<mark_yaw<<'\t'<<"mark_pitch: "<<mark_pitch<<endl;
|
cout<<"mark_yaw: "<<mark_yaw<<'\t'<<"mark_pitch: "<<mark_pitch<<endl;
|
||||||
|
|
||||||
cout<<"send_cnt: "<<send_cnt<<endl;
|
cout<<"send_cnt: "<<send_cnt<<endl;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user