Skip to content

Commit

Permalink
mode change bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dishierweidu committed May 23, 2022
1 parent 44efdf5 commit 0f77d53
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion buff/detector/inference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ BuffDetector::~BuffDetector()
//TODO:change to your dir
bool BuffDetector::initModel(string path)
{
ie.SetConfig({{CONFIG_KEY(CACHE_DIR), "/home/dishierweidu/Desktop/TUP-InfantryVision-2022-main/.cache"}});
ie.SetConfig({{CONFIG_KEY(CACHE_DIR), "../TUP-InfantryVision-2022-main/.cache"}});
// ie.SetConfig({{CONFIG_KEY(GPU_THROUGHPUT_STREAMS),"GPU_THROUGHPUT_AUTO"}});
ie.SetConfig({{CONFIG_KEY(GPU_THROUGHPUT_STREAMS),"1"}});
// Step 1. Read a model in OpenVINO Intermediate Representation (.xml and
Expand Down
8 changes: 4 additions & 4 deletions debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@
#define USING_IMU_C_BOARD //使用C板陀螺仪
#endif // USING_IMU

#ifndef DETECT_RED
#define DETECT_BLUE
#endif //DETECT_RED

#ifdef SHOW_IMG
#define SHOW_ALL_ARMOR //是否绘制装甲板
#define SHOW_ALL_FANS //是否绘制所有扇叶
Expand All @@ -95,6 +91,10 @@
#define USING_USB_CAMERA
#endif // USING_DAHENG

#ifndef DETECT_RED
#define DETECT_BLUE
#endif //DETECT_RED

#ifdef DETECT_RED
#define DETECT_BUFF_BLUE
#else
Expand Down
11 changes: 6 additions & 5 deletions thread/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,12 @@ bool consumer(Factory<TaskData> &task_factory,Factory<VisionData> &transmit_fact
VisionData data;
task_factory.consume(dst);
mode = dst.mode;
mode = 1; //默认进入自瞄模式

#ifdef DEBUG_WITHOUT_COM
mode = 1;
#endif //DEBUG_WITHOUT_COM

#ifdef SAVE_TRANSMIT_LOG
// cout<<mode<<"..."<<last_mode<<endl;
if (mode != last_mode)
{
LOG(INFO)<<"[CONSUMER] Mode switched to "<< mode;
Expand Down Expand Up @@ -252,9 +254,8 @@ bool dataReceiver(SerialPort &serial, MessageFilter<MCUData> &receive_factory, s
auto timestamp = (int)(std::chrono::duration<double,std::milli>(time_cap - time_start).count());
// cout<<"Quat: "<<serial.quat[0]<<" "<<serial.quat[1]<<" "<<serial.quat[2]<<" "<<serial.quat[3]<<" "<<endl;
// Eigen::Quaterniond quat = {serial.quat[0],serial.quat[1],serial.quat[2],serial.quat[3]};
//FIXME:注意此处mode设置
// int mode = serial.mode;
int mode = 1;

int mode = serial.mode;
Eigen::Quaterniond quat = {serial.quat[0],serial.quat[1],serial.quat[2],serial.quat[3]};
Eigen::Vector3d acc = {serial.acc[0],serial.acc[1],serial.acc[2]};;
Eigen::Vector3d gyro = {serial.gyro[0],serial.gyro[1],serial.gyro[2]};;
Expand Down

0 comments on commit 0f77d53

Please sign in to comment.