tof3DMain.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // Created by zx on 2023/10/7.
  3. //
  4. #include <iostream>
  5. #include "tool/log.hpp"
  6. #include "vzense/device_tof3d.h"
  7. #include "detect/detect_manager.h"
  8. #include "proto/measure_manager.pb.h"
  9. #include "tool/load_protobuf.hpp"
  10. #include "communication/communication_manager.h"
  11. int main(int argc, char * argv[]) {
  12. // 初始化日志系统
  13. ZX::InitGlog(PROJECT_NAME, ETC_PATH PROJECT_NAME "/LogInfo/");
  14. // 初始化相机处理程序
  15. tof3dManagerParams tof3d_etc;
  16. if (loadProtobufFile(ETC_PATH PROJECT_NAME "/tof3d_manager.json", tof3d_etc) == SUCCESS) {
  17. // auto ret = DeviceTof3D::iter()->Init(tof3d_etc.vzense_tof3d_devices());
  18. Error_manager ret;
  19. if (ret != SUCCESS) {
  20. LOG(ERROR) << ret.to_string();
  21. return EXIT_FAILURE;
  22. }
  23. } else {
  24. LOG(WARNING) << "tof3dManager read param form " << ETC_PATH PROJECT_NAME "/tof3d_manager.json" << " error.";
  25. return EXIT_FAILURE;
  26. }
  27. // 初始化测量程序
  28. // DetectManager::iter()->Init();
  29. // 通信
  30. CommunicationManager::iter()->Init(tof3d_etc.communication());
  31. // 加载看门狗 TODO:添加看门狗,监视线程
  32. LOG(INFO) << "---------- all init complate ----------";
  33. while (true) {
  34. // auto mat = DeviceTof3D::iter()->getDevicePointsMat(DeviceAzimuth::DEVICE_AZIMUTH_LF);
  35. // if (mat.empty()) {
  36. // LOG(INFO) << "get a empty mat";
  37. // } else {
  38. // cv::imshow("merge_mat", mat);
  39. // }
  40. usleep(100 * 1000);
  41. }
  42. return EXIT_SUCCESS;
  43. }