更新监视脚本绑定方式。

This commit is contained in:
xinyang
2019-05-07 23:25:34 +08:00
parent bd52fc33fc
commit 9b3178753f
3 changed files with 64 additions and 61 deletions

View File

@@ -57,7 +57,7 @@ void ArmorFinder::run(cv::Mat &src) {
}
}
#define FOCUS_PIXAL (0.36/0.48*640)
#define FOCUS_PIXAL (800)
bool ArmorFinder::sendBoxPosition() {
static int dx_add = 0;
@@ -68,6 +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;
uart.sendTarget(yaw, -pitch, 0);
return true;
}