1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #pragma once
- #include <pcl/point_types.h>
- #include <pcl/point_cloud.h>
- #include "pahoc/mqtt_async.h"
- #include "tool/log.hpp"
- #include "vzense/device_tof3d.h"
- class Tof3DMqttAsyncClient : public MqttAsyncClient {
- public:
- static Tof3DMqttAsyncClient *iter() {
- static Tof3DMqttAsyncClient *instance = nullptr;
- if (instance == nullptr) {
- instance = new Tof3DMqttAsyncClient();
- }
- return instance;
- }
- void init(const std::string &file);
- protected:
- Tof3DMqttAsyncClient() = default;
- private:
- void run();
- static int CloudDataArrived(MqttAsyncClient *client, char *topicName, int topicLen, MQTTAsync_message *message);
- public:
- private:
- std::mutex m_cloud_mutex;
- std::map<long, DeviceTof3D::DeviceTof3DSaveInfo> m_lf_info;
- std::map<long, DeviceTof3D::DeviceTof3DSaveInfo> m_rf_info;
- std::map<long, DeviceTof3D::DeviceTof3DSaveInfo> m_lr_info;
- std::map<long, DeviceTof3D::DeviceTof3DSaveInfo> m_rr_info;
- std::thread *t = nullptr;
- Thread_condition *condit = nullptr;
- };
|