This commit is contained in:
xinyang
2019-05-08 20:43:29 +08:00
parent 9b3178753f
commit 13ffc6efe6
7 changed files with 98 additions and 30 deletions

View File

@@ -57,7 +57,7 @@ void ArmorFinder::run(cv::Mat &src) {
}
}
#define FOCUS_PIXAL (800)
#define FOCUS_PIXAL (600)
bool ArmorFinder::sendBoxPosition() {
static int dx_add = 0;
@@ -68,7 +68,7 @@ bool ArmorFinder::sendBoxPosition() {
double dy = rect.y + rect.height/2 - 240 - 30;
double yaw = atan(dx / FOCUS_PIXAL) * 180 / 3.14159265459;
double pitch = atan(dy / FOCUS_PIXAL) * 180 / 3.14159265459;
cout << yaw << endl;
// cout << yaw << endl;
uart.sendTarget(yaw, -pitch, 0);
return true;
}