detect_wheel_ceres.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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 update_mat(int rows, int cols);
  20. bool Solve(double& x,double& y,double& theta,double& wheel_base,double& width,double& front_theta,double &avg_loss);
  21. private:
  22. pcl::PointCloud<pcl::PointXYZ> m_left_front_cloud; //左前点云
  23. pcl::PointCloud<pcl::PointXYZ> m_right_front_cloud; //右前点云
  24. pcl::PointCloud<pcl::PointXYZ> m_left_rear_cloud; //左后点云
  25. pcl::PointCloud<pcl::PointXYZ> m_right_rear_cloud; //右后点云
  26. cv::Mat m_map; //保存一份地图用作匹配
  27. };
  28. #endif //CERES_TEST_DETECT_WHEEL_CERES_H