123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- //
- // Created by zx on 23-11-28.
- //
- #ifndef CERES_TEST_TransitData_H
- #define CERES_TEST_TransitData_H
- #include <opencv2/opencv.hpp>
- #include <pcl/point_types.h>
- #include <pcl/point_cloud.h>
- #include "tool/timedlockdata.hpp"
- #include "tool/singleton.hpp"
- #include "proto/enum_type.pb.h"
- #include <mutex>
- class TransitData : public Singleton<TransitData> {
- friend Singleton<TransitData>;
- public:
- struct MeasureInfo {
- float x;
- float y;
- float transx;
- float transy;
- float theta;
- float width;
- float wheelbase;
- float ftheta;
- int border_plc;
- int border_display;
- std::string error;
- MeasureInfo &operator=(const MeasureInfo &info) {
- x = info.x;
- y = info.y;
- theta = info.theta;
- transx = info.transx;
- transy = info.transy;
- width = info.width;
- wheelbase = info.wheelbase;
- ftheta = info.ftheta;
- border_plc = info.border_plc;
- border_display = info.border_display;
- error = info.error;
- return *this;
- }
- };
- public:
- void setImage(cv::Mat image, int id);
- void setImageCL(cv::Mat &image, int id);
- void setMask(std::vector<cv::Point> mask, int id);
- void setMeasureInfo(MeasureInfo info);
- bool getImage(cv::Mat &image, int id, float timeout);
- bool getImageCL(cv::Mat &image, int id, float timeout);
- bool getMask(std::vector<cv::Point> &mask, int id, float timeout);
- bool getMeasureInfo(MeasureInfo &info, float timeout);
- private:
- TransitData();
- std::mutex mutex_;
- TimedLockData<cv::Mat> image_[DeviceAzimuth::DEVICE_AZIMUTH_MAX];
- TimedLockData<cv::Mat> imageCL_[DeviceAzimuth::DEVICE_AZIMUTH_MAX];
- TimedLockData<std::vector<cv::Point>> mask_[DeviceAzimuth::DEVICE_AZIMUTH_MAX];
- TimedLockData<MeasureInfo> measureInfo_;
- };
- #endif //CERES_TEST_TransitData_H
|