代码拉取完成,页面将自动刷新
//
// Created by bisheng on 5/10/22.
//
#ifndef OPENCV_TEST_ROBOTINTERFACE_H
#define OPENCV_TEST_ROBOTINTERFACE_H
#include "Config.h"
#include "ImageMeasurement.h"
#include "MyPLC.h"
#include <mutex>
#include <condition_variable>
#include <queue>
#include <atomic>
void GenerateMovePulseCommand(vector<unsigned char> &move_pulse_command, int x_pulse, int y_pulse);
class RobotInterface {
private:
ImageMeasurement image_measure_left;
ImageMeasurement image_measure_right;
MyPLC my_plc;
int Calibration_Pulse_;
enum Task {
LeftInitialize,
RightInitialize,
LeftCheck,
RightCheck,
Free
};
Task task;
mutex task_mutex_lock_;
mutex send_mutex_lock_;
// 接收数据锁
std::queue<vector<unsigned char>> command_list;
mutex receive_data_mutex_lock_;
condition_variable receive_data_condition_variable_;
atomic_bool adjust_received;
atomic_bool adjust_finished;
atomic_bool vision_finished;
public:
RobotInterface(int PLC_IP, int Calibration_Pulse):
Calibration_Pulse_(Calibration_Pulse),
my_plc(PLC_IP),
image_measure_left("/dev/left_video", Calibration_Pulse),
image_measure_right("/dev/right_video", Calibration_Pulse),
task(Free),
adjust_received(false),
adjust_finished(false),
vision_finished(false)
{}
void test_left();
void test_right();
void ExecuteThread();
void ReceiveThread();
void ParseThread();
};
#endif //OPENCV_TEST_ROBOTINTERFACE_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。