detect_wheel_ceres.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // Created by zx on 2020/7/1.
  3. //
  4. #ifndef CERES_TEST_DETECT_WHEEL_CERES_H
  5. #define CERES_TEST_DETECT_WHEEL_CERES_H
  6. #include <ceres/ceres.h>
  7. #include <glog/logging.h>
  8. #include <pcl/point_types.h>
  9. #include <pcl/point_cloud.h>
  10. #include <pcl/common/centroid.h>
  11. #include <opencv2/opencv.hpp>
  12. #include "fallModel.h"
  13. #include "tool/point3D_tool.hpp"
  14. class detect_wheel_ceres {
  15. public:
  16. static detect_wheel_ceres *iter() {
  17. static detect_wheel_ceres *instance = nullptr;
  18. if (instance == nullptr) {
  19. instance = new detect_wheel_ceres();
  20. }
  21. return instance;
  22. }
  23. ~detect_wheel_ceres();
  24. bool detect_fall(pcl::PointCloud<pcl::PointXYZ>::Ptr cl1,pcl::PointCloud<pcl::PointXYZ>::Ptr cl2,
  25. pcl::PointCloud<pcl::PointXYZ>::Ptr cl3,pcl::PointCloud<pcl::PointXYZ>::Ptr cl4,
  26. float& cx,float& cy,float& theta,float& wheel_base,float& width,float& front_theta,float& loss);
  27. bool detect_2Step(pcl::PointCloud<pcl::PointXYZ>::Ptr cl1,pcl::PointCloud<pcl::PointXYZ>::Ptr cl2,
  28. pcl::PointCloud<pcl::PointXYZ>::Ptr cl3,pcl::PointCloud<pcl::PointXYZ>::Ptr cl4,
  29. float& cx,float& cy,float& theta,float& wheel_base,float& width,float& front_theta,float& loss);
  30. /*
  31. * 只检测动态参数, 固定参数已知
  32. */
  33. bool detect_dynP(pcl::PointCloud<pcl::PointXYZ>::Ptr cl1,pcl::PointCloud<pcl::PointXYZ>::Ptr cl2,
  34. pcl::PointCloud<pcl::PointXYZ>::Ptr cl3,pcl::PointCloud<pcl::PointXYZ>::Ptr cl4,
  35. float& cx,float& cy,float& theta,float& wheel_base,float& width,float& front_theta,float& loss);
  36. private:
  37. detect_wheel_ceres();
  38. bool detect_RYL(pcl::PointCloud<pcl::PointXYZ>::Ptr cl1,pcl::PointCloud<pcl::PointXYZ>::Ptr cl2,
  39. pcl::PointCloud<pcl::PointXYZ>::Ptr cl3,pcl::PointCloud<pcl::PointXYZ>::Ptr cl4,
  40. float& cx,float& cy,float& theta,float& wheel_base,float& width,float& front_theta,float& loss);
  41. bool detect_XWF(pcl::PointCloud<pcl::PointXYZ>::Ptr cl1,pcl::PointCloud<pcl::PointXYZ>::Ptr cl2,
  42. pcl::PointCloud<pcl::PointXYZ>::Ptr cl3,pcl::PointCloud<pcl::PointXYZ>::Ptr cl4,
  43. float& cx,float& cy,float& theta,float& wheel_base,float& width,float& front_theta,float& loss);
  44. pcl::PointCloud<pcl::PointXYZ>::Ptr filter(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud,float r);
  45. pcl::PointCloud<pcl::PointXYZ>::Ptr m_left_front_cloud; //左前点云
  46. pcl::PointCloud<pcl::PointXYZ>::Ptr m_right_front_cloud; //右前点云
  47. pcl::PointCloud<pcl::PointXYZ>::Ptr m_left_rear_cloud; //左后点云
  48. pcl::PointCloud<pcl::PointXYZ>::Ptr m_right_rear_cloud; //右后点云
  49. public:
  50. cv::Mat m_map; //保存一份地图用作匹配
  51. cv::Mat m_mapr;
  52. std::vector<double> m_line_l;
  53. std::vector<double> m_line_r;
  54. std::vector<double> m_line_y_2stp;
  55. std::vector<double> m_line_y;
  56. };
  57. #endif //CERES_TEST_DETECT_WHEEL_CERES_H