1 Star 0 Fork 0

bisheng/CheckPointRectReconnect

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
RobotInterface.h 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
ubuntu16 提交于 2024-03-04 13:41 . 20230304
//
// 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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/bishengsjtu/check-point-rect-reconnect.git
git@gitee.com:bishengsjtu/check-point-rect-reconnect.git
bishengsjtu
check-point-rect-reconnect
CheckPointRectReconnect
master

搜索帮助