56 lines
1.8 KiB
C++
56 lines
1.8 KiB
C++
#ifndef CEPICEYEDEVICE_H
|
||
#define CEPICEYEDEVICE_H
|
||
|
||
#include "IEpicEyeDevice.h"
|
||
#include <mutex>
|
||
#include <string>
|
||
|
||
/**
|
||
* @brief CEpicEyeDevice 实现类
|
||
* 封装 EpicEye SDK,实现 3D 相机点云采集功能
|
||
*/
|
||
class CEpicEyeDevice : public IEpicEyeDevice
|
||
{
|
||
public:
|
||
CEpicEyeDevice();
|
||
~CEpicEyeDevice();
|
||
|
||
// SDK 版本
|
||
int GetSDKVersion(std::string& version) override;
|
||
|
||
// 搜索和连接
|
||
int SearchCameras(std::vector<EpicEyeDeviceInfo>& deviceList) override;
|
||
int Connect(const std::string& ipAddress) override;
|
||
int Disconnect() override;
|
||
bool IsConnected() override;
|
||
|
||
// 设备信息
|
||
int GetDeviceInfo(EpicEyeDeviceInfo& deviceInfo) override;
|
||
int GetWidth(unsigned int& width) override;
|
||
int GetHeight(unsigned int& height) override;
|
||
|
||
// 触发和获取数据
|
||
int TriggerCapture(std::string& frameID, bool withPointCloud = true) override;
|
||
int GetPointCloud(const std::string& frameID, PointCloudData& pointCloud) override;
|
||
int GetImage(const std::string& frameID, ImageData2D& image) override;
|
||
int GetDepth(const std::string& frameID, DepthData& depth) override;
|
||
|
||
// 便捷方法
|
||
int CapturePointCloud(PointCloudData& pointCloud, unsigned int timeout = 5000) override;
|
||
int CaptureImage(ImageData2D& image, unsigned int timeout = 5000) override;
|
||
|
||
// 相机参数
|
||
int GetCameraIntrinsics(CameraIntrinsics& intrinsics) override;
|
||
int GetConfig(std::string& configJson) override;
|
||
int SetConfig(const std::string& configJson) override;
|
||
|
||
private:
|
||
// 内部成员
|
||
std::string m_ipAddress; // 相机IP地址
|
||
bool m_bConnected; // 连接状态
|
||
EpicEyeDeviceInfo m_deviceInfo; // 设备信息
|
||
std::mutex m_mutex; // 线程安全锁
|
||
};
|
||
|
||
#endif // CEPICEYEDEVICE_H
|