fix bug.
This commit is contained in:
@@ -44,7 +44,7 @@ static bool sendTarget(Serial &serial, double x, double y, double z, uint16_t sh
|
|||||||
bool ArmorFinder::sendBoxPosition(uint16_t shoot_delay) {
|
bool ArmorFinder::sendBoxPosition(uint16_t shoot_delay) {
|
||||||
if (target_box.rect == cv::Rect2d()) return false;
|
if (target_box.rect == cv::Rect2d()) return false;
|
||||||
if (shoot_delay) {
|
if (shoot_delay) {
|
||||||
LOGM(STR_CTR(WORD_BLUE, "shoot after %dms"), shoot_delay);
|
LOGM(STR_CTR(WORD_BLUE, "next box %dms"), shoot_delay);
|
||||||
}
|
}
|
||||||
auto rect = target_box.rect;
|
auto rect = target_box.rect;
|
||||||
double dx = rect.x + rect.width / 2 - IMAGE_CENTER_X;
|
double dx = rect.x + rect.width / 2 - IMAGE_CENTER_X;
|
||||||
|
|||||||
@@ -62,5 +62,6 @@ bool ArmorFinder::stateTrackingTarget(cv::Mat &src) {
|
|||||||
target_box.rect = pos;
|
target_box.rect = pos;
|
||||||
target_box.light_blobs.clear();
|
target_box.light_blobs.clear();
|
||||||
}
|
}
|
||||||
|
last_box = target_box;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user