detect_wheel_ceres.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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. class detect_wheel_ceres {
  13. public:
  14. detect_wheel_ceres();
  15. ~detect_wheel_ceres();
  16. bool detect(std::vector<pcl::PointCloud<pcl::PointXYZ>> cloud_vec,
  17. double& cx,double& cy,double& theta,double& wheel_base,double& width,double& front_theta);
  18. protected:
  19. bool Solve(double& x,double& y,double& theta,double& wheel_base,double& width,double& front_theta);
  20. private:
  21. pcl::PointCloud<pcl::PointXYZ> m_left_front_cloud; //左前点云
  22. pcl::PointCloud<pcl::PointXYZ> m_right_front_cloud; //右前点云
  23. pcl::PointCloud<pcl::PointXYZ> m_left_rear_cloud; //左后点云
  24. pcl::PointCloud<pcl::PointXYZ> m_right_rear_cloud; //右后点云
  25. public:
  26. cv::Mat m_map; //保存一份地图用作匹配
  27. };
  28. #endif //CERES_TEST_DETECT_WHEEL_CERES_H