wheel_model_3d.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // Created by zx on 2023/7/20.
  3. //
  4. #pragma once
  5. #include "executor.hpp"
  6. #include "hybrid_grid.hpp"
  7. #include "interpolated_grid.hpp"
  8. #include "tool/static_tool.hpp"
  9. #include <pcl/point_types.h>
  10. #include <pcl/point_cloud.h>
  11. #include <pcl/common/centroid.h>
  12. class WheelModel3D: public SingletonIter<WheelModel3D> {
  13. friend class SingletonIter<WheelModel3D>;
  14. public:
  15. HybridGrid* left_grid() {
  16. return mp_left_grid;
  17. }
  18. HybridGrid* right_grid() {
  19. return mp_right_grid;
  20. };
  21. protected:
  22. WheelModel3D() {
  23. mp_left_grid = nullptr;
  24. mp_right_grid = nullptr;
  25. }
  26. Error_manager init() override;
  27. /**
  28. * @description 加载左侧车轮模型;
  29. * @return 加载结果;
  30. **/
  31. Error_manager loadLeftModel();
  32. /**
  33. * @description 加载右侧车轮模型;
  34. * @return 加载结果;
  35. **/
  36. Error_manager loadRightModel();
  37. private:
  38. /**
  39. * @description 更新模型;
  40. * @param clouds 输入点云;
  41. * @param ratio 模型比例;
  42. * @return 更新后的模型;
  43. **/
  44. static HybridGrid* updateModel(pcl::PointCloud<pcl::PointXYZ>::Ptr &clouds, float ratio = 1);
  45. protected:
  46. HybridGrid* mp_left_grid; // 左侧车轮模型
  47. HybridGrid* mp_right_grid; // 右侧车轮模型
  48. private:
  49. const char* left_file = ETC_PATH"MeasureNode/left_model.txt"; // 左侧车轮加载路径
  50. const char* right_file = ETC_PATH"MeasureNode/right_model.txt"; // 右侧车轮加载路径
  51. };