2026-03-11 23:40:06 +08:00

58 lines
1.2 KiB
C++

#ifndef PROTOCOLCOMMON_H
#define PROTOCOLCOMMON_H
#include <string>
#include <vector>
#include <functional>
// 机械臂坐标结构体
struct RobotCoordinate
{
double x = 0.0;
double y = 0.0;
double z = 0.0;
double roll = 0.0;
double pitch = 0.0;
double yaw = 0.0;
};
// 目标位置结构体
struct TargetPosition
{
RobotCoordinate coordinate; // 目标坐标
int cameraId = 0; // 对应的相机ID
};
// 多目标数据
struct MultiTargetData
{
std::vector<TargetPosition> targets; // 目标位置列表
int totalTargets = 0; // 总目标数
};
// 机器人法兰位姿结构体(触发信号中携带的位姿)
struct RobotFlangePose
{
double x = 0.0;
double y = 0.0;
double z = 0.0;
double roll = 0.0;
double pitch = 0.0;
double yaw = 0.0;
};
// 连接状态枚举
enum ConnectionStatus
{
CONNECTION_DISCONNECTED = 0,
CONNECTION_CONNECTED = 1,
CONNECTION_CONNECTING = 2,
CONNECTION_ERROR = 3
};
// 回调函数类型
using ConnectionCallback = std::function<void(bool connected)>;
using WorkSignalCallback = std::function<void(int cameraIndex)>;
#endif // PROTOCOLCOMMON_H