统一跨平台时间函数接口。
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
//
|
||||
|
||||
#include <armor_finder/armor_finder.h>
|
||||
#include <additions/additions.h>
|
||||
#include <additions.h>
|
||||
#include <log.h>
|
||||
|
||||
static double boxDistance(const cv::Rect2d &a, const cv::Rect2d &b) {
|
||||
@@ -53,8 +53,8 @@ void ArmorFinder::antiTop() {
|
||||
if (anti_top_state == ANTI_TOP) {
|
||||
top_periodms.push(interval);
|
||||
LOGM(STR_CTR(WORD_LIGHT_GREEN, "top period: %.1lf ms"), interval);
|
||||
timeval curr_time;
|
||||
gettimeofday(&curr_time, nullptr);
|
||||
systime curr_time;
|
||||
getsystime(curr_time);
|
||||
auto calculate_time = getTimeIntervalms(curr_time, frame_time);
|
||||
shoot_delay = mean(top_periodms) - calculate_time;
|
||||
} else if (anti_top_state == NORMAL) {
|
||||
|
||||
@@ -17,11 +17,10 @@
|
||||
|
||||
#define LOG_LEVEL LOG_NONE
|
||||
#include <log.h>
|
||||
#include <options/options.h>
|
||||
#include <options.h>
|
||||
#include <show_images/show_images.h>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <armor_finder/armor_finder.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
std::map<int, string> id2name = { //装甲板id到名称的map
|
||||
{-1, "OO"},{ 0, "NO"},
|
||||
@@ -58,7 +57,7 @@ ArmorFinder::ArmorFinder(uint8_t &color, Serial &u, const string ¶s_folder,
|
||||
}
|
||||
|
||||
void ArmorFinder::run(cv::Mat &src) {
|
||||
gettimeofday(&frame_time, nullptr);
|
||||
getsystime(frame_time);
|
||||
// stateSearchingTarget(src); // for debug
|
||||
// goto end;
|
||||
switch (state) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <armor_finder/armor_finder.h>
|
||||
#include <show_images/show_images.h>
|
||||
#include <options/options.h>
|
||||
#include <options.h>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#define DO_NOT_CNT_TIME
|
||||
#include <log.h>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
|
||||
#include <armor_finder/armor_finder.h>
|
||||
#include <options/options.h>
|
||||
#include <options.h>
|
||||
#include <opencv2/highgui.hpp>
|
||||
|
||||
static double lw_rate(const cv::RotatedRect &rect) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <armor_finder/armor_finder.h>
|
||||
#include <show_images/show_images.h>
|
||||
#include <options/options.h>
|
||||
#include <options.h>
|
||||
#include <log.h>
|
||||
|
||||
bool ArmorFinder::stateSearchingTarget(cv::Mat &src) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Created by xinyang on 19-3-27.
|
||||
//
|
||||
#include <log.h>
|
||||
#include <options/options.h>
|
||||
#include <options.h>
|
||||
#include <armor_finder/armor_finder.h>
|
||||
#include <show_images/show_images.h>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <show_images/show_images.h>
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include <options/options.h>
|
||||
#include <options.h>
|
||||
#include <log.h>
|
||||
|
||||
using namespace cv;
|
||||
|
||||
Reference in New Issue
Block a user