main.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. printf("%d %s\n", argc, argv[1]);
  14. command = argv[1];
  15. }
  16. if (command == "-s") {
  17. // 执行程序1
  18. CloudDataManager::sendClient();
  19. } else if (command == "-r") {
  20. // 执行程序2
  21. CloudDataManager::receiveClient();
  22. } else if (command == "-t") {
  23. // 执行程序3
  24. CloudDataManager::sendClient();
  25. } else if (command == "-lidar") {
  26. // 执行程序3
  27. CloudDataManager::testRslidar();
  28. } else {
  29. std::cerr << "-s 发送雷达数据到客户端" << std::endl;
  30. std::cerr << "-r 接收雷达数据并展示" << std::endl;
  31. std::cerr << "-t 测试mqtt网络延时" << std::endl;
  32. std::cerr << "-lidar 测试雷达数据接收能力" << std::endl;
  33. return 1;
  34. }
  35. return 0;
  36. }