main.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "lidar_manager.h"
  2. #include <X11/Xlib.h>
  3. // 避免和Eigen冲突
  4. // #ifdef Success
  5. // #undef Success
  6. // #endif
  7. int main(int argc, char **argv) {
  8. XInitThreads();
  9. std::string command;
  10. if (argc < 2) {
  11. command = "-help";
  12. } else {
  13. command = argv[1];
  14. }
  15. if (command == "-s") {
  16. // 执行程序1
  17. ZX::InitGlog("DataToCloud-s", ETC_PATH"DataToCloud/DataToCloud-sLog/");
  18. CloudDataManager::sendClient();
  19. } else if (command == "-r") {
  20. // 执行程序2
  21. ZX::InitGlog("DataToCloud-r", ETC_PATH"DataToCloud/DataToCloud-rLog/");
  22. CloudDataManager::receiveClient();
  23. } else if (command == "-t") {
  24. // 执行程序3
  25. ZX::InitGlog("DataToCloud-t", ETC_PATH"DataToCloud/DataToCloud-tLog/");
  26. CloudDataManager::sendClient();
  27. } else if (command == "-lidar") {
  28. // 执行程序3
  29. ZX::InitGlog("DataToCloud-lidar", ETC_PATH"DataToCloud/DataToCloud-lidarLog/");
  30. CloudDataManager::testRslidar();
  31. } else {
  32. std::cerr << "-s 发送雷达数据到客户端" << std::endl;
  33. std::cerr << "-r 接收雷达数据并展示" << std::endl;
  34. std::cerr << "-t 测试mqtt网络延时" << std::endl;
  35. std::cerr << "-lidar 测试雷达数据接收能力" << std::endl;
  36. return 1;
  37. }
  38. return 0;
  39. }