Auto Aim
This commit is contained in:
@@ -61,8 +61,8 @@ int Energy::run(cv::Mat &src){
|
|||||||
cout<<"all_armor_centers.size(): "<<all_armor_centers.size()<<endl;
|
cout<<"all_armor_centers.size(): "<<all_armor_centers.size()<<endl;
|
||||||
cycleLeastFit();
|
cycleLeastFit();
|
||||||
|
|
||||||
cycle_center = cv::Point(416,227);
|
cycle_center = cv::Point(414,227);
|
||||||
radius = 203.665;
|
radius = 203.728;
|
||||||
getFanPosition(fanPosition, fans, cycle_center, radius);
|
getFanPosition(fanPosition, fans, cycle_center, radius);
|
||||||
getArmorPosition(armorPosition, armors, cycle_center, radius);
|
getArmorPosition(armorPosition, armors, cycle_center, radius);
|
||||||
findTarget(fanPosition, armorPosition, target_armor);
|
findTarget(fanPosition, armorPosition, target_armor);
|
||||||
@@ -81,7 +81,7 @@ int Energy::run(cv::Mat &src){
|
|||||||
cout<<"curr_yaw: "<<curr_yaw<<'\t'<<"curr_pitch: "<<curr_pitch<<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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
8
main.cpp
8
main.cpp
@@ -114,10 +114,10 @@ void uartReceive(Uart* uart){
|
|||||||
memcpy(&curr_yaw, buffer, 4);
|
memcpy(&curr_yaw, buffer, 4);
|
||||||
memcpy(&curr_pitch, buffer+4, 4);
|
memcpy(&curr_pitch, buffer+4, 4);
|
||||||
// LOGM("Get yaw:%f pitch:%f", curr_yaw, curr_pitch);
|
// LOGM("Get yaw:%f pitch:%f", curr_yaw, curr_pitch);
|
||||||
if(buffer[9] == 1){
|
if(buffer[9] == 1 && mark == 0){
|
||||||
mark = 1;
|
mark = 1;
|
||||||
mark_yaw = curr_yaw;
|
mark_yaw = curr_yaw;
|
||||||
mark_pitch = curr_pitch;
|
mark_pitch = curr_pitch;
|
||||||
// LOGM("Marked");
|
// LOGM("Marked");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user